Skip to content

Commit 99ad6c5

Browse files
authored
Merge pull request #78485 from tfitzmac/0531mg
added management group deployments
2 parents 90ef94d + 92e4cf8 commit 99ad6c5

File tree

4 files changed

+46
-32
lines changed

4 files changed

+46
-32
lines changed

articles/azure-resource-manager/resource-group-overview.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ms.devlang: na
1111
ms.topic: overview
1212
ms.tgt_pltfrm: na
1313
ms.workload: na
14-
ms.date: 05/24/2019
14+
ms.date: 05/31/2019
1515
ms.author: tomfitz
1616

1717
---
@@ -47,14 +47,16 @@ Resource Manager provides several benefits:
4747
* You can apply tags to resources to logically organize all the resources in your subscription.
4848
* You can clarify your organization's billing by viewing costs for a group of resources sharing the same tag.
4949

50-
## Understand management scope
50+
## Understand scope
5151

52-
Azure provides four levels of management scope: [management groups](../governance/management-groups/index.md), subscriptions, [resource groups](#resource-groups), and resources. The following image shows an example of these layers.
52+
Azure provides four levels of scope: [management groups](../governance/management-groups/index.md), subscriptions, [resource groups](#resource-groups), and resources. The following image shows an example of these layers.
5353

5454
![Scope](./media/resource-group-overview/scope-levels.png)
5555

5656
You apply management settings at any of these levels of scope. The level you select determines how widely the setting is applied. Lower levels inherit settings from higher levels. For example, when you apply a [policy](../governance/policy/overview.md) to the subscription, the policy is applied to all resource groups and resources in your subscription. When you apply a policy on the resource group, that policy is applied the resource group and all its resources. However, another resource group does not have that policy assignment.
5757

58+
You can deploy templates to management groups, subscriptions, or resource groups.
59+
5860
## Guidance
5961

6062
The following suggestions help you take full advantage of Resource Manager when working with your solutions.

articles/azure-resource-manager/resource-group-template-deploy-cli.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ To deploy to a **subscription**, use [az deployment create](/cli/azure/deploymen
3939
az deployment create --location <location> --template-file <path-to-template>
4040
```
4141

42+
Currently, management group deployments are only supported through the REST API. See [Deploy resources with Resource Manager templates and Resource Manager REST API](resource-group-template-deploy-rest.md).
43+
4244
The examples in this article use resource group deployments. For more information about subscription deployments, see [Create resource groups and resources at the subscription level](deploy-to-subscription.md).
4345

4446
## Deploy local template
@@ -98,11 +100,11 @@ az group deployment create --resource-group examplegroup \
98100

99101
## Redeploy when deployment fails
100102

101-
This feature is also known as *Rollback on error*. When a deployment fails, you can automatically redeploy an earlier, successful deployment from your deployment history. To specify redeployment, use the `--rollback-on-error` parameter in the deployment command. This functionality is useful if you have got a known good state for your infrastructure deployment and want this to be reverted to. There are a number of caveats and restrictions:
103+
This feature is also known as *Rollback on error*. When a deployment fails, you can automatically redeploy an earlier, successful deployment from your deployment history. To specify redeployment, use the `--rollback-on-error` parameter in the deployment command. This functionality is useful if you've got a known good state for your infrastructure deployment and want to revert to this state. There are a number of caveats and restrictions:
102104

103-
- The redeployment is run exactly as it was run previously with the same parameters. You can not change the parameters.
105+
- The redeployment is run exactly as it was run previously with the same parameters. You can't change the parameters.
104106
- The previous deployment is run using the [complete mode](./deployment-modes.md#complete-mode). Any resources not included in the previous deployment are deleted, and any resource configurations are set to their previous state. Make sure you fully understand the [deployment modes](./deployment-modes.md).
105-
- The redeployment only affects the resources, any data changes are not affected.
107+
- The redeployment only affects the resources, any data changes aren't affected.
106108
- This feature is only supported on Resource Group deployments, not subscription level deployments. For more information about subscription level deployment, see [Create resource groups and resources at the subscription level](./deploy-to-subscription.md).
107109

108110
To use this option, your deployments must have unique names so they can be identified in the history. If you don't have unique names, the current failed deployment might overwrite the previously successful deployment in the history. You can only use this option with root level deployments. Deployments from a nested template aren't available for redeployment.

articles/azure-resource-manager/resource-group-template-deploy-rest.md

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
---
22
title: Deploy resources with REST API and template | Microsoft Docs
33
description: Use Azure Resource Manager and Resource Manager REST API to deploy resources to Azure. The resources are defined in a Resource Manager template.
4-
services: azure-resource-manager
5-
documentationcenter: na
64
author: tfitzmac
75

86
ms.assetid: 1d8fbd4c-78b0-425b-ba76-f2b7fd260b45
97
ms.service: azure-resource-manager
10-
ms.devlang: na
118
ms.topic: conceptual
12-
ms.tgt_pltfrm: na
13-
ms.workload: na
14-
ms.date: 03/28/2019
9+
ms.date: 05/31/2019
1510
ms.author: tomfitz
1611

1712
---
@@ -23,11 +18,25 @@ You can either include your template in the request body or link to a file. When
2318

2419
## Deployment scope
2520

26-
You can target your deployment to either an Azure subscription or a resource group within a subscription. In most cases, you'll target deployment to a resource group. Use subscription deployments to apply policies and role assignments across the subscription. You also use subscription deployments to create a resource group and deploy resources to it. Depending on the scope of the deployment, you use different commands.
21+
You can target your deployment to a management group, an Azure subscription, or a resource group. In most cases, you'll target deployments to a resource group. Use management group or subscription deployments to apply policies and role assignments across the specified scope. You also use subscription deployments to create a resource group and deploy resources to it. Depending on the scope of the deployment, you use different commands.
2722

28-
To deploy to a **resource group**, use [Deployments - Create](/rest/api/resources/deployments/createorupdate).
23+
To deploy to a **resource group**, use [Deployments - Create](/rest/api/resources/deployments/createorupdate). The request is sent to:
2924

30-
To deploy to a **subscription**, use [Deployments - Create At Subscription Scope](/rest/api/resources/deployments/createorupdateatsubscriptionscope).
25+
```HTTP
26+
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}?api-version=2019-05-01
27+
```
28+
29+
To deploy to a **subscription**, use [Deployments - Create At Subscription Scope](/rest/api/resources/deployments/createorupdateatsubscriptionscope). The request is sent to:
30+
31+
```HTTP
32+
PUT https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}?api-version=2019-05-01
33+
```
34+
35+
To deploy to a **management group**, use Deployments - Create At Management Group Scope. The request is sent to:
36+
37+
```HTTP
38+
PUT https://management.azure.com/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}
39+
```
3140

3241
The examples in this article use resource group deployments. For more information about subscription deployments, see [Create resource groups and resources at the subscription level](deploy-to-subscription.md).
3342

@@ -38,7 +47,7 @@ The examples in this article use resource group deployments. For more informatio
3847
1. If you don't have an existing resource group, create a resource group. Provide your subscription ID, the name of the new resource group, and location that you need for your solution. For more information, see [Create a resource group](/rest/api/resources/resourcegroups/createorupdate).
3948

4049
```HTTP
41-
PUT https://management.azure.com/subscriptions/<YourSubscriptionId>/resourcegroups/<YourResourceGroupName>?api-version=2018-05-01
50+
PUT https://management.azure.com/subscriptions/<YourSubscriptionId>/resourcegroups/<YourResourceGroupName>?api-version=2019-05-01
4251
```
4352

4453
With a request body like:
@@ -54,13 +63,13 @@ The examples in this article use resource group deployments. For more informatio
5463

5564
1. Validate your deployment before executing it by running the [Validate a template deployment](/rest/api/resources/deployments/validate) operation. When testing the deployment, provide parameters exactly as you would when executing the deployment (shown in the next step).
5665

57-
1. Create a deployment. Provide your subscription ID, the name of the resource group, the name of the deployment, and a link to your template. For information about the template file, see [Parameter file](#parameter-file). For more information about the REST API to create a resource group, see [Create a template deployment](/rest/api/resources/deployments/createorupdate). Notice the **mode** is set to **Incremental**. To run a complete deployment, set **mode** to **Complete**. Be careful when using the complete mode as you can inadvertently delete resources that aren't in your template.
66+
1. To deploy a template, provide your subscription ID, the name of the resource group, the name of the deployment in the request URI.
5867

5968
```HTTP
60-
PUT https://management.azure.com/subscriptions/<YourSubscriptionId>/resourcegroups/<YourResourceGroupName>/providers/Microsoft.Resources/deployments/<YourDeploymentName>?api-version=2018-05-01
69+
PUT https://management.azure.com/subscriptions/<YourSubscriptionId>/resourcegroups/<YourResourceGroupName>/providers/Microsoft.Resources/deployments/<YourDeploymentName>?api-version=2019-05-01
6170
```
6271

63-
With a request body like:
72+
In the request body, provide a link to your template and parameter file. Notice the **mode** is set to **Incremental**. To run a complete deployment, set **mode** to **Complete**. Be careful when using the complete mode as you can inadvertently delete resources that aren't in your template.
6473

6574
```json
6675
{
@@ -69,11 +78,11 @@ The examples in this article use resource group deployments. For more informatio
6978
"uri": "http://mystorageaccount.blob.core.windows.net/templates/template.json",
7079
"contentVersion": "1.0.0.0"
7180
},
72-
"mode": "Incremental",
7381
"parametersLink": {
7482
"uri": "http://mystorageaccount.blob.core.windows.net/templates/parameters.json",
7583
"contentVersion": "1.0.0.0"
76-
}
84+
},
85+
"mode": "Incremental"
7786
}
7887
}
7988
```
@@ -87,11 +96,11 @@ The examples in this article use resource group deployments. For more informatio
8796
"uri": "http://mystorageaccount.blob.core.windows.net/templates/template.json",
8897
"contentVersion": "1.0.0.0"
8998
},
90-
"mode": "Incremental",
9199
"parametersLink": {
92100
"uri": "http://mystorageaccount.blob.core.windows.net/templates/parameters.json",
93101
"contentVersion": "1.0.0.0"
94102
},
103+
"mode": "Incremental",
95104
"debugSetting": {
96105
"detailLevel": "requestContent, responseContent"
97106
}
@@ -101,7 +110,7 @@ The examples in this article use resource group deployments. For more informatio
101110

102111
You can set up your storage account to use a shared access signature (SAS) token. For more information, see [Delegating Access with a Shared Access Signature](https://docs.microsoft.com/rest/api/storageservices/delegating-access-with-a-shared-access-signature).
103112

104-
1. Instead of linking to files for the template and parameters, you can include them in the request body.
113+
1. Instead of linking to files for the template and parameters, you can include them in the request body. The following example shows the request body with the template and parameter inline:
105114

106115
```json
107116
{
@@ -164,19 +173,19 @@ The examples in this article use resource group deployments. For more informatio
164173
}
165174
```
166175

167-
1. Get the status of the template deployment. For more information, see [Get information about a template deployment](/rest/api/resources/deployments/get).
176+
1. To get the status of the template deployment, use [Deployments - Get](/rest/api/resources/deployments/get).
168177

169178
```HTTP
170179
GET https://management.azure.com/subscriptions/<YourSubscriptionId>/resourcegroups/<YourResourceGroupName>/providers/Microsoft.Resources/deployments/<YourDeploymentName>?api-version=2018-05-01
171180
```
172181

173182
## Redeploy when deployment fails
174183

175-
This feature is also known as *Rollback on error*. When a deployment fails, you can automatically redeploy an earlier, successful deployment from your deployment history. To specify redeployment, use the `onErrorDeployment` property in the request body. This functionality is useful if you have got a known good state for your infrastructure deployment and want this to be reverted to. There are a number of caveats and restrictions:
184+
This feature is also known as *Rollback on error*. When a deployment fails, you can automatically redeploy an earlier, successful deployment from your deployment history. To specify redeployment, use the `onErrorDeployment` property in the request body. This functionality is useful if you've got a known good state for your infrastructure deployment and want to revert to this state. There are a number of caveats and restrictions:
176185

177-
- The redeployment is run exactly as it was run previously with the same parameters. You can not change the parameters.
186+
- The redeployment is run exactly as it was run previously with the same parameters. You cannot change the parameters.
178187
- The previous deployment is run using the [complete mode](./deployment-modes.md#complete-mode). Any resources not included in the previous deployment are deleted, and any resource configurations are set to their previous state. Make sure you fully understand the [deployment modes](./deployment-modes.md).
179-
- The redeployment only affects the resources, any data changes are not affected.
188+
- The redeployment only affects the resources, any data changes aren't affected.
180189
- This feature is only supported on Resource Group deployments, not subscription level deployments. For more information about subscription level deployment, see [Create resource groups and resources at the subscription level](./deploy-to-subscription.md).
181190

182191
To use this option, your deployments must have unique names so they can be identified in the history. If you don't have unique names, the current failed deployment might overwrite the previously successful deployment in the history. You can only use this option with root level deployments. Deployments from a nested template aren't available for redeployment.
@@ -264,6 +273,5 @@ If you need to provide a sensitive value for a parameter (such as a password), a
264273

265274
- To specify how to handle resources that exist in the resource group but aren't defined in the template, see [Azure Resource Manager deployment modes](deployment-modes.md).
266275
- To learn about handling asynchronous REST operations, see [Track asynchronous Azure operations](resource-manager-async-operations.md).
267-
- For an example of deploying resources through the .NET client library, see [Deploy resources using .NET libraries and a template](../virtual-machines/windows/csharp-template.md?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
268-
- To define parameters in template, see [Authoring templates](resource-group-authoring-templates.md#parameters).
269-
- For guidance on how enterprises can use Resource Manager to effectively manage subscriptions, see [Azure enterprise scaffold - prescriptive subscription governance](/azure/architecture/cloud-adoption-guide/subscription-governance).
276+
- To learn more about templates, see [Understand the structure and syntax of Azure Resource Manager templates](resource-group-authoring-templates.md).
277+

articles/azure-resource-manager/resource-group-template-deploy.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Use Azure Resource Manager and Azure PowerShell to deploy resources
44
author: tfitzmac
55
ms.service: azure-resource-manager
66
ms.topic: conceptual
7-
ms.date: 05/14/2019
7+
ms.date: 05/31/2019
88
ms.author: tomfitz
99

1010
---
@@ -30,6 +30,8 @@ To deploy to a **subscription**, use [New-AzDeployment](/powershell/module/az.re
3030
New-AzDeployment -Location <location> -TemplateFile <path-to-template>
3131
```
3232

