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

Improve documentation around powerplatform_environment_application_package_install (resource) #441

Open webstean opened 2 months ago

webstean commented 2 months ago

Description

Apparently, this resource is intended to be used for install of "Dynamics 365 Apps" which are separate from solutions. These "apps" can be inbuilt or available from Microsoft AppSource. Currently does not mention AppSource, so we need to know how to install "Dynamics 365 Apps" from AppSource. The supplied example is also not very clear on how to leverage this resource.

There also may be dependency on the "Enable Dynamics 365 apps" option being set when the environment is first created.

Definition of Done

Contributions

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

See the contributing guide for more information about what's expected for contributions.

webstean commented 2 months ago

For example, I would expect this to work:

resource "powerplatform_environment_application_package_install" "install_sample_application" {
  for_each = { for k, v in powerplatform_environment.environments : k => v if k == "coe" }

  environment_id = each.value.id
  unique_name    = "Creator Kit"
}

but it doesn't and errors with:

╷
│ Error: Client error when creating powerplatform
│ 
│   with powerplatform_environment_application_package_install.install_sample_application["coe"],
│   on powerapps-solutions-coe.tf line 275, in resource "powerplatform_environment_application_package_install" "install_sample_application":
│  275: resource "powerplatform_environment_application_package_install" "install_sample_application" {
│ 
│ status: 400, message: {"StatusCode":400,"Message":"Package requested for
│ installation was not found"}
╵
mawasile commented 1 month ago

each region has a different set of apps to install, for example the Europe region has the Creator Kit app available but Germany or Switzerland do not. Please validate, that the environment that you are iterating over are in regions that do have Creator Kit available to install.