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(...

ADO.NET provider with invariant name 'System.Data.SqlClient' could not be loaded

Today blog post will be started with the following error when running DB tests on the CI machine: threw exception: System.InvalidOperationException: The Entity Framework provider type 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' registered in the application config file for the ADO.NET provider with invariant name 'System.Data.SqlClient' could not be loaded. Make sure that the assembly-qualified name is used and that the assembly is available to the running application. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information. at System.Data.Entity.Infrastructure.DependencyResolution.ProviderServicesFactory.GetInstance(String providerTypeName, String providerInvariantName) This error happened only on the Continuous Integration machine. On the devs machines, everything has fine. The classic problem – on my machine it’s working. The CI has the following configuration: TeamCity .NET 4.51 EF 6.0.2 VS2013 It see...

Navigating Cloud Strategy after Azure Central US Region Outage

 Looking back, July 19, 2024, was challenging for customers using Microsoft Azure or Windows machines. Two major outages affected customers using CrowdStrike Falcon or Microsoft Azure computation resources in the Central US. These two outages affected many people and put many businesses on pause for a few hours or even days. The overlap of these two issues was a nightmare for travellers. In addition to blue screens in the airport terminals, they could not get additional information from the airport website, airline personnel, or the support line because they were affected by the outage in the Central US region or the CrowdStrike outage.   But what happened in reality? A faulty CrowdStrike update affected Windows computers globally, from airports and healthcare to small businesses, affecting over 8.5m computers. Even if the Falson Sensor software defect was identified and a fix deployed shortly after, the recovery took longer. In parallel with CrowdStrike, Microsoft provi...