If you want to use Azure as deployment server for your existing WCF service then one way is to create an ‘Azure cloud service’ project from inside cloud project template in Microsoft Visual Studio and then copy all the code manually from WCF service to the Azure cloud service project. Or, you can take advantage of the hosting services and scalability of Azure, by which the existing WCF service can be easily converted to Azure cloud service with minimal changes using Microsoft Visual Studio. [ Empower executives and employees across your organization to connect, converse, discover and work together at one central location to save time, increase productivity and boost engagement Know more at: Office 365 Based Intranet ]
To migrate WCF service to ‘Azure cloud service’, Azure tools need to be installed in Visual Studio. If Azure SDK is not installed on your machine, then you will see an option to install Azure on launching of Visual Studio and selecting ‘Cloud’ project template. To install Azure, follow the steps as below:
-
- Open Visual studio
- Select File, New Project
- Select Visual C# or any other node from installed templates
- Select the ‘Cloud’ project template
- If you haven’t installed the Azure Tools, then it contains a project template named ‘Get Microsoft Azure SDK for .NET’ as shown below
Â
- To download the Azure tools select ‘Get Microsoft Azure SDK for .NET’ option and click OK button. It will open an Azure Tools tab
- To start the download, click the ‘Download Azure Tools’ button to open the web installer. Now follow the instructions as provided by web installer to install the latest version of Azure tools and the Azure SDK.
READ MORE RELATED ARTICLES
CALLING AZURE REST SERVICE FROM VBA
10 REASONS TO MOVE YOUR INFRASTRUCTURE TO MICROSOFT AZURE
After the successful installation and launch of Visual Studio, select ‘Cloud’ project template. Now it will list out all Azure cloud project templates including ‘Azure Cloud Service’ project template to start working with Azure projects as below.
 Now, let us see how to convert an Existing WCF service to Azure cloud service:
- Open your existing ‘WCF service’ project and then right click on the project.
- Move to ‘Convert’ option and then click ‘Convert to Microsoft Azure Cloud Service Project’.
- It will create an ‘Azure cloud service’ project using your existing ‘WCF service’ in the same solution as below.
- Now for deployment, build your Azure cloud service and then right click on the Azure project, click Package.
- It will create a package file and a configuration file which need to be deployed to Azure. After creating these files it will automatically open the file explorer, where you can view those files. Save this file path as it will be required at the time of deployment.
- Now to publish this ‘Azure Cloud service’, Open Microsoft Azure and login with your credentials.
- After logging into Azure, navigate to the ‘Cloud Services’ tab
- Create a new cloud service. Click on the ‘+ New’ at the bottom, then select Compute –> Cloud Service –> Quick create. Provide the URL for the new service. This complete URL (in this case – TestCloudService.cloudapp.net) will be used to browse the service later.
- URL name should be unique and it will display a green tick if the name given is available, as below.
- Click ‘Create Cloud Service’ in the bottom right, the newly created cloud service will be listed with already existing services inside ‘Cloud services’ tab.
- Click on the newly created service and then click on ‘Dashboard’ tab
- Click ‘UPLOAD A NEW PRODUCTION DEPLOYMENT’ and provide deployment label.
- Browse for the package & configuration files from the location where we have created the package in step five
- Check both the checkboxes and click the tick mark in bottom right.
- It will start deploying the cloud service, the progress can be checked in the details section below.
- It will display a success message after the successful creation of the cloud service. Also, it will display a failure message if any error occurs in between.
After successful deployment of the cloud service, you can browse the service and check it using the URL displayed in the SITE URL section. Now the service is ready to be called from inside your application.