Clarity, Technology, and Solving Problems | PracticeThis.com
WP7 App with Key Windows Azure resources – Slides, Videos, How-To’s, and T-shooting – for quick consumption on the go.
Before proceeding with further reading, review the following previous posts:
In this post I will show how to publish your ASP.NET web application and how to configure it to keep federated authentication with ACS v 2.0 functional when running in Windows Azure production environment.
Content in this step adopted and adapted from Code Quick Launch: Create and deploy an ASP.NET application in Windows Azure.
In this step you will deploy the application to the cloud using the Windows Azure management portal. First you’ll need to create a service and a service configuration file, called service package, and then upload it to Windows Azure environment using Windows Azure management portal.
For Configuration file, click the corresponding Browse Locally… button, navigate to the folder where your ServiceConfiguration.cscfg is, and select the file.
Click on Add Certificate button to add your certificate to be deployed, but first you need to export the certificate into file. To export the certificate into file follow these steps:
Open mmc console by first clicking on Windows button in task bar and typing mmc. You should see mmc.exe appears in search results. Click on it.
When mmc console appears click on File option and then on Add/Remove Snap-in… option.
In the Add or Remove Snap-ins dialog box choose Certificates from the available snap-ins list and click on Add> button.
Choose Computer Account option and click Finish button.
In the Select Computer wizard page select Local Computer (the computer this console is running on) and click Finish button. The click OK button.
Expand Console Root folder.
Expand Certificates(Local Computer) folder.
Expand Personal folder.
Click on Certificates folder to list available certificates.
Locate your certificate in the list.
Right click on the certificate and choose All Tasks and then Export… option.
Click Next on the welcome page of the wizard.
On the Export Private Key page choose Yes, export the private key option and click Next button.
On the Export File Format leave the default option which is Personal Information Exchange - PKCS #12 (.PFX) and click Next button.
On the Password page of the wizard specify password. You will need it when uploading the certificate to Windows Azure environment via management portal.
On the File to Export page of the wizard specify destination file and click Next button. Make a note where you are saving the file. Note, since the certificate being exported has private key extra care should be taken to not exposing it to the public. It’s best if you delete the file altogether after uploading it to Windows Azure environment.
Click Finish to complete the wizard. You should be presented with The export was successful message, click OK button to dismiss the message.
Switch back to Windows Azure management portal where you opened a dialog box to locate your certificate (.PFX) file and locate the certificate file you have just exported.
Specify the password for your certificate in the Certificate Password field.
Click OK. You will receive a warning after you click OK because there is only one instance of the web role defined for your application (this setting is contained in the ServiceConfiguration.cscfg file). For purposes of this walk-through, override the warning by clicking Yes, but realize that you likely will want more than one instance of a web role for a robust application.
You can monitor the status of the deployment in the Windows Azure management portal by navigating to the Hosted Services section. Because this was a deployment to a staging environment, the DNS will be of the form http://<guid>.cloudapp.net. You can see the DNS name if you click the deployment name in the Windows Azure management portal (you may need to expand the Hosted Service node to see the deployment name); the DNS name is in the right hand pane of the portal. Once your deployment has a status of Ready (as indicated by the Windows Azure management portal), you can enter the DNS name in your browser (or click it from the Windows Azure management portal) to see that your application is deployed to the cloud.
Although this walk-through was for a deployment to the staging environment, a deployment to production follows the same steps, except you pick the production environment instead of staging. A deployment to production results in a DNS name based on the URL of your choice, instead of a GUID as used for staging.
If this is your first exposure to the Windows Azure management portal, take some time to familiarize yourself with its functionality. For example, similar to the way you deployed your application, the portal provides functionality for stopping, starting, deleting, or upgrading a deployment.
Assuming no issues were encountered, at this point you have deployed your Windows Azure application to the cloud. However, before proceeding, realize that a deployed application, even if it is not running, will continue to accrue billable time for your subscription. Therefore, it is extremely important that you delete unwanted deployments from your Windows Azure subscription. To delete the deployment, use the Windows Azure management portal to first stop your deployment, and then delete your deployment. These steps take place within the Hosted Services section of the Windows Azure management portal: Navigate to your deployment, select it, and then click the Stop icon. After it is stopped, delete it by clicking the Delete icon. If you do not delete the deployment, billable charges will continue to accrue for your deployment, even if it is stopped.
Publish to production clicking on you deployment node so that Swap VIP ribbon appears.
Click on Swap VIP ribbon and then OK button. The deployment to production should take couple of minutes.
In the next procedure you will update the the package and the ACSv2 to reflect on the address changes from staging environment to production.
Next procedure helps you to verify your application is functional when running in Windows Azure environment.
My live demo is here https://wawithacsv2.cloudapp.net:8085/.