daoom
daoom

Reputation: 61

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?

Upvotes: 1

Views: 2390

Answers (1)

Francesco
Francesco

Reputation: 614

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:

  1. Create a CNAME entry for your domain to point to your blob storage (eg CNAME blob.mydomain.com to myservice.blob.core.windows.net)

  2. Add a managed custom domain to your Azure storage account: blob.mydomain.com

  3. Create a CloudFront CDN distribution with origin server blob.mydomain.com

  4. Use your CloudFront CDN url to access your resources eg: http://acbdefgh.cloudfront.net/users/john

  5. 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.

Upvotes: 3

Related Questions