I'm trying to deploy a service bus api connection using bicep. This connection should auth using managed identity (in my case, Logic Apps). In my DEV environment the api connection was created from a Logic App, and I'm trying to deploy the same to other environment.
I have tried this:
connections module:
param connectionName string
param displayName string
param apiName string
param parameterValues object = {}
param parameterValueSet object = {}
resource connection 'Microsoft.Web/connections@2016-06-01' = {
name: connectionName
location: resourceGroup().location
kind: 'V2'
properties: {
api: {
id: 'subscriptions/${subscription().subscriptionId}/providers/Microsoft.Web/locations/${resourceGroup().location}/managedApis/${apiName}'
}
displayName: displayName
parameterValues: parameterValues
parameterValueSet: parameterValueSet
}
}
output connectionRuntimeUrl string = reference(connection.id, connection.apiVersion, 'full').properties.connectionRuntimeUrl
In main.bicep
module servicebusApiConnection 'Modules/connection.bicep' = {
name: serviceBusApiConnectionName
params: {
connectionName: serviceBusApiConnectionName
displayName: serviceBusApiConnectionName
apiName: 'servicebus'
parameterValueSet: {
name: 'managedIdentityAuth'
values: {
namespaceEndpoint: {
'value': 'sb://${serviceBusNamespace.name}.servicebus.windows.net'
}
}
}
}
}
But the connection says Status "Error" after deploy.
I can see in my service bus api connection in DEV has the option "Logic Apps Managed Identity" for Authentication Type.
the deployed one look like this. It does not say "This connection can only be used with a managed identity." like the one in DEV.