1

I've setup Azure CDN (Verizon Premium) and have it serving static files from a Blob Storage.

domain is http://abc.domain.com

I also have an azure function at

POST https://flows1.azurewebsites.net/api/survey

now from my page

http://abc.domain.com/index.html

I need to call my azure function.

Am I able to use the CDN for a URL re-write to take

POST http://abc.domain.com/api/survey

and have the CDN pass through to

POST https://flows1.azurewebsites.net/api/survey

I want to avoid cross-domain scripting issues and am hoping this configuration will allow me to do so.

Thanks for your help,

PNC
  • 1,932
  • 19
  • 36

1 Answers1

0

I have done some research and concluded that this is not possible. At least, not without sacrificing the benefits of using the Azure CDN and Azure Storage in the first place.

To address the issue of cross-domain scripting: Once you have setup another domain to point to the Azure Functions (e.g. http://api.domain.com), make sure you add Access-Control-Allow-Origin: https://abc.domain.com to the response headers in the Azure Functions. Do not use Access-Control-Allow-Origin: *. See here why.

Casper Alant
  • 452
  • 5
  • 15