Azure / bicep-types-az

Bicep type definitions for ARM resources
MIT License
87 stars 28 forks source link

Cannot set labels for Azure App Configuration using Bicep #1642

Open pirahawk opened 1 year ago

pirahawk commented 1 year ago

I have noticed that when creating Azure App Configuration Key-Values via Bicep, I cannot set a label for a configuration Key-Value pair declaratively via Bicep using the Microsoft.AppConfiguration/configurationStores/keyValues@2023-03-01 resource type.

For example consider the following Bicep template:

resource mysampleKv 'Microsoft.AppConfiguration/configurationStores/keyValues@2023-03-01' = {
  name: 'BackgroundColor'
  parent: myAppConfiguration
  properties: {
    contentType: 'application/vnd.microsoft.appconfig.ff+json;charset=utf-8'
    value: '#FF0000'
    label: 'Development'
  }
}

When this is run, I notice that the KV pair is created in Azure App Configuration instance, but the label is omitted.

As a contrast, running the equivalent Azure CLI command to do the same works fine:

> az appconfig kv set -n myAppConfiguration --content-type "application/vnd.microsoft.appconfig.ff+json;charset=utf-8" --key "BackgroundColor" --value "#FF0000" --label Development --yes

May I please request that it would be awesome if there was Bicep support for being able to set labels, as being able to decorate KV pairs with labels for designated environments is a primary capability of Azure App Configuration.

alex-frankel commented 1 year ago

This is not a bicep issue. I would open a support case with the App Config team as to why the property is being ignored.

pirahawk commented 1 year ago

This is not a bicep issue. I would open a support case with the App Config team as to why the property is being ignored.

@alex-frankel Fair enough. From what I can see in the bicep documentation, I don't think the ability exists to be able to define the Label via the Bicep definition.

If the App config teams are responsible for maintaining this, happy to raise it on their board?

brwilkinson commented 1 year ago

More discussion on this over here:

brwilkinson commented 1 year ago

I added some DeploymentScripts to perform this task as a workaround for keys and feature flags.

https://github.com/Azure/bicep/discussions/9352#discussioncomment-6191816

pirahawk commented 1 year ago

Thanks @brwilkinson I will close this issue since it has been reported already and some workaround available.

brwilkinson commented 1 year ago

@pirahawk it's moved to this types repo now. So it's fine to leave it open.

I am not clear why label is set to read only in ARM. All other properties are settable.

Plus it's settable via rest api commands.

microsoft-github-policy-service[bot] commented 1 year ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @antcp, @AzureAppServiceCLI. Please see https://aka.ms/biceptypesinfo for troubleshooting help.