I’m trying to automate deployment of my Azure integration project using bicep. The projects includes a Logic App, which connects to an on-prem sql database unsing an on-premise data gateway. This requires creating an Api Connection for the Logic App. However, exact parameters for the API connection are not documented at all and cannot be exported from the UI. I found similar thread for Arm, not bicep, and gave the following code a try:
resource apiConnection 'Microsoft.Web/connections@2018-07-01-preview' = {
name: apiConnectionName
location: 'westeurope'
kind: 'v2'
properties: {
alternativeParameterValues: {}
api: {
id: subscriptionResourceId('Microsoft.Web/locations/managedApis', location, 'sql')
type: 'Microsoft.Web/locations/managedApis'
}
displayName: apiConnectionName
parameterValues: {
Server: 'sqlservername'
Database: 'dbname'
AuthType: 'WindowsAuthentication'
username: 'user-id'
password: 'user password'
gateway: {
id: '/subscriptions/<subid>/resourceGroups/<rg-name>/providers/Microsoft.Web/connectionGateways/<gateway-name>'
}
}
customParameterValues: {}
}}
When I run the code above, I’m getting the following error:
The connection gateway installation
‘/subscriptions/SUB_ID/providers/Microsoft.Web/locations/northeurope/connectionGatewayInstallations/SOME_GUID’
cannot be referenced as it is already linked with the connection
gateway
‘/subscriptions/SUB_ID/resourceGroups/RG_NAME/providers/Microsoft.Web/connectionGateways/GATEWAY_NAME’.
Connection gateway installation can only be linked with a single
connection gateway at a time. (Code:
ConnectionGatewayInstallationUnavailable)
The error makes little sense, as I’m only trying to create a new API connection referencing existing data gateway.
Have anyone got that working with bicep? Maybe this is documented somewhere?