[SOLVED] Prevent hotlinking in azure blob storage?

Issue

This Content is from Stack Overflow. Question asked by KillerTopic

I’m searching for a technique to avoid hotlinking on Azure, similar to how in AWS one may use waf and cdn to check for referer headers. Is it possible to accomplish this with Azure?
I also can’t utilise signed links since the user would have to reload the page continuously.



Solution

You could use Azure CDN Premium for it. It provides token authentication to prevent assets from being served to unauthorized clients:

https://learn.microsoft.com/en-us/azure/cdn/cdn-token-auth

There were also some discussion already here regarding the use of SAS Tokens. Combining short lived SAS Tokens and Content-Cache Header might work as well.

Prevent hotlinking in Azure Blob Storage


This Question was asked in StackOverflow by KillerTopic and Answered by Julian Hüppauff It is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?