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/bicep/deployment-script-bicep.md
+18-3Lines changed: 18 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ services: azure-resource-manager
5
5
author: mumian
6
6
ms.service: azure-resource-manager
7
7
ms.topic: conceptual
8
-
ms.date: 12/28/2021
8
+
ms.date: 10/26/2022
9
9
ms.author: jgao
10
10
11
11
---
@@ -18,7 +18,7 @@ Learn how to use deployment scripts in Bicep. With [Microsoft.Resources/deployme
18
18
- perform data plane operations, for example, copy blobs or seed database
19
19
- look up and validate a license key
20
20
- create a self-signed certificate
21
-
- create an object in Azure AD
21
+
- create an object in Azure Active Directory (Azure AD)
22
22
- look up IP Address blocks from custom system
23
23
24
24
The benefits of deployment script:
@@ -38,7 +38,7 @@ The deployment script resource is only available in the regions where Azure Cont
38
38
39
39
### Training resources
40
40
41
-
If you would rather learn about the ARM template test toolkit through step-by-step guidance, see [Extend ARM templates by using deployment scripts](/training/modules/extend-resource-manager-template-deployment-scripts).
41
+
If you would rather learn about deployment scripts through step-by-step guidance, see [Extend ARM templates by using deployment scripts](/training/modules/extend-resource-manager-template-deployment-scripts).
42
42
43
43
## Configure the minimum permissions
44
44
@@ -174,6 +174,7 @@ Property value details:
174
174
-[Sample 1](https://raw.githubusercontent.com/Azure/azure-docs-bicep-samples/master/samples/deployment-script/deploymentscript-keyvault.bicep): create a key vault and use deployment script to assign a certificate to the key vault.
175
175
-[Sample 2](https://raw.githubusercontent.com/Azure/azure-docs-bicep-samples/master/samples/deployment-script/deploymentscript-keyvault-subscription.bicep): create a resource group at the subscription level, create a key vault in the resource group, and then use deployment script to assign a certificate to the key vault.
176
176
-[Sample 3](https://raw.githubusercontent.com/Azure/azure-docs-bicep-samples/master/samples/deployment-script/deploymentscript-keyvault-mi.bicep): create a user-assigned managed identity, assign the contributor role to the identity at the resource group level, create a key vault, and then use deployment script to assign a certificate to the key vault.
177
+
-[Sample 4](https://github.com/Azure/azure-quickstart-templates/tree/master/quickstarts/microsoft.resources/deployment-script-azcli-graph-azure-ad): manually create a user-assigned managed identity and assign it permission to use the Microsoft Graph API to create Azure AD applications; in the Bicep file, use a deployment script to create an Azure AD application and service principal, and output the object IDs and client ID.
177
178
178
179
## Use inline scripts
179
180
@@ -614,6 +615,20 @@ After the script is tested successfully, you can use it as a deployment script i
614
615
| DeploymentScriptContainerGroupInNonterminalState | When creating the Azure container instance (ACI), another deployment script is using the same ACI name in the same scope (same subscription, resource group name, and resource name). |
615
616
| DeploymentScriptContainerGroupNameInvalid | The Azure container instance name (ACI) specified doesn't meet the ACI requirements. See [Troubleshoot common issues in Azure Container Instances](../../container-instances/container-instances-troubleshooting.md#issues-during-container-group-deployment).|
616
617
618
+
## Use Microsoft Graph within a deployment script
619
+
620
+
A deployment script can use [Microsoft Graph](/graph/overview) to create and work with objects in Azure AD.
621
+
622
+
### Commands
623
+
624
+
When you use Azure CLI deployment scripts, you can use commands within the `az ad` command group to work with applications, service principals, groups, and users. You can also directly invoke Microsoft Graph APIs by using the `az rest` command.
625
+
626
+
When you use Azure PowerShell deployment scripts, you can use the `Invoke-RestMethod` cmdlet to directly invoke the Microsoft Graph APIs.
627
+
628
+
### Permissions
629
+
630
+
The identity that your deployment script uses needs to be authorized to work with the Microsoft Graph API, with the appropriate permissions for the operations it performs. You must authorize the identity outside of your Bicep file, such as by pre-creating a user-assigned managed identity and assigning it an app role for Microsoft Graph. For more information, [see this quickstart example](https://github.com/Azure/azure-quickstart-templates/tree/master/quickstarts/microsoft.resources/deployment-script-azcli-graph-azure-ad).
631
+
617
632
## Next steps
618
633
619
634
In this article, you learned how to use deployment scripts. To walk through a Learn module:
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/templates/deployment-script-template.md
+18-3Lines changed: 18 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ services: azure-resource-manager
5
5
author: mumian
6
6
ms.service: azure-resource-manager
7
7
ms.topic: conceptual
8
-
ms.date: 09/06/2022
8
+
ms.date: 10/26/2022
9
9
ms.author: jgao
10
10
ms.custom: devx-track-azurepowershell
11
11
@@ -18,7 +18,7 @@ Learn how to use deployment scripts in Azure Resource templates (ARM templates).
18
18
- Perform data plane operations, for example, copy blobs or seed database.
19
19
- Look up and validate a license key.
20
20
- Create a self-signed certificate.
21
-
- Create an object in Azure AD.
21
+
- Create an object in Azure Active Directory (Azure AD).
22
22
- Look up IP Address blocks from custom system.
23
23
24
24
The benefits of deployment script:
@@ -41,7 +41,7 @@ The deployment script resource is only available in the regions where Azure Cont
41
41
42
42
### Training resources
43
43
44
-
To learn more about the ARM template test toolkit, and for hands-on guidance, see [Extend ARM templates by using deployment scripts](/training/modules/extend-resource-manager-template-deployment-scripts).
44
+
If you would rather learn about deployment scripts through step-by-step guidance, see [Extend ARM templates by using deployment scripts](/training/modules/extend-resource-manager-template-deployment-scripts).
45
45
46
46
## Configure the minimum permissions
47
47
@@ -181,6 +181,7 @@ Property value details:
181
181
-[Sample 3](https://raw.githubusercontent.com/Azure/azure-docs-json-samples/master/deployment-script/deploymentscript-keyvault-mi.json): create a user-assigned managed identity, assign the contributor role to the identity at the resource group level, create a key vault, and then use deployment script to assign a certificate to the key vault.
182
182
-[Sample 4](https://raw.githubusercontent.com/Azure/azure-docs-json-samples/master/deployment-script/deploymentscript-keyvault-lock-sub.json): it is the same scenario as Sample 1 in this list. A new resource group is created to run the deployment script. This template is a subscription level template.
183
183
-[Sample 5](https://raw.githubusercontent.com/Azure/azure-docs-json-samples/master/deployment-script/deploymentscript-keyvault-lock-group.json): it is the same scenario as Sample 4. This template is a resource group level template.
184
+
-[Sample 6](https://github.com/Azure/azure-quickstart-templates/tree/master/quickstarts/microsoft.resources/deployment-script-azcli-graph-azure-ad): manually create a user-assigned managed identity and assign it permission to use the Microsoft Graph API to create Azure AD applications; in the Bicep file, use a deployment script to create an Azure AD application and service principal, and output the object IDs and client ID.
184
185
185
186
## Use inline scripts
186
187
@@ -622,6 +623,20 @@ After the script is tested successfully, you can use it as a deployment script i
622
623
| DeploymentScriptContainerGroupInNonterminalState | When creating the Azure container instance (ACI), another deployment script is using the same ACI name in the same scope (same subscription, resource group name, and resource name). |
623
624
| DeploymentScriptContainerGroupNameInvalid | The Azure container instance name (ACI) specified doesn't meet the ACI requirements. See [Troubleshoot common issues in Azure Container Instances](../../container-instances/container-instances-troubleshooting.md#issues-during-container-group-deployment).|
624
625
626
+
## Use Microsoft Graph within a deployment script
627
+
628
+
A deployment script can use [Microsoft Graph](/graph/overview) to create and work with objects in Azure AD.
629
+
630
+
### Commands
631
+
632
+
When you use Azure CLI deployment scripts, you can use commands within the `az ad` command group to work with applications, service principals, groups, and users. You can also directly invoke Microsoft Graph APIs by using the `az rest` command.
633
+
634
+
When you use Azure PowerShell deployment scripts, you can use the `Invoke-RestMethod` cmdlet to directly invoke the Microsoft Graph APIs.
635
+
636
+
### Permissions
637
+
638
+
The identity that your deployment script uses needs to be authorized to work with the Microsoft Graph API, with the appropriate permissions for the operations it performs. You must authorize the identity outside of your template deployment, such as by pre-creating a user-assigned managed identity and assigning it an app role for Microsoft Graph. For more information, [see this quickstart example](https://github.com/Azure/azure-quickstart-templates/tree/master/quickstarts/microsoft.resources/deployment-script-azcli-graph-azure-ad).
639
+
625
640
## Next steps
626
641
627
642
In this article, you learned how to use deployment scripts. To walk through a deployment script tutorial:
0 commit comments