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_search_service create/update fails to update because on invalid properties #24623

Closed
1 task done
vamshisiram opened this issue Jan 24, 2024 · 14 comments · Fixed by #24837
Closed
1 task done

Comments

@vamshisiram
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 and review the contribution guide to help.

Terraform Version

1.4.6

AzureRM Provider Version

3.57.0

Affected Resource(s)/Data Source(s)

azurerm_search_service

Terraform Configuration Files

resource "azurerm_search_service" "search_service" {
  name                          = "srch-test"
  resource_group_name           = "rg-test"
  location                      = "northcentralus"
  sku                           = var.sku
  replica_count                 = var.replica_count
  partition_count               = lower(var.sku) == "basic" ? 1 : var.partition_count
  public_network_access_enabled = false
  local_authentication_enabled  = true
}

Debug Output/Panic Output

Error: updating Search Service (Subscription: "a3f35929-499d-49ee-a21d-0fbc494461b3" Resource Group Name: "rg-openai-001" Search Service Name: "srch-idpaidev-001"): performing CreateOrUpdate: unexpected status 400 with error: BadRequest: Request body cannot contain the following invalid Properties : privateEndpointConnections,provisioningState,sharedPrivateLinkResources,status,statusDetails. Please refer to https://learn.microsoft.com/en-us/rest/api/searchmanagement/management-api-versions for a list of allowed properties

Expected Behaviour

expect the search service local auth to be enabled.

Actual Behaviour

Error: updating Search Service (Subscription: "a3f35929-499d-49ee-a21d-0fbc494461b3" Resource Group Name: "rg-openai-001" Search Service Name: "srch-idpaidev-001"): performing CreateOrUpdate: unexpected status 400 with error: BadRequest: Request body cannot contain the following invalid Properties : privateEndpointConnections,provisioningState,sharedPrivateLinkResources,status,statusDetails. Please refer to https://learn.microsoft.com/en-us/rest/api/searchmanagement/management-api-versions for a list of allowed properties

Steps to Reproduce

  1. Create a search service first with local auth set to false.
  2. then change the local auth to true. and apply.

Important Factoids

No response

References

No response

@neil-yechenwei
Copy link
Contributor

Thanks for raising this issue. Seems I can't reproduce this issue with the latest azurerm provider and below tf config that is similar with yours. Could you try latest azurerm provider and below tf config to see if the issue still exists? Thanks.

tf config:

provider "azurerm" {
  features {}
}

resource "azurerm_resource_group" "test" {
  name     = "acctestRG-search-test01"
  location = "westeurope"
}

resource "azurerm_search_service" "test" {
  name                          = "acctestsearchservicetest01"
  resource_group_name           = azurerm_resource_group.test.name
  location                      = azurerm_resource_group.test.location
  sku                           = "standard"
  replica_count                 = 2
  partition_count               = 3
  public_network_access_enabled = false
  local_authentication_enabled  = false
}

image
image

@vamshisiram
Copy link
Author

vamshisiram commented Jan 25, 2024 via email

@acranefei
Copy link

I'm having the same issue. I was able to deploy previously with no issue, but now it's throwing this error.

@math280h
Copy link

math280h commented Feb 5, 2024

I'm having the same issue. I was able to deploy previously with no issue, but now it's throwing this error.

Same here (Only updating semantic_search_sku)

@noiserockfiend
Copy link

Same issue. Unable to make any changes to Search services.

@leiter-jakab
Copy link

I'm also encountering this issue. You can find my configuration below. I'm using a private endpoint and configure to use both API keys and RBAC for access.

resource "azurerm_search_service" "ais-search" {
  name                = "ais-${local.workload}-search-${var.environment}"
  resource_group_name = data.azurerm_resource_group.rg-base.name
  location            = data.azurerm_resource_group.rg-base.location
  sku                 = "basic"

  public_network_access_enabled = false
  local_authentication_enabled  = false

  identity {
    type = "SystemAssigned"
  }
  
  tags = local.tags
}

