I have a terraform deployment which runs in azure pipeline. Azure pipelines is connected to Azure via a service connection. This service connection is registered as an application in the Azure AD of the Azure account. The problem I constantly run into is that I can't remember which id from the application should be granted keyvault access so the build pipeline can read and write to keyvault.
1 | resource "azurerm_key_vault_access_policy" "terraformaccess" { |
Maybe the value is in the portal somewhere:
)
Nope.
It seems to be findable by doing either
1 | Login-AzureRmAccount -SubscriptionId <your subscription id>; |
or
1 | az ad sp list --spn <the application id> |
Then look for ObjectId