-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
keyvault certificate import api doesn't work when password has special character #8827
Comments
What shell are you running the CLI command from? I suspect it is Powershell based on the error, and if that's the case, there is nothing we can do about this because the splitting on & occurs before your command ever reaches the CLI. |
Sorry, not sure what you mean, but I'm running the CLI command directly from my pc thru the cmd. |
Thanks for the clarification @vany0114. For CMD, only ever wrap strings in double quotes. If you run your command with --debug, you will see, for example, that |
@tjprescott I tried with double quotes too and didn't work :( |
With double quotes, do you get the |
With double quotes I get:
|
Use |
Sorry @tjprescott, indeed I get that error. When you asked I tested out in PS rather than cmd. I've tried with |
Thanks @vany0114, I was trying to separate the quoting issue with the service issue. The KeyVault team will need to address why your certificate does not work. Since you can't upload it with the CLI, PS or portal, it implies there is something questionable in the service. Also, I noticed you are using CLI 2.0.24, which is well over a year old. You might try updating your CLI and see if that resolves the problem. |
Hi guys, yeah also have run into this recently and the only workaround was to change the password for the PFX to not use any special characters ;-)... tested with PS and Azure Gui |
I just ran into this today. My certificate password has a |
Yeah, you will need to export it again with MMC-snapin-cert and then make sure the password has no special characters in it, and then attempt the import into Azure it will work... ;-) |
Similar to #11003 (comment) @vany0114, please check the solution and let us know if you can get unblocked. |
Describe the bug
When I try to import a certificate with special characters inside the password it generates this error:
To Reproduce
Try to import a certificate with this password: Q1$VGcjv&%8H
Expected behavior
It should import the certificate since it is completely valid.
Environment summary
CLI version:
azure-cli (2.0.24)
OS version:
Windows 10 Enterprise
Shell Type: bash | cmd.exe | Bash on Windows
Additional context
I tried to import the same certificate thru the Azure Portal, but I'm getting this error:
So I decided to try with Powershell, then I got the same error, so I guess the Azure portal use the same script.
Then I tried with Azure CLI and I get the mentioned error. My workaround was to import it as a secret using the
Set-AzureKeyVaultSecret
api, but it should import the certificate as a key vault certificate because the pfx and passwrods are completely valid.The text was updated successfully, but these errors were encountered: