terraform-provider-power-platform icon indicating copy to clipboard operation
terraform-provider-power-platform copied to clipboard

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

Open sundium opened this issue 1 year ago • 1 comments

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.

  • When this bot resource is removed (commented out).
  • tf state confirms its removal
  • The resource actually gets removed from the target environment (which it doesn't).

System Information

  • Provider Version: [2.7.0-preview]
  • OS & Version: [Windows]

Additional context

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

  • 1 x bot for the Copilot record
  • n x botcomponent for topics, global variables etc.

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 avatar Sep 19 '24 18:09 sundium

Thunder client HTTP action call for validation in environment.

thunder-collection_Create Bot (template).json

sundium avatar Sep 19 '24 18:09 sundium

We want to verify if there is a issue related to the Datareocord.

eduardodfmex avatar Jan 23 '25 17:01 eduardodfmex

Closing this as won't fix. We can open a new bug if we can repro this with a data record type we intend to support

mattdot avatar Mar 07 '25 07:03 mattdot