Azure / Azure/azure-cli-extensions
Creating local user with public key failed to validate key
- Dominant language
- Python
- Stars
- 454
- Forks
- 1.7k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 64
Description
### Related command
```bash
az storage account local-user create --account-name accname -g private_rg -n sftpuser --home-directory sftp --permission-scope permissions=rwlcd service=blob resource-name=sftp --ssh-authorized-key key="*SSH_KEY*" --has-ssh-key true
```
### Extension name
storage-preview
### Description of issue
When supplying the contents of a rsa `.pub` file to the `key` property, I get the below error.
I did notice the trailing `=` seem to get dropped in the output not sure if they are maybe getting dropped on input.
Error:
```
Code: InvalidBase64String
Message: String AAAAB3Nza...g04Dyy6Iw is not base64 encoded.
```
I've also tried base64 encoding the contents on the rsa `.pub` file and supplying that in the key data section but that results in the same error.
Key was generated using `ssh-keygen -m PEM -t rsa -b 4096 -f ./keyfile`
-----
OS: macOS Monterey - 12.3.1 (21E258)
Shell: ZSH
Contributor guide
Assessment
This issue has not been assessed yet.