https://docs.microsoft.com/azure/templates/
az login
az group create \
--name <resource-group-name> \
--location <location>
https://docs.microsoft.com/cli/azure/storage/account#az-storage-account-create
az storage account create \
--name <unique-name> \
--resource-group <resource-group-name> \
--location <location> \
--sku Standard_LRS
https://docs.microsoft.com/azure/templates/microsoft.storage/storageaccounts
{
"location": "<location>",
"kind": "StorageV2",
"sku": {
"name": "Standard_LRS"
}
}
https://docs.microsoft.com/cli/azure/resource#az-resource-create
az resource create \
--name <unique-name> \
--resource-group <resource-group-name> \
--resource-type 'Microsoft.Storage/storageAccounts' \
--api-version '2021-08-01' \
--is-full-object \
--properties '@<filename>.json'
https://docs.microsoft.com/azure/azure-resource-manager/templates/syntax
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": []
}
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"name": "<unique-name>",
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2021-08-01",
"location": "<location>",
"kind": "StorageV2",
"sku": {
"name": "Standard_LRS"
}
}
]
}
az deployment group create
--resource-group <resource-group-name> \
--template-file <filename>.armdeploy.json
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"storageAccountName": {
"type": "string"
}
},
"variables": {
"defaultLocation": "[resourceGroup().location]"
},
"resources": [
{
"name": "[parameters('storageAccountName')]",
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2021-08-01",
"location": "[variables('defaultLocation')]",
"kind": "StorageV2",
"sku": {
"name": "Standard_LRS"
}
}
]
}
az deployment group create
--resource-group <resource-group-name> \
--template-file <filename>.armdeploy.json \
--name <deployment-name> \
--parameters storageAccountName=<unique-name>
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"storageAccountName": {
"value": "<unique-name>"
}
}
}
az deployment group create \
--resource-group <resource-group-name> \
--template-file <filename>.armdeploy.json \
--name <deployment-name> \
--parameters '@<filename>.parameters.armdeploy.json'
https://docs.microsoft.com/azure/azure-resource-manager/bicep/file https://docs.microsoft.com/azure/azure-resource-manager/bicep/resource-declaration
resource storageAccount 'Microsoft.Storage/storageAccounts@2021-08-01' = {
name: '<unique-name>'
location: '<location>'
kind: 'StorageV2'
sku: {
name: 'Standard_LRS'
}
}
az deployment group create \
--resource-group <resource-group-name> \
--template-file <filename>.bicep
https://docs.microsoft.com/azure/azure-resource-manager/bicep/parameters
param defaultLocation string = resourceGroup().location
resource storageAccount 'Microsoft.Storage/storageAccounts@2021-08-01' = {
name: '<unique-name>'
location: defaultLocation
kind: 'StorageV2'
sku: {
name:'Standard_LRS'
}
}
az deployment group create \
--resource-group <resource-group-name> \
--template-file <filename>.bicep \
--name <deployment-name>
https://docs.microsoft.com/azure/azure-resource-manager/bicep/variables
@minLength(3)
@maxLength(24)
param storageAccountName string
param defaultLocation string = resourceGroup().location
var sku = 'Standard_LRS'
var kind = 'StorageV2'
resource storageAccount 'Microsoft.Storage/storageAccounts@2021-08-01' = {
name: storageAccountName
location: defaultLocation
kind: kind
sku: {
name: sku
}
}
az deployment group create \
--resource-group <resource-group-name> \
--template-file <filename>.bicep \
--name <deployment-name> \
--parameters storageAccountName=<unique-name>
az deployment group create \
--resource-group <resource-group-name> \
--template-file <filename>.bicep \
--name <deployment-name> \
--parameters '@<filename>.parameters.armdeploy.json'
@minLength(3)
@maxLength(24)
param storageAccountName string = 'stor${uniqueString(resourceGroup().id)}'
param defaultLocation string = resourceGroup().location
var sku = 'Standard_LRS'
var kind = 'StorageV2'
resource storageAccount 'Microsoft.Storage/storageAccounts@2021-08-01' = {
name: storageAccountName
location: defaultLocation
kind: kind
sku: {
name: sku
}
}
az deployment group create \
--resource-group <resource-group-name> \
--template-file <filename>.bicep \
--name <deployment-name>
https://docs.microsoft.com/azure/azure-resource-manager/bicep/outputs
az storage account show \
--name <unique-name> \
--resource-group <resource-group-name>
@minLength(3)
@maxLength(24)
param storageAccountName string = 'stor${uniqueString(resourceGroup().id)}'
param defaultLocation string = resourceGroup().location
var sku = 'Standard_LRS'
var kind = 'StorageV2'
resource storageAccount 'Microsoft.Storage/storageAccounts@2021-08-01' = {
name: storageAccountName
location: defaultLocation
kind: kind
sku: {
name: sku
}
}
output storageBlobUri string = storageAccount.properties.primaryEndpoints.blob
az deployment group create \
--resource-group <resource-group-name> \
--template-file <filename>.bicep \
--name <deployment-name> \
--parameters storageAccountName=<unique-name> \
--parameters defaultLocation=<location>