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:
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:
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.
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.
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.
Your style is unique in comparison to other
ReplyDeletefolks 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