Sunday, January 8, 2023

Setting up App Config values with Bicep

There are often times where we need to setup a master configuration instance for the config values that might be referenced within pipelines. In such situations we can setup the initial configs such as environment name initially. 

First of all we will initialise a set of key value names. 

param keyValueNames array = [

Text after $ sign reference to the label name of the config.

Next we can setup values as an array with same length.

var keyValueValues = [

Next we can do the setup of the App Configuration instance. 

resource configStore 'Microsoft.AppConfiguration/configurationStores@2022-05-01' = {
  name: configStoreName
  location: region
  sku: {
    name: 'standard'

Lastly we can iterate through the key value names and post values.

resource configStoreKeyValue
= [for (item, i) in keyValueNames: {
  parent: configStore
  name: item
  properties: {
    value: keyValueValues[i]
    contentType: contentType
    tags: tags

No comments:

Post a Comment