简体   繁体   English

有没有办法将证书从 azure 密钥库导入 azure web 应用程序中的 Z303CB0EF5825EDB9082DAZ61?

[英]Is there a way to import certificate from azure keyvault to azure web app in .NET?

In azure cli we have this command to import/bind certificates to azure app from keyvault.az在 azure cli 中,我们有此命令可从 keyvault.az 将证书导入/绑定到 azure 应用程序

webapp config ssl bind --certificate-thumbprint {certificate-thumbprint} --name MyWebapp --resource-group MyResourceGroup --ssl-type SNI webapp config ssl bind --certificate-thumbprint {certificate-thumbprint} --name MyWebapp --resource-group MyResourceGroup --ssl-type SNI

I couldn't find equivalent library in .NET to do the same (I am using C#).我在 .NET 中找不到等效的库来做同样的事情(我使用的是 C#)。 Can anyone help in this?有人可以帮忙吗?

Microsoft has a fluent API to access all the Azure services.微软有一个流畅的 API 可以访问所有 Azure 服务。

By accessing the App Service API you should be able to assign an existing certificate to it.通过访问应用服务 API ,您应该能够为其分配现有证书

Thanks @john your hint was more than enough for me to look this up.谢谢@john,你的提示对我来说已经足够了。 The method that you pointed helps in ssl binding with the existing certificate.您指出的方法有助于 ssl 与现有证书绑定。 But I need to import the certificate in my azure web app但我需要在我的 azure web 应用程序中导入证书在此处输入图像描述 . . Any API for that?有任何 API 吗?

var webApp1 = azure.WebApps
                .GetById(<your resouce Id as a string>)
                .Update()
                .DefineSslBinding()
                .ForHostname(<host name as a string>)
                .WithPfxCertificateToUpload(<certificate as a string>,
                    <password as a string>)
                .WithSniBasedSsl()
                .Attach()
                .Apply();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM