You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for tokenless authentication for GitHub Actions configured with OpenID Connect with Azure User Managed Identity (or Service Principal) (#385)
## Changes
See
https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-cloud-providers
and
https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-azure
Technically, it should also work with Azure DevOps Workload Identity
Federation, once we figure out the environment variables:
https://techcommunity.microsoft.com/t5/azure-devops-blog/introduction-to-azure-devops-workload-identity-federation-oidc/ba-p/3908687
## Tests
setup:
```
resource "github_actions_environment_secret" "scope" {
for_each = github_repository_environment.default
repository = each.value.repository
environment = each.value.environment
secret_name = "ARM_CLIENT_ID"
# this value is not a secret as well
plaintext_value = data.azurerm_user_assigned_identity.scopes[local.project_scopes[each.key]].client_id
}
...
resource "azurerm_federated_identity_credential" "oidc" {
for_each = github_repository_environment.default
name = "${local.org}-${each.value.repository}-${each.value.environment}-oidc"
resource_group_name = local.resource_group_name
audience = ["api://AzureADTokenExchange"]
issuer = "https://token.actions.githubusercontent.com"
parent_id = data.azurerm_user_assigned_identity.scopes[local.project_scopes[each.key]].id
subject = "repo:${local.org}/${each.value.repository}:environment:${each.value.environment}"
}
...
resource "azurerm_user_assigned_identity" "scopes" {
for_each = local.scopes
name = "labs-${each.key}-identity"
resource_group_name = azurerm_resource_group.this.name
location = azurerm_resource_group.this.location
// ...
}
...
resource "databricks_service_principal" "scopes" {
provider = databricks.account
for_each = local.scopes
application_id = azurerm_user_assigned_identity.scopes[each.key].client_id
display_name = azurerm_user_assigned_identity.scopes[each.key].name
external_id = azurerm_user_assigned_identity.scopes[each.key].principal_id
}
```
result
<img width="603"
alt="_Experiment__Call_integration_tests_via_OIDC_·_databrickslabs_ucx_5a94b24"
src="https://github.com/databricks/databricks-sdk-py/assets/259697/33b08224-ceed-4c15-bfcd-32e0b58f8483">
- [ ] `make test` run locally
- [x] `make fmt` applied
- [ ] relevant integration tests applied
0 commit comments