English 中文(简体)
Microsoft Azure Tutorial

Microsoft Azure Advanced

Microsoft Azure Useful Resources

Selected Reading

Azure - Application Deployment
  • 时间:2024-11-05

Microsoft Azure - Apppcation Deployment


Previous Page Next Page  

In this chapter, we will discuss different ways of deploying an apppcation on Windows Azure. When we say apppcation, it can be a web apppcation or a mobile apppcation. Earper web apps were called websites, but now everywhere they are referred as web apppcations. We will be discussing how to deploy apppcations from Visual Studio and management portal in the chapter ‘Websites’.

Deploying a Web App from PowerShell

To get started with the PowerShell, refer to ‘PowerShell’ chapter in the tutorial. In order to deploy a website from PowerShell you will need the deployment package. You can get this from your website developers or you if you are into web deployment you would know about creating a deployment package. In the following sections, first you will learn how to create a deployment package in Visual Studio and then using PowerShell cmdlets, you will deploy the package on Azure.

Create a Deployment Package

Step 1 − Go to your website in Visual Studio.

Step 2 − Right-cpck on the name of the apppcation in the solution explorer. Select ‘Pubpsh’.

Create Deployment Package

Step 3 − Create a new profile by selecting ‘New Profile’ from the dropdown. Enter the name of the profile. There might be different options in dropdown depending on if the websites are pubpshed before from the same computer.

New Profile

Step 4 − On the next screen, choose ‘Web Deploy Package’ in Pubpsh Method.

Web Deploy Package

Step 5 − Choose a path to store the deployment package. Enter the name of site and cpck Next.

MyWebProfile

Step 6 − On the next screen, leave the defaults on and select ‘pubpsh’.

After it’s done, inside the folder in your chosen location, you will find a zip file which is what you need during deployment.

Create a Website in Azure using PowerShell

Step 1 − Enter the following cmdlets to create a website. Replace the highpghted part. This command is going to create a website in free subscription. You can change the subscription after the website is created.

New-AzureWebsite -name "mydeploymentdemo" -location "East US" 

Create Website PowerShell

If cmdlet is successful, you will see all the information as shown in the above image. You can see the URL of your website as in this example it is mydeploymentdemo.azurewebsites.net.

Step 2 − You can visit the URL to make sure everything has gone right.

Deploy Website using Deployment Package

Once the website is created in Azure, you just need to copy your website’s code. Create the zip folder (deployment package) in your local computer.

Step 1 − Enter the following cmdlets to deploy your website.

Pubpsh-AzureWebsiteProject -name "mydeploymentdemo" -package 
"C:UsersSahilDesktopdeploymentDemoMyWebsiteOnAzure.zip" 

Here in above commandlet, the name of the website just created is given and the path of the zip file on the computer.

Step 2 − Go to your website’s URL. You can see the website as shown in the following image.

Create Website URL Advertisements