Azure key vault certificate renewal on web apps with hostname bindings - azure

We are trying to set up an automatic way to update our custom certificates bound to a lot of different hostnames (custom domains) that we use on all of our web apps.
When a renewal is needed we update a new version of the certificate in our key vault on which it will automatic sync with all of the web apps that uses the certificate. This proces works fine in Azure but we still have to update the TLS/SSL bindings in the web app by hand as this will still be bound to the old certificate, even though the new certificate is synced to the web app.
Is there a workaround for this so we don't have to open every web app and change the TLS/SSL binding by hand for each hostname with the renewed certificate?

Related

Azure App Service renew/change the certificate

I have one question regarding the azure app service certificate update. I have already a certificate bound to one of the azure web apps. But this certificate is going to expire soon. I have renewed my certificate and uploaded a new version of the certificate. So now I have two different certificates in the app service certificate store.
My question is, what is the best way to switch the certificate for the web app without any downtime?
what is the best way to switch the certificate for the web app without any downtime?
AFAIK, the best way is to turn on automatic renewal of your certificate at any time.
Choose the certificate from the App Service Certificates page.
Then select Auto Renew Settings in the left navigation.
Select ON > Save.
If you have automatic renewal enabled on, certificates will begin renewing 60 days before they expire.
Renew App Service Certificate automatically
Click Sync once the renew operation completes which automatically updates the hostname bindings for the App Service Certificate without causing any downtime to your applications.
Refer to the Renew an expiring certificate of azure app service-SSL for more information.

Cannot connect to external https from Azure SF due to untrusted certificate

I have an application, deployed in Azure Service Fabric.
The application connects to external web service which has an untrusted SSL certificate and fails.
I solved problem by implementing custom cert validation logic in "ServerCertificateCustomValidationCallback" method of HttpClient, however this is not an ideal solution.
How to install external SSL certificate into the trusted store on VMs in VMSS, so that any app in ASF can consume external web services without additional efforts?
Additional notes
Certificate contains no private key, so it cannot be imported into Azure key vault and used in ARM template (or I didn't find a way how to achieve this)
Certificate cannot be installed manually via RD, because this doesn't support autoscaling
It is possible to import .pfx certificate without password into Azure Key Valut. Certificate should be imported into Secrets (not into Certificates). Azure portal says, that this feature is deprecated but it works.
When certificate is in key valut, then ARM template can be used to deploy it onto VMs.
To get pfx certificates, I downloaded root and intermediate certificates in browser. Then converted .cer to .pfx via small .net console, written by myself - check X509Certificate class, it has all necessary methods.

Add SSL binding to Azure custom domain

Trying to add SSL binding for a custom domain, but keep getting the error message "Cannot enable SNI SSL for a hostname 'xxx.com' because current site mode does not allow it."
The app service plan is in the D1 (shared infrastructure) tier, and the SSL certificate is one that I (accidentally) purchased through azure.
Does anyone have any idea what the problem could be?
From https://learn.microsoft.com/en-us/azure/app-service/web-sites-purchase-ssl-web-site#check-the-pricing-tier: "Custom SSL is not supported in the F1 or D1 tier."
Steps to use Azure App Certificate SSL w/out upgrade a shared resource account to a more expensive account that allows SSL config.
1. Download Azure App Certificate
2. Install Certificate to a local machine
3. Export the certificate from the local machine and add password protection to the export certificate
4. Open Azure -> Custom domains -> Add binding -> upload the pfx certificate and now you can type your password

azure webapp access a CRM secure site with ssl

I have a .NET Web App on Azure space, that needs to communicate with our CRM server via Microsoft.Xrm.Client and .Portal. The CRM site is protected by SSL, we issue our own pfx files.
Currently the app brings up a "The remote certificate is invalid according to the validation procedure." error.
Is there any way to install a pfx file enabling our app to talk to our secure CRM system on our Azure account. What is the minumim pricing plan that would enable this facility?
You can read how to upload certificates and load them into the website context here,
https://azure.microsoft.com/en-us/blog/using-certificates-in-azure-websites-applications/
Remember to set the appsetting WEBSITE_LOAD_CERTIFICATES in the portal to the thumbprint or * for the certificate to be accessible from the web app.
I believe this is available even on the free plan. (But could be wrong, as normally play with SSL certs which do require Basic plan)

How to renew SSL certificate on an Azure Cloud Service?

I have a cloud service SAAS application that is running on Azure using https which SSL certificate is expiring soon. I've recently obtained a new SSL certificate that I need to apply to before the expiration date.
Looking up on the web, all I found are articles about how to setup SSL certificate for Azure Cloud Service (i.e. http://www.windowsazure.com/en-us/develop/net/common-tasks/enable-ssl/) and non regarding the renewal process. At this point, I'm thinking it's the same process.
In order to avoid unnecessary issue, I'm looking for confirmation from someone else that might have already done this before and perhaps some pointers on other things that I need to be aware of.
1)You upload the certificate to the Service Certificates section on the Windows Azure Portal - just as you did originally.
2) You modify the Service Configuration file to provide the thumbprint of the new certificate instead of the old one. This causes the certificate to be deployed to each instance.
3) You do an in-place upgrade or (use a VIP Swap) which causes IIS to start using the new certificate.
First you upload the new certificate using the Management Portal - go to Certificates tab of your cloud service.
Then if you believe in in-place reconfiguration (which I don't recommend for this scenario) you can go to Configure tab, scroll down to Certificates, change the thumbprint (you can get it from the Certificates tab) and click Save. Just don't forget to update your .cscfg files so that you have the changes preserved when you redeploy.
If you don't believe in in-place reconfiguration you'll have to change your .cscfg files and deploy your service into staging with the updated .cscfg and then do VIP swap and delete the previous deployment. This is what I recommend for this scenario because should anything go wrong with in-place reconfiguration you can experience service downtime.

Resources