I have been scouring documentation and issue logs for days now. I need to figure out how to successfully export my configs as reference to my app services that live in subscriptions that are different than were the app configuration service resides.
I can successfully login to azure cli with my service principal which has access to both my prod subscription (App Configuration Service location) and my test subscription (App Service location)
az login --service-principal --username XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX --password XXXXXXXXXXXXX --tenant XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX
I then set my account to my test subscription (where my app service is located) and verify it is set correct with az account show
az account set -s TEST-SUBSCRIPTION-NAME
az account show
Next to test that I can access the App Configuration Service in my production subscription even though I am logged into my test subscription I run the az appconfig kv export with the export going to file
az appconfig kv export --destination file --connection-string 'Endpoint=https://prod-app-config-service.azconfig.io;Id=XYZK;Secret=ZZZZZZZZZZZZZZZZZZZZ' --label my-label --skip-features true --format yaml --path config.yml
This command successfully generates the config.yml file.
However, when I try to export to my app service directly without exporting to file, I get errors:
az appconfig kv export --destination appservice --connection-string 'Endpoint=https://prod-app-config-service.azconfig.io;Id=XYZK;Secret=ZZZZZZZZZZZZZZZZZZZZ' --label my-label --export-as-reference true --skip-features true --appservice-account test-app-service
Failed to find the App Configuration store ‘prod-app-config-service’
If I try to use the full ARM ID of my app service, then I get the following error:
az appconfig kv export --destination appservice --connection-string 'Endpoint=https://prod-app-config-service.azconfig.io;Id=XYZK;Secret=ZZZZZZZZZZZZZZZZZZZZ' --label my-label --export-as-reference true --skip-features true --appservice-account /subscriptions/test-subscription-id/resourceGroups/rg-test-app-service/providers/Microsoft.Web/sites/test-app-service
Failed to read key-values from appservice. ‘NoneType’ object has no attribute ‘strip’
Brett B is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.