Overall Azure bicep
is the best repalcement for AWS CDK
currently available (2023) and the recommended way to express infrastructure-as-code in the aure universe.
Bicep CLI
All command require azure CLI and PowerShell 7.x.x
Select subscription by name / set context
$context = Get-AzSubscription -SubscriptionName '<name of the subscription>' Set-AzContext $context
Set default
Set-AzDefault -ResourceGroupName <resource-group-name>
Run bicep deployment
New-AzResourceGroupDeployment -TemplateFile main.bicep
Read resource group
Get-AzResourceGroupDeployment -ResourceGroupName <resource-group-name> | Format-Table
List resource groups
Get-AzResourceGroup
Bicep functions
Random unique name uniqueString
param fooUniceName string = 'fooo${uniqueString('constant-seed-value')}'
Create resource group with bicep
targetScope = 'subscription' param location string = deployment().location resource rg 'Microsoft.Resources/resourceGroups@2022-09-01' = { name: 'myName' location: location }
az deployment create --location westeurope --template-file .\main.bicep