I need to automate creating a keyvault and adding two certificates to the vault. I have one self-signed without a password and one wildcard cert signed from a valid authority.
When I try and import them the signed cert gets added fine but the self-signed returns an error...
- Import-AzureKeyVaultCertificate : Pending Certificate not found: cluster-app-primary At script.ps1:18 char:1
- Import-AzureKeyVaultCertificate -VaultName $name -Name 'cluster-app...
-
+ CategoryInfo : CloseError: (:) [Import-AzureKeyVaultCertificate], KeyVaultErrorException + FullyQualifiedErrorId : Microsoft.Azure.Commands.KeyVault.ImportAzureKeyVaultCertificate
The powershell code is as follows:
Import-AzureKeyVaultCertificate -VaultName $name -Name 'cluster-app-primary' -FilePath "..\..\Certificates\cluster-app-primary.pfx"
Now the exact same command with the other certificate works fine (with a password though).
Also note that if I try and import the self-signed certificate through the Azure portal it works fine.
Does anyone know what this error means and is there anything I can do to import this thru powershell?
Thanks.