Search code examples
azureazure-bicepazure-communication-services

Bicep for acsemail API Connection


Has anyone managed to create the Bicep for an acs API connection? When it is created through the Logic App designer, you specify a connection string. However, I cannot work out the correct syntax for the Bicep file. If I specify this:

resource cn_communicationservices 'Microsoft.Web/connections@2018-07-01-preview' = {
  name: connectionType
  location: location
  kind: 'V2'
  properties: {
    displayName: connectionName
    parameterValues: {
      connectionString: connString
    }
    api: {
      name:         connectionType
      displayName:  connectionName
      description:  'Connector to send Email using the domains linked to the Azure Communication Services in your subscription'
      iconUri:      'https://connectoricons-prod.azureedge.net/releases/v1.0.1619/1.0.1619.3185/${connectionType}/icon.png'
      id:           '/subscriptions/${subId}/providers/Microsoft.Web/locations/${location}/managedApis/acsemail'
      type:         'Microsoft.Web/locations/managedApis'
    }
    testLinks: []
  }
}

I get this error:

Parameter 'connectionString' is not allowed on the connection since it was not defined as a connection parameter when the API was registered I have tried many other things but none have worked, has anyone done this successfully?


Solution

  • Please try with the below parameter to feed the ACS connection string,

         parameterValues: {
          api_key       : connString
        }
    

    I ran a local test and confirmed it works to create a API connection.