Azure / Azure/AppConfiguration
Allow querying for multiple labels from ARM Template using listKeyValue
- Vorherrschende Sprache
- Keine Sprachdaten
- Sterne
- 263
- Forks
- 82
- Ø Merge
- 3 T. 15 Std.
- Gemergte PRs (30 T.)
- 6
Beschreibung
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.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Das Issue nennt keine Repository-Dateien, Tests oder Einstiegspunkte für die Implementierung. Beginne damit, die ARM-template-Integration für listKeyValue und ihr aktuelles Verhalten mit einem einzelnen Label zu lokalisieren; done sollte als geordnete Labels definiert werden, die den ersten passenden Schlüsselwert zurückgeben, mit Testabdeckung für die hier beschriebenen Fallback- und Override-Beispiele.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- azure
- Bereich
- cloud, infrastructure
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 25/100