Skip to main content

Some deployment methods of a web application on Windows Azure

With the new version of Windows Azure we can publish web-sites on Windows Azure more easily. This new features can be used with Visual Studio 2010 also, not only with the new Visual Studio 2012 (current version is RC).
The classic deploy, using a deploy package or from the Azure project from Visual Studio remained unchanged. The new features help us a lot when we want to publish a new version (update) of web-site without recreated the web-role. In the old version of Windows Azure, this could be done, but there were a lot of configuration that need to be done on the solution.
Let see how we can publish a web-site very easily using the new features. I assume that you already have a Windows Azure account and a Windows Azure Deployment Project added to your current solution.
When you first time want to publish the web application you will need to configure the account credentials. The main different from the old version is the option to download the credentials information from Windows Azure Portal. At this first step you will find a URL that will redirect you to the page where from credentials can be downloaded. This information will be saved on your computer. Use the “Import” button to import all this information. After you make this configuration you are ready to deploy the application. No more copy/paste the subscription ID, user, and password and so on. This is one of the think that I hated more, the 1st time configuration of the Windows Azure Deploy Project.
Don’t forget to have a storage account configured also. It will be used to the deployment process. After the deploy ends, the package is automatically removed from the storage. I recommend having two instances because when an upgrade is made, the web application will be down. But with the new upgrade mechanism deploy can be made only in few seconds.
If you want, the wizard gives us the possibility to select a specific storage account or to have a custom label for the given deployment and so on. At this step, if you want to allow upgrades of your application, you need to select the “Enable deployment upgrade”.
Another very fast deployment process is the web deploys functionality. There are some very important things that you should know about this type of publish:
  • A web deploy can be made only to the web role. You will not be able to upgrade a worker role for instance. Because this process use a feature that can be found on the IIS
  • Use this deployment method when you are on the development process or testing. But never on a production environment as a deployment step. Because if the web role instances crash, the image that will be used to redeploy the package will be original one, not the one from the upgrade. This feature can be used for hot fixes in production if we cannot make a normal deploy, but we need to be very careful with it.
  • The remote desktop connection need to be activated on the web role.
  • This deployment can be done only when we have only one web role per web application. If for example we have 10 web role for a given application, that this deploy method cannot be used. Because Visual Studio should connect to each web role and make the upgrade.
  • Only the file that was changed is uploaded to the web role. For example if we have 10 html file, and only one file is changed, than that file will be the only file that is uploaded to the worker role.
After we configure the web deploy mechanism the only thing that you need to do is to right click on the web project and click “Publish”. If is the first type when you do this you will need to select the username, password and also the publish profile. You could have project with more than one publish profile (eq.: production, testing, development).
Let see how we can configure the web deploy. First of all you need to have the Remote Desktop connection activated. The same thing is required to make an upgrade. After that when you deploy your web role you need to select “Enable Web Deploy”. After that, when you will make a deploy, the web roles will have this options activated and you will be able to make the publish in only few seconds.
The web publish process goes on HTTP by default. If you want to have a secure connection (using HTTPS) you will need use a certificate from Windows Azure portal. I recommend creating on your machine a certificate for this purpose and uploaded it to the portal.
The default way to add this certificate is too remote connects to each machine and add the corticated to the IIS. Another solution is to add the certificate to the Azure project. To do this you will need to add the following lines of code to your “ServiceDefinition.csdef” from Azure project:
<Certificates>
<Certificate name="myProject" storeLocation="CurrentUser" storeName="My" />
</Certificates>
Next, in the *.cscfg file you will need a node for your defined certificate under the web role node with the thumbprint of your certificate:
<Certificates>
<Certificate name="myProject" thumbprint="17485124E04D8E64B1044F5BB43FEEDF431B5B32" thumbprintAlgorithm="sha1" />
...
</Certificates>
This certificate needs to be installed on your machine. The store name represents the location where certificate can be found. This configuration can be made from the UI, if you open your web role under the Roles directory from the Azure project and select the “Certificates” tab.
You can also make a web deploy using FTP. When you want to make a publish, you need to select the FTP publish method instated of web deploy.
There are a lot of methods to publish a web application to the cloud. You need to choose the best one for you and for your project.

Comments

  1. Your style is unique in comparison to other
    folks I have read stuff from. Many thanks for posting when you have the
    opportunity, Guess I'll just bookmark this blog.
    Feel free to visit my web blog ... free sites

    ReplyDelete

Post a Comment

Popular posts from this blog

Windows Docker Containers can make WIN32 API calls, use COM and ASP.NET WebForms

After the last post , I received two interesting questions related to Docker and Windows. People were interested if we do Win32 API calls from a Docker container and if there is support for COM. WIN32 Support To test calls to WIN32 API, let’s try to populate SYSTEM_INFO class. [StructLayout(LayoutKind.Sequential)] public struct SYSTEM_INFO { public uint dwOemId; public uint dwPageSize; public uint lpMinimumApplicationAddress; public uint lpMaximumApplicationAddress; public uint dwActiveProcessorMask; public uint dwNumberOfProcessors; public uint dwProcessorType; public uint dwAllocationGranularity; public uint dwProcessorLevel; public uint dwProcessorRevision; } ... [DllImport("kernel32")] static extern void GetSystemInfo(ref SYSTEM_INFO pSI); ... SYSTEM_INFO pSI = new SYSTEM_INFO(

Azure AD and AWS Cognito side-by-side

In the last few weeks, I was involved in multiple opportunities on Microsoft Azure and Amazon, where we had to analyse AWS Cognito, Azure AD and other solutions that are available on the market. I decided to consolidate in one post all features and differences that I identified for both of them that we should need to take into account. Take into account that Azure AD is an identity and access management services well integrated with Microsoft stack. In comparison, AWS Cognito is just a user sign-up, sign-in and access control and nothing more. The focus is not on the main features, is more on small things that can make a difference when you want to decide where we want to store and manage our users.  This information might be useful in the future when we need to decide where we want to keep and manage our users.  Feature Azure AD (B2C, B2C) AWS Cognito Access token lifetime Default 1h – the value is configurable 1h – cannot be modified

What to do when you hit the throughput limits of Azure Storage (Blobs)

In this post we will talk about how we can detect when we hit a throughput limit of Azure Storage and what we can do in that moment. Context If we take a look on Scalability Targets of Azure Storage ( https://azure.microsoft.com/en-us/documentation/articles/storage-scalability-targets/ ) we will observe that the limits are prety high. But, based on our business logic we can end up at this limits. If you create a system that is hitted by a high number of device, you can hit easily the total number of requests rate that can be done on a Storage Account. This limits on Azure is 20.000 IOPS (entities or messages per second) where (and this is very important) the size of the request is 1KB. Normally, if you make a load tests where 20.000 clients will hit different blobs storages from the same Azure Storage Account, this limits can be reached. How we can detect this problem? From client, we can detect that this limits was reached based on the HTTP error code that is returned by HTTP