1
votes

I want to deploy the logic app to the portal using the Azure cloud shell, I have modified the all the files , and able to deploy the logic apps successfully. But when I see the changes in the portal all the actions are showing but the blob storage part it is showing like invalid connection.

Please help us how to provide the connections and all related to the blob storage in the logic app template file.

Thanks in advance.

Regards, Manikanta P.

1
Can you share your ARM template , specifically the blob connection part?bit

1 Answers

1
votes

Let's assume i already have a container called azureBlobContainer under MyStorageAccount Using the below template you should be able to deploy a LogicApp with a blob connection created.

{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "LogicAppName": {
            "defaultValue": "Test",
            "type": "string"
        },
        "storageAccountName": {
            "defaultValue": "MyStorageAccount",
            "type": "string"
        }
    },
    "variables": {},
    "resources": [
        {
            "type": "Microsoft.Web/connections",
            "apiVersion": "2016-06-01",
            "name": "azureblobContainer",
            "location": "[resourceGroup().location]",
            "properties": {
                "displayName": "BlobConnection",
                "api": {
                    "id": "[concat(subscription().id, '/providers/Microsoft.Web/locations/', resourceGroup().location, '/managedApis/', 'azureblob')]"
                },
                "parameterValues": {
                    "accessKey": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName')), providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value]",
                    "accountName": "[parameters('storageAccountName')]"
                }
            }
        },
        {
            "type": "Microsoft.Logic/workflows",
            "apiVersion": "2017-07-01",
            "name": "[parameters('LogicAppName')]",
            "location": "[resourceGroup().location]",
            "dependsOn": [
                "[resourceId('Microsoft.Web/connections', 'azureblobContainer')]"
            ],
            "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": {
                        "$connections": {
                            "defaultValue": {},
                            "type": "Object"
                        }
                    },
                    "triggers": {
                        "request": {
                            "type": "Request",
                            "kind": "Http",
                            "inputs": {
                                "schema": {}
                            }
                        }
                    },
                    "actions": {
                        "Create_blob": {
                            "runAfter": {},
                            "type": "ApiConnection",
                            "inputs": {
                                "body": "@triggerBody()",
                                "host": {
                                    "connection": {
                                        "name": "@parameters('$connections')['azureblob']['connectionId']"
                                    }
                                },
                                "method": "post",
                                "path": "/datasets/default/files",
                                "queries": {
                                    "folderPath": "/azureblobContainer",
                                    "name": "Test",
                                    "queryParametersSingleEncoded": true
                                }
                            },
                            "runtimeConfiguration": {
                                "contentTransfer": {
                                    "transferMode": "Chunked"
                                }
                            }
                        },
                        "Response": {
                            "runAfter": {
                                "Create_blob": [
                                    "Succeeded"
                                ]
                            },
                            "type": "Response",
                            "inputs": {
                                "statusCode": 200
                            }
                        }
                    },
                    "outputs": {}
                },
                "parameters": {
                    "$connections": {
                        "value": {
                            "azureblob": {
                                "connectionId": "[resourceId('Microsoft.Web/connections', 'azureblobContainer')]",
                                "connectionName": "azureblobContainer",
                                "id": "[concat(subscription().id, '/providers/Microsoft.Web/locations/', resourceGroup().location, '/managedApis/', 'azureblob')]"
                            }
                        }
                    }
                }
            }
        }
    ]
}

enter image description here