Is it possible to associate a single wildcard SSL certificate with multiple separate App Service instances? - azure

We have a number of discrete App Service Plan instances (separated to simplify tenant billing), each hosting a number of Web App instances. Each App is on a subdomain of the same parent:
AppService-1:
subone.mydomain.com
subtwo.mydomain.com
AppService-2:
subthree.mydomain.com
&c...
Can we purchase a single wildcard SSL certificate (from Azure, or elsewhere) for *.mydomain.com and apply it to all three subdomains in the example above, or do we need a separate certificate for each App Service Plan?

YES. You have a valid scenario where you can use a single wild card domain for multiple sub-domains. I am attaching a screenshot of my setup below. If you see I have mapped the same certificate for multiple domains.
This will also work with another App Service Plan. These are the things to note though:
If the second app service plan is in the same resource group, then you need not Import/Upload the certificate.
If the second app service plan is in a different resource group, then you will have to again Import/Upload the certificate.
Certificates are specific to Resource Group and are visible to all the web apps in that resource group.
Also I have my certificate issued for both root domain and Wildcard. This way I can cover more scenarios.
NOTE: Even though there are multiple IP-Based SSL bindings in the screenshot below, there is only IP assigned to the webapp. As there is
only certificate which meets all the requirements, the bindings are simple
re-using the existing resource (IP).

Yes, it is possible to associate a single wildcard SSL certificate with multiple separate App Service.
You do not need to purchase an individual SSL Certificates.
Get a Wildcard SSL Certificate for *.domain.com.
It will allow you to secure anything.domain.com, means security for the unlimited number of sub-domains.
But make sure the Certificate Authority from where you have purchased the Wildcard SSL should offering unlimited server license.
Certificate Authorities like Comodo, RapidSSL, Thawte, and GeoTrust are offering unlimited server license along with their Wildcard SSL.

Yes, you can do that. What you would do is create a certificate resource and assign that resource to the Web Apps. You might need a separate certificate resource for each app service plan.

Yes, you can use same wildcard SSL certificate for your web app services, but make sure that all AppServices are hosted under the same domain. Major certificates authorities are offering unlimited server licenses with their wildcard certificate, you have to configure your certificate on your multiple servers.
AppService-1:
sub1.mydomain.com
sub2.mydomain.com
AppService-2:
sub3.mydomain.com
sub4.mydomain.com
AppService-3:
sub5.mydomain.com
sub9999.mydomain.com
AlphaSSL, Comodo, RapidSSL offers domain validated low-cost wildcard certificate where Thawte, GlobalSign, and GeoTrust offers organization validated certificate at the higher prices.

Related

Can I get SSL certificate for website running in Azure VM at westeurope.cloudapp.azure.com subdomain

