To install Azure bicep for use with Azure Powershell: winget install -e --id Microsoft.Bicep
A list of all templates available: https://docs.microsoft.com/en-us/azure/templates/
This repository provides a devcontainer with PowerShell, Azure CLI and Azure PowerShell. Login using one of the following commands.
For Azure CLI: az login --use-device-code
For Azure PowerShell: Connect-AzAccount -UseDeviceAuthentication
To preview the modifications the bicep will make to the resource group: New-AzResourceGroupDeployment -TemplateFile [BICEP_FILE] -TemplateParameterFile [PARAM_FILE] -ResourceGroupName [RESOURCE_GROUP] -WhatIf
To execute the bicep file on a resource group: New-AzResourceGroupDeployment -TemplateFile [BICEP_FILE] -TemplateParameterFile [PARAM_FILE] -ResourceGroupName [RESOURCE_GROUP] -Confirm
To remove everything except the resources from base.bicep
: New-AzResourceGroupDeployment -TemplateFile base.bicep -TemplateParameterFile [PARAM_FILE] -ResourceGroupName [RESOURCE_GROUP] -Mode Complete -WhatIf
A template file can be specified with configuration parameters.
Parameter | Default value | Description |
---|---|---|
homeIp | 127.0.0.1/32 | IP address to whitelist |
publicKey | Public key for SSH access |
Example base.params.json
file:
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"homeIp": {
"value": "127.0.0.1/32"
},
"publicKey": {
"value": ""
}
}
}
Parameter | Default value | Description |
---|---|---|
tenantId | Tenant Id |
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"tenantId": {
"value": ""
}
}
}