Skip to content

Commit 3451fe0

Browse files
committed
update the two quickstarts
1 parent 088df07 commit 3451fe0

File tree

5 files changed

+126
-88
lines changed

5 files changed

+126
-88
lines changed

articles/azure-resource-manager/bicep/deployment-stacks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.custom: devx-track-azurecli, devx-track-azurepowershell, devx-track-bicep
66
ms.date: 05/15/2024
77
---
88

9-
# Deployment stacks (Preview)
9+
# Deployment stacks
1010

1111
An Azure deployment stack is a type of Azure resource that enables the management of a group of Azure resources as an atomic unit. When a Bicep file or an ARM JSON template is submitted to a deployment stack, it defines the resources that are managed by the stack. If a resource that was previously included in the template is removed, it will either be detached or deleted based on the specified _actionOnUnmanage_ behavior of the deployment stack. Similar to other Azure resources, access to the deployment stack can be restricted using Azure role-based access control (Azure RBAC).
1212

5.48 KB
Loading

articles/azure-resource-manager/bicep/quickstart-create-deployment-stacks-template-specs.md

Lines changed: 82 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.custom: mode-api, devx-track-azurecli, devx-track-azurepowershell, devx-track
77
# Customer intent: As a developer I want to use Bicep to create a deployment stack from a template spec.
88
---
99

10-
# Quickstart: Create and deploy a deployment stack with Bicep from template specs (Preview)
10+
# Quickstart: Create and deploy a deployment stack with Bicep from template specs
1111

1212
This quickstart describes how to create a [deployment stack](deployment-stacks.md) from a template spec.
1313

