Skip to content

Replacing a character in keys in an object #14991

Discussion options

You must be logged in to vote

I think you should be able to use the toObject function to achieve something like the below:

resource symbolicname 'Microsoft.Web/sites/config@2022-09-01' = {
  name: 'appsettings'
  parent: function_app
  properties: toObject(
    items(secrets),
    secret => replace(secret.key, '-', '_'),
    secret => '@Microsoft.KeyVault(VaultName=${key_vault_name};SecretName=${secret.key})')
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jonlarsdizparc
Comment options

Answer selected by jonlarsdizparc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants