通过powershell证书:\LocalMachine\My证书存储区,我确实看到了证书,但是通过证书管理器certmgr.msc,我看不到它的任何地方。如何使它出现在那里或在IIS服务器证书部分。证书是使用下面的脚本导入的。
# Install a secret stored in KeyVault into an Azure VM's credential store.
$resourceGroup = [resource group name]
$vm = Get-AzureRmVM -ResourceGroupName $resourceGroup -Name [VM name]
$vaultId = "/subscriptions/[subscription guid]/resourceGroups/$resourceGroup/providers/Microsoft.KeyVault/vaults/[vault name]"
$certStore = "My"
$certUrl = [KeyVault secret URL w/ version id]
$vm = Add-AzureRmVMSecret -VM $vm -SourceVaultId $vaultId -CertificateStore $certStore -CertificateUrl $certUrl
# Update the VM so the changes take effect.
Update-AzureRmVM -ResourceGroupName $resourceGroup -VM $vm发布于 2018-01-26 21:25:14
这些步骤看起来不错,问题是如何生成证书。尝试在本地机器上生成一个自签名证书,然后上传到保险库进行测试。
#Generating self-singed certificate
$Cert = New-SelfSignedCertificate -Subject "CN=Disk Encryption Cert" -CertStoreLocation "cert:\LocalMachine\My" -FriendlyName "Disk Encryption Cert" -NotAfter (Get-Date).AddYears(10) -KeyAlgorithm RSA -KeyLength 2048 -Type Custom -KeySpec Signature
Export-PfxCertificate -Cert $cert -Password (ConvertTo-SecureString "Testing123" -AsPlainText -Force) -FilePath .\Diskencrypt.pfx -Forcehttps://serverfault.com/questions/894332
复制相似问题