1
votes

In azure cli we have this command to import/bind certificates to azure app from keyvault.az

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#). Can anyone help in this?

2

2 Answers

2
votes

Microsoft has a fluent API to access all the Azure services.

By accessing the App Service API you should be able to assign an existing certificate to it.

0
votes

Thanks @john your hint was more than enough for me to look this up. The method that you pointed helps in ssl binding with the existing certificate. But I need to import the certificate in my azure web app enter image description here. Any API for that?

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();