Web Service on Windows Azure? - wcf

I am new to Windows Azure and I have a question.
I have:
Web site which deployed to Windows Azure - The web site manage a table (add, edit, delete). I used this guide: Deploying an ASP.NET Web Application to a Windows Azure Web Site and SQL Database
Andorid application & iOS Application (Native Code).
Now, I want the mobile applications to get data (in JSON format) from the web site (and from the DB).
What is the best practice to do that?
I tried to create a Azure (WCF) Service (the project refrenced to the web site project) but I didn't succeded. If this is the way - Is anyone knows a good tutorial to do that?
Is there another option? Maybe from the web site itself?
Thank you very much,
Yuval

If you want to integrate with non-Microsoft technologies I suggest you take a look at the ASP.NET Web API which allows you to build REST services using content negotiation. Content negotiation allows your consumer to specify the format it requires (json, xml, ...).
To host the ASP.NET Web API in a Windows Azure Web Site you should take a look at Carlos' blog, he describes in detail what you need to do to make this work: Creating ASP.NET Web APIs on Azure Web Sites

Have you given ASP.NET Web API a look-see?
http://www.asp.net/web-api

Related

create web service config file in access 2016 vba

I don't have any code yet as I don't know where to start! I see on the web that I'd need to select
on the Access toolbar external data >> more >> data services. Then it asks to point to a xml config file. Which I don't have and would need to create. I have the connection string from a VB.net application.
sWIPConnString As String = "SERVER=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=fake3465-vip.ent.agt.bb.ca)(PORT=41521))(CONNECT_DATA=(SERVICE_NAME=fictitious_service_name)));uid=APP_getinfo;pwd=thispassword;"
I'd have to convert that to an xml version. Any help would be appreciated!
Thank in advance
Pete
But those data services are not just any old plane jane web site. They are web sites that have installed, setup, and the developers of those web sites setup that data service connection. And these custom connections are NOT general web sites, and they are not general web services that many sites have. And they are not a web API written around say SOAP or some REST standard.
So unless that web site decided to adopt this Microsoft specific means and method to expose data, then you not be able to use this feature to simple connect to any old web site out of the blue. If you have a existing web site that exposes some web services? Then you have to use MSXML and consume that web data yourself. That option in Access is not some general purpose setting or feature that allows connection to any old web site - only ones that have created that web service written to the business connection options that Microsoft created.
It not clear if you planning to create some web services on the target web site (that would assume you're the developer of that web site), or you trying to consume existing web services that the given site exposes. Even in this 2nd case, those exposed web services or even REST calls has ZERO to do with the feature in Access.
so that feature is of only use for connecting to web sites that offer specific created connection based on that standard from Microsoft - it not a general web service consuming feature built into access and you can't use that feature as such.
How to make a web service call from Access? Well, it has ZERO to do with that feature. Here is a MSXML exmaple:
How to use XML web services in Access2007 which are built on Visual studio (2008/2010)

How to host a WebAPI2 console app in production?

I was reading this article in looking for differences between creating an API using WebAPI and MVC and came across this statement:
In simple load testing on my local machine, I’ve found that Web API
endpoints hosted in console apps are nearly 50% faster than both
ASP.NET controller actions and Web API endpoints hosted within MVC
projects.
As such, I'm interested in how this would take shape in a production environment.
Obviously I'm looking for performance, so I looked into OWIN and self-hosting. However I'm not clear on if this offers the same efficiency as the console app discussed above.
Can someone please explain the proposal of hosting an API console application for consumption in a production environment - i.e. how would you connect a URL to the console app, etc.?
Thanks.
My understanding is self hosted OWIN apps can be run within any kind of app domain e.g console, windows forms, windows service, AWS EC2, Azure Worker Role etc. The application you should run it in is dependent upon the hosting environment you choose, there are lots of options.

Azure webforms application insights

Is it possible use Visual Studio 2013 Application Insights with my web forms project?
I have added application insight to my project but cannot get performance metrics to Application Insights portal. My project is running top of Azure web sites.
There's now an Azure Websites Extension that supports perf metrics for azure websites:
http://blogs.msdn.com/b/visualstudioalm/archive/2015/01/07/application-insights-and-azure-websites.aspx
If you have an Azure WebSite and would like to enable Application
Insights follow these steps:
1) Onboard your application to Application Insights from Visual Studio
2013 Update 3 or later and deploy to an Azure WebSite.
Note: If your application onboarded to Application Insights already
ensure you are using the .12 SDK (or later).
2) Enable the Application Insights Extension on the Azure WebSite
blade (not the Application Insight blade) for the website that was
enabled for Application Insights with the .12 or later SDKs
3) Now the extension is enabled execute a few requests against your
web App and navigate to your Application Insights resource blade
As far as I know Application Insights will only work with Web Applications.
Here are the project types supported:
A web service or web application.
Web pages that use JavaScript. A
Windows Phone 8 app.
A Windows Store app.
See this page for further information on the types of projects you can monitor: http://msdn.microsoft.com/en-us/library/dn481095.aspx
Ken's answer is right for the types of apps that application insights supports really well. this includes seamless onboarding/getting started and loads of "automatic" data visible without having to write any new lines of code.
From an SDK "core" perspective we can support other types of apps like WPF and desktop apps. Here are the steps required to setup it up manually and the code required to get metrics, events, traces, etc sent to the application insights service. this should just work if your winform app is running on an azure website too.
Application Insights for WPF Application
At the present time, Application Insights is focused just on web-based applications.
ASP.NET Web Forms
ASP.NET MVC
ASP.NET Web API
ASP.NET Core
WCF
JavaScript
and some alternative platforms / languages (PHP, Ruby, Java).
Azure App Service (formerly Web Sites) does not support Performance Counters (CPU percentage, Disc read/write operations, Available Memory etc.).
For clarification: Azure Website Extension just helps you to collect dependencies and some statistics in case your application is running on .NET version < 4.6.

