Created
January 10, 2023 17:32
-
-
Save fredgdaley2/587b55fe341d9275b5ad176842514bf1 to your computer and use it in GitHub Desktop.
Azure Bicep notes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Run the following command to ensure you have the latest version of Bicep: | |
az bicep install && az bicep upgrade | |
Sign into Azure | |
az login | |
Set the default subscription for all of the Azure CLI commands that you run in this session. | |
az account set --subscription "Concierge Subscription" | |
Get the Concierge Subscription IDs. | |
az account list \ | |
--refresh \ | |
--query "[?contains(name, 'Concierge Subscription')].id" \ | |
--output table | |
Set the default subscription by using the subscription ID. Replace {your subscription ID} with the latest Concierge Subscription ID. | |
az account set --subscription {your subscription ID} | |
Deploy the template and parameter file to Azure by using the Azure CLI | |
az deployment group create \ | |
--template-file main.bicep \ | |
--parameters main.parameters.dev.json | |
adminlogin | |
Smooth@pass32 | |
keyVaultName='fgdKeyVault' # A unique name for the key vault. | |
login='adminlogin' # The login that you used in the previous step. | |
password='Smooth@pass32' # The password that you used in the previous step. | |
az keyvault create --name $keyVaultName --location westus --enabled-for-template-deployment true | |
az keyvault secret set --vault-name $keyVaultName --name "sqlServerAdministratorLogin" --value $login | |
az keyvault secret set --vault-name $keyVaultName --name "sqlServerAdministratorPassword" --value $password | |
keyVaultName='fgdKeyVault' | |
password='Smooth@pass32' | |
az keyvault secret set --vault-name $keyVaultName --name "sqlServerAdministratorPassword" --value $password | |
az keyvault show --name $keyVaultName --query id --output tsv | |
/subscriptions/a7aa57ee-6226-46e9-be74-c3d35b627219/resourceGroups/learn-0f79008b-c9bc-49c2-bd56-c54d3c1c4543/providers/Microsoft.KeyVault/vaults/fgdKeyVault | |
Azure resources: | |
All Azure resources are deployed with a specific type. | |
The type identifies the kind of resource it is. | |
A resource ID is the way Azure identifies a specific instance of a resource. | |
Resource providers: | |
A resource provider is a logical grouping of resource types, which usually relate to one or a smaller number of Azure services. | |
az storage account create \ | |
--name fdtoyrnd \ | |
--location eastus | |
az deployment group create \ | |
--template-file main.bicep \ | |
--parameters storageAccountName=fdtoyrnd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment