.NET 6 CoreWCF and Azure App Service (Linux) HTTPS Binding

156 Views Asked by At

I have a .NET6 application that uses CoreWCF to host a SOAP service, and it's working just fine locally, where I have self-signed dev certificates for HTTPS. I'm having a problem when I attempt to host this on Azure App Service, as the code that sets up an HTTPS binding for the SOAP service in Kestrel isn't playing nicely with the standard HTTPS setup in Azure App Service because it can't locate a certificate to use.

I did some digging, and it seems like the standard *.azurewebsites.net certificate is definitely not to be accessed via code, so instead I've registered a custom domain, and app service has set up an App Service Managed Certificate.

From what I can make out, I need to access the thumbprint of this certificate to access it via code, and I should then be able to both expose it to my code via an application setting called WEBSITE_LOAD_CERTIFICATES, and also use that same thumbprint to locate it via the code to create the binding, but I'm struggling, as no matter what I do, I can't seem to get that certificate from the code to create the binding.

Because of the binding issue, App Service keeps restarting the container it has created from my code, so I can't even SSH on there to see what certificates are available.

Can anyone help me to access this certificate?

0

There are 0 best solutions below