Deploy Logic App (Std) Workflow Disabled with Bicep/YAML

Deploy Logic App (Std) Workflow Disabled with Bicep/YAML

In my yaml I send a the workflows in a pipe separated string e.g. “wf-one|wf-two|wf-three|wf-four”

Then, in my bicep I populate an array of Workflow states app settings:

var wfAppSettingStatuses = [ for wf in split(workflows,’|’): { 
 name: ‘Workflows.${wf}.FlowState’ 
 value: ‘Disabled’ 
}]


To add to the Logic App container configuration settings use the union function:
resource logicContainer ‘Microsoft.Web/sites@2022-03-01’ = { 
 name: appName 
 location: location 
 kind: ‘functionapp,workflowapp’ 
 identity: { 
     type: ‘SystemAssigned’ 
 } 
 properties: { 
     httpsOnly: true 
     siteConfig: { 
         appSettings: union(wfAppSettingStatuses, [ 
         { 
             name: ‘APPINSIGHTS_INSTRUMENTATIONKEY’ 
             value: applicationInsights.properties.InstrumentationKey 
         } 
         … 
         ]) 
     use32BitWorkerProcess: true 
 } 
 serverFarmId: planId 
 clientAffinityEnabled: false 
 vnetRouteAllEnabled: true 
 storageAccountRequired: false 
 keyVaultReferenceIdentity: ‘SystemAssigned’ 
 } 
}
Each workflow in the list is now disabled, therefore if you require one to be enabled on deployment, remove it from the pipe delimited string.

Leave a Reply

Your email address will not be published. Required fields are marked *