Azure / Azure/AppConfiguration

Allow querying for multiple labels from ARM Template using listKeyValue

Open
#412 14 comments 0 reactions 0 assignees View on GitHub
ARM enhancement
Dominant language
No language data
Stars
263
Forks
82
Avg merge
3d 15h
Merged PRs (30d)
6

Description

I have been exploring the integration of App Configuration with ARM templates. Ideally I would like to be able to query for the value of key with an array of labels, returning only the first matching value.

Example scenario:
An overly simple example might be the following.

```javascript
{
"$schema": "https://schema.management.azure.com/schemas/2019-08-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.9",
"parameters": {
"environment": {
"type": "String",
"defaultValue": "dev",
"metadata": {
"description": "This is the SDLC environment that is being deployed to."
}
}
},
"variables": {
"keyVaultName":"[concat(parameters('environment'),'-keyvault01')]",
"skuFamily": {
"key": "/keyvault/sku/family",
"label": ["[variables('keyVaultName')]","[parameters('environment')]", "default"]
},
"skuName": {
"key": "/keyvault/sku/name",
"label": ["[variables('keyVaultName')]","[parameters('environment')]", "default"]
},
"enableSoftDelete": {
"key": "/keyvault/enableSoftDelete",
"label": ["[variables('keyVaultName')]","[parameters('environment')]", "default"]
}
},
"resources": [
{
"type": "Microsoft.KeyVault/vaults",
"apiVersion": "2016-10-01",
"name": "[variables('keyVaultName')]",
"location": "northcentral",
"properties": {
"sku": {
"family": "[listKeyValue(resourceId('Microsoft.AppConfiguration/configurationStores', 'appConfig01'), '2019-10-01',variables('skuFamily')).value]",
"name": "[listKeyValue(resourceId('Microsoft.AppConfiguration/configurationStores', 'appConfig01'), '2019-10-01',variables('skuName')).value]"
},
"accessPolicies": [],
"tenantId": "53a61a04-8224-4d62-b270-a5823ebeb33c",
"enabledForDeployment": false,
"enabledForDiskEncryption": false,
"enabledForTemplateDeployment": false,
"enableSoftDelete": "[listKeyValue(resourceId('Microsoft.AppConfiguration/configurationStores', 'appConfig01'), '2019-10-01',variables('enableSoftDelete')).value]"
}
}
]
}

```

You can see that I am querying for some configuration Keys for Sku and enableSoftDelete. I am ordering my array of labels from most specific to least in this case. Enabling something like this would allow me to:
- Provide a default for everything (least specific).
- All keyvaults will be deployed as standard
- Allow for an overload based on environment (more specific).
- All keyvaults in production will be deployed as premium
- While also allowing me to handle an exception for a specific named instance (most specific).
- This specific production keyvault should be standard.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.