有没有办法将证书从 azure keyvault 导入到 .NET 中的 azure web 应用程序?

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

在 azure cli 中,我们使用此命令将 import/bind 证书从 keyvault.az

发送到 azure 应用程序

webapp 配置 ssl 绑定 --certificate-thumbprint {certificate-thumbprint} --name MyWebapp --resource-group MyResourceGroup --ssl-type SNI

我在 .NET 中找不到等效的库来执行相同的操作(我使用的是 C#)。 有人可以帮忙吗?

Microsoft 可以流畅地API访问所有 Azure 服务。

通过访问 App Service API you should be able to assign an existing certificate 到它。

谢谢@john,你的提示对我来说已经足够了。 您指出的方法有助于 ssl 与现有证书的绑定。 但是我需要在我的 Azure Web 应用程序 中导入证书。有 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();