Azure Container Instances won't deploy or start due to host name invalid.

William Kruse 5 Reputation points
2026-08-19T19:54:00.6666667+00:00

Hello!
I have been running a bunch of container instances for months now on a pretty basic setup.
Now all of a sudden the containers wont start and I can't deploy new ones. The error i am getting is like this:

"Failed to start the container group '<containerName>'. Error: The server '<server>.azurecr.io' in the 'imageRegistryCredentials' of container group '<container name>' is invalid. It should be a valid host name without protocol."

My server hostname has not changed. Same container, same registry. The hostname is: companynamecontainerregistry-fthyjju6ymqerta1.azurecr.io

*
*I have alwayd used the Azure Portal GUI to deploy, and have never configures the servername or host myself. It is done through a dropdown choosing between both my Azure Container Registries and the images they have.

I have a VNET setup, but have been running the Container Registry on BASIC tier ( no private endpoint ). But It has worked flawless for months and now suddenly not.

Any idea why this might have happened?

I have tries creating new Registries and new Container Instanceses pointing to thoose images but with the same error.

Thank you.

Azure Container Instances

2 answers

Sort by: Most helpful
  1. SUNOJ KUMAR YELURU 18,736 Reputation points MVP Volunteer Moderator
    2026-08-23T09:31:55+00:00

    Hello @William Kruse

    Your registry name is too long: companynamecontainerregistry-fthyjju6ymqerta1 = 45 chars. ACI now validates the first label (before .azurecr.io) against DNS spec - and combined with internal suffixes it exceeds 63 chars / fails regex.

    It's a known bug - Portal dropdown still shows it, but API rejects it.

    Fix: Create a new ACR with short name < 25 chars, e.g. companynameacr1.azurecr.io, push your images there, deploy ACI to that.

    Workaround: Deploy via ARM/Bicep and use imageRegistryCredentials without protocol - Portal GUI is adding https://


    If this answers your query, do click Accept Answer and Up-Vote for the same. And, if you have any further query do let us know.

    Was this answer helpful?


  2. Allan Solomon Mejia 7,590 Reputation points
    2026-08-19T21:28:46.17+00:00

    Hello @William Kruse

    The error is interesting because the hostname you've shown appears syntactically valid. For ACI, imageRegistryCredentials.server must contain only the registry login server hostname, without https://, a port, repository path, or image tag. Microsoft documents this explicitly.

    For example:

    server: companynamecontainerregistry-fthyjju6ymqerta1.azurecr.io

    image: companynamecontainerregistry-fthyjju6ymqerta1.azurecr.io/repository/image:tag

    The -fthyjju6ymqerta1 portion is also not necessarily an error. Azure Container Registry can now use Domain Name Label (DNL) protection, where the login server includes a DNS hash such as myregistry-abc123.azurecr.io.

    I would first verify what Azure considers the actual login server:

    az acr show \
      --name <registry-name> \
      --query loginServer \
      --output tsv
    

    Then inspect what ACI actually stored:

    az container show \
      --resource-group <resource-group> \
      --name <container-group> \
      --query properties.imageRegistryCredentials
    

    The server value should exactly match the ACR loginServer value.

    Since you're selecting the registry through the Azure Portal and you've reproduced this even with newly created registries/container instances, I'd also try one deployment using CLI rather than the portal:

    az container create \
      --resource-group <resource-group> \
      --name aci-test \
      --image <login-server>/<repository>:<tag> \
      --registry-login-server <login-server> \
      --registry-username <username> \
      --registry-password <password>
    

    Microsoft documents this syntax for ACI pulling from ACR.

    If the CLI deployment succeeds while the Portal-generated deployment fails with InvalidImageRegistryServer, that strongly points to a Portal-generated configuration issue rather than your VNet or ACR Basic tier.

    Also, this error occurs while ACI validates the registry server value. A registry network-access problem would more typically surface later as an image accessibility/pull/connectivity failure, so I wouldn't start changing your VNet configuration yet.

    If CLI fails as well, please share the output of:

    az acr show -n <registry-name> --query loginServer -o tsv
    

    and the imageRegistryCredentials section from:

    az container show -g <resource-group> -n <container-group>
    

    with credentials removed. That should show whether ACI is receiving a malformed hostname or whether this needs investigation as a service-side regression.

    Sharing this reference with you:

    Microsoft: Deploy an ACR image to Azure Container Instances

    https://learn.microsoft.com/en-us/azure/container-instances/container-instances-using-azure-container-registry

    Please "Accept the Answer" if this information helped you. This will help us and others in the community.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.