What is the difference between an Azure Web Site and an Azure Web Role (July '13 edition)

Context:
Building new multi-tenant application using Azure SQL, Azure Table Storage, EF, Web API, MVC, Azure Cache, Possibly Worker Roles -- all the usual suspects:
Please see prior question asked/answered a while back (Jun '12): What is the difference between an Azure Web Site and an Azure Web Role
Side Note:
I'm leaning towards Web Role/Worker Role for Web API and Web Site for MVC/CMS frameworks (i.e., DotNetNuke)
I understand Web Sites are out of beta and have closed the gap with the Web Role in some respects.
Question:
I'm looking for an updated answer to the following:
What are the material differences between the new Azure Web Sites and the traditional Azure Web Roles for an ASP.NET MVC and an ASP.NET Web API application? What reason would I choose a "web site" over a "web role" or vice versa?
Nowadays you have the following execution models:
-Web Sites
-Cloud Services (Worker Role / Web Role)
-Mobile Services
-Virtual Machines
What are the differences between Cloud Services and Web Sites.
-Cloud Services:
You could integrate with Team Foundation Services and allow it to publish to Azure. (Continuous Delivery). With Cloud Services (Web Role), you have two environments in Azure, staging and production. You can use Staging to validate, and with one click (swap option), apply the new deployment package to production environment.
-Web Sites:
Web Sites is the right option when you want to create a simple web site. It is also a good choice for creating a low-administration web application, even one that must be quite scalable, or moving an existing IIS web app to the public cloud.
Cloud Services, which was the initial execution model provided by
Windows Azure, is an explicitly PaaS approach. While the line between
PaaS and web hosting is blurry, Cloud Services differs in some
important ways from Web Sites, including the following:
Unlike Web Sites, Cloud Services gives you administrative access to
your application’s VMs. This lets you install arbitrary software that
your application needs, something that’s not possible with Web Sites.
Because Cloud Services offers both web roles and worker roles, it’s a
better choice than Web Sites for multi-tier applications that need
separate VMs for their business logic. Cloud Services provides
separate staging and production environments, making application
updates somewhat smoother than Web Sites. Unlike Web Sites, you can
use networking technologies such as Windows Azure Virtual Network and
Windows Azure Connect to hook on-premises computers to Cloud Services
applications. Cloud Services lets you use Remote Desktop to connect
directly to an application’s VMs, something that’s not possible with
Web Sites.
http://www.windowsazure.com/en-us/manage/windows/fundamentals/compute/
More info:
http://www.windowsazure.com/en-us/manage/services/cloud-services/how-to-create-and-deploy-a-cloud-service/

WCF Authentication

I have a WCF service that uses Membership for security. If I create a Silverlight Business Application It automatically links in with it and authenticates. How do I do the same with Windows Forms, and possibly XNA?
You can use Microsoft's Client Application Services http://msdn.microsoft.com/en-us/library/bb384297.aspx. I think that is what you are looking for.
Client application services make it easy for you to create Windows-based applications that use the Microsoft Ajax login, roles, and profile application services included in the Microsoft ASP.NET 2.0 AJAX Extensions. These services enable multiple Web and Windows-based applications to share user information and user-management functionality from a single server. For example, you can use these services to perform the following tasks: