Connect-AzAccount
$sp = New-AzADServicePrincipal -DisplayName "terraform" -Role "Contributor" $sp.AppId $sp.PasswordCredentials.SecretText
$RESOURCE_GROUP_NAME='tfstate'
New-AzResourceGroup -Name $RESOURCE_GROUP_NAME -Location eastus
$storageAccount = New-AzStorageAccount -ResourceGroupName $RESOURCE_GROUP_NAME -Name $STORAGE_ACCOUNT_NAME -SkuName…
$storageAccount = New-AzStorageAccount -ResourceGroupName $RESOURCE_GROUP_NAME -Name $STORAGE_ACCOUNT_NAME -SkuName Standard_LRS -Location westeurope -AllowBlobPublicAccess $true# New-AzStorageContainer -Name $CONTAINER_NAME -Context $storageAccount.context -Permission blob
$ACCOUNT_KEY=(Get-AzStorageAccountKey -ResourceGroupName $RESOURCE_GROUP_NAME -Name $STORAGE_ACCOUNT_NAME)[0].value $env:ARM_ACCESS_KEY=$ACCOUNT_KEY $ACCOUNT_KEY
$env:ARM_CLIENT_ID="<service_principal_app_id>" $env:ARM_SUBSCRIPTION_ID="<azure_subscription_id>" $env:ARM_TENANT_ID="<azure_subscription_tenant_id>" $env:ARM_CLIENT_SECRET="<service_principal_password>"