Azure / Azure/azure-cli

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

Open
#14,845 8 comments 0 reactions 1 assignee Assigned to @ChristineWanjau View on GitHub
act-codegen-extensibility-squad App Configuration customer-reported needs-team-attention Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

## 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.