33+
Currently, management group deployments are only supported through the REST API. See [Deploy resources with Resource Manager templates and Resource Manager REST API](resource-group-template-deploy-rest.md).
34+
3335
The examples in this article use resource group deployments. For more information about subscription deployments, see [Create resource groups and resources at the subscription level](deploy-to-subscription.md).
3436

3537
## Prerequisites
@@ -94,7 +96,7 @@ To paste the code into the shell, right-click inside the shell and then select *
9496

9597
This feature is also known as *Rollback on error*. When a deployment fails, you can automatically redeploy an earlier, successful deployment from your deployment history. To specify redeployment, use either the `-RollbackToLastDeployment` or `-RollBackDeploymentName` parameter in the deployment command. This functionality is useful if you've got a known good state for your infrastructure deployment and want to revert to this state. There are a number of caveats and restrictions:
9698

97-
- The redeployment is run exactly as it was run previously with the same parameters. You cannot change the parameters.
99+
- The redeployment is run exactly as it was run previously with the same parameters. You can't change the parameters.
98100
- The previous deployment is run using the [complete mode](./deployment-modes.md#complete-mode). Any resources not included in the previous deployment are deleted, and any resource configurations are set to their previous state. Make sure you fully understand the [deployment modes](./deployment-modes.md).
99101
- The redeployment only affects the resources, any data changes aren't affected.
100102
- This feature is only supported on Resource Group deployments, not subscription level deployments. For more information about subscription level deployment, see [Create resource groups and resources at the subscription level](./deploy-to-subscription.md).

0 commit comments

Comments
 (0)