-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CORS settings for function app #1374
Comments
Hi @TsuyoshiUshio, Currently as far as I know no one is working on this. |
FWIW: here is our current (workaround) resource "azurerm_template_deployment" "cors" {
name = "arm_cors"
resource_group_name = "${azurerm_function_app.test_fn_app.resource_group_name}"
deployment_mode = "Incremental"
template_body = <<DEPLOY
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"functionAppName": {
"type": "string"
}
},
"variables": {},
"resources": [
{
"comments": "CORS allow origins *.",
"type": "Microsoft.Web/sites/config",
"name": "[concat(parameters('functionAppName'), '/web')]",
"apiVersion": "2016-08-01",
"properties": {
"cors": {
"allowedOrigins": [
"*"
]
}
},
"dependsOn": []
}
]
}
DEPLOY
parameters {
"functionAppName" = "${azurerm_function_app.test_fn_app.name}"
}
depends_on = [
"azurerm_function_app.test_fn_app",
]
} |
@kevinneufeld |
CORS has been implemented for App Service in provider v.1.24. Is there any blockers implement this for |
Is there any new status on this? Given that functions are often implemented as service oriented API controllers, CORS is important for web browser security policies. |
FYI, I added this support in #3666. To follow the same convention of that of app_service, the schema will look as follows:
|
As workaround I created a module to wrap a az command in resources: https://registry.terraform.io/modules/StefanSchoof/function-cors/azurerm |
I think this is done in #3949 and released with 1.33.0. |
@katbyte or @tombuildsstuff: I thing this is done and can be closed. |
Closing @StefanSchoof's request - thanks for the ping :) |
Seems there is an issue with this causing it to fail if you specify |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks! |
Community Note
Description
When I deploy FunctionApp with CORS settings, I have no way to config that. If no one is trying this, I'd happy to contribute this.
New or Affected Resource(s)
Potential Terraform Configuration
References
--->
The text was updated successfully, but these errors were encountered: