This is another blog post in the series of how to #MakeStuffGo in Azure.
I am working on a client project that requires containerised applications – so we will be using Azure Container Registry.
I am using bash scripts to create the resources in Azure – so am using variables for all the things.
How to #MakeStuffGo with Azure Container Registry
Initially I had a Resource Group called AKS-RG as the client wanted their resource groups to have the function of what would be in there (in this case Azure Kubernetes Services) and -RG so that it was obvious it was a resource group.
So initially the script for the Azure Container Registry was:
az acr create --resource-group $RESOURCE_GROUP --location $REGION_NAME --name $ACR_NAME --sku Standard
Where I had the variables $RESOURCE_GROUP, $REGION_NAME and $ACR_NAME already defined further up in the script.
The only problem was – we had defined
validation error: Parameter 'registry_name' must conform to the following pattern: '^[a-zA-Z0-9]*$'.
The fix was pretty simple – we just changed ACR_NAME variable to be:
Which to be honest was a better standard – as we already had the clientname defined as a variable.
It is also the same in the UI (sometimes it is good to try this out as sometimes there are inconsistencies in Azure……)
So there you go – in some places you can use dashes in Azure and in some places you cannot. But that’s why we have prototypes – to find out all this fun stuff that keeps us on our toes..