Pages

Showing posts with label Windows Azure. Show all posts
Showing posts with label Windows Azure. Show all posts

Monday, February 24, 2014

Windows Azure cannot perform a VIP swap between deployments that have a different number of endpoints - Error solved

I have been taking a look at Windows Azure VIP swap feature and started facing this issue.

What this issue is all about and what is VIP Swap?

I had deployed an application on the production slot of a cloud service and the test application was deployed on the staging slot of same cloud service.
When you have both deployments of a cloud service up and running, you can perform a VIP swap which is nothing but the swap between your virtual ip addresses of production and staging deployments and doing so your production deployment becomes the staging and staging deployment becomes the production deployment.

But then after trying to perform VIP swap I started facing an error which says
Windows Azure cannot perform a VIP swap between deployments that have a different number of endpoints.
Though error was too obvious and pointing to the exact issue still as a typical developer I preferred to do a quick search on web and it seemed like its a very common issue which is faced by many people and so documenting the possible solutions.

All right, what is the solution?

Solution is quite easy as error is descriptive enough - check the number of endpoints of your cloud service deployments.

  • Check the cscfg files of both deployments i.e. production and staging. The number of input endpoints on both deployments should match.
  • Check endpoint ports of both slot's deployments e.g. Https / Http. (443/80)
  • Check if one of your deployment has remote desktop enabled on any of it's role instances because it ultimately ends up opening another port internally on your cloud service. If remote desktop is enabled then it needs to be enabled on both deployment slot's instances.

Takeaways:

Ideally your both deployments should match exactly because whenever you will want to put something on the production slot by swapping it with staging then you must have to make sure that it works correctly and this is why the staging slot is used for internal testing purpose, however there might some scenarios where you might want to have different deployments on both slots e..g Site under maintenance on production slot while you upgrade your deployment on staging and test it. So make sure to have a close look on the endpoints of your both deployments and now you know how.

Saturday, January 18, 2014

Profiling Windows Azure Cloud Services

Hi again guys,

Last week I was working really close with performance related things of the web applications and this what I came across for Windows Azure Cloud services.

Profiling is one of the great feature of Visual Studio and I almost fell in love with it. why? because first of all its quite descriptive and helps to measure the memory / CPU monitoring of your application and second is it can be configured in both ways i.e. while running your application locally as well as while running your application in the cloud.

I will not go into much deeper on how to use this feature and how it helps, all you need to do is click on the link to know and you are done.
http://msdn.microsoft.com/en-us/library/2s0xxa1d.aspx

You can use this great feature to go into the quite deeper understanding in terms of how your application is consuming resources on the server and it helps in deciding to scale up or scale down your application needs. More information on it at http://msdn.microsoft.com/en-us/library/dd264994.aspx

But all right , lets come back to the Cloud arena and let see how can use this for Windows Azure cloud services.

basically you can use this feature while deploying your application using VS to cloud deployment wizard. (Publish)

A great article http://msdn.microsoft.com/en-us/library/windowsazure/hh369930.aspx#BK_ProfilingCloudService which explains the approach about how you can do it pretty easily while deploying to Azure through your VS.

I was interested more on what special this VS does when we check the check box of Enable Profiling in the publish wizard? and here is what I found

Basically VS adds few entries in your cloud service definition and cloud service configuration files.

(I am using Windows Azure SDK 2.2)

In csdef
 <InternalEndpoint name="Microsoft.WindowsAzure.Plugins.Caching.cacheArbitrationPort" protocol="tcp" />
  <InternalEndpoint name="Microsoft.WindowsAzure.Plugins.Caching.cacheClusterPort" protocol="tcp" />
  <InternalEndpoint name="Microsoft.WindowsAzure.Plugins.Caching.cacheReplicationPort" protocol="tcp" />
  <InternalEndpoint name="Microsoft.WindowsAzure.Plugins.Caching.cacheServicePortInternal" protocol="tcp" />
  <InternalEndpoint name="Microsoft.WindowsAzure.Plugins.Caching.cacheSocketPort" protocol="tcp" />


In cscfg
<Setting name="Profiling.ProfilingConnectionString" value="YourStorageAccount" />
<Setting name="CloudToolsDiagnosticAgentVersion" value="2.2" />


But then I also found that the size of the deployment packages increases when you enable this option of profiling, and that's because VS also adds the 64 bit profiler in your package.
So I am not sure about how you can use this feature when you dont want to publish using VS to your cloud service, however article http://michaelwasham.com/2011/08/10/deployment-to-windows-azure-fails-with-profiling-enabled/ explains how can you do it but as it is written for older version of SDK so I am doubtful if this works for later versions of Windows Azure SDK.

Overall profiling feature managed to impress me with with it's native integration with Windows Azure Cloud Services.

Once you enable the profiling and deploy the cloud service, VS 2012 Server explorer helps you in getting report out of your profiling build with just a single click and you are set to analyze the report.