Logic App Consumption deployment with API connection Error

Tran, Nguyen 40 Reputation points
2025-01-17T17:02:56.65+00:00

I'm setting up a Logic App deployment process for my team. The idea is to have a GHA workflow handle deployment from DEV to NP, from NP to P.

I'm trying to deploy the API connections (eg. SharePoint, KeyVault) alongside with the Logic App in one ARM template. However, I got this BadRequest error for both of the API connections:

{"code":"InvalidRequestContent","message":"The request content is not valid and could not be deserialized: 'Could not find member 'definition' on object of type 'ApiConnectionPropertiesDefinition'. Path 'properties.definition', line 1, position 1083.'."}

I'm confused, because looking at this link on deploying Microsoft.Web connections, its ARM resource definition does not have Path 'properties.definition'.

User's image

Deploy_TriggerADF-ESOASharePoint.yml


name: Deploy TriggerADF-ESOASharePoint



on: 
  workflow_dispatch: 
    inputs: 
      template-file: 
        description: 'Path to the ARM template file' 
        required: true 
        default: 'LogicApps/TriggerADF_ESOASharePoint_template.json' 
      parameters-file: 
        description: 'Path to the ARM parameters file' 
        required: true 
        default: 'LogicApps/TriggerADF_ESOASharePoint_parameters.json'
      pipeline-name:
        description: 'ADF pipeline name that the Logic App monitors'
        required: true
        default: LAXLunchBreaksAvTechV2


jobs:
  deploy-to-nonprod:
    runs-on: ubuntu-latest
    steps:
    
    - uses: actions/checkout@master

    - name: Update Parameters
      run: |
        jq '.resources[].properties.definition.parameters.subscriptionId.defaultValue = "033d20ae-901d-4797-b93b-5c6c0c02534b" |
            .resources[].properties.definition.parameters.resourceGroupName.defaultValue = "rglns-n-eaus-evy-ei-rg" |
            .resources[].properties.definition.parameters.factoryName.defaultValue = "EIJobsNP" |
            .resources[].properties.definition.parameters.pipelineName.defaultValue = "${{ github.event.inputs.pipeline-name }}" |
            .parameters.workflows_TriggerADF_ESOASharePoint_name.defaultValue = "TriggerADF-ESOASharePoint-NP" |
            .parameters.connections_sharepointonline_1_externalid.defaultValue = "/subscriptions/033d20ae-901d-4797-b93b-5c6c0c02534b/resourceGroups/rglns-n-eaus-evy-ei-rg/providers/Microsoft.Web/connections/sharepointonline-1" |
            .parameters.connections_keyvault_1_externalid.defaultValue = "/subscriptions/033d20ae-901d-4797-b93b-5c6c0c02534b/resourceGroups/rglns-n-eaus-evy-ei-rg/providers/Microsoft.Web/connections/keyvault-1" ' ${{ github.event.inputs.template-file }} > temp.json && mv temp.json ${{ github.event.inputs.template-file }}

    - name: Print Updated JSON
      run: |
        cat ${{ github.event.inputs.template-file }}

    - uses: azure/login@v2
      with:
        creds: ${{ secrets.NP_DEPLOY_CREDENTIALS }}


    - uses: azure/bicep-deploy@v1
      name: Deploy Logic App to NP
      with:
        type: deployment
        operation: create
        name: Deploy_TriggerADFSharePoint_LogicApps
        scope: resourceGroup
        resource-group-name: rglns-n-eaus-evy-ei-rg
        subscription-id: 033d20ae-901d-4797-b93b-5c6c0c02534b
        template-file: ${{ github.event.inputs.template-file }}
        parameters-file: ${{ github.event.inputs.parameters-file }}

TriggerADF_ESOASharePoint_template.json