I have created Windows Server VM in Azure and deployed my site to IIS, which is now accessible at https://mysite.westeurope.cloudapp.azure.com/
however I get certificate error when I try to visit it from outside the vm.
how do I configure the VM to have proper https without certificate errors (just like app service - mysite.azurewebsites.net)?
As the comments from micker #micker, you can't get an SSL certificate for this subdomain westeurope.cloudapp.azure.com which is owned by Microsoft.
Since you host your websites on Azure VM, you could purchase a domain then get an SSL certificate for your own domain, then bind the SSL certificate to your custom domain in IIS on the Azure VM. You can either purchase that certificate through Azure or an external provider or get a free SSL cert from Let's Encrypt.
However, if you just want to have a test in your test environment, you can use a self-signed certification with this DNS name like vma.centralus.cloudapp.azure.com. You can follow steps in How To Create A SHA-256 Self-Signed Certificate on the Azure VM then export this cert .cer format file on the Azure VM and import the .cer cert under the mmc---certificate---local machine---Trusted root certification Authorities on the machine where you want to access the websites. Please note this It's not recommended to use self-signed cert in your production environment.
I had same issue, and I found resolution without custom domain using following additional azure settings.
create Azure WAF, add custom rules to deny if not in IP list - this is if you need ip whitelisting, useful if your main domain uses akamai or other edge routing to point to external hosting of subdomains, you can use whitelist to restrict access to the akamai or other servers, though this takes some big lists you must paste of ranges one row at a time. Set any other web app firewall rules you want enforced for allow/deny.
Create Azure Front Door named like you want as an endpoint url e.g. myappfrontdoor will make myappfrontdoor.azurefd.net. in backend pool specify the your public-ip shared dns name (see step 3) like myapptest..cloudapp.azure.com.
This is the important step : in Settings at top of front door designer, disable cert validation. in routing rules config, no condition, forward to backend pool setup in prior step. This ignores the fact that you cannot cert your cloudapp.azure.com endpoint, and wraps it with a *.azurefd.net certificate.
In your azure firewall, Edit NAT rules, set rule name myapp-web-fd-... , tcp, ip address, 147.243.0.0/16 (this is Azure's front door backend ip range). destination should be the firewall's own public ip. destination port 443, translated address should be the target vm's azure internal ip, target port - service port.
Now you will have a site like myappfrontdoor.azurefd.net.
Note that Azure Front Door and WAF have their own pricing costs, so maybe it is cheaper for you to buy a domain. Hopefully you are also using Azure Firewall, though expensive. If not, one could point to public ip directly on NSG or on vm itself but I wouldn't skip having a firewall for a public server. There is a standing Azure enhancement request to get Azure Front Door to recognize certificates, but it was triaged 2 years ago and still not added, so not sure if it will be worked. If it ever does get worked, devs could make own cert auth and self-signed cert with expirations to more securely hook front door to azure internal vm. For now, have to rely on the front door backend setting, waf, and azure firewall to have these things routed.
There are some options in Akamai and other edge routing systems to import cert and self-created authority sort of, but I've not tried that yet, so cannot confirm this would cleanly wrap your azure site without cert errors. You can make a self-signed authority using openssl commands as noted in other posts out and about on the web.
The simplest and cheapest option is to purchase a domain and use a cname dns record to map your new domain to your Azure subdomain address - an "A" record is not required. Also per answer above, a WAF is expensive and possibly unnecessary for a test set up (but a requirement for a production website). You can use Certbot and NGINX to create a free Lets Encrypt certificate for your domain and assign it to your website.
Adding a Public IP Address, Load Balancer, and Network Security Group to your Azure Resource Group may also be required to provide access to your website. This is largely how my test configuration is set up except I'm using a Linux VM, have a single wildcard certificate, and use NGINX to reverse proxy 3 websites.

HTTPS not working for Azure Traffic Manager for Azure Function at azurewebsites.net

I'm trying to use https://mysite.trafficmanager.net that should resolve to https://myfunction.azurewebsites.net without adding my own SSL cert or domain.
When I go directly to https://myfunction.azurewebsites.net the cert is valid, but when I go to https://mysite.trafficmanager.net I get a cert error saying the cert is issued to *.azurewebsites.net
Do I have to purchase my own SSL to get this to work? It seems like the certs should just work within the Azure family and that I'm just missing a configuration setting.
You get a cert error since myfunction.azurewebsites.net have a certificate for *.azurewebsites.net but not *.trafficmanager.net so traffic manager site is not secured unless you have a custom domain + SSL cert.
The azure traffic manager works at DNS level. This means that it does not handle any request, just making the right redirection. The clients connect directly to the selected endpoint, not through Traffic Manager.
If you want to access the endpoint via HTTPS, you just need to bind an SSL certificate on your endpoint. If you want this error to disappear, you can read this Azure networking feedback.
For a dev\test scenario, there are a couple options you may want to
consider:
Buy a real cert and domain/sub-domain for your dev-test setup.
Create a self-signed certificate for your site with the *.trafficmanager.net SAN added to it and install this self-signed cert to the Trusted Certificate Authorities store on your clients to not
get browser warnings.

Azure Traffic Manager and SSL Certificates

I have 6 different micro services with an Azure Traffic Manager setup for each of them. The services are running in 3 different regions to improve their performance but I need to come up with the certificates for the Azure Traffic Manager.
I have seen that there are two options available in the Azure Portal: The Standard and the Wild Card. While the latter is much more expensive, I was wondering if the same SSL Certificate can be used in all my 6 services so in the end, I will save money.
All my sites are like this:
http://foo1.trafficmanager.net
http://foo2.trafficmanager.net
http://foo3.trafficmanager.net
http://foo4.trafficmanager.net
http://foo5.trafficmanager.net
http://foo6.trafficmanager.net
As you can see the, the domain is the same (I do not have any custom domain, just the by default trafficmanager.net), so I am wondering whether one certificate will be enough. I have not seen any information about the wildcard certificate and it is pretty expensive to just give it a try...
Also, is there any security concern if I use the same certificate for all the sites? Is there a best practice recommendation? 1 certificate per site vs. 1 certificate for multiple sites.
Lastly, if I decide to use Custom Domains in the future, will I be able to reuse the issued certificate? (the domain will not be trafficmanager.net anymore)
Actually, a valid SSL certificate must match the access FQDN domain name. One Standard certificate only could be used for one FQDN domain name, such as "foo1.trafficmanager.net" while one WildCard certificate could be used for all like "*.trafficmanager.net" FQDN domain name, so usually we use the same WildCard certificate for all different services.
If you use Custom Domains in the future, you need to deploy new certificate to match the new Custom domain.
You can get more details about SSL Certificate Names

Can a Domain Name purchased through another vendor be used with an SSL Certificate purchased from Azure?

We purchased a domain name from Network Solutions, and set up our website as two App Services in Azure (one within US East and one within US West). Our domain name purchased from Network Solutions is assigned as a hostname in Azure, and a traffic manager balances the traffic between the two App Services. I have two questions...
Azure offers SSL Certficates. If I purchase an SSL Certificate from Azure, is there anything I need to do in Network Solutions to update the site?
Do I need to purchase two SSL Certificates since I am using two App Services?
I have looked at these articles, but unfortunately, they did not answer my questions:
https://learn.microsoft.com/en-us/azure/app-service-web/web-sites-configure-ssl-certificate
https://learn.microsoft.com/en-us/azure/app-service-web/web-sites-purchase-ssl-web-site
Thank you!
If you already have a custom domain associated with your Web Apps (both deployments Region #1 and #2), then no. You're all set.
E.g. www.example.com pointing to {TrafficManagerName}.trafficmanager.net
No. Just one TLS certificate valid for www.example.com or *.example.com
See my answer here for more:
https://stackoverflow.com/a/40399500/4148708

Azure Application Gateway - Multiple SSL Certificates?

Is it possible to set multiple Domains to point to an Azure Application Gateway Public IP and then upload SSL Certificates for each one that can then Offload on the Application Gateway?
For example if we'd like to have 200 LetsEncrypt certificates uploaded and terminating at the gateway, then forwarding traffic onto the internal VM IPs
Is it possible to set multiple Domains to point to an Azure
Application Gateway Public IP and then upload SSL Certificates for
each one that can then Offload on the Application Gateway?
Yes, it is possible to set multiple domains to point to an Azure Application Gateway Public IP.
It is also possible to upload SSL certificates for each one so that Application Gateway offloads it.
However, there are limits. Please read below.
According to https://learn.microsoft.com/en-us/azure/azure-subscription-service-limits#application-gateway-limits you can upload a maximum of 20 certificates to a single Application Gateway resource, and only one certificate per HTTP listener.
You can however generate SAN certificate through LetsEncrypt and have a single certificate for multiple domains:
Can I get a certificate for multiple domain names (SAN certificates or
UCC certificates)?
Yes, the same certificate can contain several different names using
the Subject Alternative Name (SAN) mechanism.
https://letsencrypt.org/docs/faq/
I do not have experience yet with LetsEncrypt and do not know how to generate SAN certificate through LetsEncrypt.
We have SAN certificate (paid) through another company for multiple domains working in Application Gateway.

Resources