2
votes

I am using Azure Key Vault connector in the logic apps and for deploying the logic apps using ARM templates.

In the ARM templates I have added the Microsoft.Web/connections resource to include Key Vault API connection.

The API Connection gets successfully deployed, but when I open it on the portal to Authorize it I get an error :- "Failed to edit Api connection "keyvault"".

The resource template of the key vault looks like below :-

{
  "type": "Microsoft.Web/connections",
  "apiVersion": "2016-06-01",
  "name": "[parameters('connections_keyvault_name')]",
  "location": "[parameters('location')]",
  "properties": {
    "api": {
      "id": "[concat('/subscriptions/',subscription().subscriptionId,'/providers/Microsoft.Web/locations/', parameters('location'), '/managedApis/', parameters('connections_keyvault_name'))]"
    },
    "displayName": "",
    "customParameterValues": {}
  }
}

The status of the API connection after deployment always shows "Error". However, I am using office365 API connection as well which works fine after deployment i.e. when I authorize it, it allows me to save it.

Can anyone please help me with this issue? This is blocking us to move this logic app to production.

Thanks,

Archana Kolte

1

1 Answers

2
votes

You have to add the key vault name to connect to by setting the vaultName property under properties.paramaterValues.

Also, the end of the properties.api.id is the same for all Key Vault API Connections and should be /managedApis/keyvault.

Your ARM template would look something like this

{
  "type": "Microsoft.Web/connections",
  "apiVersion": "2016-06-01",
  "name": "[parameters('connections_keyvault_name')]",
  "location": "[parameters('location')]",
  "properties": {
    "api": {
      "id": "[concat('/subscriptions/',subscription().subscriptionId,'/providers/Microsoft.Web/locations/', parameters('location'), '/managedApis/keyvault')]"
    },
    "displayName": "",
    "parameterValues": {
      "vaultName": "<name-of-your-key-vault>"
    }
  }
}