hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.6k stars 4.65k forks source link

azurerm_resource_group_template_deployment - API version information for RP "Microsoft.Compute" ("")was not found - disks #26348

Open morbendor opened 5 months ago

morbendor commented 5 months ago

Is there an existing issue for this?

Community Note

Terraform Version

1.7.0

AzureRM Provider Version

3.108.0

Affected Resource(s)/Data Source(s)

azurerm_resource_group_template_deployment

Terraform Configuration Files

https://drive.google.com/file/d/1F4Q1fhIplXHAhoBw8_Y09l55IF0NoXAu/view?usp=sharing

Debug Output/Panic Output

│ Error: removing items provisioned by this Template Deployment: API version information for RP "Microsoft.Compute" ("") was not found - nestedResource="/subscriptions/6f-ded2-4f21-b5fe-95276272403c/resourceGroups/rg-networking-test-dev/providers/Microsoft.Compute/disks/vSocket2disk"

Expected Behaviour

The nested Microsoft.Compute/disks resource should have been deleted successfully.

Actual Behaviour

The provider errors and is not able to remove the nested resource:

Error: removing items provisioned by this Template Deployment: API version information for RP "Microsoft.Compute" ("") was not found - nestedResource="/subscriptions/a0-ded2-4f21-b5fe-95276272403c/resourceGroups/rg-networking-test-dev/providers/Microsoft.Compute/disks/vSocket2disk"

Steps to Reproduce

terraform apply -auto-approve terraform destroy -auto-approve

Important Factoids

No response

References

No response

teowa commented 5 months ago

Hi @morbendor , thanks for submitting the issue! From the shared configurations, I can find that your template used in azurerm_resource_group_template_deployment is a nested template, which deploy a Microsoft.Resources/deployments resource, and the Microsoft.Resources/deployments resource then deploy a Microsoft.Compute/disks resource. This is simiar to the case in https://github.com/hashicorp/terraform-provider-azurerm/issues/25458.

rcskosir commented 5 months ago

@teowa Do you think your PR #25466 will also fix this issue?

teowa commented 5 months ago

Yes, PR#25466 is intended to fix this, it is still under review.