Skip to content

can not update identity of Microsoft.App/managedEnvironments@2025-02-02-preview via azapi_update_resource #941

@s-nakagaki

Description

@s-nakagaki

terraform: v1.12.2
azapi: 2.5.0

I tried this. terraform validate said An argument named "identity" is not expected here.

resource "azapi_update_resource" "container_apps_environment" {
  type      = "Microsoft.App/managedEnvironments@2025-02-02-preview"
  name      = azurerm_container_app_environment.main.name
  parent_id = data.azurerm_resource_group.main.id
  identity = {
    type = "UserAssigned"
    identity_ids = [
      azurerm_user_assigned_identity.container_apps.id
    ]
  }
  body = {

I tried this. terraform validate said Success! The configuration is valid.

resource "azapi_update_resource" "container_apps_environment" {
  type      = "Microsoft.App/managedEnvironments@2025-02-02-preview"
  name      = azurerm_container_app_environment.main.name
  parent_id = data.azurerm_resource_group.main.id
  body = {
    identity = {
      type = "UserAssigned"
      identity_ids = [
        azurerm_user_assigned_identity.container_apps.id
      ]
    }

but ah, terraform apply said

│ --------------------------------------------------------------------------------
│ RESPONSE 400: 400 Bad Request
│ ERROR CODE: MissingIdentityIds
│ --------------------------------------------------------------------------------
│ {
│   "error": {
│     "code": "MissingIdentityIds",
│     "message": "The identity ids must not be null or empty for 'UserAssigned' identity type."
│   }
│ }

What should I do?

thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    exampleExample request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions