Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Terraform script data.azurerm_client_config.current.object_id will return "" empty when upgrading az cli to 2.37.0 #430

Closed
3 tasks done
backwind1233 opened this issue Jul 11, 2022 · 2 comments
Assignees
Labels
azure-spring All azure-spring related issues azure-spring-samples Issues related to Spring Cloud Azure samples.
Milestone

Comments

@backwind1233
Copy link
Contributor

backwind1233 commented Jul 11, 2022

Describe the bug
Terraform script data.azurerm_client_config.current.object_id will return "" empty when upgrading az cli to 2.37.0 .
The same issue happened as the hashicorp/terraform-provider-azurerm#16982 described.

Exception or Stack Trace

╷
│ Error: expected "access_policy.0.object_id" to be a valid UUID, got 
│ 
│   with azurerm_key_vault.kv_account_02,
│   on main.tf line 112, in resource "azurerm_key_vault" "kv_account_02":
│  112:     object_id = data.azurerm_client_config.current.object_id

To Reproduce

  1. Make sure the version of Azure cli in local machine >= 2.37.0 .
  2. Follow the Readme to run property-source.

Code Snippet

Expected behavior
Running terraform scripts successfully.

Screenshots

Setup (please complete the following information):

Additional context

Information Checklist

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added
@backwind1233 backwind1233 added the azure-spring All azure-spring related issues label Jul 11, 2022
@backwind1233 backwind1233 changed the title [BUG] Fix terraform errror when upgrading azure cli to 2.38.0 [BUG] Fix terraform errror when upgrading azure cli to 2.37.0 Jul 11, 2022
@backwind1233 backwind1233 added this to the Backlog milestone Jul 11, 2022
@backwind1233
Copy link
Contributor Author

backwind1233 commented Jul 11, 2022

We can't just upgrade version of hashicorp/azurerm to 3.9.0 to fix this bug, there are api changes from 2.x.x to 3.x.x;
we need to update terraform scripts to make sure it works when upgrading azurerm to 3.9.0.

Here is the result of running terraform scripts with different hashicorp/azurerm versions:

Module Version
Az Cli version 2.38.0
terraform Version v1.2.4 on darwin_arm64
hashicorp/azurerm 3.9.0
service sample result Fixing Status
aad aad-resource-server-by-filter Not using azurerm
aad-resource-server-by-filter-stateless Not using azurerm
web-client-access-resource-server Not using azurerm
appconfiguration appconfiguration-client success
cache spring-cloud-azure-sample-cache success
cosmos spring-cloud-azure-cosmos-sample success
spring-cloud-azure-data-cosmos-sample success
cosmos-multi-database-multi-account failed due to ipv6
cosmos-multi-database-single-account success
eventhubs spring-cloud-azure-sample-eventhubs-kafka success
eventhubs-client success
eventhubs-integration fail Fixed
eventhubs-binder fail Fixed
eventhubs-multibinders fail Fixed
keyvault property-source fail False alarm
secret-client success
servicebus multiple-namespaces success
single-namespace success False alarm
servicebus-jms-queue success
servicebus-jms-topic success
servicebus-multibinders success
servicebus-queue-binder success
servicebus-queue-binder-arm success
servicebus-topic-binder success
spring-native storage-blob-native fail Fixed
spring-petclinic-microservices spring-petclinic-microservices success
storage storage-queue-integration success
storage-queue-operation success
storage-blob-sample fail Fixed
storage-queue-client fail False alarm

Module Version
Az Cli version 2.38.0
terraform Version v1.2.4 on darwin_arm64
hashicorp/azurerm 2.99.0
service sample result
cache spring-cloud-azure-sample-cache success
eventhubs spring-cloud-azure-sample-eventhubs-kafka success
eventhubs-client fail
eventhubs-integration fail
eventhubs-binder fail
eventhubs-multibinders fail
keyvault property-source fail
secret-client fail
servicebus multiple-namespaces fail
single-namespace fail
servicebus-jms-queue success
servicebus-jms-topic success
servicebus-multibinders fail
servicebus-queue-binder fail
servicebus-queue-binder-arm success
servicebus-topic-binder fail
storage storage-queue-integration fail
storage-blob-sample fail
storage-queue-client fail
storage-queue-operation fail

There are many failures here, we need to fix this issue.

@backwind1233 backwind1233 changed the title [BUG] Fix terraform errror when upgrading azure cli to 2.37.0 [BUG] Terraform script data.azurerm_client_config.current.object_id will return "" empty when upgrading az cli to 2.37.0 Jul 11, 2022
@saragluna saragluna self-assigned this Jul 13, 2022
@saragluna saragluna added the azure-spring-samples Issues related to Spring Cloud Azure samples. label Jul 13, 2022
@saragluna
Copy link
Contributor

Fixed in #435.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
azure-spring All azure-spring related issues azure-spring-samples Issues related to Spring Cloud Azure samples.
Projects
None yet
Development

No branches or pull requests

2 participants