How to use Origin Types in Azure CDN endpoings? - azure

I just need to know when to use the Origin Types in Azure CDN endpoints.
I have already created a Web App service and when I create an endpoint, i am presented with a list of Origin Types: Storage,Web App,Cloud service,Custom origin. If I choose Web App, I see my Web App. If I choose Storage, I see the storage account i created. My purpose is to have a fast web app by caching all "cachable" assets.
When creating an Azure CDN endpoint, what or when should I use the following Origin Types :Storage,Web App,Cloud service,Custom origin?
I have not seen any documentation that provides any guidance on this.

For Azure service like Storage, Web App, Cloud service, you can use that respective origin type, for other public custom name or IP address, you can select Custom origin. See the process of creating a CDN endpoint.
Especially, if you host a static website on the Azure storage account. To make your static website files available over your custom domain and HTTPS, see Using the Azure CDN to access blobs with custom domains over HTTPS. As a part of this process, you need to point your CDN to the primary static website endpoint as opposed to the primary blob service endpoint. If so, you can select primary static website endpoint in the custom origin, see details here.

Related

Enabling HTTPS for a Azure blob static website

I have an Azure storage account with a static website on the blob service enabled. I also have configured custom domain for my blob service. To be able to serve my website over HTTPS on the custom domain I need to somehow apply my certificate. How can I do it?
p.s.
I don't want no CDN
To be able to serve my website over HTTPS on the custom domain I need
to somehow apply my certificate. How can I do it?
Unfortunately it is not possible as of writing this answer because Azure Storage still doesn't have the ability to allow you to bring your own certificates. You will need to use CDN if you want HTTPS enabled custom domain mapped to your static website hosted in Azure Blob Storage.
From this link:
It's easier to enable HTTP access for your custom domain, because
Azure Storage natively supports it. To enable HTTPS, you'll have to
use Azure CDN because Azure Storage does not yet natively support
HTTPS with custom domains. see Map a custom domain to an Azure Blob
Storage endpoint for step-by-step guidance.
You can use an application gateway instead of CDN, here is a recipe:
https://github.com/easkerov/azure-sa-custom-domain-ssl-sample

Issue trying to connect Azure CDN endpoint with custom origin (origin pointing to Azure Function App Proxy)

I have a static website hosted in a storage account, and i want to be able to manage the request/response headers. I found some sources about people that used Function App Proxy as a workaround. And it all works well. But i am using Azure CDN to cache the website and deliver it. So i tried to create a CDN endpoint, using custom origin, and connect it to the Function App Proxy. But the CDN is not able to pull and cache the content. Any idea if this anyhow is possible to work? I definitely need the CDN in front of the website, in order to achieve better performance.

How to deploy a react.js based SPA to Azure App Service + CDN?

I'm creating a react.js based SPA, and I'll have a landing page on launch. The static landing page should have an action button that directs to the full SPA.
For AWS, I realized it's done by simply using S3 and Cloudfront, and Cloudfront also allows routing to custom error page on 404. This means no server code is needed to handle this, and it may free up some server resources?
For Azure, however, I'm unsure of how to mimic such an architecture. I'm guessing I should use Blob storage to store the SPA and the landing page, but how would I be able to mimic the abilities of Cloudfront? Is Azure CDN sufficient? Thanks!
Azure CDN supports to cache Web Apps.
You can build up a simple Azure Web App with your SPA and custom routing rules and the 404 error page. Then create the Azure CDN, configure the Origin type to web app, and select or type your origin domain in the Origin hostname dropdown.
You can refer to https://azure.microsoft.com/en-us/documentation/articles/cdn-create-new-endpoint/ for the detailed steps.

Azure Cloud Service and Amazon Cloudfront Inter-Operability

From what I’ve been told by the Azure support staff, the Azure CDN is at best deprecated at the moment while they work out the details of a new service they are supposed to roll out eventually. For that reason and because the particular site I am building requires the content to secured (It’s going to be paid for) I need to look somewhere else for a CDN since the current Azure offering doesn’t offer that possibility.
I was thinking of using Cloudfront but the dilemma I’m having is where to store my files. I cannot seem to find anything online about inter-operability between Azure and Cloudfront (using either Cloudfront with Azure Blob Storage, or an Azure Web Worker and S3/Cloudfront for file storage and CDN).
Does anybody have any experience, tips, pointers, or gotchas on doing this? Or perhaps a recommend another service I can use?
To point your CloudFront CDN to your Azure Blob storage you will need to set up a managed custom domain on your Azure storage service and point your CloudFront CDN origin domain name to this custom domain.
Steps:
Create a CNAME entry for your domain to point to your blob storage (eg CNAME blob.mydomain.com to myservice.blob.core.windows.net)
Add a managed custom domain to your Azure storage account: blob.mydomain.com
Create a CloudFront CDN distribution with origin server blob.mydomain.com
Use your CloudFront CDN url to access your resources eg: http://acbdefgh.cloudfront.net/users/john
Alternatively set up a CNAME to point to your CloudFront CDN domain. Eg avatar.mydomain.com to acbdefgh.cloudfront.net and update your CloudFront distribution CNAME with avatar.mydomain.com
The ability to invalidate cached objects is a good example of why you might want to use Amazon's CloudFront CDN over the Azure CDN. Using the steps above you could for example use CloudFront to cached objects that occasionally need to be invalidated (such as profile pics - avatar.mydomain.com) and the Azure CDN for everything else (blob.mydomain.com) where both sub domains point to the same azure blob storage account myservice.blob.core.windows.net.

Azure CDN for cloud service requests are forwarded to <myapp>.cloudapp.net instead of my custom hostname binding

As mentioned in the title above I have a cloudservice with a WebRole that runs a web app www.myappname.com. I have taken all necessary steps to enable serving of CDN content from my app using url rewrite module on IIS. This works fine but:
The requests coming in from CDN are forwarded to .cloudapp.net instead of my custom hostname binding. I cannot find any place to change this in my configuration. When I create a new CDN endpoint my options for setting the ORIGIN DOMAIN are limited to my cloud service endpoints
Say I got a custom domain name for my cloud service CDN endpoint (ex. static.appnamecdn.com). What happens when I make request with https? I don't see any place to register the "static.appnamecdn.com" 's ssl certificate. Isn't something like this required?
From the help icon on the Create CDN Endpoint screen (Azure Management Portal) I got my answer to the second point above:
If you choose to enable HTTPS for your CDN endpoint, keep in mind the
following points:
You must use the certificate provided by the CDN. Third party certificates are not supported.
You must use the CDN domain to access content. HTTPS support is not available for custom domain names (CNAMEs) since the CDN does
not support custom certificates at this time.
HTTPS is from the CDN to the client only. Requests from the CDN to the content provider (Storage Account or hosted service) are
still made using HTTP.
Regarding your first question, I don't think that is possible...Azure's CDN unfortunately is somewhat limited in its options.
As to the 2nd, as was said in the other answer, it's not possible to use HTTPS with a custom domain name :/

Resources