@@ -26,7 +26,7 @@ param resourceGroupLocation string = resourceGroup().location
2626
param storageAccountName string = 'store${uniqueString(resourceGroup().id)}'
2727
param vnetName string = 'vnet${uniqueString(resourceGroup().id)}'
2828
29-
resource storageAccount 'Microsoft.Storage/storageAccounts@2022-09-01' = {
29+
resource storageAccount 'Microsoft.Storage/storageAccounts@2023-04-01' = {
3030
name: storageAccountName
3131
location: resourceGroupLocation
3232
kind: 'StorageV2'
@@ -35,7 +35,7 @@ resource storageAccount 'Microsoft.Storage/storageAccounts@2022-09-01' = {
3535
}
3636
}
3737
38-
resource virtualNetwork 'Microsoft.Network/virtualNetworks@2022-11-01' = {
38+
resource virtualNetwork 'Microsoft.Network/virtualNetworks@2023-11-01' = {
3939
name: vnetName
4040
location: resourceGroupLocation
4141
properties: {
@@ -113,7 +113,7 @@ az group create \
113113
--name 'demoRg' \
114114
--location 'centralus'
115115
116-
id=$(az ts show --name stackSpec --resource-group templateSpecRG --version "1.0" --query "id")
116+
id=$(az ts show --name 'stackSpec' --resource-group 'templateSpecRG' --version '1.0' --query 'id')
117117
118118
az stack group create \
119119
--name demoStack \
@@ -130,14 +130,14 @@ New-AzResourceGroup `
130130
-Name "demoRg" `
131131
-Location "eastus"
132132
133-
$id = (Get-AzTemplateSpec -ResourceGroupName templateSpecRG -Name stackSpec -Version "1.0").Versions.Id
133+
$id = (Get-AzTemplateSpec -ResourceGroupName "templateSpecRG" -Name "stackSpec" -Version "1.0").Versions.Id
134134
135135
New-AzResourceGroupDeploymentStack `
136-
-Name 'demoStack' `
137-
-ResourceGroupName 'demoRg' `
136+
-Name "demoStack" `
137+
-ResourceGroupName "demoRg" `
138138
-TemplateSpecId $id `
139139
-ActionOnUnmanage "detachAll" `
140-
-DenySettingsMode none
140+
-DenySettingsMode "none"
141141
```
142142

143143
---
@@ -171,14 +171,14 @@ The output shows two managed resources - one storage account and one virtual net
171171
"excludedPrincipals": null,
172172
"mode": "none"
173173
},
174-
"deploymentId": "/subscriptions/00000000-0000-0000-0000-000000000000/demoRg/providers/Microsoft.Resources/deployments/demoStack-2023-06-08-14-58-28-fd6bb",
174+
"deploymentId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/demoRg/providers/Microsoft.Resources/deployments/demoStack-240517162aqmf",
175175
"deploymentScope": null,
176176
"description": null,
177177
"detachedResources": [],
178-
"duration": "PT30.1685405S",
178+
"duration": "PT30.5642429S",
179179
"error": null,
180180
"failedResources": [],
181-
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/demoRg/providers/Microsoft.Resources/deploymentStacks/demoStack",
181+
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/demoRg/providers/Microsoft.Resources/deploymentStacks/demoStack",
182182
"location": null,
183183
"name": "demoStack",
184184
"outputs": null,
@@ -189,51 +189,62 @@ The output shows two managed resources - one storage account and one virtual net
189189
"resources": [
190190
{
191191
"denyStatus": "none",
192-
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/demoRg/providers/Microsoft.Network/virtualNetworks/vnetthmimleef5fwk",
192+
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/demoRg/providers/Microsoft.Network/virtualNetworks/vnetthmimleef5fwk",
193193
"resourceGroup": "demoRg",
194194
"status": "managed"
195195
},
196196
{
197197
"denyStatus": "none",
198-
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/demoRg/providers/Microsoft.Storage/storageAccounts/storethmimleef5fwk",
198+
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/demoRg/providers/Microsoft.Storage/storageAccounts/storethmimleef5fwk",
199199
"resourceGroup": "demoRg",
200200
"status": "managed"
201201
}
202202
],
203203
"systemData": {
204-
"createdAt": "2023-06-08T14:58:28.377564+00:00",
205-
"createdBy": "johndole@contoso.com",
204+
"createdAt": "2024-05-17T16:07:51.172012+00:00",
205+
"createdBy": "jgao@microsoft.com",
206206
"createdByType": "User",
207-
"lastModifiedAt": "2023-06-08T14:58:28.377564+00:00",
208-
"lastModifiedBy": "johndole@contoso.com",
207+
"lastModifiedAt": "2024-05-17T16:07:51.172012+00:00",
208+
"lastModifiedBy": "jgao@microsoft.com",
209209
"lastModifiedByType": "User"
210210
},
211-
"tags": null,
211+
"tags": {},
212212
"template": null,
213-
"templateLink": null,
213+
"templateLink": {
214+
"contentVersion": null,
215+
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/templateSpecRG/providers/Microsoft.Resources/templateSpecs/stackSpec/versions/1.0",
216+
"queryString": null,
217+
"relativePath": null,
218+
"resourceGroup": "templateSpecRG",
219+
"uri": null
220+
},
214221
"type": "Microsoft.Resources/deploymentStacks"
215222
}
216223
```
217224

218225
# [PowerShell](#tab/azure-powershell)
219226

220227
```azurepowershell
221-
Get-AzResourceGroupDeploymentStack -ResourceGroupName demoRg -Name demoStack
228+
Get-AzResourceGroupDeploymentStack `
229+
-ResourceGroupName "demoRg" `
230+
-Name "demoStack"
222231
```
223232

224233
The output shows two managed resources - one virtual network, and one storage account:
225234

226235
```output
227-
Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/demoRg/providers/Microsoft.Resources/deploymentStacks/demoStack
228-
Name : demoStack
229-
ProvisioningState : succeeded
230-
ResourcesCleanupAction : detach
231-
ResourceGroupsCleanupAction : detach
232-
DenySettingsMode : none
233-
CreationTime(UTC) : 6/5/2023 8:55:48 PM
234-
DeploymentId : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/demoRg/providers/Microsoft.Resources/deployments/demoStack-2023-06-05-20-55-48-38d09
235-
Resources : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/demoRg/providers/Microsoft.Network/virtualNetworks/vnetzu6pnx54hqubm
236-
/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/demoRg/providers/Microsoft.Storage/storageAccounts/storezu6pnx54hqubm
236+
Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/demoRg/providers/Microsoft.Resources/deploymentStacks/demoStack
237+
Name : demoStack
238+
ProvisioningState : succeeded
239+
resourcesCleanupAction : detach
240+
resourceGroupsCleanupAction : detach
241+
managementGroupsCleanupAction : detach
242+
CorrelationId : e91d07b8-90f0-48f4-b876-07fcadcc4c66
243+
DenySettingsMode : none
244+
CreationTime(UTC) : 5/17/2024 3:53:52 PM
245+
DeploymentId : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/demoRg/providers/Microsoft.Resources/deployments/demoStack-24051715frp6o
246+
Resources : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/demoRg/providers/Microsoft.Network/virtualNetworks/vnetthmimleef5fwk
247+
/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/demoRg/providers/Microsoft.Storage/storageAccounts/storethmimleef5fwk
237248
```
238249

239250
---
@@ -244,8 +255,8 @@ You can also verify the deployment by list the managed resources in the deployme
244255

245256
```azurecli
246257
az stack group show \
247-
--name 'demoStack'
248-
--resource-group 'demoRg'
258+
--name 'demoStack' \
259+
--resource-group 'demoRg' \
249260
--output 'json'
250261
```
251262

@@ -266,11 +277,11 @@ The output is similar to:
266277
"excludedPrincipals": null,
267278
"mode": "none"
268279
},
269-
"deploymentId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/demoRg/providers/Microsoft.Resources/deployments/demoStack-2023-06-05-20-55-48-38d09",
280+
"deploymentId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/demoRg/providers/Microsoft.Resources/deployments/demoStack-240517162aqmf",
270281
"deploymentScope": null,
271282
"description": null,
272283
"detachedResources": [],
273-
"duration": "PT29.006353S",
284+
"duration": "PT30.5642429S",
274285
"error": null,
275286
"failedResources": [],
276287
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/demoRg/providers/Microsoft.Resources/deploymentStacks/demoStack",
@@ -284,28 +295,35 @@ The output is similar to:
284295
"resources": [
285296
{
286297
"denyStatus": "none",
287-
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/demoRg/providers/Microsoft.Network/virtualNetworks/vnetzu6pnx54hqubm",
298+
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/demoRg/providers/Microsoft.Network/virtualNetworks/vnetthmimleef5fwk",
288299
"resourceGroup": "demoRg",
289300
"status": "managed"
290301
},
291302
{
292303
"denyStatus": "none",
293-
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/demoRg/providers/Microsoft.Storage/storageAccounts/storezu6pnx54hqubm",
304+
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/demoRg/providers/Microsoft.Storage/storageAccounts/storethmimleef5fwk",
294305
"resourceGroup": "demoRg",
295306
"status": "managed"
296307
}
297308
],
298309
"systemData": {
299-
"createdAt": "2023-06-05T20:55:48.006789+00:00",
300-
"createdBy": "johndole@contoso.com",
310+
"createdAt": "2024-05-17T16:07:51.172012+00:00",
311+
"createdBy": "jgao@microsoft.com",
301312
"createdByType": "User",
302-
"lastModifiedAt": "2023-06-05T20:55:48.006789+00:00",
303-
"lastModifiedBy": "johndole@contoso.com",
313+
"lastModifiedAt": "2024-05-17T16:07:51.172012+00:00",
314+
"lastModifiedBy": "jgao@microsoft.com",
304315
"lastModifiedByType": "User"
305316
},
306-
"tags": null,
317+
"tags": {},
307318
"template": null,
308-
"templateLink": null,
319+
"templateLink": {
320+
"contentVersion": null,
321+
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/templateSpecRG/providers/Microsoft.Resources/templateSpecs/stackSpec/versions/1.0",
322+
"queryString": null,
323+
"relativePath": null,
324+
"resourceGroup": "templateSpecRG",
325+
"uri": null
326+
},
309327
"type": "Microsoft.Resources/deploymentStacks"
310328
}
311329
```
@@ -321,8 +339,8 @@ The output is similar to:
321339
```output
322340
Status DenyStatus Id
323341
------ ---------- --
324-
managed none /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/demoRg/providers/Microsoft.Network/virtualNetworks/vnetzu6pnx54hqubm
325-
managed none /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/demoRg/providers/Microsoft.Storage/storageAccounts/storezu6pnx54hqubm
342+
managed none /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/demoRg/providers/Microsoft.Network/virtualNetworks/vnetthmimleef5fwk
343+
managed none /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/demoRg/providers/Microsoft.Storage/storageAccounts/storethmimleef5fwk
326344
```
327345

328346
---
@@ -355,8 +373,8 @@ For more information, see [Delete deployment stacks](./deployment-stacks.md#dele
355373

356374
```azurepowershell
357375
Remove-AzResourceGroupDeploymentStack `
358-
-Name demoStack `
359-
-ResourceGroupName demoRg `
376+
-Name "demoStack" `
377+
-ResourceGroupName "demoRg" `
360378
-ActionOnUnmanage "deleteAll"
361379
```
362380

@@ -383,20 +401,36 @@ For more information, see [Delete deployment stacks](./deployment-stacks.md#dele
383401

384402
The remove command only remove the managed resources and managed resource groups. You still need to delete the resource group.
385403

386-
# [CLI](#tab/CLI)
404+
# [CLI](#tab/azure-cli)
387405

388406
```azurecli
389407
az group delete --name 'demoRg'
390408
```
391409

392-
# [PowerShell](#tab/PowerShell)
410+
# [PowerShell](#tab/azure-powershell)
393411

394412
```azurepowershell
395413
Remove-AzResourceGroup -Name "demoRg"
396414
```
397415

398416
---
399417

418+
To delete the template spec and the resource group:
419+
420+
# [CLI](#tab/azure-cli)
421+
422+
```azurecli
423+
az group delete --name 'templateSpecRG'
424+
```
425+
426+
# [PowerShell](#tab/azure-powershell)
427+
428+
```azurepowershell
429+
Remove-AzResourceGroup -Name "templateSpecRG"
430+
```
431+
432+
---
433+
400434
## Next steps
401435

402436
> [!div class="nextstepaction"]

0 commit comments

Comments
 (0)