2
votes

I want to upload existing WebApp package in azure resource group using powershell commands.

having gone through multiple links, such as this one

http://blogs.technet.com/b/georgewallace/archive/2015/05/10/deploying-a-website-with-content-through-visual-studio-with-resource-groups.aspx

I am still not sure, which parameter in the template json file is required for package contents.

I could create blank web app using azure quick start templates.and this command.

New-AzureRMResourceGroupDeployment

But want to deploy existing web app to resource group.Any suggestions appreciated!

Thanks

1

1 Answers

6
votes

I know you said you have an existing Web Deploy Package but I'm including the steps to generate this in my answer to hopefully get ahead of any future questions on this.

Create the Web Deploy Package

Using Visual Studio, in the Solution Explorer window right-click on your ASP.NET web application project and select Publish. On the Profile page of the publish dialog, select Custom to create a new profile.

enter image description here

Give the profile a Name; I called mine WebDeployPkg. Next, set the Publish Method to Web Deploy Package and select a folder for the Package location. Then, click Publish. This will generate the Web Deploy Package (a .zip) in that folder.

Add the Web Deploy Package to your Resource Group Project

Add a folder to your project to store your Web Deploy Package in. I named mine App. Then, copy the Web Deploy Package to this folder. If you do this using Windows Explorer, click the Show All Files button in the toolbar and then right-click on the .zip file and select Include in Project.

enter image description here

Using the JSON Outline window for the DeploymentTemplate.json file in your project, add a Web Deploy for Web Apps resource.

enter image description here

Deploy the Web App using Azure Resource Manager

When you're ready to deploy your resource group, right-click on the resource group project and select Deploy > New Deployment.

The Web Deploy for Web Apps resource will cause the Artifact Storage Account setting to light up so you can specify where to upload the web deploy package to. Azure Resource Manager will pick it up from here after it has created your web app environment in Azure. So, create a storage account for this purpose if you don't already have one. Next, click the Edit Parameters button.

enter image description here

In the Edit Parameters dialog you will see two parameters for the Web Deploy Package. For the PackageFolder setting, this should be your <resource group project name>/<folder name you created above>.

For the PackageFileName setting, this is simply the file name of the Web Deploy Package.

enter image description here

Click Save and then Deploy.