Hosting WCF in Azure App Service

Introduction

In this article we will discuss on the procedures to host a WCF Service on Azure WebApps in AppService. Azure AppSerivce consists of four sub types and they are

  • Web Apps    – Provides hosting service for Web Applications
  • Mobile Apps – Provides a mobile-application development platform that’s highly scalable.
  • Logic Apps   – Provides a visual designer to automate the business process in a series of workflow
  • API Apps      – Provides design and hosting services for Rest API

Description

Usually we use Cloud Services on Azure to host WCF services. While Cloud Services hosting works as expected, the requirement we got was to find an option to host wcf service using one of the features in Azure AppService itself.

We can use WebApps feature to host the WCF in Azure AppService. Follow along this article to find out the procedures.

Step 1: Right Click on WCF Project in Visual Studio and Select the Publish Option

Azure Right Click

Step 2:  Publish dialog box will display. In that Select the Microsoft Azure AppService option. If you are deploying WCF Service for the first time then select “Create New” and click on Publish Button

AzureWCF1

Step 3: Now we will see the App Service configuration dialog window. In the dialog window, we have to create the configuration details for WebApp in Azure

  • App Name – Name of the hosted wcf service application in azure
  • Subscription – Your active subscription for Azure. This field will be auto populated when you login to azure
  • Resource Group – Enables you to work with the resources in your solution as a
  • App Service Plan – Option to select the deployment location and the App Service Plan for deployment

AzureWCF2Step 4: Before publishing to Azure, Make sure the application type is “Web AppAzureWCF3

Step 5: Click on Create button to start deployment to Azure. You can also find the status of deployment in Output Window of Visual StudioAzureWCF4 Deploying

AzureWCF5 OutputStep 6: After successful deployment, the published WCF Service will be displayed on the App Service section on Azure portal.AzureWCF6AzureWindowStep 7: Click on Published WCF Service to find more details and URL of service.AzureWCF6Azure Publish

Accessing the WCF Service

Create a console app as client application for WCF Service. Right click on console app and use the Add -> Service Reference option to access wcf service on client applicationServiceReference

ServiceReferenceAdded

Once we add the WCF Service reference, we can call the WCF method like below

CallingWCF

 

Advertisements

, , , ,

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: