1

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.

Manikanta P
  • 49
  • 1
  • 4

1 Answers1

1

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

HariHaran
  • 3,642
  • 2
  • 16
  • 33
  • I can see the blob storage container under my storage account as well, but when I deploy it in the logic app designer window it is showing like connector not found ( blob storage). – Manikanta P Jul 25 '19 at 10:08
  • @ManikantaP try again. Check your blob name as well as path – HariHaran Jul 26 '19 at 10:01