OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

How to export configs from azure app configuration to app service in a different subscription?

  • Thread starter Thread starter Brett B
  • Start date Start date
B

Brett B

Guest
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'

Update 1: Screen Shot From GitHub Action. See comment: enter image description here

Update 2: It seems that I can recreate the error:

Failed to read key-values from appservice. 'NoneType' object has no attribute 'strip'

By adding the environment variable: DOCKER_REGISTRY_SERVER_PASSWORD. If I remove that variable then the export from the App Configuration Service to my App Services works. If I add that variable, even with a simple "Testing" value, the I get the "Failed To read key-values" error.
<p>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.</p>
<p>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)</p>
<p><code>az login --service-principal --username XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX --password XXXXXXXXXXXXX --tenant XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX</code></p>
<p>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</p>
<p><code>az account set -s TEST-SUBSCRIPTION-NAME</code></p>
<p><code>az account show</code></p>
<p>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</p>
<p><code>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</code></p>
<p>This command successfully generates the config.yml file.</p>
<p>However, when I try to export to my app service directly without exporting to file, I get errors:</p>
<p><code>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</code></p>
<p><strong>Failed to find the App Configuration store 'prod-app-config-service'</strong></p>
<p>If I try to use the full ARM ID of my app service, then I get the following error:</p>
<p><code>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</code></p>
<p><strong>Failed to read key-values from appservice. 'NoneType' object has no attribute 'strip'</strong></p>
<p>Update 1: Screen Shot From GitHub Action. See comment:
<a href="https://i.sstatic.net/TMKOjXJj.png" rel="nofollow noreferrer">enter image description here</a></p>
<p>Update 2: It seems that I can recreate the error:</p>
<p><strong>Failed to read key-values from appservice. 'NoneType' object has no attribute 'strip'</strong></p>
<p>By adding the environment variable: DOCKER_REGISTRY_SERVER_PASSWORD. If I remove that variable then the export from the App Configuration Service to my App Services works. If I add that variable, even with a simple "Testing" value, the I get the "Failed To read key-values" error.</p>
Continue reading...
 

Latest posts

Top