An Azure service that provides customers with a serverless container experience.
The error is raised because Azure is validating the DNS name label, not the container group name, and the DNS label must follow stricter rules than the container group name. In PowerShell, the -IPAddressDnsNameLabel parameter on New-AzContainerGroup / New-AzContainerInstanceContainerGroupProfile is what sets this value.
Key points from the DNS name label rules for Azure Container Instances:
- Allowed characters: lowercase letters, numbers, and hyphens (
-). - First character: must be a letter.
- Last character: must be a letter or number (cannot be a hyphen).
- Length: 5–63 characters.
The error message shows that the DNS name label is alludio-platform-tenants-api-prod. Even though this string appears valid, the issue is typically one of the following in the script:
- A different value is actually being passed to
-IPAddressDnsNameLabelthan expected (for example, including a trailing hyphen, whitespace, or an empty/short value after variable expansion). - The DNS label is being set from a variable that contains uppercase characters or invalid characters once concatenated.
- The container group name and DNS name label are being confused; the portal may auto-generate a valid DNS label even if the group name is longer or slightly different, while the script explicitly sets an invalid DNS label.
To resolve:
- Explicitly set a valid DNS label in the script:
- Ensure the value is all lowercase, 5–63 characters, starts with a letter, and does not end with
-. - Example:
-IPAddressDnsNameLabel "alludio-platform-tenants-api-prod".
- Ensure the value is all lowercase, 5–63 characters, starts with a letter, and does not end with
- Log or output the exact value passed to
-IPAddressDnsNameLabelbefore callingNew-AzContainerGroupto verify there are no trailing spaces or unexpected characters. - Confirm that the container group name itself also follows its own naming rules (lowercase letters, numbers, hyphens; cannot start or end with a hyphen; no consecutive hyphens; length 1–63) because some tooling can conflate the two when building the request.
If the same values work in the portal, compare the portal-generated DNS label with what the script sends and align the script’s -IPAddressDnsNameLabel to that format.
References: