在Terraform Azure App服务资源中配置CORS

问题描述 投票:2回答:1

我有以下Terraform资源用于配置Azure应用服务:

resource "azurerm_app_service" "app_service" {
  name                = "Test-App-Service-3479112"
  location            = "${azurerm_resource_group.resource_group.location}"
  resource_group_name = "${azurerm_resource_group.resource_group.name}"
  app_service_plan_id = "${azurerm_app_service_plan.app_service_plan.id}"

  site_config {
    dotnet_framework_version = "v4.0"
    remote_debugging_version = "VS2012"
  }

  app_settings {
    "ASPNETCORE_ENVIRONMENT" = "test"
    "WEBSITE_NODE_DEFAULT_VERSION" = "4.4.7"
  }
}

我正在尝试添加要在我的资源中使用的CORS原始值。有没有办法在Terraform中添加它,或者如果没有,我怎么能在我的Terraform文件中配置它(可能使用Azure SDK)?

azure cors terraform azure-virtual-network azure-sdk
1个回答
2
投票

目前,它不受支持。你可以检查azurerm_app_service

在目前的terraform版本中,不支持cors。

如果可能,您可以使用Azure模板执行此操作,您可以检查此example

 "properties": {
        "cors": {
          "allowedOrigins": [
            "[concat('https://', parameters('siteName'), '.azurewebsites.net')]"
          ]
        },
© www.soinside.com 2019 - 2024. All rights reserved.