question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AppConfig Key Vault reference import causes invalid Content Type for YAML files

See original GitHub issue

Describe the bug

I see in the release notes there was recently the breaking change “Support settings with JSON content type” for AppConfig and I suspect this is what is impacting me.

Command Name az appconfig kv import

Errors:

Failed to import 'yaml' file format with 'application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8' content type. Please provide JSON file format to match your content type.

To Reproduce:

Steps to reproduce the behavior.

  • Create file test.yml with content such as: MySecret: ‘{“uri”:“https://my-key-vault.vault.azure.net/secrets/my-secret”}’
  • Try importing it: az appconfig kv import -s file --path test.yml --format yaml -n STCU-App-Config --content-type "application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8"

Expected Behavior

Previously this would import the new property, now the above error occurs. If I change the content type by excluding +json or changing it to something else then the property is created but it is not a Key Vault reference. Is it possible to import a new Key Vault reference property within a YAML file in version 2.10.1 of the CLI?

Environment Summary

Linux-4.15.0-1092-azure-x86_64-with-debian-10.2 (Cloud Shell)
Python 3.6.10
Installer: DEB

azure-cli 2.10.1

Additional Context

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
avaniguptacommented, Feb 25, 2022

Hi @ChristopherL-STCU, this issue occurred because we don’t support importing key-values from a YAML file with JSON content-type. If you still want this feature, feel free to open a new issue in https://github.com/Azure/AppConfiguration/issues repo and we will get this prioritized.

@navba-MSFT, this issue can be closed now.

0reactions
ChristopherL-STCUcommented, Feb 25, 2022

Thanks @navba-MSFT. From @avanigupta comment my understanding is that YAML import was deprecated. So the issue remains but my understanding is it is expected and that there are no plans to support YAML functionality. If this is correct then it seems this issue can be closed. But if YAML deprecation was a mistake and this functionality is intended then this issue can remain open to track it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

az appconfig kv import - importing the key vault content type in ...
Hi @manvkaur, if you are interested in importing/exporting Key Vault references from AppConfig to JSON file, please use Azure CLI for both ...
Read more >
Use Key Vault references - Azure App Service - Microsoft Learn
Key Vault references can be used as values for Application Settings, allowing you to keep secrets in Key Vault instead of the site...
Read more >
Spring Cloud Azure App Configuration - Microsoft Open Source
Because the client recognizes the keys as Key Vault references, they have a unique content-type, and the client will connect to Key Vault...
Read more >
Azure App Configuration Push Task - How can I deploy key ...
The push task takes content type as a parameter. If you want to create key-vault references, you'll need to specify the content type...
Read more >
Core Features - Spring
It is also possible to configure the SpringApplication by using an application.properties file. See Externalized Configuration for details. For a complete list ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found