terraform-provider-power-platform
terraform-provider-power-platform copied to clipboard
Copilot Studio isn't deleted from environment but tfstate confirms it does
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:
- Add the following resource
- Then remove it
- tfstate confirms removal
- 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
botfor the Copilot record - n x
botcomponentfor 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
Thunder client HTTP action call for validation in environment.
We want to verify if there is a issue related to the Datareocord.
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