Skip to content
This repository has been archived by the owner on Aug 3, 2019. It is now read-only.

CORS setting does not work? #8

Open
joseph-cloudthing opened this issue Mar 13, 2018 · 5 comments
Open

CORS setting does not work? #8

joseph-cloudthing opened this issue Mar 13, 2018 · 5 comments

Comments

@joseph-cloudthing
Copy link

joseph-cloudthing commented Mar 13, 2018

I've been attempting to implement CORS configuration via arm templates.

I have used this template as a guide, specifically this section.

{
          "apiVersion": "2015-04-01",
          "name": "web",
          "type": "config",
          "dependsOn": [
            "[resourceId('Microsoft.Web/Sites', variables('apiSiteName'))]"
          ],
          "properties": {
            "cors": {
              "allowedOrigins": [
                "[concat('https://', parameters('siteName'), '.azurewebsites.net')]"
              ]
            }
          }
},

I've attached this resource within the resources array of an existing Microsoft.Web/Sites object.

The template deploys successfully. No errors are returned.

The CORS configuration is not updated however, the entry does not appear in the Azure Portal either?

Is this really a valid way of setting CORS configurations?

https://schema.management.azure.com/schemas/2016-08-01/Microsoft.Web.json#/resourceDefinitions/sites_config suggests it is correct.

@mswehli
Copy link

mswehli commented Jun 13, 2018

Same issue. Tried both as a child resource and having it in the siteConfig section (as per the online documentation), as well as directly in properties. Nothing seems to work (using api version 2016-08-01

@melezhik
Copy link

melezhik commented Nov 8, 2018

the same issue for me! what is ETA on this?

@melezhik
Copy link

melezhik commented Nov 8, 2018

@mutanttech
Copy link

Guys, @melezhik were you able to find the solution to this problem. Setting the CORS values using ARM templates still not working for me. This is ridiculous to mix things with ARM and scripts.
Does using Azure CLI is way going forward? Please suggest.

@mutanttech
Copy link

It worked for me really straightforward from the ARM Template.
"siteConfig": {
"AlwaysOn": true,
"webSocketsEnabled": true,
"use32BitWorkerProcess": false,
"cors": {
"allowedOrigins": "[parameters('corsAllowedOrigins')]",
"supportCredentials": false
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants