Search code examples
azurecorsazure-functionsazure-gov

Add CORS setting for Azure Function on Government Cloud


Is there anyway to set additional CORS url for Azure functions hosted on Azure Government Cloud?

The web portal is not available through Azure Government Cloud and the only documentation I found to set CORS through Azure CLI is only for Azure storage. It doesn't work for funcapp.

Thanks


Solution

  • If you aren't opposed to using Azure Resource Manager, you could use the suggestion by Bjornicus here. The core of his answer lies in setting the resources.properties.cors.allowedOrigins property to a JSON array of the allowed URLs.