Blob storage connection API failing in Logic App after ARM template deployment

Thomas Bailey 11 Reputation points
2022-11-11T09:56:14.127+00:00

I have a standard logic app which uses the Create Blob v2 task. This creates a blob in a data lake container using an azureblob API connector.

It works fine when created via VSCode into my development environment, but I am having issues when I am trying to deploy to a test environment. I am deploying the azureblob API connector using the below template:

{  
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",  
    "contentVersion": "1.0.0.0",  
    "parameters": {  
        "connections_azureblob_name": {  
            "defaultValue": "azureblob",  
            "type": "String"  
        },  
        "storage_account_name": {  
            "defaultValue": "datalake",  
            "type": "String"  
        },  
        "location": {  
            "defaultValue": "uksouth",  
            "type": "String"  
        }  
    },  
    "variables": {  
        "storageAccountId": "[resourceId('Microsoft.Storage/storageAccounts', parameters('storage_account_name'))]"  
    },  
    "resources": [  
        {  
            "type": "Microsoft.Web/connections",  
            "apiVersion": "2016-06-01",  
            "name": "[parameters('connections_azureblob_name')]",  
            "location": "[parameters('location')]",  
            "kind": "V2",  
            "properties": {  
                "displayName": "hub-data-lake",  
                "api": {  
                    "id": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Web/locations/uksouth/managedApis/', parameters('connections_azureblob_name'))]",  
                    "type": "Microsoft.Web/locations/managedApis"  
                },  
                "parameterValues": {  
                    "accountName": "[parameters('storage_account_name')]",  
                    "accessKey": "[listKeys(variables('storageAccountId'),'2022-05-01').keys[0].value]"  
                },  
                "testLinks": []  
            }  
        }  
    ],  
    "outputs": {  
        "azure-blob-connection-runtime-url": {  
            "type": "string",  
            "value": "[reference(concat('Microsoft.Web/connections/', parameters('connections_azureblob_name')), '2016-06-01', 'Full').properties.connectionRuntimeUrl]"  
          }   
    }  
}  

When I run the logic app workflow in the Test environment, I get a JWT token error:

Error from token exchange: Bad Key authorization token. Token must be a valid JWT signed with HS256\r\nInvalid JWT token. IDX12741: JWT: 'System.String' must have three segments (JWS) or five segments (JWE)

However, if I try to navigate the containers in the workflow designer, I am perfectly able to see and select containers:

259567-image.png

Thanks

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