Sergio
Sergio

Reputation: 147

Standard logic app workflow URL does not show after deploying with ARM template to different resource group

I have resource group A with a standard logic app and a few workflows. Few of the workflows have a HTTP trigger and in the overview section the URL field is filled in.

When I deploy all those workflows with the ARM template from Azure Devops to a different resource group (all the other details are also edited in the deployment), the URL field is not filled in anymore.

What is the best way to deploy those workflows under a different resource group with the URl field filled in?

As you can see is the Workflow URL empty. In the original resource group the field is not empty.

enter image description here

This is the task I am using to deploy the logic app.

- task: AzureResourceManagerTemplateDeployment@3
  displayName: "Create Standard Logic Application"
  inputs:
    deploymentScope: 'Resource Group'
    azureResourceManagerConnection: $(TestSubscription)
    subscriptionId: $(IDTestSubscription)
    action: 'Create Or Update Resource Group'
    resourceGroupName: $(ResourceGroup)
    templateLocation: 'Linked artifact'
    csmFile: '$(Pipeline.Workspace)/drop/armtemplates/logicapp_deployment.json'
    csmParametersFile: '$(Pipeline.Workspace)/drop/armtemplates/logicapp_parameters.json'
    deploymentMode: 'Incremental'
    overrideParameters: '-SubscriptionName $(TestSub) -VersionToDeploy $(VersionToDeploy) -LaName $(LaName) -LaStorageAccountName $(LaStorageAccountName)'
  continueOnError: true

This is the task I am using to deploy the workflows.

- task: AzureFunctionApp@1 
  displayName: Deploy Logic App Workflows
  inputs:
    azureSubscription: Testsubscription
    appType: functionapp 
    appName: $(LaAppName)
    package: '$(Pipeline.Workspace)/drop/workflow.zip'
    deploymentMethod: 'zipDeploy'
    ResourceGroupName: $(ResourceGroup)
  continueOnError: true

Upvotes: 0

Views: 817

Answers (1)

SiddheshDesai
SiddheshDesai

Reputation: 8253

When I deployed Azure Logic app workflow in standard logic app, Even the workflow was not visible. But the workflow triggers ran successfully. As an alternative I deployed the below ARM Template code for consumption based plan and the Workflow URL was visible after deployment:-

{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "resources": [
    {
      "type": "Microsoft.Logic/workflows",
      "apiVersion": "2019-05-01",
      "name": "[parameters('logicAppName')]",
      "location": "[parameters('location')]",
      "properties": {
        "definition": {
          "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
          "contentVersion": "1.0.0.0",
          "actions": {
            "HTTPRequest": {
              "type": "Http",
              "inputs": {
                "method": "GET",
                "uri": "https://reqres.in/api/users?page=2"
              },
              "runAfter": {}
            }
          },
          "triggers": {
            "manualTrigger": {
              "type": "Request",
              "kind": "Http",
              "inputs": {
                "method": "POST",
                "schema": {}
              }
            }
          }
        },
        "parameters": {},
        "state": "Enabled"
      }
    }
  ],
  "parameters": {
    "logicAppName": {
      "type": "string",
      "defaultValue": "http-trigger-logicapp",
      "metadata": {
        "description": "Name of the Logic App."
      }
    },
    "location": {
      "type": "string",
      "defaultValue": "[resourceGroup().location]",
      "metadata": {
        "description": "Location of the Logic App."
      }
    }
  }
}

Output:-

enter image description here

Try using the yaml code below to deploy the Workflow:-

trigger:
  branches:
    include:
      - main
      - development

pool:
  vmImage: 'ubuntu-latest'

steps:
- task: CopyFiles@2
  displayName: 'Copy files to artifact staging directory'
  inputs:
    SourceFolder: '$(System.DefaultWorkingDirectory)'
    Contents: |
      **/*.json
      !**/bin/**
      !**/obj/**
    TargetFolder: '$(Build.ArtifactStagingDirectory)/LogicApp'

- task: ArchiveFiles@2
  displayName: 'Archive files'
  inputs:
    rootFolderOrFile: '$(Build.ArtifactStagingDirectory)/LogicApp'
    includeRootFolder: false
    archiveType: 'zip'
    archiveFile: '$(Build.ArtifactStagingDirectory)/MyBuildArtifact.zip'
    replaceExistingArchive: true

- task: AzureFunctionApp@1
  displayName: 'Deploy logic app workflows'
  inputs:
    azureSubscription: 'xxx subscription (xxxxxxxxxcb2a7)'
    appType: 'functionApp'
    appName: 'valleyLA98'
    package: '$(Build.ArtifactStagingDirectory)/MyBuildArtifact.zip'
    deploymentMethod: 'zipDeploy'

Upvotes: 0

Related Questions