Azure / terraform-provider-azapi

Terraform provider for Azure Resource Manager Rest API
https://registry.terraform.io/providers/Azure/azapi/latest
Mozilla Public License 2.0
190 stars 50 forks source link

embedded schema validation failed when running terraform destroy #584

Closed devichris closed 47 minutes ago

devichris commented 2 months ago

Hi, I am trying to delete a keyvault SECRET that was created with the azapi_resource block.

Upon running terraform destroy I am presented with the error

│ Error: Invalid configuration │ │ with azapi_resource.RESOURCE, │ on keyvault.tf line 398, in resource "azapi_resource" "RESOURCE": │ 398: resource "azapi_resource" "RESOURCE" { │ │ embedded schema validation failed: the argument "body" is invalid: │ location is not expected here, it's read only │ You can try to update azapi provider to the latest version or disable the validation using the feature flag schema_validation_enabled = false within the resource block

The issue is that I dont have location specified anywhere in the azapi_resource block/body.

I am using the provider version 1.15.0(latest)

ms-henglu commented 2 months ago

Hi @devichris ,

Thank you for taking time to report this issue.

This seems to be a mismatch between the API and swagger definition, I've opened this issue to track it: https://github.com/Azure/azure-rest-api-specs/issues/30259

As a workaround, please disable the schema validation.

Related issue: https://github.com/Azure/terraform-provider-azapi/issues/538

ms-henglu commented 47 minutes ago

I'll close this issue in favor of https://github.com/Azure/terraform-provider-azapi/issues/655 which also includes other resource types that have same issue.

Please subscribe to https://github.com/Azure/terraform-provider-azapi/issues/655 for any updates. Thanks.