# Is an imperative `az create` script safe to re-run? Let's find out.
$ export CLASS_RG=rg-hyf-students
$ az storage account create \
--name sthyfdemo014 --resource-group "$CLASS_RG" \
--location westeurope --sku Standard_LRS --query provisioningState -o tsv
Succeeded
# Now run the exact same command a second time.
$ az storage account create \
--name sthyfdemo014 --resource-group "$CLASS_RG" \
--location westeurope --sku Standard_LRS --query provisioningState -o tsv
WARNING: A storage account with the provided name sthyfdemo014 is found.
Will continue to update the existing account.
Succeeded
# No error. And it is not a no-op either: change --sku and it applies.
$ az storage account create ... --sku Standard_GRS --query sku.name -o tsv
Standard_GRS
# Could I have previewed that? Not for this command. But az does have a preview:
$ az deployment group what-if --help | head -2
az deployment group what-if : Execute a deployment What-If operation.
# Same CLI. A deployment carries a declared desired state, so Azure can
# diff it against reality. A one-off create has nothing to compare.