I was struggling with this for the past 2 days and found that terraform version was outdated on my system. All I did was upgraded to the latest version (terrform init -upgrade) - guess what, it just worked man!
ObjectID is null
Kaushalendra Kumar
106
Reputation points
I have been struggling with the below error for quite some time. I haven't been able to find any solution on how to fix this. There are only discussion available on this topic why this being caused but no solution on how to fix this. May be someone here can help me with the solution on this platform. This below error comes when I try to deploy/fetch data from terraform of Azure Key vault.
╷
│ Error: expected "access_policy.0.object_id" to be a valid UUID, got
│
│ with module.main_kv_001.azurerm_key_vault.vault,
│ on ../../XXXXX/shared/keyvault/main.tf line 28, in resource "azurerm_key_vault" "vault":
│ 28: object_id = data.azurerm_client_config.current.object_id
│
╵
Releasing state lock. This may take a few moments...
kaus3778@AAD-4MLD9K3:/mnt/c/projects/XXXXX/scaffold$
Here is my configuration-
kaus3778@AAD-4MLD9K3:/mnt/c/projects/XXXXXX/scaffold$ az account show --query "{subscriptionId:id, tenantId:tenantId,objectId:objectId}"
{
"objectId": null,
"subscriptionId": "XXXXXXXXXX",
"tenantId": "XXXXXXXXXX"
}
kaus3778@AAD-4MLD9K3:/mnt/c/projects/XXXXXX/scaffold$
kaus3778@AAD-4MLD9K3:/mnt/c/projects/XXXXXX/scaffold$ az version
{
"azure-cli": "2.42.0",
"azure-cli-core": "2.42.0",
"azure-cli-telemetry": "1.0.8",
"extensions": {
"account": "0.2.3"
}
}
kaus3778@AAD-4MLD9K3:/mnt/c/projects/XXXXXX/scaffold$
kaus3778@AAD-4MLD9K3:/mnt/c/projects/XXXXXX/scaffold$ terraform -v
Terraform v1.3.5
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.4.0
+ provider registry.terraform.io/hashicorp/local v2.2.3
kaus3778@AAD-4MLD9K3:/mnt/c/projects/XXXXXX/scaffold$