Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure App Configuration Push Task@6: Prefix not appended to Key value #810

Closed
j-noel-b opened this issue Oct 5, 2023 · 11 comments
Closed
Assignees
Labels
Azure Pipelines bug Something isn't working

Comments

@j-noel-b
Copy link

j-noel-b commented Oct 5, 2023

With version 6 of the AzureAppConfigurationPush task, we no longer see the supplied prefix values being appended to the keys in our configuration. Version 3 works without issue in that our prefixes appear on the keys. We do see the ".appconfig.featureflag" appear on both versions but I am unsure if that is due to us providing that value in the prefix or if azure is managing that regardless. I have not tested versions between. Our prefix value does have a colon : in it, if that matters.

Our working version 3 code:

- task: AzureAppConfigurationPush@3
              displayName: "some display name"
              inputs:
                azureSubscription: ${{ parameters.azureSubscription }}
                AppConfigurationEndpoint: ${{ parameters.appConfigurationEndpoint }}
                ConfigurationFile: "${{ configurationFile }}"
                Separator: ';'
                Depth: ${{ parameters.depth }}
                Prefix: ".appconfig.featureflag/${{ somePrefixValueWith:ColonInIt }}"
                Label: ${{ parameters.label }}
                ContentType: "application/vnd.microsoft.appconfig.ff+json;charset=utf-8"
                Strict: ${{ parameters.strict }}

Our version 6 code:

- task: AzureAppConfigurationPush@6
              displayName: "some display name"
              inputs:
                azureSubscription: ${{ parameters.azureSubscription }}
                AppConfigurationEndpoint: ${{ parameters.appConfigurationEndpoint }}
                ConfigurationFile: "${{ configurationFile }}"
                Separator: ';'
                Depth: ${{ parameters.depth }}
                Prefix: ".appconfig.featureflag/${{ somePrefixValueWith:ColonInIt }}"
                Label: ${{ parameters.label }}
                ContentType: "application/vnd.microsoft.appconfig.ff+json;charset=utf-8"
                Strict: ${{ parameters.strict }}
                ImportMode: ${{ parameters.import_mode }}
                DryRun: ${{ parameters.dry_run }}
                Tags: ${{ parameters.tags }}

Our team requires the use of the prefix, so we will stay with version 3 for the immediate time being, but we would appreciate any insight that can be provided.

@MaryanneNjeri
Copy link
Contributor

MaryanneNjeri commented Oct 5, 2023

Hello @j-noel-b , to make sure I understand, with the Azure App Configuration Push@6, you are unable to add the prefix ".appconfig.featureflag/someprefix" when pushing feature flags ?
If so this is cause keys cannot start with the reserved prefix(".appconfig.featureflag/") for feature flags. The update was introduced from version 5.

@j-noel-b
Copy link
Author

j-noel-b commented Oct 5, 2023

Hello @j-noel-b , to make sure I understand, with the Azure App Configuration Push@6, you are unable to add the prefix ".appconfig.featureflag/someprefix" when pushing feature flags ? If so this is cause keys cannot start with the reserved prefix(".appconfig.featureflag/") for feature flags. The update was introduced from version 5.

Sorry @MaryanneNjeri - the copy-paste from v3 got away from me in writing this ticket. I sincerely apologize for the confusion in the description.

Here is our feature json:

{
  "FeatureManagement": {
      "Feature1": false,
      "Feature2": true
  }
}

here is our v6 task:

- task: AzureAppConfigurationPush@6
              displayName: "some display name"
              inputs:
                azureSubscription: ${{ parameters.azureSubscription }}
                AppConfigurationEndpoint: ${{ parameters.appConfigurationEndpoint }}
                ConfigurationFile: "${{ configurationFile }}"
                Separator: ';'
                Depth: ${{ parameters.depth }}
                Prefix: "OurPrefix"
                Label: ${{ parameters.label }}
                ContentType: "application/vnd.microsoft.appconfig.ff+json;charset=utf-8"
                Strict: ${{ parameters.strict }}
                ImportMode: ${{ parameters.import_mode }}
                DryRun: ${{ parameters.dry_run }}
                Tags: ${{ parameters.tags }}

And here are the keys I am seeing in our feature manager:

.appconfig.featureflag/Feature1
.appconfig.featureflag/Feature2

Whereas I would expect to see:

.appconfig.featureflag/OurPrefixFeature1
.appconfig.featureflag/OurPrefixFeature2

Ultimately, we would like a colon in our prefix value such as Our:Prefix but I can't seem to get the basic text of OurPrefix to append.

@MaryanneNjeri
Copy link
Contributor

MaryanneNjeri commented Oct 6, 2023

@j-noel-b I see, seems there was a regression from version 5 of not appending prefixes for feature flags. We can explore the possibility of reintroducing the appending prefixes for feature flags.

@zhenlan zhenlan added bug Something isn't working and removed question labels Oct 6, 2023
@j-noel-b
Copy link
Author

j-noel-b commented Oct 9, 2023

@MaryanneNjeri - thank you so much for the confirmation - much appreciated.

@CMarshall92Shawbrook
Copy link

@j-noel-b @MaryanneNjeri

Can i ask im having a nightmare of a time deploying the configuration file to the app config do you have an example of what your file that worked prior to this change looked like.

You have no idea how much of a saviour you would be if you could.

or if anyone else can as nothing ive attempted in the past five days seems to work....

@MaryanneNjeri
Copy link
Contributor

MaryanneNjeri commented Oct 23, 2023

@CMarshall92Shawbrook dependent on the content profile you are using

For appconfig/default

Example configuration file

{
  "app": {
	"Settings":{
		"Font": {
		    "Size": "45"
		}
	    }
    },
    "FeatureManagement": { 
        "FeatureY": {
            "EnabledFor": [
                {
                "Name": "AlwaysOn"
                }
            ]
        }
     }
}

For appconfig/kvset

Please see the example here

@CMarshall92Shawbrook
Copy link

So I tried the appconfig/kvset example and it worked but went into the configuration explorer and nothing appeared under the feature manager any ideas why this is the case?

{
  "items": [
    {
      "key": ".appconfig.featureflag/Beta",
      "value": "{\"id\":\"Beta\",\"description\":\"Beta feature\",\"enabled\":true,\"conditions\":{\"client_filters\":[]}}",
      "label": "dev",
      "content_type": "application/vnd.microsoft.appconfig.ff+json;charset=utf-8",
      "tags": {}
    }
  ]
}

@MaryanneNjeri
Copy link
Contributor

MaryanneNjeri commented Oct 23, 2023

@CMarshall92Shawbrook seems you are trying to import feature flags, with the appconfig/default content profile feature flag import requires adherence to feature-management schema. Some more examples can be found here

So I tried the appconfig/kvset example and it worked but went into the configuration explorer and nothing appeared under the feature manager any ideas why this is the case?

In your configuration explorer under Manage view > Settings ensure the option to "Include feature flags in the configuration explorer" is enabled
image

Please let me know if this helps
Are you able to view the feature flags in "Feature manager"?

@CMarshall92Shawbrook
Copy link

Can confirm that worked apologies for derailing this issue just thought it may have been related hopefully this will help out people in the future anyways. Is this 'Include feature flags in configuration explorer' mentioned in the docs if not might be worth adding as im sure i never once came across that

@MaryanneNjeri
Copy link
Contributor

Yes it is mentioned in the docs, Access feature flags

@MaryanneNjeri
Copy link
Contributor

Hello @j-noel-b the fix to address the regression where feature flags are not appended can be found in version 6.4.0 of the Azure App Configuration Push Task. Please let me know if this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure Pipelines bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants