microsoft / terraform-provider-power-platform

Power Platform Terraform Provider
https://registry.terraform.io/providers/microsoft/power-platform/latest/docs
MIT License
35 stars 13 forks source link

Copilot Studio isn't deleted from environment but tfstate confirms it does #455

Open sundium opened 2 months ago

sundium commented 2 months ago

Describe the bug

When removing a copilot studio bot resource, it's not getting deleted from the target Power Platform environment, even the tfstate says so.

To Reproduce

Steps to reproduce the behavior:

  1. Add the following resource
  2. Then remove it
  3. tfstate confirms removal
  4. Resource isn't deleted from target Power Platform environment (confirmed through real time OData endpoint call)

Sample Terraform Code

resource "powerplatform_data_record" "sample_bot" { environment_id = powerplatform_environment.dev.id table_logical_name = "bot" columns = { name = var.copilot_name // e.g. test01 schemaname = var.copilot_schemaname // e.g. new_test01 template = var.copilot_template_version // default-2.1.0 } }

If applicable, add terraform code to help explain your problem.

Expected behaviour

A clear and concise description of what you expected to happen.

System Information

Additional context

When creating a Copilot Studio bot, it creates several records across multiple tables

I speculate it the botcomponent records would prevent the deletion of the bot records due to referential integrity.

Contribution

Do you plan to raise a PR to address this issue? YES

sundium commented 2 months ago

Thunder client HTTP action call for validation in environment.

thunder-collection_Create Bot (template).json