AppConfiguration icon indicating copy to clipboard operation
AppConfiguration copied to clipboard

adding or deleting a specific user or group in Azure app configuration feature filter CLI

Open Bhanu88 opened this issue 2 years ago • 2 comments

i created a filter by following command in azure app configuration

az appconfig feature filter add -n azureDBconfig --feature check --filter-name Microsoft.Targeting --filter-parameters Audience={\"DefaultRolloutPercentage\":0,\"Users\":[\"[email protected]\",\"[email protected]\"]}

{
	"id": "check",
	"description": "",
	"enabled": true,
	"conditions": {
		"client_filters": [
			{
				"name": "Microsoft.Targeting",
				"parameters": {
					"Audience": {
						"DefaultRolloutPercentage": 0,
						"Users": [
							"[email protected]",
							"[email protected]"
						]
					}
				}
			}
		]
	}
}

now i want to add [email protected] and delete [email protected] from the user list without affecting any other attribute of the feature

az appconfig feature filter add -n azureDBconfig --feature check --filter-name Microsoft.Targeting --filter-parameters Audience={\"DefaultRolloutPercentage\":0,\"Users\":[\"[email protected]\",\"[email protected]\"]}

But when i am trying to do the same the new list is getting appended below the previous list rather than updating .

{
	"id": "check",
	"description": "",
	"enabled": true,
	"conditions": {
		"client_filters": [
			{
				"name": "Microsoft.Targeting",
				"parameters": {
					"Audience": {
						"DefaultRolloutPercentage": 0,
						"Users": [
							"[email protected]",
							"[email protected]"
						]
					}
				}
			},
			{
				"name": "Microsoft.Targeting",
				"parameters": {
					"Audience": {
						"DefaultRolloutPercentage": 0,
						"Users": [
							"[email protected]",
							"[email protected]"
						]
					}
				}
			}
		]
	}
}

i want the end result like

{
	"id": "check",
	"description": "",
	"enabled": true,
	"conditions": {
		"client_filters": [
			{
				"name": "Microsoft.Targeting",
				"parameters": {
					"Audience": {
						"DefaultRolloutPercentage": 0,
						"Users": [
							"[email protected]",
							"[email protected]"
						]
					}
				}
			}
		]
	}
}

Bhanu88 avatar Apr 04 '22 10:04 Bhanu88

Hi @Bhanu88, thanks for the feedback! We will add this capability in Azure CLI and keep you posted. In the meantime, you can achieve this in 2 steps:

  1. Delete the existing filter named "Microsoft.Targeting":
  • az appconfig feature filter delete -n <storeName> --feature <featureName> --filter-name Microsoft.Targeting
  1. Add a new filter called "Microsoft.Targeting" with the updated filter params:
  • az appconfig feature filter add -n azureDBconfig --feature check --filter-name Microsoft.Targeting --filter-parameters Audience={\"DefaultRolloutPercentage\":0,\"Users\":[\"[email protected]\",\"[email protected]\"]}

avanigupta avatar Apr 04 '22 20:04 avanigupta

@avanigupta thanks for the workaround i will wait for the enhancement

Bhanu88 avatar Apr 05 '22 23:04 Bhanu88

@Bhanu88 The feature filter update functionality is available in preview now with azure-cli version 2.41.0. I hope this works for your use case. Any feedback you may have on this is welcome.

albertofori avatar Oct 12 '22 15:10 albertofori

Thanks for the update and I will check and update here

Bhanu88 avatar Oct 13 '22 09:10 Bhanu88

its working as expected

Bhanu88 avatar Nov 08 '22 11:11 Bhanu88