Skip to content

Commit a5a7286

Browse files
authored
powerplatform environment support for creating environment without dataverese (#255)
* refarctoring environment datasource * wip * refactoring powerplatform_environment * refactoring template metadata * Refactoring environment datasource * Squashed commit of the following: commit 08f8476 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed Apr 10 08:17:36 2024 +0200 Bump github.com/Azure/azure-sdk-for-go/sdk/azidentity (#254) Bumps [github.com/Azure/azure-sdk-for-go/sdk/azidentity](https://github.com/Azure/azure-sdk-for-go) from 1.5.1 to 1.5.2. - [Release notes](https://github.com/Azure/azure-sdk-for-go/releases) - [Changelog](https://github.com/Azure/azure-sdk-for-go/blob/main/documentation/release.md) - [Commits](Azure/azure-sdk-for-go@sdk/internal/v1.5.1...sdk/internal/v1.5.2) --- updated-dependencies: - dependency-name: github.com/Azure/azure-sdk-for-go/sdk/azidentity dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit e255409 Author: mawasile <[email protected]> Date: Mon Apr 8 18:47:07 2024 +0200 Adding powerplatform_environment_settings resource and datasource (#250) * Add new Environment Settings data source * adding unit tests * Add environment settings resource and data source * adding unit tests * Squashed commit of the following: commit 34468d7 Author: Engin Polat <[email protected]> Date: Fri Mar 22 10:16:34 2024 -0700 creating languages data source (#237) * creating language data source * adding languages data source to provider * changing languages data source example to use cli to authenticate * updating model and api for languages * adding documentation * adding tests * Update ProtoV6ProviderFactories in unit test * Update ProtoV6ProviderFactories in unit test * Refactor API calls in environment settings tests * Update user.md and resource_user.go with additional resources * Refactor power platform environment settings * Add power_apps_component_framework_for_canvas_apps feature to powerplatform_environment_settings resource and datasource * Update ImportState function to use environment_id instead of id * Delete import.tf file --------- Co-authored-by: Matt Dotson <[email protected]> commit 0223f4b Author: Matt Dotson <[email protected]> Date: Thu Apr 4 11:02:52 2024 -0700 more precise login command (#253) commit 8f6a60e Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu Apr 4 11:01:33 2024 -0700 Bump github.com/Azure/azure-sdk-for-go/sdk/azcore from 1.11.0 to 1.11.1 (#251) Bumps [github.com/Azure/azure-sdk-for-go/sdk/azcore](https://github.com/Azure/azure-sdk-for-go) from 1.11.0 to 1.11.1. - [Release notes](https://github.com/Azure/azure-sdk-for-go/releases) - [Changelog](https://github.com/Azure/azure-sdk-for-go/blob/main/documentation/release.md) - [Commits](Azure/azure-sdk-for-go@sdk/azcore/v1.11.0...sdk/azcore/v1.11.1) --- updated-dependencies: - dependency-name: github.com/Azure/azure-sdk-for-go/sdk/azcore dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Refactoring dataverse attribute for environment * no dataverse use case for solution import * refactoing managed environment when no dataverse is present * handling no dataverse when using environment_settings * refactoring application packages install to handle no dataverse environments * refactoring application package install to work when no dataverse is present * supporting no dataverse in datasource solutions * updating example * refactoring unit tests and simplifing environment setup * Refactoring code to handle no Dataverse environments * Refactoring code to handle no Dataverse environments * Refactoring code to handle no Dataverse environments * fixing paths for unit test * adding additional unit tests
1 parent 08f8476 commit a5a7286

File tree

130 files changed

+17276
-1837
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+17276
-1837
lines changed

docs/data-sources/environments.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,26 @@ data "powerplatform_environments" "all_environments" {}
4242
Read-Only:
4343

4444
- `billing_policy_id` (String) Billing policy id (guid) for pay-as-you-go environments using Azure subscription billing
45-
- `currency_code` (String) Unique currency name (EUR, USE, GBP etc.)
45+
- `dataverse` (Attributes) Dataverse environment details (see [below for nested schema](#nestedatt--environments--dataverse))
4646
- `display_name` (String) Display name
47-
- `domain` (String) Domain name of the environment
4847
- `environment_type` (String) Type of the environment (Sandbox, Production etc.)
4948
- `id` (String) Unique environment id (guid)
49+
- `location` (String) Location of the environment (europe, unitedstates etc.)
50+
51+
<a id="nestedatt--environments--dataverse"></a>
52+
### Nested Schema for `environments.dataverse`
53+
54+
Read-Only:
55+
56+
- `currency_code` (String) Unique currency name (EUR, USE, GBP etc.)
57+
- `domain` (String) Domain name of the environment
5058
- `language_code` (Number) Unique language LCID (integer)
5159
- `linked_app_id` (String) Unique linked app id (guid)
5260
- `linked_app_type` (String) Type of the linked app (Internal, External etc.)
5361
- `linked_app_url` (String) URL of the linked D365 app
54-
- `location` (String) Location of the environment (europe, unitedstates etc.)
5562
- `organization_id` (String) Unique organization id (guid)
5663
- `security_group_id` (String) Unique security group id (guid)
64+
- `template_metadata` (String) Additional D365 environment template metadata (if any)
65+
- `templates` (List of String) The selected instance provisioning template (if any)
5766
- `url` (String) Url of the environment
5867
- `version` (String) Version of the environment

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ The Power Platform provider can use the [Azure CLI](https://learn.microsoft.com/
5757
1. Login using the scope as the "expose API" you configured when creating the app registration
5858

5959
```bash
60-
az login --scope api://powerplatform_provider_terraform/access
60+
az login --allow-no-subscriptions --scope api://powerplatform_provider_terraform/.default
6161
```
6262

6363
Configure the provider to use the Azure CLI with the following code:

docs/resources/environment.md

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,15 @@ provider "powerplatform" {
3636
}
3737
3838
resource "powerplatform_environment" "development" {
39-
display_name = "example_environment"
40-
location = "europe"
41-
language_code = "1033"
42-
currency_code = "USD"
43-
environment_type = "Sandbox"
44-
domain = "mydomain"
45-
security_group_id = "00000000-0000-0000-0000-000000000000"
39+
display_name = "example_environment"
40+
location = "europe"
41+
environment_type = "Sandbox"
42+
dataverse = {
43+
language_code = "1033"
44+
currency_code = "USD"
45+
domain = "mydomain"
46+
security_group_id = "00000000-0000-0000-0000-000000000000"
47+
}
4648
}
4749
```
4850

@@ -51,23 +53,36 @@ resource "powerplatform_environment" "development" {
5153

5254
### Required
5355

54-
- `currency_code` (String) Unique currency name
5556
- `display_name` (String) Display name
5657
- `environment_type` (String) Type of the environment (Sandbox, Production etc.)
57-
- `language_code` (Number) Unique language LCID (integer)
5858
- `location` (String) Location of the environment (europe, unitedstates etc.)
59-
- `security_group_id` (String) Unique security group id (guid). For an empty security group, set this property to `0000000-0000-0000-0000-000000000000`
6059

6160
### Optional
6261

6362
- `billing_policy_id` (String) Billing policy id (guid) for pay-as-you-go environments using Azure subscription billing
63+
- `dataverse` (Attributes) Dataverse environment details (see [below for nested schema](#nestedatt--dataverse))
64+
65+
### Read-Only
66+
67+
- `id` (String) Unique environment id (guid)
68+
69+
<a id="nestedatt--dataverse"></a>
70+
### Nested Schema for `dataverse`
71+
72+
Required:
73+
74+
- `currency_code` (String) Unique currency name
75+
- `language_code` (Number) Unique language LCID (integer)
76+
- `security_group_id` (String) Unique security group id (guid). For an empty security group, set this property to `0000000-0000-0000-0000-000000000000`
77+
78+
Optional:
79+
6480
- `domain` (String) Domain name of the environment
6581
- `template_metadata` (String) Additional D365 environment template metadata (if any)
6682
- `templates` (List of String) The selected instance provisioning template (if any)
6783

68-
### Read-Only
84+
Read-Only:
6985

70-
- `id` (String) Unique environment id (guid)
7186
- `linked_app_id` (String) The GUID of the linked D365 application
7287
- `linked_app_type` (String) The type of the linked D365 application
7388
- `linked_app_url` (String) The URL of the linked D365 application
@@ -76,3 +91,4 @@ resource "powerplatform_environment" "development" {
7691
- `version` (String) Version of the environment
7792

7893

94+

docs/resources/environment_settings.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@ provider "powerplatform" {
2626
}
2727
2828
resource "powerplatform_environment" "example_environment_settings" {
29-
display_name = "example_environment_settings"
30-
location = "europe"
31-
language_code = "1033"
32-
currency_code = "USD"
33-
environment_type = "Sandbox"
34-
security_group_id = "00000000-0000-0000-0000-000000000000"
29+
display_name = "example_environment_settings"
30+
location = "europe"
31+
environment_type = "Sandbox"
32+
dataverse = {
33+
language_code = "1033"
34+
currency_code = "USD"
35+
security_group_id = "00000000-0000-0000-0000-000000000000"
36+
}
3537
}
3638
3739
resource "powerplatform_environment_settings" "settings" {

docs/resources/managed_environment.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@ provider "powerplatform" {
2626
}
2727
2828
resource "powerplatform_environment" "development" {
29-
display_name = "example_managed_environment"
30-
location = "europe"
31-
language_code = "1033"
32-
currency_code = "USD"
33-
environment_type = "Sandbox"
34-
security_group_id = "00000000-0000-0000-0000-000000000000"
29+
display_name = "example_managed_environment"
30+
location = "europe"
31+
environment_type = "Sandbox"
32+
dataverse = {
33+
language_code = "1033"
34+
currency_code = "USD"
35+
security_group_id = "00000000-0000-0000-0000-000000000000"
36+
}
3537
}
3638
3739
resource "powerplatform_managed_environment" "managed_development" {

docs/resources/solution.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,14 @@ EOF
6161
}
6262
6363
resource "powerplatform_environment" "environment" {
64-
display_name = "Solution Import Test 1"
65-
location = "europe"
66-
language_code = "1033"
67-
currency_code = "USD"
68-
environment_type = "Sandbox"
69-
security_group_id = "00000000-0000-0000-0000-000000000000"
64+
display_name = "Solution Import Test 1"
65+
location = "europe"
66+
environment_type = "Sandbox"
67+
dataverse = {
68+
language_code = "1033"
69+
currency_code = "USD"
70+
security_group_id = "00000000-0000-0000-0000-000000000000"
71+
}
7072
}
7173
7274
resource "powerplatform_solution" "solution" {

docs/resources/user.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,14 @@ resource "azuread_user" "test_user" {
6363
}
6464
6565
resource "powerplatform_environment" "dataverse_user_example" {
66-
display_name = "user_example"
67-
location = "europe"
68-
language_code = "1033"
69-
currency_code = "USD"
70-
environment_type = "Sandbox"
71-
security_group_id = "00000000-0000-0000-0000-000000000000"
66+
display_name = "user_example"
67+
location = "europe"
68+
environment_type = "Sandbox"
69+
dataverse = {
70+
language_code = "1033"
71+
currency_code = "USD"
72+
security_group_id = "00000000-0000-0000-0000-000000000000"
73+
}
7274
}
7375
7476
resource "powerplatform_user" "new_user" {

examples/data-sources/powerplatform_environment_settings/datasource.tf

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ provider "powerplatform" {
1111
}
1212

1313
resource "powerplatform_environment" "example_environment_settings" {
14-
display_name = "example_environment_settings"
15-
location = "europe"
16-
language_code = "1033"
17-
currency_code = "USD"
18-
environment_type = "Sandbox"
19-
security_group_id = "00000000-0000-0000-0000-000000000000"
14+
display_name = "example_environment_settings"
15+
location = "europe"
16+
environment_type = "Sandbox"
17+
dataverse = {
18+
language_code = "1033"
19+
currency_code = "USD"
20+
security_group_id = "00000000-0000-0000-0000-000000000000"
21+
}
2022
}
2123

2224
data "powerplatform_environment_settings" "settings" {

examples/data-sources/powerplatform_securityroles/data-source.tf

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ provider "powerplatform" {
1111
}
1212

1313
resource "powerplatform_environment" "environment" {
14-
display_name = "datasource_security_roles_example"
15-
location = "europe"
16-
language_code = "1033"
17-
currency_code = "USD"
18-
environment_type = "Sandbox"
19-
security_group_id = "00000000-0000-0000-0000-000000000000"
14+
display_name = "datasource_security_roles_example"
15+
location = "europe"
16+
environment_type = "Sandbox"
17+
dataverse = {
18+
language_code = "1033"
19+
currency_code = "USD"
20+
security_group_id = "00000000-0000-0000-0000-000000000000"
21+
}
2022
}
2123

2224
data "powerplatform_security_roles" "all" {

examples/resources/powerplatform_environment/outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ output "id" {
1010

1111
output "url" {
1212
description = "URL of the environment"
13-
value = powerplatform_environment.development.url
13+
value = powerplatform_environment.development.dataverse.url
1414
}

0 commit comments

Comments
 (0)