gpt4 book ai didi

Azure 证书分配给虚拟机

转载 作者:太空宇宙 更新时间:2023-11-03 14:35:33 25 4
gpt4 key购买 nike

我正在尝试添加存储在 VM 机器上的 Key Vault 中的证书,但我无法添加,有人知道该怎么做吗?

我希望你帮我解决这个问题。

最佳答案

# 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

server {
listen 80;
return 301 https://$host$request_uri;
}

server {

listen 443;
server_name tokensaletest.southcentralus.cloudapp.azure.com;

ssl_certificate /etc/nginx/ssl/cert.pem;
ssl_certificate_key /etc/nginx/ssl/key.key;

ssl on;
ssl_session_cache builtin:1000 shared:SSL:10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
ssl_prefer_server_ciphers on;

access_log /var/log/nginx/jenkins.access.log;

location / {

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;

# Fix the “It appears that your reverse proxy set up is broken" error.
proxy_pass http://localhost:8000;
proxy_read_timeout 90;

proxy_redirect http://localhost:8000 https://tokensaletest.southcentralus.cloudapp.azure.com;
}
}

有关更多信息,请参阅此 article部署 Certificates to VMs from customer-managed Key Vault

附加信息:Configure App Service Certificate to Azure Virtual machine with Windows or Linux OS

关于Azure 证书分配给虚拟机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48281608/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com