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
- In Azure portal, open the Artifact Signing account and complete **Identity validation**.
81
+
- This is required by the service and cannot be automated by Terraform.
82
+
- If the portal says you need **Artifact Signing Identity Verifier**, re-run Terraform (it assigns this role to the identity running `terraform apply` by default) and wait a few minutes for RBAC to propagate.
79
83
80
84
4) Copy the **Identity validation Id** from the portal and set it in Key Vault:
- create the AzureRM service connection using Workload Identity Federation (WIF)
118
124
- read the generated WIF Issuer/Subject and create the Entra federated credential
119
125
120
126
Notes:
127
+
- Artifact Signing identity validation remains **portal-only** even when Azure DevOps is Terraform-managed. Treat it as part of the "Deploy with Terraform" flow above (once completed, store the Id in Key Vault and the pipeline can create the certificate profile automatically).
121
128
- The `WorkloadIdentityFederation` auth scheme requires your org feature to be enabled. If your org can’t use it yet, set `ado_service_endpoint_authentication_scheme = "ServicePrincipal"` and also set `TF_VAR_ado_service_principal_client_secret` for the service principal secret.
122
129
- Terraform creates an empty repo. You still need to push this repo’s code into the Azure DevOps repo (Terraform will output the clone URL).
130
+
- Least privilege: by default this repo does **not** grant RG `Contributor` to the Azure DevOps service principal. If you want the pipeline to auto-create the certificate profile, set `assign_contributor_role_to_ado_sp = true`.
123
131
124
132
## Pipeline
125
133
@@ -144,8 +152,19 @@ Optional (only used when creating the certificate profile):
144
152
### Azure Key Vault for pipeline variables
145
153
146
154
Terraform creates a Key Vault by default and wires RBAC so:
147
-
- your current identity can set secrets
148
-
- the Azure DevOps service principal can read secrets
155
+
- your current identity (the identity running `terraform apply`) can set secrets (`Key Vault Secrets Officer`)
156
+
- the Azure DevOps service principal can read secrets (`Key Vault Secrets User`)
157
+
158
+
> This Key Vault is **RBAC-enabled** (`rbac_authorization_enabled = true`). You will see access under **Key Vault → Access control (IAM)** (not under “Access policies”).
159
+
160
+
Least privilege options:
161
+
- Set `keyvault_populate_secrets = false` if you do not want Terraform to write secrets into Key Vault (you can manage secrets yourself and/or set pipeline variables another way).
162
+
- The pipeline does not attempt to self-assign RBAC by default (it only does if `pipeline_attempt_rbac_assignment = true`).
163
+
- If you want to view **Keys** and/or **Certificates** in the Azure portal, opt in to RBAC for your current identity:
error_message="When ado_enabled=true you must set ado_org_service_url to a real org URL like https://dev.azure.com/your-org (not REPLACE_ME)."
107
+
error_message="When ado_enabled=true set ado_org_service_url to a real org URL like https://dev.azure.com/your-org (not REPLACE_ME), or leave it null/empty and set env var AZDO_ORG_SERVICE_URL."
description="If true, assigns 'Artifact Signing Certificate Profile Signer' to the Azure DevOps service principal at the Code Signing ACCOUNT scope. This is broader than profile-scope; prefer false for least privilege."
description="If true, assigns 'Artifact Signing Identity Verifier' on the Artifact Signing account to the identity running terraform apply. Required to complete identity validation in the Azure portal."
247
+
default=true
248
+
}
249
+
235
250
variable"assign_contributor_role_to_ado_sp" {
236
251
type=bool
237
252
description="If true, assigns Contributor at the resource group scope to the Azure DevOps service principal. Required if you want the pipeline to create the certificate profile (so you don't need a second terraform apply)."
238
-
default=true
253
+
default=false
254
+
}
255
+
256
+
variable"pipeline_attempt_rbac_assignment" {
257
+
type=bool
258
+
description="If true, Terraform passes the ADO service principal object id to the pipeline so it can attempt az role assignment create. Prefer false for least privilege (do RBAC in Terraform instead)."
description="If true, Terraform writes the artifactSigning* secrets into Key Vault during apply (requires data-plane RBAC on the vault). Set false for least privilege if you prefer managing secrets outside Terraform."
271
+
default=true
272
+
}
273
+
274
+
variable"keyvault_grant_keys_access_to_current" {
275
+
type=bool
276
+
description="If true, grants the identity running terraform apply permission to view/use Key Vault Keys via RBAC (assigns 'Key Vault Crypto User'). Default false (least privilege)."
description="If true, grants the identity running terraform apply full Key Vault administration rights via RBAC (assigns 'Key Vault Administrator'). Broad; prefer the narrower key/cert toggles when possible. Default false."
289
+
default=false
290
+
}
291
+
247
292
variable"keyvault_name" {
248
293
type=string
249
294
description="Optional Key Vault name override (globally unique, 3-24 chars, alphanumeric). If null/empty and keyvault_enabled=true, Terraform generates a name."
0 commit comments