skip to Main Content

I’m trying to provision a workflow and an API connection for my Standard Logic app.

This is my logic app bicep script.

resource logicAppResource 'Microsoft.Web/sites@2023-01-01' = {
  name: logicAppName
  location: 'South India'
  kind: 'functionapp,workflowapp'
  identity: {
    type: 'SystemAssigned'
  }
  properties: {
    siteConfig: {
      appSettings: [
        {
          name: 'FUNCTIONS_EXTENSION_VERSION'
          value: '~4'
        }
        {
          name: 'FUNCTIONS_WORKER_RUNTIME'
          value: 'node'
        }
        {
          name: 'WEBSITE_NODE_DEFAULT_VERSION'
          value: '~18'
        }
        {
          name: 'AzureWebJobsStorage'
          value: storageConnectionString
        }
        {
          name: 'WEBSITE_CONTENTAZUREFILECONNECTIONSTRING'
          value: storageConnectionString
        }
        {
          name: 'WEBSITE_CONTENTSHARE'
          value: toLower(logicAppName)
        }
        {
          name: 'AzureFunctionsJobHost__extensionBundle__id'
          value: 'Microsoft.Azure.Functions.ExtensionBundle.Workflows'
        }
        {
          name: 'AzureFunctionsJobHost__extensionBundle__version'
          value: '[1.*, 2.0.0)'
        }
        {
          name: 'APP_KIND'
          value: 'workflowApp'
        }
      ]
    }
    enabled: true
    hostNameSslStates: [
      {
        name: '${logicAppName}.azurewebsites.net'
        sslState: 'Disabled'
        hostType: 'Standard'
      }
      {
        name: '${logicAppName}.scm.azurewebsites.net'
        sslState: 'Disabled'
        hostType: 'Repository'
      }
    ]
    serverFarmId: logicAppServicePaln.id
    reserved: false
    isXenon: false
    hyperV: false
    vnetRouteAllEnabled: true
    vnetImagePullEnabled: false
    vnetContentShareEnabled: false
    // siteConfig: {
    //   numberOfWorkers: 1
    //   acrUseManagedIdentityCreds: false
    //   alwaysOn: false
    //   http20Enabled: false
    //   functionAppScaleLimit: 0
    //   minimumElasticInstanceCount: 1
    // }
    scmSiteAlsoStopped: false
    clientAffinityEnabled: false
    clientCertEnabled: false
    clientCertMode: 'Required'
    hostNamesDisabled: false
    customDomainVerificationId: '0182BAC7C537A4874AED7705B0D4D788E2909F91FBE82947CB8133FDBDD204EA'
    containerSize: 1536
    dailyMemoryTimeQuota: 0
    httpsOnly: true
    redundancyMode: 'None'
    publicNetworkAccess: 'Enabled'
    storageAccountRequired: false
    virtualNetworkSubnetId: '${vnetResourceLogicApp.id}/subnets/${subnetResource.name}'
    keyVaultReferenceIdentity: 'SystemAssigned'
  }
}

But when I try to add workflow

resource logicApp 'Microsoft.Logic/workflows@2019-05-01' = {
  name: logicAppName
  location: resourceGroupLocation
  properties: {
    state: 'Enabled'
    definition: {
      '$schema': 'https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#'
      actions: {
        HTTP: {
          inputs: {
            method: 'GET'
            uri: 'https://ifconfig.me'
          }
          runAfter: {}
          runtimeConfiguration: {
            contentTransfer: {
              transferMode: 'Chunked'
            }
          }
          type: 'Http'
        }
      }
      contentVersion: '1.0.0.0'
      outputs: {}
      triggers: {
        When_a_HTTP_request_is_received: {
          kind: 'Http'
          type: 'Request'
        }
      }
    }
  }
}

It creates a new logic app with the consumption plan. without creating the workflow inside the standered logic app.

logic app code view

Then I tried to manually implement the workflow and tried to get the code but the kind: 'Stateful' propery wont fit in the bicep template.

Also with the API connections, but the API connections create inside the resource group, but couldnot add to the workflow.

connections inside workflow
API connection Bicep

resource sqlServerAPIConnection 'Microsoft.Web/connections@2016-06-01' = {
  name: sqlServerAPIConnectionName
  location: resourceGroupLocation
  properties: {
    api: {
      name: sqlServerAPIConnectionName
      type: 'Microsoft.Web/locations/managedApis'
      displayName: 'SQL SERVER'
      brandColor: '#f2f2f2'
      description: 'Connect to SQL Server'
      iconUri: 'https://connectoricons-prod.azureedge.net/releases/v1.0.1683/1.0.1683.3685/sql/icon.png'
      id: '/subscriptions/${subscription().subscriptionId}/providers/Microsoft.Web/locations/${resourceGroupLocation}/managedApis/sql'
    }
    parameterValues: {
      database: sqlServerAPIConnectionDbName
      server: sqlServerAPIConnectionServerName
      username: sqlServerAPIConnectionUsername
      password: sqlServerAPIConnectionPassword
      authType: 'sqlAuthentication'
    }

    displayName: 'SQL'
  }
}

Both API connections and Workflows wont get properly deployed in the Standered Logic APP.

I want to deploy the Standard Logic APP’s API connection and workflow.

I tried the consumption plan logic app, which perfectly works with this workflow and the API connections.

2

Answers


  1. Chosen as BEST ANSWER

  2. Deploy workflow in Standard Logic app using arm template is another story, being much more complicated. You can not just copy-paste consumption workflow code into standard. but using workflow.json, connections.json or etc. There are very few sample-code documents in github or offical docs. I just find one sample link in azure github . Just learn and follow the pattern.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search