Skip to content

Commit cab6687

Browse files
authored
Merge pull request #45707 from tfitzmac/0702fix
fixed image link
2 parents 46767bb + 3cd371f commit cab6687

File tree

1 file changed

+32
-43
lines changed

1 file changed

+32
-43
lines changed

articles/azure-resource-manager/vs-azure-tools-resource-groups-deployment-projects-create-deploy.md

Lines changed: 32 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,24 @@ author: tfitzmac
77
manager: timlt
88
editor: tysonn
99

10-
ms.assetid: 4bd084c8-0842-4a10-8460-080c6a085bec
1110
ms.service: azure-resource-manager
1211
ms.devlang: multiple
1312
ms.topic: tutorial
1413
ms.tgt_pltfrm: na
1514
ms.workload: na
16-
ms.date: 04/09/2018
15+
ms.date: 07/02/2018
1716
ms.author: tomfitz
1817

1918
---
2019
# Creating and deploying Azure resource groups through Visual Studio
21-
With Visual Studio and the [Azure SDK](https://azure.microsoft.com/downloads/), you can create a project that deploys your infrastructure and code to Azure. For example, you can define the web host, web site, and database for your app, and deploy that infrastructure along with the code. Or, you can define a Virtual Machine, Virtual Network and Storage Account, and deploy that infrastructure along with a script that is executed on Virtual Machine. The **Azure Resource Group** deployment project enables you to deploy all the needed resources in a single, repeatable operation. For more information about deploying and managing your resources, see [Azure Resource Manager overview](resource-group-overview.md).
20+
With Visual Studio, you can create a project that deploys your infrastructure and code to Azure. For example, you can define the web host, web site, and database for your app, and deploy that infrastructure along with the code. Visual Studio provides many different starter templates for deploying common scenarios. In this article, you deploy a web app and SQL Database.
2221

23-
Azure Resource Group projects contain Azure Resource Manager JSON templates, which define the resources that you deploy to Azure. To learn about the elements of the Resource Manager template, see [Authoring Azure Resource Manager templates](resource-group-authoring-templates.md). Visual Studio enables you to edit these templates, and provides tools that simplify working with templates.
24-
25-
In this article, you deploy a web app and SQL Database. However, the steps are almost the same for any type resource. You can as easily deploy a Virtual Machine and its related resources. Visual Studio provides many different starter templates for deploying common scenarios.
26-
27-
This article shows Visual Studio 2017. If you use Visual Studio 2015 Update 2 and Microsoft Azure SDK for .NET 2.9, or Visual Studio 2013 with Azure SDK 2.9, your experience is largely the same. You can use versions of the Azure SDK from 2.6 or later; however, your experience of the user interface may be different than the user interface shown in this article. We strongly recommend that you install the latest version of the [Azure SDK](https://azure.microsoft.com/downloads/) before starting the steps.
22+
This article shows how to use [Visual Studio 2017 with the Azure development and ASP.NET workloads installed](/dotnet/azure/dotnet-tools). If you use Visual Studio 2015 Update 2 and Microsoft Azure SDK for .NET 2.9, or Visual Studio 2013 with Azure SDK 2.9, your experience is largely the same.
2823

2924
## Create Azure Resource Group project
30-
In this procedure, you create an Azure Resource Group project with a **Web app + SQL** template.
25+
In this section, you create an Azure Resource Group project with a **Web app + SQL** template.
3126

32-
1. In Visual Studio, choose **File**, **New Project**, choose either **C#** or **Visual Basic** (which language you choose has no impact on the later stages as these projects contain only JSON and PowerShell content). Then choose **Cloud**, and **Azure Resource Group** project.
27+
1. In Visual Studio, choose **File**, **New Project**, choose either **C#** or **Visual Basic** (which language you choose has no impact on the later stages as these projects have only JSON and PowerShell content). Then choose **Cloud**, and **Azure Resource Group** project.
3328

3429
![Cloud Deployment Project](./media/vs-azure-tools-resource-groups-deployment-projects-create-deploy/create-project.png)
3530
2. Choose the template that you want to deploy to Azure Resource Manager. Notice there are many different options based on the type of project you wish to deploy. For this article, choose the **Web app + SQL** template.
@@ -48,18 +43,18 @@ In this procedure, you create an Azure Resource Group project with a **Web app +
4843

4944
![show nodes](./media/vs-azure-tools-resource-groups-deployment-projects-create-deploy/show-items.png)
5045

51-
Since we chose the Web app + SQL template for this example, you see the following files:
46+
Since you chose the Web app + SQL template for this example, you see the following files:
5247

5348
| File name | Description |
5449
| --- | --- |
55-
| Deploy-AzureResourceGroup.ps1 |A PowerShell script that invokes PowerShell commands to deploy to Azure Resource Manager.<br />**Note** Visual Studio uses this PowerShell script to deploy your template. Any changes you make to this script affect deployment in Visual Studio, so be careful. |
50+
| Deploy-AzureResourceGroup.ps1 |A PowerShell script that runs PowerShell commands to deploy to Azure Resource Manager.<br />**Note** Visual Studio uses this PowerShell script to deploy your template. Any changes you make to this script affect deployment in Visual Studio, so be careful. |
5651
| WebSiteSQLDatabase.json |The Resource Manager template that defines the infrastructure you want deploy to Azure, and the parameters you can provide during deployment. It also defines the dependencies between the resources so Resource Manager deploys the resources in the correct order. |
57-
| WebSiteSQLDatabase.parameters.json |A parameters file that contains values needed by the template. You pass in parameter values to customize each deployment. |
52+
| WebSiteSQLDatabase.parameters.json |A parameters file that has values needed by the template. You pass in parameter values to customize each deployment. |
5853

59-
All resource group deployment projects contain these basic files. Other projects may contain additional files to support other functionality.
54+
All resource group deployment projects have these basic files. Other projects may have additional files to support other functionality.
6055

6156
## Customize the Resource Manager template
62-
You can customize a deployment project by modifying the JSON templates that describe the resources you want to deploy. JSON stands for JavaScript Object Notation, and is a serialized data format that is easy to work with. The JSON files use a schema that you reference at the top of each file. If you want to understand the schema, you can download and analyze it. The schema defines what elements are valid, the types and formats of fields, the possible values of enumerated values, and so on. To learn about the elements of the Resource Manager template, see [Authoring Azure Resource Manager templates](resource-group-authoring-templates.md).
57+
You can customize a deployment project by modifying the JSON templates that describe the resources you want to deploy. JSON stands for JavaScript Object Notation, and is a serialized data format that is easy to work with. The JSON files use a schema that you reference at the top of each file. If you want to understand the schema, you can download and analyze it. The schema defines what elements are valid, the types and formats of fields, and the possible values for a property. To learn about the elements of the Resource Manager template, see [Authoring Azure Resource Manager templates](resource-group-authoring-templates.md).
6358

6459
To work on your template, open **WebSiteSQLDatabase.json**.
6560

@@ -83,7 +78,7 @@ Notice that not only was the resource added, but also a parameter for the type s
8378

8479
![show outline](./media/vs-azure-tools-resource-groups-deployment-projects-create-deploy/show-new-items.png)
8580

86-
The **storageType** parameter is pre-defined with allowed types and a default type. You can leave these values or edit them for your scenario. If you do not want anyone to deploy a **Premium_LRS** storage account through this template, remove it from the allowed types.
81+
The **storageType** parameter is pre-defined with allowed types and a default type. You can leave these values or edit them for your scenario. If you don't want anyone to deploy a **Premium_LRS** storage account through this template, remove it from the allowed types.
8782

8883
```json
8984
"storageType": {
@@ -112,7 +107,7 @@ You can set **numberOfWorkers** to 1.
112107
```
113108

114109
## Deploy the Resource Group project to Azure
115-
You are now ready to deploy your project. When you deploy an Azure Resource Group project, you deploy it to an Azure resource group. The resource group is a logical grouping of resources that share a common lifecycle.
110+
You're now ready to deploy your project. When you deploy an Azure Resource Group project, you deploy it to an Azure resource group. The resource group is a logical grouping of resources that share a common lifecycle.
116111

117112
1. On the shortcut menu of the deployment project node, choose **Deploy** > **New**.
118113

@@ -135,9 +130,9 @@ You are now ready to deploy your project. When you deploy an Azure Resource Grou
135130

136131
**hostingPlanName** specifies a name for the [App Service plan](../app-service/azure-web-sites-web-hosting-plans-in-depth-overview.md) to create.
137132

138-
**administratorLogin** specifies the user name for the SQL Server administrator. Do not use common admin names like **sa** or **admin**.
133+
**administratorLogin** specifies the user name for the SQL Server administrator. Don't use common admin names like **sa** or **admin**.
139134

140-
The **administratorLoginPassword** specifies a password for SQL Server administrator. The **Save passwords as plain text in the parameters file** option is not secure; therefore, do not select this option. Since the password is not saved as plain text, you need to provide this password again during deployment.
135+
The **administratorLoginPassword** specifies a password for SQL Server administrator. The **Save passwords as plain text in the parameters file** option isn't secure; therefore, don't select this option. Since the password isn't saved as plain text, you need to provide this password again during deployment.
141136

142137
**databaseName** specifies a name for the database to create.
143138

@@ -155,17 +150,16 @@ You are now ready to deploy your project. When you deploy an Azure Resource Grou
155150
7. In a browser, open the [Azure portal](https://portal.azure.com/) and sign in to your account. To see the resource group, select **Resource groups** and the resource group you deployed to.
156151

157152
![select group](./media/vs-azure-tools-resource-groups-deployment-projects-create-deploy/select-group.png)
158-
8. You see all the deployed resources. Notice that the name of the storage account is not exactly what you specified when adding that resource. The storage account must be unique. The template automatically adds a string of characters to the name you provided to provide a unique name.
153+
8. You see all the deployed resources. Notice that the name of the storage account isn't exactly what you specified when adding that resource. The storage account must be unique. The template automatically adds a string of characters to the name you provided to provide a unique name.
159154

160155
![show resources](./media/vs-azure-tools-resource-groups-deployment-projects-create-deploy/show-deployed-resources.png)
161156
9. If you make changes and want to redeploy your project, choose the existing resource group from the shortcut menu of Azure resource group project. On the shortcut menu, choose **Deploy**, and then choose the resource group you deployed.
162157

163158
![Azure resource group deployed](./media/vs-azure-tools-resource-groups-deployment-projects-create-deploy/redeploy.png)
164159

165160
## Deploy code with your infrastructure
166-
At this point, you have deployed the infrastructure for your app, but there is no actual code deployed with the project. This article shows how to deploy a
167-
web app and SQL Database tables during deployment. If you are deploying a Virtual Machine instead of a web app, you want to run some code on the machine as part of deployment. The process for
168-
deploying code for a web app or for setting up a Virtual Machine is almost the same.
161+
At this point, you've deployed the infrastructure for your app, but there's no actual code deployed with the project. This article shows how to deploy a
162+
web app and SQL Database tables during deployment. If you're deploying a Virtual Machine instead of a web app, you want to run some code on the machine as part of deployment. The process for deploying code for a web app or for setting up a Virtual Machine is almost the same.
169163

170164
1. Add a project to your Visual Studio solution. Right-click the solution, and select **Add** > **New Project**.
171165

@@ -192,35 +186,35 @@ deploying code for a web app or for setting up a Virtual Machine is almost the s
192186

193187
The properties are:
194188

195-
* The **Additional Properties** contains the web deployment package staging location that is pushed to the Azure Storage. Note the folder (ExampleApp) and file (package.zip). You need to know these values because you provide them as parameters when deploying the app.
196-
* The **Include File Path** contains the path where the package is created. The **Include Targets** contains the command that deployment executes.
189+
* The **Additional Properties** has the web deployment package staging location that is pushed to the Azure Storage. Note the folder (ExampleApp) and file (package.zip). You need to know these values because you provide them as parameters when deploying the app.
190+
* The **Include File Path** has the path where the package is created. The **Include Targets** has the command that deployment executes.
197191
* The default value of **Build;Package** enables the deployment to build and create a web deployment package (package.zip).
198192

199-
You do not need a publish profile as the deployment gets the necessary information from the properties to create the package.
193+
You don't need a publish profile as the deployment gets the necessary information from the properties to create the package.
200194
7. Go back to WebSiteSQLDatabase.json and add a resource to the template.
201195

202196
![add resource](./media/vs-azure-tools-resource-groups-deployment-projects-create-deploy/add-resource-2.png)
203197
8. This time select **Web Deploy for Web Apps**.
204198

205199
![add web deploy](./media/vs-azure-tools-resource-groups-deployment-projects-create-deploy/add-web-deploy.png)
206-
9. Redeploy your resource group project to the resource group. This time there are some new parameters. You do not need to provide values for **_artifactsLocation** or **_artifactsLocationSasToken** because Visual Studio automatically generates those values. However, you have to set the folder and file name to the path that contains the deployment package (shown as **ExampleAppPackageFolder** and **ExampleAppPackageFileName** in the following image). Provide the values you saw earlier in the reference properties (**ExampleApp** and **package.zip**).
200+
9. Redeploy your resource group project to the resource group. This time there are some new parameters. You don't need to provide values for **_artifactsLocation** or **_artifactsLocationSasToken** because Visual Studio automatically generates those values. However, you have to set the folder and file name to the path that contains the deployment package (shown as **ExampleAppPackageFolder** and **ExampleAppPackageFileName** in the following image). Provide the values you saw earlier in the reference properties (**ExampleApp** and **package.zip**).
207201

208202
![add web deploy](./media/vs-azure-tools-resource-groups-deployment-projects-create-deploy/set-new-parameters.png)
209203

210204
For the **Artifact storage account**, select the one deployed with this resource group.
211205
10. After the deployment has finished, select your web app in the portal. Select the URL to browse to the site.
212206

213207
![browse site](./media/vs-azure-tools-resource-groups-deployment-projects-create-deploy/browse-site.png)
214-
11. Notice that you have successfully deployed the default ASP.NET app.
208+
11. Notice that you've successfully deployed the default ASP.NET app.
215209

216210
![show deployed app](./media/vs-azure-tools-resource-groups-deployment-projects-create-deploy/show-deployed-app.png)
217211

218212
## Add an operations dashboard to your deployment
219-
Now that we've created a solution it's time to go the last mile and make it operational. You are not limited to only the resources that are available through the Visual Studio interface. We can leverage the use of shared dashboards, which are defined as resources in JSON. We do this by editing our template and adding a custom resource.
213+
You aren't limited to only the resources that are available through the Visual Studio interface. You can customize your deployment by adding a custom resource to your template. To show adding a resource, you add an operational dashboard to manage the resource you deployed.
220214

221-
1. Open the WebsiteSqlDeploy.json file and add the following json block of code after the storage account resource but before the closing ] of the resources section.
215+
1. Open the WebsiteSqlDeploy.json file and add the following JSON after the storage account resource but before the closing `]` of the resources section.
222216

223-
```json
217+
```json
224218
,{
225219
"properties": {
226220
"lenses": {
@@ -295,24 +289,19 @@ Now that we've created a solution it's time to go the last mile and make it oper
295289
"hidden-title": "[concat('OPS-',resourceGroup().name)]"
296290
}
297291
}
298-
}
299-
```
300-
301-
2. Redeploy your resource group and when you look at your dashboard on the azure portal you will see the shared dashboard added to your list of choices.
292+
}
293+
```
302294

303-
![Custom Dashboard](./media/vs-azure-tools-resource-groups-deployment-projects-create-deploy/view-custom-dashboards.png)
295+
2. Redeploy your resource group. Look at your dashboard on the Azure portal, and notice the shared dashboard has been added to your list of choices.
304296

297+
![Custom Dashboard](./media/vs-azure-tools-resource-groups-deployment-projects-create-deploy/view-custom-dashboards.png)
305298

299+
3. Select the dashboard.
306300

307-
> [!NOTE]
308-
> Access to the dashboard can be managed using RBAC groups and customizations can be published to the resource after its deployed. Note that when you redploy the resource group it will reset it back to the default in your template. You should consider updating the template with the customizations.
309-
> For help on how to do this refer to [Programmatically create Azure Dashboards](../azure-portal/azure-portal-dashboards-create-programmatically.md)
301+
![Custom Dashboard](./media/vs-azure-tools-resource-groups-deployment-projects-create-deploy/Ops-DemoSiteGroup-dashboard.png)
310302

303+
You can managed access to the dashboard by using RBAC groups. You can also customize the dashboard's appearance after it's deployed. However, if you redeploy the resource group, the dashboard is rest to its default state in your template. For more information about creating dashboards, see [Programmatically create Azure Dashboards](../azure-portal/azure-portal-dashboards-create-programmatically.md).
311304

312-
![Custom Dashboard](./media/vs-azure-tools-resource-groups-deployment-projects-create-deploy/Ops-DemoSiteGroup-dashboard.png)
313-
314-
315305
## Next steps
316-
* To learn about managing your resources through the portal, see [Using the Azure portal to manage your Azure resources](resource-group-portal.md).
317306
* To learn more about templates, see [Authoring Azure Resource Manager templates](resource-group-authoring-templates.md).
318307

0 commit comments

Comments
 (0)