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
@@ -34,9 +31,9 @@ For the Blueprints specs, see [Azure Blueprints REST API](/rest/api/blueprints/)
34
31
### REST API and PowerShell
35
32
36
33
If you don't already have a tool for making REST API calls, consider using PowerShell for these
37
-
instructions. Following is a sample header for authenticating with Azure. Generate an
38
-
authentication header, sometimes called a **Bearer token**, and provide the REST API URI to connect
39
-
to with any parameters or a **Request Body**:
34
+
instructions. Following is a sample header for authenticating with Azure. Generate an authentication
35
+
header, sometimes called a **Bearer token**, and provide the REST API URI to connect to with any
36
+
parameters or a **Request Body**:
40
37
41
38
```azurepowershell-interactive
42
39
# Log in first with Connect-AzAccount if not using Cloud Shell
@@ -70,9 +67,11 @@ assignments for the subscription. Then we'll add a resource group, a Resource Ma
70
67
a role assignment on the resource group.
71
68
72
69
> [!NOTE]
73
-
> When using the REST API, the _blueprint_ object is created first. For each _artifact_ to be added that has parameters, the parameters need to be defined in advance on the initial _blueprint_.
70
+
> When using the REST API, the _blueprint_ object is created first. For each _artifact_ to be added
71
+
> that has parameters, the parameters need to be defined in advance on the initial _blueprint_.
74
72
75
-
In each REST API URI, there are variables that are used that you need to replace with your own values:
73
+
In each REST API URI, there are variables that are used that you need to replace with your own
74
+
values:
76
75
77
76
-`{YourMG}` - Replace with the ID of your management group
78
77
-`{subscriptionId}` - Replace with your subscription ID
@@ -82,8 +81,8 @@ In each REST API URI, there are variables that are used that you need to replace
82
81
> [create blueprint at subscription example](/rest/api/blueprints/blueprints/createorupdate#subscriptionblueprint).
83
82
84
83
1. Create the initial _blueprint_ object. The **Request Body** includes properties about the
85
-
blueprint, any resource groups to create, and all of the blueprint level parameters. The parameters
86
-
are set during assignment and used by the artifacts added in later steps.
84
+
blueprint, any resource groups to create, and all of the blueprint level parameters. The
85
+
parameters are set during assignment and used by the artifacts added in later steps.
87
86
88
87
- REST API URI
89
88
@@ -143,10 +142,10 @@ are set during assignment and used by the artifacts added in later steps.
143
142
```
144
143
145
144
1. Add role assignment at subscription. The **Request Body** defines the _kind_ of artifact, the
146
-
properties align to the role definition identifier, and the principal identities are passed as an
147
-
array of values. In the example below, the principal identities granted the specified role are
148
-
configured to a parameter that is set during blueprint assignment. This example uses the
149
-
_Contributor_ built-in role with a GUID of `b24988ac-6180-42a0-ab88-20f7382dd24c`.
145
+
properties align to the role definition identifier, and the principal identities are passed as an
146
+
array of values. In the example below, the principal identities granted the specified role are
147
+
configured to a parameter that is set during blueprint assignment. This example uses the
148
+
_Contributor_ built-in role with a GUID of `b24988ac-6180-42a0-ab88-20f7382dd24c`.
150
149
151
150
- REST API URI
152
151
@@ -167,10 +166,10 @@ _Contributor_ built-in role with a GUID of `b24988ac-6180-42a0-ab88-20f7382dd24c
167
166
```
168
167
169
168
1. Add policy assignment at subscription. The **Request Body** defines the _kind_ of artifact, the
170
-
properties that align to a policy or initiative definition, and configures the policy assignment to
171
-
use the defined blueprint parameters to configure during blueprint assignment. This example uses
172
-
the _Apply tag and its default value to resource groups_ built-in policy with a GUID of
173
-
`49c88fc8-6fd1-46fd-a676-f12d1d3a4c71`.
169
+
properties that align to a policy or initiative definition, and configures the policy assignment
170
+
to use the defined blueprint parameters to configure during blueprint assignment. This example
171
+
uses the _Apply tag and its default value to resource groups_ built-in policy with a GUID of
172
+
`49c88fc8-6fd1-46fd-a676-f12d1d3a4c71`.
174
173
175
174
- REST API URI
176
175
@@ -199,11 +198,11 @@ the _Apply tag and its default value to resource groups_ built-in policy with a
199
198
```
200
199
201
200
1. Add another policy assignment for Storage tag (reusing _storageAccountType_ parameter) at
202
-
subscription. This additional policy assignment artifact demonstrates that a parameter defined on
203
-
the blueprint is usable by more than one artifact. In the example, the **storageAccountType** is
204
-
used to set a tag on the resource group. This value provides information about the storage account
205
-
that is created in the next step. This example uses the _Apply tag and its default value to
206
-
resource groups_ built-in policy with a GUID of `49c88fc8-6fd1-46fd-a676-f12d1d3a4c71`.
201
+
subscription. This additional policy assignment artifact demonstrates that a parameter defined on
202
+
the blueprint is usable by more than one artifact. In the example, the **storageAccountType** is
203
+
used to set a tag on the resource group. This value provides information about the storage
204
+
account that is created in the next step. This example uses the _Apply tag and its default value
205
+
to resource groups_ built-in policy with a GUID of `49c88fc8-6fd1-46fd-a676-f12d1d3a4c71`.
207
206
208
207
- REST API URI
209
208
@@ -232,13 +231,13 @@ resource groups_ built-in policy with a GUID of `49c88fc8-6fd1-46fd-a676-f12d1d3
232
231
```
233
232
234
233
1. Add template under resource group. The **Request Body** for a Resource Manager template includes
235
-
the normal JSON component of the template and defines the target resource group with
236
-
**properties.resourceGroup**. The template also reuses the **storageAccountType**, **tagName**, and
237
-
**tagValue** blueprint parameters by passing each to the template. The blueprint parameters are
238
-
available to the template by defining **properties.parameters** and inside the template JSON that
239
-
key-value pair is used to inject the value. The blueprint and template parameter names could be the
240
-
same, but were made different to illustrate how each passes from the blueprint to the template
241
-
artifact.
234
+
the normal JSON component of the template and defines the target resource group with
235
+
**properties.resourceGroup**. The template also reuses the **storageAccountType**, **tagName**,
236
+
and **tagValue** blueprint parameters by passing each to the template. The blueprint parameters
237
+
are available to the template by defining **properties.parameters** and inside the template JSON
238
+
that key-value pair is used to inject the value. The blueprint and template parameter names could
239
+
be the same, but were made different to illustrate how each passes from the blueprint to the
240
+
template artifact.
242
241
243
242
- REST API URI
244
243
@@ -325,9 +324,9 @@ artifact.
325
324
```
326
325
327
326
1. Add role assignment under resource group. Similar to the previous role assignment entry, the
328
-
example below uses the definition identifier for the **Owner** role and provides it a different
329
-
parameter from the blueprint. This example uses the _Owner_ built-in role with a GUID of
330
-
`8e3af657-a8ff-443c-a75c-2fe8c4bcb635`.
327
+
example below uses the definition identifier for the **Owner** role and provides it a different
328
+
parameter from the blueprint. This example uses the _Owner_ built-in role with a GUID of
329
+
`8e3af657-a8ff-443c-a75c-2fe8c4bcb635`.
331
330
332
331
- REST API URI
333
332
@@ -372,21 +371,31 @@ Body** specifies the blueprint to assign, provides name and location to any reso
372
371
blueprint definition, and provides all parameters defined on the blueprint and used by one or more
373
372
attached artifacts.
374
373
375
-
In each REST API URI, there are variables that are used that you need to replace with your own values:
374
+
In each REST API URI, there are variables that are used that you need to replace with your own
375
+
values:
376
376
377
377
-`{tenantId}` - Replace with your tenant ID
378
378
-`{YourMG}` - Replace with the ID of your management group
379
379
-`{subscriptionId}` - Replace with your subscription ID
380
380
381
-
1. Provide the Azure Blueprint service principal the **Owner** role on the target subscription. The AppId is static (`f71766dc-90d9-4b7d-bd9d-4499c4331c3f`), but the service principal ID varies by tenant. Details can be requested for your tenant using the following REST API. It uses [Azure Active Directory Graph API](../../active-directory/develop/active-directory-graph-api.md) which has different authorization.
381
+
1. Provide the Azure Blueprint service principal the **Owner** role on the target subscription. The
382
+
AppId is static (`f71766dc-90d9-4b7d-bd9d-4499c4331c3f`), but the service principal ID varies by
383
+
tenant. Details can be requested for your tenant using the following REST API. It uses
384
+
[Azure Active Directory Graph API](../../active-directory/develop/active-directory-graph-api.md)
385
+
which has different authorization.
382
386
383
387
- REST API URI
384
388
385
389
```http
386
390
GET https://graph.windows.net/{tenantId}/servicePrincipals?api-version=1.6&$filter=appId eq 'f71766dc-90d9-4b7d-bd9d-4499c4331c3f'
387
391
```
388
392
389
-
1. Run the blueprint deployment by assigning it to a subscription. As the **contributors** and **owners** parameters require an array of objectIds of the principals to be granted the role assignment, use [Azure Active Directory Graph API](../../active-directory/develop/active-directory-graph-api.md) for gathering the objectIds for use in the **Request Body** for your own users, groups, or service principals.
393
+
1. Run the blueprint deployment by assigning it to a subscription. As the **contributors** and
394
+
**owners** parameters require an array of objectIds of the principals to be granted the role
395
+
assignment, use
396
+
[Azure Active Directory Graph API](../../active-directory/develop/active-directory-graph-api.md)
397
+
for gathering the objectIds for use in the **Request Body** for your own users, groups, or
398
+
service principals.
390
399
391
400
- REST API URI
392
401
@@ -439,7 +448,11 @@ In each REST API URI, there are variables that are used that you need to replace
439
448
440
449
- User-assigned managed identity
441
450
442
-
A blueprint assignment can also use a [user-assigned managed identity](../../active-directory/managed-identities-azure-resources/overview.md). In this case, the **identity** portion of the request body changes as follows. Replace `{yourRG}` and `{userIdentity}` with your resource group name and the name of your user-assigned managed identity, respectively.
0 commit comments