使用Bicep将Azure Communication Service与电子邮件服务和托管域一起部署时出错

pexxcrt2  于 2023-06-24  发布在  其他
关注(0)|答案(1)|浏览(100)

正如标题所述,我试图使用bicep来部署Azure通信服务,并将其链接到具有Azure管理域的电子邮件服务。我的脚本能够创建所有资源,但在尝试将通信服务链接到域时失败,并出现以下错误:
"The specified domain is unable to be linked."
真正有趣的是:域在通信服务中显示为正确链接。
我试过使用2023-04-01-preview API但失败了,因为它不允许我将位置设置为全局...
这是我完整的二头肌:

var communicationServiceName = 'cs-medienstudio-dev'
var emailServiceName = 'es-medienstudio-dev'

resource emailService 'Microsoft.Communication/emailServices@2023-03-31' = {
  name: emailServiceName
  location: 'global'
  properties: {
    dataLocation: 'Europe'
  }
}

resource emailServiceDomain 'Microsoft.Communication/emailServices/domains@2023-03-31' = {
  parent: emailService
  name: 'AzureManagedDomain'
  location: 'global'
  properties: {
    domainManagement: 'AzureManaged'
  }
}

resource senderUserName 'Microsoft.Communication/emailServices/domains/senderUsernames@2023-03-31' = {
  parent: emailServiceDomain
  name: 'donotreply'
  properties:{
    username: 'DoNotReply'
    displayName: 'DoNotReply'
  }
}

resource communcationService 'Microsoft.Communication/communicationServices@2023-03-31' = {
  name: communicationServiceName
  location: 'global'
  properties: {
    dataLocation: 'Germany'
    linkedDomains: [
      emailServiceDomain.id
    ]
  }
}
6ju8rftf

6ju8rftf1#

请尝试将/domains/AzureManagedDomain附加到linkedDomains中的emailServiceDomain.id。因此,用于创建通信服务的二头肌代码可能是这样的:

resource communcationService 'Microsoft.Communication/communicationServices@2023-03-31' = {
  name: communicationServiceName
  location: 'global'
  properties: {
    dataLocation: 'Germany'
    linkedDomains: [
      join([emailServiceDomain.id, '/domains/AzureManagedDomain'], '')
    ]
  }
}

相关问题