You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何编写ACS Email API连接的Bicep配置?遇参数错误求助

解决ACS API连接的Bicep配置问题

你遇到的错误是因为ACS Email连接器的Managed API并未定义connectionString这个连接参数,正确的参数应该是azureCommunicationServicesResourceId(以及可选的发件地址参数)。

以下是可以正常工作的Bicep配置:

// 定义所需参数
param location string = resourceGroup().location
param connectionName string = 'acsemail-connection'
// 传入你的Azure Communication Services资源ID
param acsResourceId string

resource acsEmailConnection 'Microsoft.Web/connections@2018-07-01-preview' = {
  name: connectionName
  location: location
  kind: 'V2'
  properties: {
    displayName: connectionName
    parameterValues: {
      // 指定ACS资源ID是核心参数
      azureCommunicationServicesResourceId: acsResourceId
      // 可选:如果需要固定发件地址,添加此参数
      // emailSenderAddress: 'your-verified-sender@your-domain.com'
    }
    api: {
      id: '/subscriptions/${subscription().subscriptionId}/providers/Microsoft.Web/locations/${location}/managedApis/acsemail'
    }
  }
}

关键说明:

  • ACS Email连接器的认证逻辑依赖于ACS资源的关联,而非直接传入连接字符串,所以必须使用azureCommunicationServicesResourceId参数指定你的ACS实例。
  • 若需要指定默认发件地址,可添加emailSenderAddress参数,值为你在ACS中已验证的发件域名地址。
  • 部署前确保你的ACS资源已配置好Email服务(包含验证过的域名/发件地址)。

内容的提问来源于stack exchange,提问作者MintyOwl

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.25 19:02:09