{
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "workflows_TriggerADF_ESOASharePoint_name": {
            "defaultValue": "TriggerADF-ESOASharePoint-NP",
            "type": "String"
        },
        "connections_sharepointonline_1_externalid": {
            "defaultValue": "/subscriptions/033d20ae-901d-4797-b93b-5c6c0c02534b/resourceGroups/rgn-d-zeaus-evy-ei-rg/providers/Microsoft.Web/connections/sharepointonline-1",
            "type": "String"
        },
        "connections_keyvault_1_externalid": {
            "defaultValue": "/subscriptions/033d20ae-901d-4797-b93b-5c6c0c02534b/resourceGroups/rgn-d-zeaus-evy-ei-rg/providers/Microsoft.Web/connections/keyvault-1",
            "type": "String"
        },
        "connections_sharepointonline_1_name": {
            "defaultValue": "sharepointonline-1",
            "type": "String"
        },
        "connections_keyvault_1_name": {
            "defaultValue": "keyvault-1",
            "type": "String"
        }
    },
    "variables": {},
    "resources": [
        {
            "type": "Microsoft.Logic/workflows",
            "apiVersion": "2017-07-01",
            "name": "[parameters('workflows_TriggerADF_ESOASharePoint_name')]",
            "location": "eastus",
            "tags": {
                "aa-app-id": "7209590",
                "aa-app-shortname": "ENYInsight",
                "aa-criticality": "important",
                "aa-sdlc-environment": "nonprod"
            },
            "identity": {
                "type": "SystemAssigned"
            },
            "properties": {
                "state": "Enabled",
                "definition": {
                    "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
                    "contentVersion": "1.0.0.0",
                    "parameters": {
                        "subscriptionId": {
                            "defaultValue": "f3b9461c-06ce-43a9-bfdd-3ce08617d258",
                            "type": "String"
                        },
                        "resourceGroupName": {
                            "defaultValue": "etl-rg",
                            "type": "String"
                        },
                        "factoryName": {
                            "defaultValue": "EIJobs-Nguyen",
                            "type": "String"
                        },
                        "pipelineName": {
                            "defaultValue": "LAXLunchBreaksAvTechV2",
                            "type": "String"
                        },
                        "$connections": {
                            "defaultValue": {},
                            "type": "Object"
                        }
                    },
                    "triggers": {
                        "When_a_file_is_created_or_modified_(properties_only)": {
                            "recurrence": {
                                "frequency": "Minute",
                                "interval": 3,
                                "timeZone": "Central Standard Time"
                            },
                            "evaluatedRecurrence": {
                                "frequency": "Minute",
                                "interval": 3,
                                "timeZone": "Central Standard Time"
                            },
                            "splitOn": "@triggerBody()?['value']",
                            "type": "ApiConnection",
                            "inputs": {
                                "host": {
                                    "connection": {
                                        "name": "@parameters('$connections')['sharepointonline-1']['connectionId']"
                                    }
                                },
                                "method": "get",
                                "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://spteam.aa.com/sites/EnvoyStrategyandAnalytics'))}/tables/@{encodeURIComponent(encodeURIComponent('326f97ec-7906-4fab-8f16-48c333678391'))}/onupdatedfileitems",
                                "queries": {
                                    "folderPath": "/Shared Documents/ETL/AvTech/Employee Breaks Detail"
                                }
                            }
                        }
                    },
                    "actions": {
                        "Get_Access_Token": {
                            "runAfter": {
                                "Get_secret": [
                                    "Succeeded"
                                ]
                            },
                            "metadata": {
                                "operationMetadataId": "75b0c4a5-6b76-442e-9067-be2d05d390df"
                            },
                            "type": "Http",
                            "inputs": {
                                "uri": "https://login.microsoftonline.com/49793faf-eb3f-4d99-a0cf-aef7cce79dc1/oauth2/v2.0/token",
                                "method": "POST",
                                "headers": {
                                    "Content-Type": "application/x-www-form-urlencoded"
                                },
                                "body": "grant_type=client_credentials&client_id=cb26b88a-3da4-4832-b52e-5b39d00b6005&client_secret=@{body('Get_secret')?['value']}&scope=https%3A%2F%2Fmanagement.azure.com%2F.default\n"
                            },
                            "runtimeConfiguration": {
                                "contentTransfer": {
                                    "transferMode": "Chunked"
                                },
                                "secureData": {
                                    "properties": [
                                        "inputs",
                                        "outputs"
                                    ]
                                }
                            }
                        },
                        "Get_secret": {
                            "runAfter": {
                                "Initialize_ModifiedDate": [
                                    "Succeeded"
                                ]
                            },
                            "type": "ApiConnection",
                            "inputs": {
                                "host": {
                                    "connection": {
                                        "name": "@parameters('$connections')['keyvault-1']['connectionId']"
                                    }
                                },
                                "method": "get",
                                "path": "/secrets/@{encodeURIComponent('rglns-n-ENYInsight-2335-spPWD')}/value"
                            },
                            "runtimeConfiguration": {
                                "secureData": {
                                    "properties": [
                                        "outputs"
                                    ]
                                }
                            }
                        },
                        "Compose": {
                            "runAfter": {
                                "Get_Access_Token": [
                                    "Succeeded"
                                ]
                            },
                            "type": "Compose",
                            "inputs": "@{body('Get_Access_Token')['access_token']}\n"
                        },
                        "Trigger_Pipeline": {
                            "runAfter": {
                                "Compose": [
                                    "Succeeded"
                                ]
                            },
                            "type": "Http",
                            "inputs": {
                                "uri": "https://management.azure.com/subscriptions/@{parameters('subscriptionId')}/resourceGroups/@{parameters('resourceGroupName')}/providers/Microsoft.DataFactory/factories/@{parameters('factoryName')}/pipelines/@{parameters('pipelineName')}/createRun?api-version=2018-06-01",
                                "method": "POST",
                                "headers": {
                                    "Content-Type": "application/json",
                                    "Authorization": "@{concat('Bearer ', trim(outputs('Compose')))}"
                                },
                                "body": {
                                    "FileName": "@variables('filePath')",
                                    "ModifiedDate": "@variables('ModifiedDate')"
                                }
                            }
                        },
                        "Initialize_filePath": {
                            "runAfter": {},
                            "type": "InitializeVariable",
                            "inputs": {
                                "variables": [
                                    {
                                        "name": "filePath",
                                        "type": "string",
                                        "value": "@concat('https://spteam.aa.com/sites/EnvoyStrategyandAnalytics/',triggerBody()?['{FullPath}'])"
                                    }
                                ]
                            }
                        },
                        "Initialize_ModifiedDate": {
                            "runAfter": {
                                "Initialize_filePath": [
                                    "Succeeded"
                                ]
                            },
                            "type": "InitializeVariable",
                            "inputs": {
                                "variables": [
                                    {
                                        "name": "ModifiedDate",
                                        "type": "string",
                                        "value": "@triggerBody()?['Modified']"
                                    }
                                ]
                            }
                        }
                    },
                    "outputs": {}
                },
                "parameters": {
                    "$connections": {
                        "value": {
                            "sharepointonline-1": {
                                "id": "/subscriptions/033d20ae-901d-4797-b93b-5c6c0c02534b/providers/Microsoft.Web/locations/eastus/managedApis/sharepointonline",
                                "connectionId": "[parameters('connections_sharepointonline_1_externalid')]",
                                "connectionName": "sharepointonline-1"
                            },
                            "keyvault-1": {
                                "id": "/subscriptions/033d20ae-901d-4797-b93b-5c6c0c02534b/providers/Microsoft.Web/locations/eastus/managedApis/keyvault",
                                "connectionId": "[parameters('connections_keyvault_1_externalid')]",
                                "connectionName": "keyvault-1",
                                "connectionProperties": {
                                    "authentication": {
                                        "type": "ManagedServiceIdentity"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        {
            "type": "Microsoft.Web/connections",
            "apiVersion": "2016-06-01",
            "name": "[parameters('connections_sharepointonline_1_name')]",
            "location": "eastus",
            "tags": {
                "aa-app-shortname": "ENYInsight",
                "aa-criticality": "important",
                "aa-sdlc-environment": "nonprod"
            },
            "kind": "V1",
            "properties": {
                "displayName": "Z1056887@corpaa.aa.com",
                "statuses": [
                    {
                        "status": "Connected"
                    }
                ],
                "customParameterValues": {},
                "nonSecretParameterValues": {},
                "createdTime": "2025-01-16T17:28:19.6210638Z",
                "changedTime": "2025-01-17T14:50:41.1868167Z",
                "api": {
                    "name": "sharepointonline",
                    "displayName": "SharePoint",
                    "description": "SharePoint helps organizations share and collaborate with colleagues, partners, and customers. You can connect to SharePoint Online or to an on-premises SharePoint 2016 or 2019 farm using the On-Premises Data Gateway to manage documents and list items.",
                    "iconUri": "https://conn-afd-prod-endpoint-bmc9bqahasf3grgk.b01.azurefd.net/releases/v1.0.1723/1.0.1723.3986/sharepointonline/icon.png",
                    "brandColor": "#036C70",
                    "id": "/subscriptions/033d20ae-901d-4797-b93b-5c6c0c02534b/providers/Microsoft.Web/locations/eastus/managedApis/sharepointonline",
                    "type": "Microsoft.Web/locations/managedApis"
                },
                "testLinks": []
            }
        },
        {
            "type": "Microsoft.Web/connections",
            "apiVersion": "2016-06-01",
            "name": "[parameters('connections_keyvault_1_name')]",
            "location": "eastus",
            "tags": {
                "aa-app-shortname": "ENYInsight",
                "aa-criticality": "important",
                "aa-sdlc-environment": "nonprod"
            },
            "kind": "V1",
            "properties": {
                "displayName": "MI-n-kv-connection",
                "statuses": [
                    {
                        "status": "Ready"
                    }
                ],
                "customParameterValues": {},
                "createdTime": "2025-01-16T17:22:49.8169265Z",
                "changedTime": "2025-01-16T17:22:49.8169265Z",
                "api": {
                    "name": "keyvault",
                    "displayName": "Azure Key Vault",
                    "description": "Azure Key Vault is a service to securely store and access secrets.",
                    "iconUri": "https://conn-afd-prod-endpoint-bmc9bqahasf3grgk.b01.azurefd.net/releases/v1.0.1718/1.0.1718.3951/keyvault/icon.png",
                    "brandColor": "#0079d6",
                    "id": "/subscriptions/033d20ae-901d-4797-b93b-5c6c0c02534b/providers/Microsoft.Web/locations/eastus/managedApis/keyvault",
                    "type": "Microsoft.Web/locations/managedApis"
                },
                "testLinks": []
            }
        }
    ]
}

TriggerADF_ESOASharePoint_parameters.json

{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "workflows_TriggerADF_ESOASharePoint_name": {
            "value": null
        },
        "connections_sharepointonline_1_externalid": {
            "value": null
        },
        "connections_keyvault_1_externalid": {
            "value": null
        },
        "connections_sharepointonline_1_name": {
            "value": null
        },
        "connections_keyvault_1_name": {
            "value": null
        }
    }
}


Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,322 questions
{count} votes

Accepted answer
  1. LeelaRajeshSayana-MSFT 17,021 Reputation points
    2025-01-17T23:29:23.1+00:00

    Hi @Tran, Nguyen Thank you for posting this question here.

    You are looking at Web Connections. I believe Logic app connections are commonly tagged as API Connections and the ARM template formatting is a bit different from what you are referring to. Please refer to the file azuredeploy.json which provides a sample template creates a storage account, creates an API connection by dynamically retrieving the primary key of the Storage account. The API connection is then used in a Logic App as a trigger polling for blob changes.

    Please use the sample as a guide and try to add a reference to the connection parameters. Hope this helps!

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.