Skip to content
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

Setting support_credentials in azurerm_linux_function_app causes error #20148

Closed
1 task done
jrdzha opened this issue Jan 22, 2023 · 2 comments · Fixed by #20987
Closed
1 task done

Setting support_credentials in azurerm_linux_function_app causes error #20148

jrdzha opened this issue Jan 22, 2023 · 2 comments · Fixed by #20987
Labels
bug service/functions Function Apps upstream/microsoft Indicates that there's an upstream issue blocking this issue/PR v/3.x

Comments

@jrdzha
Copy link

jrdzha commented Jan 22, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

Setting the support_credentials option in azurerm_linux_function_app.site_config.cors causes a mysterious error with a nil message. It seems like this has been noticed by some others as well: #3188 (comment)

Terraform Version

1.2.1

AzureRM Provider Version

3.40.0

Affected Resource(s)/Data Source(s)

azurerm_linux_function_app

Terraform Configuration Files

provider "azurerm" {
  features {}
}

resource "azurerm_resource_group" "example" {
  name     = "example-resources"
  location = "West Europe"
}

resource "azurerm_storage_account" "example" {
  name                     = "linuxfunctionappsa"
  resource_group_name      = azurerm_resource_group.example.name
  location                 = azurerm_resource_group.example.location
  account_tier             = "Standard"
  account_replication_type = "LRS"
}

resource "azurerm_service_plan" "example" {
  name                = "example-app-service-plan"
  resource_group_name = azurerm_resource_group.example.name
  location            = azurerm_resource_group.example.location
  os_type             = "Linux"
  sku_name            = "Y1"
}

resource "azurerm_linux_function_app" "example" {
  name                = "example-linux-function-app"
  resource_group_name = azurerm_resource_group.example.name
  location            = azurerm_resource_group.example.location

  storage_account_name       = azurerm_storage_account.example.name
  storage_account_access_key = azurerm_storage_account.example.primary_access_key
  service_plan_id            = azurerm_service_plan.example.id

  site_config {
    cors {
      allowed_origins     = ["https://example.com"]
      support_credentials = true
    }
  }
}

Debug Output/Panic Output

╷
│ Error: updating Linux Function App: (Site Name "askedith-function-app" / Resource Group "askedith-resource-group"): web.AppsClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: autorest/azure: Service returned an error. Status=<nil> <nil>
│ 
│   with module.askedith_production.azurerm_linux_function_app.askedith_function_app,
│   on askedith/5_functions.tf line 17, in resource "azurerm_linux_function_app" "askedith_function_app":
│   17: resource "azurerm_linux_function_app" "askedith_function_app" {
│ 
│ updating Linux Function App: (Site Name "askedith-function-app" / Resource Group "askedith-resource-group"): web.AppsClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error:
│ autorest/azure: Service returned an error. Status=<nil> <nil>

Expected Behaviour

Expect setting support_credentials = true to work

Actual Behaviour

Doesn't work with a mysterious nil error message.

Steps to Reproduce

terraform apply

Important Factoids

No response

References

No response

@jrdzha jrdzha added the bug label Jan 22, 2023
@github-actions github-actions bot removed the bug label Jan 22, 2023
@jrdzha
Copy link
Author

jrdzha commented Jan 22, 2023

Turns out the issue is that setting support_credentials = true is not supported when allowed_origins = ["*"]. Either way, this issue shouldn't throw a nil error.

@github-actions
Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.