How to renew SSL certificate on an Azure Cloud Service? - azure

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.

Related

Create App Service Managed Certificates by Azure

I want to create certification by App Service Managed Certificate.
I set these records
and it works correctly but when I want to create App Service Managed Certificates by Azure
I got a strange error
Failed to create App Service Managed Certificate for hostname. Click here for more details.
I try different CAA records and none of them works.
what should I do?
and if I want to use terraform it is stuck at creating the certificate
I use this template
Azure does not support the .ir domain.
Good news on App service managed certificate.
Yes, you heard correctly it became GA now and supports apex domain with a country code top-level domain (ccTLD).
Key Features:
Supports Apex domain.
Auto renewed.
Expired in 6 month.
Auto renew 45 days before expiration.
Automate using ARM template.
App Service Managed Certificate for apex domain will take a bit longer to create than for sub-domain because it uses a different validation method.
Not exportable.
I hope this will help you in securing your environment.
Maybe the tutorial you need is this:
map-a-cname-record
Create a free certificate
I had seen this error before, and solve it by the steps below:
Check the CNAME records. Map a subdomain to the app's default domain name needs two records: CNAME record and TXT record.
Make sure you enabled the CNAME record mapping in Azure .
Clear the records you don't need, like the CAA records, because wildcard certificatesis not support for creating a free certificate. Take care of the limitations.
It may takes a while for this configuration to take effect.
App Service Managed Certificate is still in Preview, there are some limitations with this (as of today), kindly check them below.
It's a private certificate to use if you just need to secure your www custom domain or any non-naked domain in App Service.
The free certificate is issued by DigiCert. For some top-level domains, you must explicitly allow DigiCert as a certificate issuer by creating a CAA domain record with the value: 0 issue digicert.com.
The free certificate comes with the following limitations:
Does not support wildcard certificates.
Does not support naked domains.
Is not exportable.
Is not supported on App Service Environment (ASE)
Does not support A records. For example, automatic renewal doesn't work with A records.
Kindly see the different between App Service Certificate and App Service Managed Certificate.
https://microsoft.github.io/AzureTipsAndTricks/blog/tip259.html
Checkout this documentation for more details.

Can you associate SSL certificates with Azure app service on Pay-as-you-go?

I made an app service - deployed and my final part of the puzzle is my SSL certificate. When I click on that option in Azure's portal (app service menu for my app) they are all greyed out with the words
"App Service Environments are available in the Premium tier. They
offer even greater scale options, private access, and more.".
I'm on pay-as-you-go so I feel like I should be able to select the service I would like? When I click on upgrade - it just goes to my account page tries to upgrade to pay-as-you-go (even though I already have that) and then times out.
Failing that - does anyone know a way to get around this and letting me upload my ssl certificate? Thanks
You dont need the App Service Environment to deploy custom SSL certificates (that's a good news, since ASE isnt cheap :)).
Since you want to upload your own SSL certificate, I assume you want to have your own domain (and you did configure it in the Custom domains blade already, otherwise you will not be able to assign certificate anyway), then all you need is B1 or higher pricing tier instance, where custom domains are available, more details about differences in pricing tiers can be found here https://azure.microsoft.com/en-us/pricing/details/app-service/plans/
Note that for Microsoft managed domains (so ending with azurewebsites.net), MSFT is the owner of the SSL certificate.
You can try Azure Powershell: https://learn.microsoft.com/en-us/azure/app-service-web/app-service-web-app-powershell-ssl-binding

Restart after - Install certificate on Azure webrole

Is there a way to install a new certificate on an already running web service without the need to restart/redeploy the IIS/service?
I don't think so because the information about the certificate is stored in both csdef and cscfg file and csdef file gets bundled into the package file. Based on this information and the certificate you uploaded under the cloud service certificates section, Azure Fabric Controller installs the certificate in appropriate certificate store when the role is created.
One hacky way you could try (and is certainly NOT recommended) is by connecting to your cloud service VM using RDP and install the certificate manually. Even though you could do it as a temporary reprieve but it is certainly not recommended because of the stateless nature of cloud services. If for some reason Azure Fabric Controller decides to create a new VM or you decide to scale out (i.e. add more instances), the certificate information is taken from existing package file which will not have your latest certificate.

The certificate could not be deleted from cloud service XXX

I'm trying to remove a certificate (via the Management Portal) that is due to expire on 16/07/2014 days and I'm getting this error:
The certificate I'm trying to delete was automatically generated 'CN=Windows Azure Tools' and was used for Remote Access.
I also tried to configure the cloud services to use new certificates, but still no success.
Looked at Fiddlers log and indeed there in an internal server error:
My questions are:
Is there any way I can delete this certificate?
If I can't delete it, what happens when it expires?
What I really want to avoid is to have to redeploy the production services because of this certificate.
Florin, you cannot delete a certificate in production use, but you have two options for this issue:
The easiest option is to just ignore it. The RDP cert is only used for password encryption and it doesn't matter if the cert is expired or not since Azure does not check the expiration date when doing the encryption/decryption.
You can upload a new certificate and then modify the RDP configuration to use that new certificate. After this you can delete the old certificate. This is essentially the same process you would use for an HTTPS certificate.

Can Azure generate a certificate at the cloud side?

During the development, we didn't get the domain binding for our application, so we just use the Azure URL, something like this: xxx.cloudapp.net.
Because we would like our website use HTTPS protocol, we need to use a certificate, just follow the MSDN, we generated the self-signed pfx file using IIS Manager. Before we publish our application to cloud, we upload the pfx file to cloud by the portal page.
So my question is, is above the only way for this situation? Which I means, I need to upload the certificate to cloud manually first, then publish the application? Is there a way I don't need to to this, something like I even not rely on IIS Manager, the cloud can generate a certificate?
Simple answer to your question is No, Azure can't create a certificate for you. But you could do the same.
To elaborate further, let me explain you what's happening behind the scenes. So you have uploaded the PFX certificate in the portal and in your application configuration screen you have specified the thuumbprint of that certificate. When Azure Fabric Controller spins of the VM, it checks for this certificate thumbprint and based on that it fetches the certificate you uploaded previously and installs that certificate. Furthermore it makes changes to the IIS settings does the SSL magic. Now if you want (not sure why) but you could do the same. If we take just development environment, what you could do is write a startup task which would first create a certificate using makecert utility. Then you would write some IIS scripts which will do the SSL magic for IIS.
Yet another thing you could do is automate the deployment of your code using Azure PowerShell Cmdlets. As a part of deployment automation, 1st thing you would do is upload the SSL certificate using Add-AzureCertificate and then create a deployment of your service using New-AzureDeployment.

Resources