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/templates/deploy-to-management-group.md
+13-1Lines changed: 13 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,8 +58,20 @@ For management group deployments, there are some important considerations when u
58
58
59
59
* The [resourceGroup()](template-functions-resource.md#resourcegroup) function is **not** supported.
60
60
* The [subscription()](template-functions-resource.md#subscription) function is **not** supported.
61
-
* The [resourceId()](template-functions-resource.md#resourceid) function is supported. Use it to get the resource ID for resources that are used at management group level deployments. For example, get the resource ID for a policy definition with `resourceId('Microsoft.Authorization/policyDefinitions/', parameters('policyDefinition'))`. It returns the resource ID in the format `/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}`.
62
61
* The [reference()](template-functions-resource.md#reference) and [list()](template-functions-resource.md#list) functions are supported.
62
+
* The [resourceId()](template-functions-resource.md#resourceid) function is supported. Use it to get the resource ID for resources that are used at management group level deployments. Don't provide a value for the resource group parameter.
63
+
64
+
For example, to get the resource ID for a policy definition, use:
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/templates/deploy-to-subscription.md
+15-1Lines changed: 15 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,8 +81,22 @@ For each deployment name, the location is immutable. You can't create a deployme
81
81
For subscription-level deployments, there are some important considerations when using template functions:
82
82
83
83
* The [resourceGroup()](template-functions-resource.md#resourcegroup) function is **not** supported.
84
-
* The [resourceId()](template-functions-resource.md#resourceid) function is supported. Use it to get the resource ID for resources that are used at subscription level deployments. For example, get the resource ID for a policy definition with `resourceId('Microsoft.Authorization/roleDefinitions/', parameters('roleDefinition'))`. Or, use the [subscriptionResourceId()](template-functions-resource.md#subscriptionresourceid) function to get the resource ID for a subscription level resource.
85
84
* The [reference()](template-functions-resource.md#reference) and [list()](template-functions-resource.md#list) functions are supported.
85
+
* The [resourceId()](template-functions-resource.md#resourceid) function is supported. Use it to get the resource ID for resources that are used at subscription level deployments. Don't provide a value for the resource group parameter.
86
+
87
+
For example, to get the resource ID for a policy definition, use:
Or, use the [subscriptionResourceId()](template-functions-resource.md#subscriptionresourceid) function to get the resource ID for a subscription level resource.
Returns the unique identifier of a resource. You use this function when the resource name is ambiguous or not provisioned within the same template.
750
+
Returns the unique identifier of a resource. You use this function when the resource name is ambiguous or not provisioned within the same template. The format of the returned identifier varies based on whether the deployment happens at the scope of a resource group, subscription, management group, or tenant.
751
751
752
752
### Parameters
753
753
754
754
| Parameter | Required | Type | Description |
755
755
|:--- |:--- |:--- |:--- |
756
756
| subscriptionId |No |string (In GUID format) |Default value is the current subscription. Specify this value when you need to retrieve a resource in another subscription. |
757
-
| resourceGroupName |No |string |Default value is current resource group. Specify this value when you need to retrieve a resource in another resource group. |
757
+
| resourceGroupName |No |string |Default value is current resource group. Specify this value when you need to retrieve a resource in another resource group. Only provide this value when deploying at the scope of a resource group. |
758
758
| resourceType |Yes |string |Type of resource including resource provider namespace. |
759
759
| resourceName1 |Yes |string |Name of resource. |
760
760
| resourceName2 |No |string |Next resource name segment, if needed. |
@@ -763,7 +763,7 @@ Continue adding resource names as parameters when the resource type includes mor
763
763
764
764
### Return value
765
765
766
-
The resource ID is returned in the following format:
766
+
When the template is deployed at the scope of a resource group, the resource ID is returned in the following format:
When used in a [management group-level deployment](deploy-to-management-group.md) or tenant-level deployment, the resource ID is returned in the following format:
0 commit comments