resource "azurerm_private_dns_zone" "dns-search" {
  name                = "privatelink.${local.ai_search_domain}"
  resource_group_name = data.azurerm_resource_group.rg-base.name
  
  tags = local.tags
}

resource "azurerm_private_dns_zone_virtual_network_link" "dns-vnet-link-search-base" {
  name                  = "dns-vnet-link-${local.workload}-search-${var.environment}"
  resource_group_name   = data.azurerm_resource_group.rg-base.name
  private_dns_zone_name = azurerm_private_dns_zone.dns-search.name
  virtual_network_id    = data.azurerm_virtual_network.vnet-base.id

  tags = local.tags
}

resource "azurerm_private_endpoint" "pe-search" {
  name                = "pe-${local.workload}-search-${var.environment}"
  location            = data.azurerm_resource_group.rg-base.location
  resource_group_name = data.azurerm_resource_group.rg-base.name
  subnet_id           = azurerm_subnet.snet-private-endpoints.id

  custom_network_interface_name = "nic-${local.workload}-search-${var.environment}"

  private_service_connection {
    name                           = "psc-${local.workload}-search-${var.environment}"
    private_connection_resource_id = azurerm_search_service.ais-search.id
    subresource_names              = ["searchService"]
    is_manual_connection           = false
  }

  private_dns_zone_group {
    name                 = "dns-zg-${local.workload}-search-${var.environment}"
    private_dns_zone_ids = [azurerm_private_dns_zone.dns-search.id]
  }

  tags = local.tags
}

resource "azurerm_monitor_diagnostic_setting" "ds_search" {
  name                       = "ds-${local.workload}-search-${var.environment}"
  target_resource_id         = azurerm_search_service.ais-search.id
  log_analytics_workspace_id = data.azurerm_log_analytics_workspace.law-base.id

  enabled_log {
    category = "OperationLogs"
  }

  metric {
    category = "AllMetrics"
    enabled  = false
  }
}

@fonts1215
Copy link

Same, just update authentication_failure_mode to "http403", also use private endpoint for connection

@user81017012
Copy link

it seems that updating anything in the resource causes this
the issue doesnt seem to be present in some older versions; like 3.53.0

@narisada014
Copy link

I've encountered the same issue with AzureRM version 3.90.0. The issue occurred just by adding the semantic_search_sku property.

@fonts1215
Copy link

Maybe Microsoft changed some API, and now for each change inside the Azuresearch (apply for terraform) we have this problem

@user81017012
Copy link

user81017012 commented Feb 8, 2024

it seems that updating anything in the resource causes this the issue doesnt seem to be present in some older versions; like 3.53.0

The issue seems to have started from version 3.54.0(and i can see alot of updates were added to azure search on this version) and doesnt seem to be solved in recent provider versions

For the moment i just added an ignore changes on all for this resource so that it works :/ hopefully it gets fixed soon

@gjednaszewski
Copy link

I'm seeing this on 3.83.0 trying to update a tag value on the azure search resource

@WodansSon WodansSon self-assigned this Feb 9, 2024
@WodansSon
Copy link
Collaborator

WodansSon commented Feb 9, 2024

I suspect that something has changed on the service side. Our nightly acceptance tests had a 100% passing rate until January 31, 2024, where some of our test cases started failing with the exact same error message as mentioned above. I will reach out to the service team to see if anything was pushed to production in that timeframe.

@rcskosir rcskosir added the bug label Feb 9, 2024
WodansSon added a commit that referenced this issue Feb 9, 2024
* Initial Check-in...

* Address PR comments...

* Missed one field...

* Remove log debug messages...
@github-actions github-actions bot added this to the v3.92.0 milestone Feb 9, 2024
rizkybiz pushed a commit to rizkybiz/terraform-provider-azurerm that referenced this issue Feb 29, 2024
* Initial Check-in...

* Address PR comments...

* Missed one field...

* Remove log debug messages...
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, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.