You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/vs-azure-tools-resource-groups-deployment-projects-create-deploy.md
+32-43Lines changed: 32 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,29 +7,24 @@ author: tfitzmac
7
7
manager: timlt
8
8
editor: tysonn
9
9
10
-
ms.assetid: 4bd084c8-0842-4a10-8460-080c6a085bec
11
10
ms.service: azure-resource-manager
12
11
ms.devlang: multiple
13
12
ms.topic: tutorial
14
13
ms.tgt_pltfrm: na
15
14
ms.workload: na
16
-
ms.date: 04/09/2018
15
+
ms.date: 07/02/2018
17
16
ms.author: tomfitz
18
17
19
18
---
20
19
# 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.
22
21
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.
28
23
29
24
## 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.
31
26
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.
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 +
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:
52
47
53
48
| File name | Description |
54
49
| --- | --- |
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. |
56
51
| 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. |
58
53
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.
60
55
61
56
## 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).
63
58
64
59
To work on your template, open **WebSiteSQLDatabase.json**.
65
60
@@ -83,7 +78,7 @@ Notice that not only was the resource added, but also a parameter for the type s
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.
87
82
88
83
```json
89
84
"storageType": {
@@ -112,7 +107,7 @@ You can set **numberOfWorkers** to 1.
112
107
```
113
108
114
109
## 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.
116
111
117
112
1. On the shortcut menu of the deployment project node, choose **Deploy** > **New**.
118
113
@@ -135,9 +130,9 @@ You are now ready to deploy your project. When you deploy an Azure Resource Grou
135
130
136
131
**hostingPlanName** specifies a name for the [App Service plan](../app-service/azure-web-sites-web-hosting-plans-in-depth-overview.md) to create.
137
132
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**.
139
134
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.
141
136
142
137
**databaseName** specifies a name for the database to create.
143
138
@@ -155,17 +150,16 @@ You are now ready to deploy your project. When you deploy an Azure Resource Grou
155
150
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.
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.
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.
162
157
163
158

164
159
165
160
## 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.
169
163
170
164
1. Add a project to your Visual Studio solution. Right-click the solution, and select **Add** > **New Project**.
171
165
@@ -192,35 +186,35 @@ deploying code for a web app or for setting up a Virtual Machine is almost the s
192
186
193
187
The properties are:
194
188
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.
197
191
* The default value of **Build;Package** enables the deployment to build and create a web deployment package (package.zip).
198
192
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.
200
194
7. Go back to WebSiteSQLDatabase.json and add a resource to the template.

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**).
207
201
208
202

209
203
210
204
For the **Artifact storage account**, select the one deployed with this resource group.
211
205
10. After the deployment has finished, select your web app in the portal. Select the URL to browse to the site.
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.
220
214
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.
222
216
223
-
```json
217
+
```json
224
218
,{
225
219
"properties": {
226
220
"lenses": {
@@ -295,24 +289,19 @@ Now that we've created a solution it's time to go the last mile and make it oper
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.
> 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)
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).
0 commit comments