Open digorgonzola opened 5 months ago
I face the same issue. Creating the variable group by hand on AzureDevops portal doesn't seem to work either. @digorgonzola, is creating the very same variable group through the portal is working on your side?
FYI: I opened an issue on developer community as well
@digorgonzola, I made it work. The issue on my side was that my keyvault is behind private endpoint but Azure DevOps tries to list the secret from its public IP. I whitelisted Azure Devops public IP on keyvault firewall and it works like a charm!
We do face the same issue in a similar configuration. The same error message is generated 'Failed to generate an OIDC token' while trying to update a variable group backed by a key vault. The error is generated when the devops provider uses a service principal secret authentication. It works and update the group if we switch to PAT authentication.
Creating a var group manually with the involved service connection works without any warning.
Our devops organization is not connected to the same tenant than our azure key vault. When using the service principal secret auth, the service principal belongs to the devops org's AD and has not permission on the target azure subscription.
@digorgonzola, I made it work. The issue on my side was that my keyvault is behind private endpoint but Azure DevOps tries to list the secret from its public IP. I whitelisted Azure Devops public IP on keyvault firewall and it works like a charm!
I think this might be a red herring @gregbaleyy
We do not restrict access to the keyvault and it still fails...
Community Note
Terraform (and Azure DevOps Provider) Version
Terraform v1.8.5 AzureDevops provider v1.1.1
Affected Resource(s)
azuredevops_variable_group
Terraform Configuration Files
Debug Output
debug logs
Panic Output
Expected Behavior
The key vault linked variable is created
Actual Behavior
Terraform fails to create the resource with the following error:
Steps to Reproduce
terraform plan -out=tfplan
terraform apply tfplan
terraform apply
Important Factoids
Works perfectly fine if I use a PAT for the Azure Devops provider.
Provider config using managed identity:
References
0000