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

azurerm_app_service_connection: Expected type object but found type string #19439

Closed
1 task done
yellowhat opened this issue Nov 25, 2022 · 2 comments · Fixed by #19519
Closed
1 task done

azurerm_app_service_connection: Expected type object but found type string #19439

yellowhat opened this issue Nov 25, 2022 · 2 comments · Fixed by #19519
Labels

Comments

@yellowhat
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

1.3.5

AzureRM Provider Version

3.33.0

Affected Resource(s)/Data Source(s)

azurerm_app_service_connection

Terraform Configuration Files

terraform {
  required_version = "1.3.5"

  required_providers {
    azurerm = {
      source  = "hashicorp/azurerm"
      version = "3.33.0"
    }
  }
}

provider "azurerm" {
  features {}
}

resource "azurerm_resource_group" "main" {
  name     = "zz_delete"
  location = "West Europe"
}

resource "azurerm_postgresql_server" "main" {
  name                             = "pgsql-server"
  resource_group_name              = azurerm_resource_group.main.name
  location                         = azurerm_resource_group.main.location
  administrator_login              = "supermegauser"
  administrator_login_password     = "aaa.000.bbb"
  backup_retention_days            = 7
  sku_name                         = "GP_Gen5_2"
  version                          = "11"
  storage_mb                       = 5120
  public_network_access_enabled    = false
  ssl_enforcement_enabled          = true
  ssl_minimal_tls_version_enforced = "TLS1_2"
}

resource "azurerm_postgresql_database" "main" {
  name                = "db"
  server_name         = azurerm_postgresql_server.main.name
  resource_group_name = azurerm_postgresql_server.main.resource_group_name
  charset             = "utf8"
  collation           = "und-x-icu"
}

resource "azurerm_service_plan" "main" {
  name                = "main-serviceplan"
  resource_group_name = azurerm_resource_group.main.name
  location            = azurerm_resource_group.main.location
  sku_name            = "P1v2"
  os_type             = "Linux"
}

resource "azurerm_linux_web_app" "main" {
  name                = "main-linuxwebapp"
  resource_group_name = azurerm_resource_group.main.name
  location            = azurerm_resource_group.main.location
  service_plan_id     = azurerm_service_plan.main.id
  site_config {}
}

resource "azurerm_app_service_connection" "main" {
  name               = "main-serviceconnector"
  app_service_id     = azurerm_linux_web_app.main.id
  target_resource_id = azurerm_postgresql_database.main.id
  client_type        = "springBoot"
  authentication {
    type   = "secret"
    name   = azurerm_postgresql_server.main.administrator_login
    secret = azurerm_postgresql_server.main.administrator_login_password
  }
}

Debug Output/Panic Output

╷
│ Error: creating Scoped Linker (Resource Uri: "/subscriptions/xx/resourceGroups/zz_delete/providers/Microsoft.Web/sites/main-linuxwebapp"
│ Linker Name: "main-serviceconnector"): performing LinkerCreateOrUpdate: servicelinker.ServiceLinkerClient#LinkerCreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: Code="HttpRequestPayloadAPISpecValidationFailed" Message="HTTP request payload failed validation against API specification with one or more errors. Please see details for more information." Target="Microsoft.Web/sites/main-linuxwebapp/providers/Microsoft.ServiceLinker/linkers/main-serviceconnector" Details=[{"code":"InvalidType","message":"Expected type object but found type string. Paths in payload: '$.properties.authInfo.secretInfo.secretType'"}]
│ 
│   with azurerm_app_service_connection.main,
│   on main.tf line 45, in resource "azurerm_app_service_connection" "main":
│   45: resource "azurerm_app_service_connection" "main" {
│ 
│ creating Scoped Linker (Resource Uri: "/subscriptions/xxx/resourceGroups/zz_delete/providers/Microsoft.Web/sites/main-linuxwebapp"
│ Linker Name: "main-serviceconnector"): performing LinkerCreateOrUpdate: servicelinker.ServiceLinkerClient#LinkerCreateOrUpdate: Failure sending request: StatusCode=0
│ -- Original Error: Code="HttpRequestPayloadAPISpecValidationFailed" Message="HTTP request payload failed validation against API specification with one or more errors.
│ Please see details for more information." Target="Microsoft.Web/sites/main-linuxwebapp/providers/Microsoft.ServiceLinker/linkers/main-serviceconnector"
│ Details=[{"code":"InvalidType","message":"Expected type object but found type string. Paths in payload: '$.properties.authInfo.secretInfo.secretType'"}]

Expected Behaviour

Succeed

Actual Behaviour

No response

Steps to Reproduce

  1. terraform apply

Important Factoids

No response

References

No response

@yellowhat yellowhat added the bug label Nov 25, 2022
@github-actions github-actions bot removed the bug label Nov 25, 2022
@xiaxyi
Copy link
Contributor

xiaxyi commented Nov 29, 2022

Thanks @yellowhat for raising this issue. Seems the type that's send to the api is not the expected one. I will raise a pr for the fix and update progress here.

@github-actions
Copy link

github-actions bot commented Jan 5, 2023

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 Jan 5, 2023
favoretti pushed a commit to favoretti/terraform-provider-azurerm that referenced this issue Jan 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants