terraform-provider-azuread
terraform-provider-azuread copied to clipboard
[WIP] Add support Extension properties
Hi
Please find a PR which address https://github.com/hashicorp/terraform-provider-azuread/issues/737
Actually I'm stuck with the acceptance test which return an error about delta in state after import
Here the logs
2022/05/20 13:19:09 [DEBUG] Importing Resource - parsing "f897af1f-6780-4fd3-808c-5ab9f35c97c6/extensionProperty/b6415c1f-1a26-4a2b-a6fa-d2033768d25d"
2022/05/20 13:19:09 [DEBUG] ============================ Begin AzureAD Request ============================
Request ID: 0ab96d16-1722-485a-fb2d-86b3e70dde15
GET /beta/XXXXXXXXXXXXXXXXXXXXXX/applications/f897af1f-6780-4fd3-808c-5ab9f35c97c6/extensionProperties?%24filter=id+eq+%27b6415c1f-1a26-4a2b-a6fa-d2033768d25d%27 HTTP/1.1
Host: graph.microsoft.com
User-Agent: HashiCorp Terraform/1.2.0 (+https://www.terraform.io) Terraform Plugin SDK/2.10.1 terraform-provider-azuread/acc Hamilton (Go-http-client/1.1) pid-222c6c49-1b0a-5959-a213-6608f9eb8820
Accept: application/json; charset=utf-8; IEEE754Compatible=false
Content-Type: application/json; charset=utf-8
Odata-Maxversion: 4.0
Odata-Version: 4.0
Accept-Encoding: gzip
============================= End AzureAD Request =============================
2022/05/20 13:19:10 [DEBUG] ============================ Begin AzureAD Response ===========================
GET https://graph.microsoft.com/beta/XXXXXXXXXXXXXXXXXXXXXX/applications/f897af1f-6780-4fd3-808c-5ab9f35c97c6/extensionProperties?%24filter=id+eq+%27b6415c1f-1a26-4a2b-a6fa-d2033768d25d%27
Request ID: 0ab96d16-1722-485a-fb2d-86b3e70dde15
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Cache-Control: no-cache
Client-Request-Id: 10f36b6e-2e61-43b8-955d-0cacac6ac3fc
Content-Type: application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8
Date: Fri, 20 May 2022 13:19:09 GMT
Odata-Version: 4.0
Request-Id: 10f36b6e-2e61-43b8-955d-0cacac6ac3fc
Strict-Transport-Security: max-age=31536000
Vary: Accept-Encoding
X-Ms-Ags-Diagnostic: {"ServerInfo":{"DataCenter":"North Europe","Slice":"E","Ring":"4","ScaleUnit":"001","RoleInstance":"DU2PEPF000118A0"}}
X-Ms-Resource-Unit: 1
1c6
{"@odata.context":"https://graph.microsoft.com/beta/$metadata#applications('f897af1f-6780-4fd3-808c-5ab9f35c97c6')/extensionProperties","value":[{"id":"b6415c1f-1a26-4a2b-a6fa-d2033768d25d","deletedDateTime":null,"appDisplayName":"acctest-APP-220520131858937372","name":"extension_cdcad7ea4d3f46169132826e9a3ba3e3_acctest_APP_complete_220520131858937372","dataType":"String","isMultiValued":null,"isSyncedFromOnPremises":false,"targetObjects":["User"]}]}
0
============================= End AzureAD Response ============================
2022-05-20T13:19:10.122Z [DEBUG] sdk.helper_resource: Stopping providers: test_name=TestAccApplicationExtensionProperty_complete test_step_number=2 test_terraform_path=/usr/local/bin/terraform test_working_directory=/tmp/plugintest1032555577
2022-05-20T13:19:10.123Z [DEBUG] sdk.helper_resource: Creating sdkv2 provider instance: test_name=TestAccApplicationExtensionProperty_complete test_step_number=2 test_terraform_path=/usr/local/bin/terraform test_working_directory=/tmp/plugintest1032555577 tf_provider_addr=registry.terraform.io/hashicorp/azuread
2022-05-20T13:19:10.123Z [DEBUG] sdk.helper_resource: Created sdkv2 provider instance: test_name=TestAccApplicationExtensionProperty_complete test_step_number=2 test_terraform_path=/usr/local/bin/terraform test_working_directory=/tmp/plugintest1032555577 tf_provider_addr=registry.terraform.io/hashicorp/azuread
2022-05-20T13:19:10.123Z [DEBUG] sdk.helper_resource: Starting sdkv2 provider instance server: test_name=TestAccApplicationExtensionProperty_complete test_step_number=2 test_terraform_path=/usr/local/bin/terraform test_working_directory=/tmp/plugintest1032555577 tf_provider_addr=registry.terraform.io/hashicorp/azuread
2022-05-20T13:19:10.123Z [DEBUG] sdk.helper_resource: Started sdkv2 provider instance server: test_name=TestAccApplicationExtensionProperty_complete test_step_number=2 test_terraform_path=/usr/local/bin/terraform test_working_directory=/tmp/plugintest1032555577 tf_provider_addr=registry.terraform.io/hashicorp/azuread
2022-05-20T13:19:10.190Z [DEBUG] sdk.helper_resource: Stopping providers: test_name=TestAccApplicationExtensionProperty_complete test_step_number=2 test_terraform_path=/usr/local/bin/terraform test_working_directory=/tmp/plugintest1032555577
testcase.go:60: ImportStateVerify attributes not equivalent. Difference is shown below. Top is actual, bottom is expected.
(map[string]string) {
}
(map[string]string) (len=1) {
(string) (len=14) "application_id": (string) (len=36) "f897af1f-6780-4fd3-808c-5ab9f35c97c6"
}
2022-05-20T13:19:10.191Z [DEBUG] sdk.helper_resource: Creating sdkv2 provider instance: test_name=TestAccApplicationExtensionProperty_complete test_step_number=2 test_terraform_path=/usr/local/bin/terraform test_working_directory=/tmp/plugintest1032555577 tf_provider_addr=registry.terraform.io/hashicorp/azuread
Any help is welcome ^^'
@phenixdotnet It seems your implementation forgot to write the application_id
of resources to be imported...; am I answering your concern?