-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathaz-powershell-module.ps1
44 lines (39 loc) · 2.33 KB
/
az-powershell-module.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# For more information go to:
# https://www.nathannellans.com/post/deploying-bicep-files-part-3-az-powershell-module
# Install the Az Module from PowerShell Gallery
Install-Module -Name Az
# Deploy Bicep to a Resource Group
New-AzResourceGroupDeployment `
-ResourceGroupName <rgName> `
-Mode Incremental | Complete ` # Optional, choose one. Default: Incremental
-RollbackToLastDeployment | -RollbackToDeployment <name> ` # Optional, choose one
-Name <deploymentName> ` # Optional. Default: name of the Bicep file
-TemplateFile <main.bicep> `
-TemplateParameterFile <main.bicepparam> ` # Optional
-Key1 Value1 -Key2 Value2 ` # Optional parameter overrides
-WhatIf | -Confirm | -Confirm -ProceedIfNoChange # Optional, choose one
# Deploy Bicep to a Subscription
New-AzDeployment `
-Location <region> `
-Name <deploymentName> ` # Optional. Default: name of the Bicep file
-TemplateFile <main.bicep> `
-TemplateParameterFile <main.bicepparam> ` # Optional
-Key1 Value1 -Key2 Value2 ` # Optional parameter overrides
-WhatIf | -Confirm | -Confirm -ProceedIfNoChange # Optional, choose one
# Deploy Bicep to a Management Group
New-AzManagementGroupDeployment `
-Location <region> `
-ManagementGroupId <mgId> `
-Name <deploymentName> ` # Optional. Default: name of the Bicep file
-TemplateFile <main.bicep> `
-TemplateParameterFile <main.bicepparam> ` # Optional
-Key1 Value1 -Key2 Value2 ` # Optional parameter overrides
-WhatIf | -Confirm | -Confirm -ProceedIfNoChange # Optional, choose one
# Deploy Bicep to a Tenant
New-AzTenantDeployment `
-Location <region> `
-Name <deploymentName> ` # Optional. Default: name of the Bicep file
-TemplateFile <main.bicep> `
-TemplateParameterFile <main.bicepparam> ` # Optional
-Key1 Value1 -Key2 Value2 ` # Optional parameter overrides
-WhatIf | -Confirm | -Confirm -ProceedIfNoChange # Optional, choose one