Skip to content

"az appconfig kv export --destination appservice" produces "Failed to read key-values from appservice" when DOCKER_REGISTRY_SERVER_PASSWORD exists in app service #29270

Description

@bruschke

Describe the bug

Found that I continued to receive "Failed to read key-values from appservice. 'NoneType' object has no attribute 'strip'" when trying to export my configuration values from App Configuration Service to my App Service. I was able to finally get around the issue by removing the DOCKER_REGISTRY_SERVER_PASSWORD environment variable from app service. My work around is to delete the variable, then run the export command, and then re-insert the variable (in my case I stored the value in a separate key vault in order to re-create it.)

Related command

This is my command with my workaround logic:

DELETE ENV VAR DOCKER_REGISTRY_SERVER_PASSWORD

az webapp config appsettings delete --name my-app-service --resource-group my-resource-group --setting-names DOCKER_REGISTRY_SERVER_PASSWORD --only-show-errors

EXPORT CONFIG TO APP SERVICE

az appconfig kv export
--auth-mode login
--endpoint https://my-config.azconfig.io
--destination appservice
--appservice-account /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.Web/sites/my-app-service
--label my-label
--export-as-reference true
--skip-features true
--only-show-errors
--yes

PULL DOCKER_REGISTRY_SERVER_PASSWORD VALUE FROM KEY VAULT

docker_password=$(az keyvault secret show --vault-name my-vault --name docker-registry-server-password --query value -o tsv)

RE-CREATE ENV VAR DOCKER_REGISTRY_SERVER_PASSWORD

az webapp config appsettings set --name my-app-service --resource-group my-resource-group --settings DOCKER_REGISTRY_SERVER_PASSWORD=$docker_password

Errors

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

Issue script & Debug output

N/A - See error message

Expected behavior

az appconfig kv export --destination appservice can be run successfully even when the DOCKER_REGISTRY_SERVER_PASSWORD environment variable is present

Environment Summary

azure-cli 2.61.0

core 2.61.0
telemetry 1.1.0

Extensions:
azure-devops 1.0.1

Dependencies:
msal 1.28.0
azure-mgmt-resource 23.1.1

Python location '/opt/az/bin/python3'
Extensions directory '/opt/az/azcliextensions'

Python (Linux) 3.11.8 (main, May 16 2024, 03:47:28) [GCC 11.4.0]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

No response

Metadata

Metadata

Labels

App ConfigurationAuto-AssignAuto assign by botService AttentionThis issue is responsible by Azure service team.act-codegen-extensibility-squadcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions