Azure communication/email service ARM deployment error with linkedDomains

wunderbar 20 Reputation points
2023-07-26T11:30:41.09+00:00

The error is:
"Requested linked domains are not valid (Code: InvalidLinkedDomains)"

It is definetely due to the following line

"linkedDomains": [
    "[resourceId('Microsoft.Communication/emailServices/domains',variables('acsename'),'AzureManagedDomain')]"
]

of the communicationServices resource. When deployed with linkedDomains as empty array - communication service is created successfully (but, of course, without linked domain).

ARM Template (taken from the answer in https://learn.microsoft.com/en-us/answers/questions/1189581/azure-communication-service-email-arm-deployment-e):

{
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "acsemailName": {
            "type": "string"
        },
        "tagsByResource": {
            "type": "object"
        },
        "dataLocation":{
            "type": "string"
        }
    },
    "functions": [],
    "variables": {
        "acsename": "[concat(parameters('acsemailName'),'-email')]"
        
    },
    "resources": [
        {
            "type": "Microsoft.Communication/emailServices",
            "apiVersion": "2022-07-01-preview",
            "location": "global",
            "name" :"[variables('acsename')]",
            "tags": "[parameters('tagsByResource')]",
            "properties":{
                "dataLocation" :"[parameters('dataLocation')]"
            }
        },
        {
            "type": "Microsoft.Communication/communicationServices",
            "apiVersion": "2022-07-01-preview",
            "location": "global",
            "name" : "[concat(parameters('acsemailName'),'-cs')]",
            "tags": "[parameters('tagsByResource')]",
            "dependsOn":[
                "[resourceId('Microsoft.Communication/emailServices/domains',variables('acsename'),'AzureManagedDomain')]"
            ],
            "properties": {
                "dataLocation":"[parameters('dataLocation')]",
                "linkedDomains": [
                    "[resourceId('Microsoft.Communication/emailServices/domains',variables('acsename'),'AzureManagedDomain')]"
                ]
            }
        },
        {
            "type": "Microsoft.Communication/emailServices/domains",
            "apiVersion": "2022-07-01-preview",
            "location": "global",
            "name": "[concat(variables('acsename'),'/AzureManagedDomain')]",
            "tags":"[parameters('tagsByResource')]",
            "properties":{
                "domainManagement": "AzureManaged",
                "userEngagementTracking": "Enabled",
                "validSenderUsernames":{"DoNotReply": "DoNotReply"}
            },
            "dependsOn": [
                "[resourceId('Microsoft.Communication/emailServices', variables('acsename'))]"
            ]
        }
    ],
    "outputs": {}
}
Azure Communication Services
Azure Communication Services
An Azure communication platform for deploying applications across devices and platforms.
1,245 questions
{count} votes

Accepted answer
  1. VenkateshDodda-MSFT 25,111 Reputation points Microsoft Employee Moderator
    2023-07-26T18:39:41.5066667+00:00

    @wunderbar Thanks for your patience on this. I have tried deploying the above shared template and it has failed with the same error.

    Upon checking the template further, we see that you are passing the data location parameter value as United States (containing Upper case), post passing the datalocation parameter value in lower case we are able to deploy the resources successfully.

    I have checked with Azure communication Engineering team and sharing the below.

    Our product team has identified a bug and they are actively working on it.

    As a workaround, please try the deployment by modifying the Data Location name to be in lowercase, such as "unitedstates" or "canada.", the fix will be rolled out in a few days. 

    Feel free to reach back to me if you have any further questions on this.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

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