azureazure-resource-managerazure-bicepazure-logic-app-standard

Configure Action Group to call Logic App workflow using Bicep


I am trying to configure an Azure Action Group to call a workflow in a standard Logic App using Bicep.

When I configure the Action Group in the portal, it appears like enter image description here

ie the value contains {logic app name} / {workflow name} and in the portal JSON, the resourceId is given as /subscriptions/{subscription id}/resourceGroups/{resourcegroup name}/providers/Microsoft.Web/sites/{logic app name}/workflows/{workflow}

I want to use this in the resourceId of a logicAppReceiver in the action group

logicAppReceivers: [
  {
    name: 'LogicAppReceiverAlerting'
    resourceId: resourceId // <- set this 
    callbackUrl: logicAppCallbackUrl
    useCommonAlertSchema: true
  }]

How do I construct the resource ID of the workflow in this format?

Using

resourceId('Microsoft.Logic/workflows', workflowName)

gives just the workflow ID /subscriptions/{subscription id}/resourceGroups/{resourcegroup name}/providers/Microsoft.Logic/workflows/{workflow name}

Using

resourceId('Microsoft.Web/sites', logicAppName)

gives just the logic app ID /subscriptions/{subscription id}/resourceGroups/{resourcegroup name}/providers/Microsoft.Web/sites/{logic app name}

Using

resourceId('Microsoft.Web/sites', logicAppName, workflowName)

is invalid.


Solution

  • Looking at the documentation, you need to specify the sub-resource type:

    resourceId('Microsoft.Web/sites/workflows', logicAppName, workflowName)