简体   繁体   中英

ARM Template: How to create connection to storage from different resource group?

I'm trying to write an ARM template to deploy a connection to the storage account for my Logic App. The problem is that my Logic App belongs to one resource group & the storage account in another.

When I run the deployment pipeline I get the following deployment error:

The Resource 'Microsoft.Storage/storageAccounts/ StorageAccountName ' under resource group ' Logic App Resource Group ' was not found.

I understand that the storage account does not belong to this resource group but how do I write the ARM template to look for the storage account from another group?

Here is my template for the connection:

 {
          "type": "Microsoft.Web/connections",
          "apiVersion": "2016-06-01",
          "name": "[parameters('storageConName')]",
          "location": "[parameters('logicAppLocation')]",
          "properties": {
            "displayName": "[parameters('storageConName')]",
            "parameterValues": {
              "accountName": "[parameters('storageAccountName')]",
              "accessKey": "[listKeys(variables('storageAccountId'),'2019-06-01').keys[0].value]"
            },
            "api": {
              "id": "[concat('/subscriptions/',parameters('resourceGroupId'),'/providers/Microsoft.Web/locations/northeurope/managedApis/azureblob')]"
            }
          }
        }

I've worked out what was wrong, the properties:api:id was using the logic App resource group id where it should be using the storage accounts resource group id .

I misunderstood that this was the resource group where I wanted the connection to be created.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM