az vm secret add / Add-AzureRmVMSecret - Certificate full chain
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 3.5k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 60
Description
> ### `az feedback` auto-generates most of the information requested below, as of CLI version 2.0.62
**Describe the bug**
When adding a PFX certificate containing full chain - only the leaf (with private key) certificate is added to the VM. The store specified is My.
As an alternative I have also tried to the intermediate and root certificates stored in separate secrets (base64 encoded) in key vault to their designated stores however I receive the following error
```The data retrieved from https://xxx is not deserializable into JSON.```
On further reading I presume this is to do with the following encoding requirement for the secret and the fact this only allows for a PFX.
```Specifies the URL that points to a Key Vault secret which contains a certificate. The certificate is the Base64 encoding of the following JavaScript Object Notation (JSON) object, which is encoded in UTF-8: { "data": "", "dataType": "", "password": "" } Currently, dataType accepts only .pfx files.```
**To Reproduce**
- Upload a base64 encoded CRT certificate into key vault secret
- Attempt to add key vault secret to root/ca store.
**Expected behavior**
A way of adding the whole certificate chain from a pfx file or being able to add intermediate/ root certficates separately.
**Environment summary**
Azure CLI / Powershell 7 - both Windows and Linux.
**Additional context**
My currrent work around is to store the root/intermediate certifcate in storage, then pull and install using Powershell run on the target VM but this feels a little clunky.
Contributor guide
Assessment
This issue has not been assessed yet.