Phil
Phil

Reputation: 1789

Azure CLI - removing a parentheses

I'm running the following command using azure cli

az functionapp config appsettings set --name $functionAppName --settings "[email protected](VaultName=$keyValutName;SecretName=encryptionKey)"

When I view the value it shows as

"@Microsoft.KeyVault(VaultName=MyVaultName;SecretName=encryptionKey"

It's removing the end parentheses which breaks the key vault connection.

I think the problem is the semicolon, I can't use --% to stop processing as I need to resolve the $keyValutName.

Also think this is more of a powershell issue than az cli.

Any suggestions?

Upvotes: 0

Views: 331

Answers (1)

Joy Wang
Joy Wang

Reputation: 42133

I can also reproduce your issue when I run the CLI command in Powershell, to solve the issue, just use the command below.

$functionAppName = "joyfun"
$keyValutName = "joykeyvault123"
$setting = "[email protected](VaultName=$keyValutName;SecretName=encryptionKey"+'")"'
az functionapp config appsettings set --resource-group xxxx --name $functionAppName --settings $setting

enter image description here

Upvotes: 1

Related Questions