Deploy your application to an Azure Cloud Service
Deploying an Azure Cloud service couldn’t be easier than using OnCheckin to build and deploy your service.
What you’ll need to get started:
- Visual Studio with the Azure SDK Installed.
- An Azure Account.
- A Visual Studio Azure website or service project saved in a source control repository (we’ll be using Github, but any publically accessible service should work).
Laying the ground work.
The first thing you need before you set out to configure OnCheckin cloud deployment is a valid Website or service project setup as an Azure Cloud service.
You can read about setting up your first Azure Cloud service here.
For the purposes of this tutorial we’ve uploaded a sample application to Github.
This application consists of a sample ASP.Net website (in Azure Cloud Services, a “Web Role”).
If you have your own Cloud Service project, simply make sure that it uploaded into an internet accessible Git, TFS or SVN repository so that we can access it later when setting up your OnCheckin deployment project.
Getting your Azure cloud hosting setup
Login to your Azure portal here.
Select the “Cloud services” menu option on the left.
Create a new Azure Service (if you haven’t got one ready to go) by clicking on the “Create a cloud service” link.
Select a region you would like your cloud service to run in, and then give it a name.
Now click on “Create cloud service” to create your service.
Now switch over to the “Storage” section of the Azure management console. We’re going to create a storage account to store the deployment packages OnCheckin builds and deploys for you.
This step is optional, as you may already have an Azure storage account you’d like us to upload your deployment packages to. When we deploy we’ll be creating a container named “oncheckin-deployments” to upload these within.
Click on the “New” icon at the bottom of the page and click on the “Quick create” option.
Enter a name for your new storage account – we’ve entered “oncheckin” but you can name this whatever you’d like.
Then enter a region for your storage account. As we selected “East US” as the region for our cloud service we’ll select the same for our storage account. This gives us the fastest deployment performance while also saving costs from any unneeded inter-region traffic.
Deployment Project configuration
Login to your OnCheckin account here.
Click on the “Why not add one now, it’s easy” button if this if your first project or the “Add another site” button if not.
On the project Source Control tab enter your credentials and connection information for the server hosting your source control and your Azure Cloud Service.
If you’d like to use our sample application, do the following:
- Select “Git” from the dropdown for Source Control Type.
- Enter the Url below as the Url:
- Leave the username and password blank.
- Hit the “Test Source Control” button to validate the connection to Github.
Select the “Deployment Configuration” tab at the top of the screen to shift over to configuring your Azure Cloud Service deployment.
In the text box labelled “Visual Studio Web project to deploy” enter the project name of your Azure Cloud service within your Visual Studio solution.
If you are using our sample project, you can simply enter:
Now select the top unnamed deployment environment in the tab on the left, it’s labelled “[Untitled Environment]”
Give your environment a name by entering “Production” into the first text box.
Now select “Azure Cloud” from the Deployment Method drop down.
This will then show you a message as you are yet to create any Azure management certificates.
Click on the link labelled “Create one now” to open the certificate creation modal.
Enter a name for your certificate. We’ve entered “Example Cloud Service” above, but you can name your certificate anything you’d like to help identify this certificate. Then press “Create” and wait for the certificate to be generated.
Once the certificate has been created, click on the download link to download your certificate.
Save this .cer file somewhere safe as this certificate is the equivalent of a username/password to your Azure account so this file is sensitive.
Now open a new browser window/tab and login to your Azure account at https://manage.windowsazure.com/
Once you’re logged in, select the “Subscriptions” link at the top of the page, and click the link marked “Manage subscriptions/directory”.
Now select the “MANAGEMENT CERTIFICATES” tab at the top of the page. This will show you all of the management certificates if your Azure account.
Click on the “Upload” icon at the bottom of the page and upload the certificate you downloaded from your Azure account.
Now that you’ve uploaded your certificate, copy the “Subscription Id” value shown next to it. This is your Azure subscription id and we’ll be needing this in a minute.
Now switch back to the browser window/tab that you had OnCheckin open in. Close the modal dialog labelled “Certificate Successfully Created”.
Now do the following:
- Enter the Azure subscription Id you copied previously after uploading your certificate to Azure.
- Select the Management certificate you uploaded to Azure from the Management Certificate drop down.
- Enter your Azure cloud service name (We called ours “oncheckinsample” above but you may have named yours differently).
- Enter the name of the Azure storage account you want OnCheckin to upload your deployment packages to (We called our “oncheckin” above, but you may have named yours differently).
- Select “Production” as the deployment slot you’d like us to deploy to (if you select “Staging” we’ll only upload your deployment to the staging slot in Azure).
You’ve now configured your OnCheckin cloud service for deployment.
Hit “Test Deployment Settings” and wait for the green “Success” box to show.
Now switch over the the “Review Project” tab on in the OnCheckin project management page.
Review your OnCheckin project configuration and then click the “Save OnCheckin Project Configuration” button.
The page should ask you if you’d like to run a test deployment to build your project. Feel free to click “Yes” – this downloads and builds your project without deploying it to make sure your codebase compiles.
Back on the main deployment console page you can now deploy at anytime by pressing the link “Run” next to your deployment project. The same will occur by simply checking in some changes to your source control.
You now have your Azure Cloud Service properly configured with OnCheckin for continuous deployment.