Replacing a character in keys in an object #14991
Answered
by
anthony-c-martin
jonlarsdizparc
asked this question in
Q&A
-
Currently have a bit of trouble with the following scenario:
How do i do this? Do i create a new variable (array) where i loop each secret , replace the key, insert it into the array and then convert the array back to an object? Any help is appreciated. Thanks. |
Beta Was this translation helpful? Give feedback.
Answered by
anthony-c-martin
Sep 6, 2024
Replies: 1 comment 1 reply
-
I think you should be able to use the 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})')
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
jonlarsdizparc
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think you should be able to use the
toObject
function to achieve something like the below: