Keyvault created is not visible under subscription for Keyvault API connection

HanumanthappaKarthik-7245 21 Reputation points
2022-12-08T13:44:43.543+00:00

I created a API connection with ARM Template for Keyvault with managed identity . i didnt create Keyvault before hand but specified the vault name as mentioned in some document.

            "parameterValueType": "Alternative",  
            "alternativeParameterValues": {  
                "vaultName": "[parameters('Connection_vaultName')]"  
            },  

Resource got created. but i am unable to find the keyvault in my subscription as well as i am unable to create a keyvault with same name as it throws error as KeyVault name already exit.

How to resolve this issue.

This is the ARM Template i used for deployment.
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"connections_keyvault_name": {
"defaultValue": "keyvault",
"type": "String"
},
"env": {
"defaultValue": "dev",
"type": "string"
},
"Connection_vaultName": {
"type": "string",
"defaultValue": ""
}
},
"variables": {},
"resources": [
{
"type": "Microsoft.Web/connections",
"apiVersion": "2016-06-01",
"name": "[parameters('connections_keyvault_name')]",
"location": "[resourceGroup().location]",
"kind": "V1",
"properties": {
"displayName": "[parameters('connections_keyvault_name')]",
"statuses": [
{
"status": "Ready"
}
],
"customParameterValues": {},
"createdTime": "2022-11-03T04:53:20.6599559Z",
"changedTime": "2022-11-03T04:53:20.6599559Z",
"api": {
"name": "keyvault",
"displayName": "Azure Key Vault",
"description": "Azure Key Vault is a service to securely store and access secrets.",
"iconUri": "https://connectoricons-prod.azureedge.net/releases/v1.0.1597/1.0.1597.3005/keyvault/icon.png",
"brandColor": "#0079d6",
"id": "[concat(subscription().id,'/providers/Microsoft.Web/locations/',resourceGroup().location,'/managedApis/keyvault')]",
"type": "Microsoft.Web/locations/managedApis"
},
"parameterValueType": "Alternative",
"alternativeParameterValues": {
"vaultName": "[parameters('Connection_vaultName')]"
},
"testLinks": []
}
}
]
}

Azure Key Vault
Azure Key Vault
An Azure service that is used to manage and protect cryptographic keys and other secrets used by cloud apps and services.
1,124 questions
Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,854 questions
0 comments No comments
{count} votes

Accepted answer
  1. MayankBargali-MSFT 68,656 Reputation points
    2022-12-09T08:33:37.24+00:00

    @Anonymous Thanks for reaching out. As per your ARM template that you have shared you are creating the resource of type Microsoft.Web/connections and for this (connection resource type) you are defining the properties and inside the properties you are defining the api connection details as azure keyvalut resource in your below ARM template. The below ARM template will only create the API connection i.e. Microsoft.Web/connections resource on your azure subscription and not the keyvalut resource.

    To create the keyvalut vaults resource you need to create the resource of type Microsoft.KeyVault/vaults and you can refer to key Vault document for more details.
    Fore Microsoft.Web/connections please refer to this documentation.

    {  
        "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",  
        "contentVersion": "1.0.0.0",  
        "parameters": {  
            "connections_keyvault_name": {  
                "defaultValue": "keyvault",  
                "type": "String"  
            }  
        },  
        "variables": {},  
        "resources": [  
            {  
                "type": "Microsoft.Web/connections",  
                "apiVersion": "2016-06-01",  
                "name": "[parameters('connections_keyvault_name')]",  
                "location": "westus2",  
                "kind": "V1",  
                "properties": {  
                    "displayName": "kechaw@microsoft.com",  
                    "statuses": [  
                        {  
                            "status": "Error",  
                            "target": "token",  
                            "error": {}  
                        }  
                    ],  
                    "customParameterValues": {},  
                    "nonSecretParameterValues": {  
                        "vaultName": "chepra",  
                        "token:TenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47",  
                        "token:grantType": "code"  
                    },  
                    "createdTime": "2020-02-07T06:52:22.7297504Z",  
                    "changedTime": "2021-04-09T16:02:11.7387664Z",  
                    "api": {  
                        "name": "[parameters('connections_keyvault_name')]",  
                        "displayName": "Azure Key Vault",  
                        "description": "Azure Key Vault is a service to securely store and access secrets.",  
                        "iconUri": "[concat('https://connectoricons-prod.azureedge.net/releases/v1.0.1613/1.0.1613.3125/', parameters('connections_keyvault_name'), '/icon.png')]",  
                        "brandColor": "#0079d6",  
                        "id": "[concat('/subscriptions/b83c1ed3-c5b6-44fb-b5ba-2b83a074c23f/providers/Microsoft.Web/locations/westus2/managedApis/', parameters('connections_keyvault_name'))]",  
                        "type": "Microsoft.Web/locations/managedApis"  
                    },  
                    "testLinks": []  
                }  
            }  
        ]  
    }  
    

    When you mention "i am unable to create a keyvault with same name as it throws error as KeyVault name already exit" then can you please confirm how you were creating the key valut resource. Were you trying to deploy the same ARM template that you have shared? As the shared ARM template creates the web connection resource and not key vault resource. As there would be already another connection with the same name in your subscription.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful