If you find yourself having to move existing .Net solutions to Microsoft Azure you may come across an initial deployment issue if you add a Cloud Service Project type to your existing application and then publish it to a new Azure Cloud Service using Visual Studio. It’s not immediately obvious what the source of the issue is so let’s take a look at how we can troubleshoot the source of the problem.

Visual Studio provides you with the vanilla error message “Error: No deployments were found. Http Status Code: NotFound” which doesn’t provide much guidance on what the actual source is!

Visual Studio Deployment Error

The way to troubleshoot this is to package the solution you want to deploy and then manually deploy via the Azure Management Portal. Create a package by selecting the menu option shown below.

Package Option in Visual Studio

This option will produce a cspkg file (essentially a zip file) and a cscfg configuration file which you provide in the Upload dialog in the Azure Management Portal which is shown next.

Upload Package

After uploading and provisioning our new test Cloud Service we get this error back from the Portal.

Deployment Failed

When we click on the arrow we finally see the actual source of this failure!

Guest OS doesn't support this .Net Framework version.

The source of the issue (and the fix)

Cloud Services operate on Windows-based virtual machines that can run a range of “Guest OS” releases from Windows Server 2008 up to Windows Server 2012 R2. Each Guest OS release supports a different set of .Net framework versions as detailed on MSDN.

When you create a new Cloud Service project in Visual Studio it sets the default Guest OS to “2” which based on the above MSDN article does not support .Net 4.5. The fix for this is relatively simple – you need to update the ServiceConfiguration configuration file so that it has the correct setting of “3” as per the below snippet.

<ServiceConfiguration serviceName="TestCloudService" xmlns="…" osFamily="3" osVersion="*" schemaVersion="2014-06.2.4">

Once you have done this you will be able to deploy your solution to Azure. Happy days!

Category:
Application Development and Integration, Azure Infrastructure, Azure Platform, Cloud Infrastructure
Tags:

Comments are closed.