Appconfiguration: AzureAppConfiguration@2 task: does not support TrimKeyPrefix

Created on 31 Jan 2020  路  7Comments  路  Source: Azure/AppConfiguration

I'm trying to use File transform task in Azure Pipelines. And I'm providing variables from Azure App Configurations. By using AzureAppConfiguration@2 task to fetch config values dynamically.
According to Azure App Configurations it is recommended/possible to use application, region, etc discriminator key prefixes like:

And in .NET Core these can be removed by using .TrimKeyPrefix(); However in AzureDevops AzureAppConfiguration@2 Task does not have this feature. So this task loads all Keys with full name and when I try to use variables in a File transform task that will fail. Since variables does not match to JSON path.

Is it possible to add a new property which would remove the give prefix form all loaded key? Like this trimKeyPrefix: "WebSite:"

- task: AzureAppConfiguration@2
      displayName: 'Get Azure App Configurations'
      inputs:
        azureSubscription: ''
        ConfigstoreName: ''
        KeyFilter: 'WebSite:*'
        Label: 'Development'
        * trimKeyPrefix: "WebSite:"

I have requested this in the "azure-pipelines-tasks" repo. Not sure why is this Task in a different repo?
https://github.com/microsoft/azure-pipelines-tasks/issues/12236#issue-556258774

Azure Pipelines

All 7 comments

@Yiming-Jia

@majorimi we will be looking into this. Thanks for the suggestion.

Is there any update on this?

We will add support of this, it's still in the backlog though.

Sounds good. Thank you.

Hello @majorimi,

We just release a AzureDevOps task at version 2.10 for Azure AppConfiguration to support the TrimKeyPrefix.

Thank you very much. I have tried it, works perfectly :)

My problem is that .NET Core and Azure Pipeline not really compatible... Using these variables in .NET Core with separator ':' and replacing in the pipeline with '.' is not possible. Posted this request here, but the other team is not really responsible:
https://github.com/microsoft/azure-pipelines-tasks/issues/12235

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kamalsivalingam picture kamalsivalingam  路  3Comments

kamalsivalingam picture kamalsivalingam  路  4Comments

xin9le picture xin9le  路  4Comments

David-Stark picture David-Stark  路  5Comments

mmigala picture mmigala  路  4Comments