Skip to content

Commit ef7a76e

Browse files
committed
Add LAB_APP_TENANT_ID support; wire up RequestMSIDLAB client ID for ADO
- lab_config.py: _get_credential() now reads LAB_APP_TENANT_ID env var (with fallback to Microsoft tenant 72f988bf-...) so ADO builds can override the tenant if needed. GH builds are unaffected since they don't set LAB_APP_TENANT_ID. - template-pipeline-stages.yml: pass LAB_APP_TENANT_ID to the test step alongside LAB_APP_CLIENT_ID and LAB_APP_CLIENT_CERT_PFX_PATH. LAB_APP_CLIENT_ID for ADO = f62c5ae3-bf3a-4af5-afa8-a68b800396e9 (RequestMSIDLAB) Verified locally: both msidlabs and id4skeyvault accessible with this ID + LabAuth cert.
1 parent c8662ac commit ef7a76e

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.Pipelines/template-pipeline-stages.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ stages:
189189
# The matching certificate is retrieved from Key Vault by the steps above.
190190
# When unset, all LabBasedTestCase tests skip gracefully.
191191
LAB_APP_CLIENT_ID: $(LAB_APP_CLIENT_ID)
192+
LAB_APP_TENANT_ID: $(LAB_APP_TENANT_ID)
192193
LAB_APP_CLIENT_CERT_PFX_PATH: $(LAB_APP_CLIENT_CERT_PFX_PATH)
193194
194195
- task: PublishTestResults@2

tests/lab_config.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,12 @@ def _get_credential():
194194
"""
195195
client_id = _clean_env("LAB_APP_CLIENT_ID")
196196
cert_path = _clean_env("LAB_APP_CLIENT_CERT_PFX_PATH")
197-
tenant_id = "72f988bf-86f1-41af-91ab-2d7cd011db47" # Microsoft tenant
197+
# Allow callers to override the tenant via LAB_APP_TENANT_ID.
198+
# Defaults to the Microsoft tenant where the MSID Lab app is registered.
199+
tenant_id = (
200+
_clean_env("LAB_APP_TENANT_ID")
201+
or "72f988bf-86f1-41af-91ab-2d7cd011db47" # Microsoft tenant
202+
)
198203

199204
if not client_id:
200205
raise EnvironmentError(

0 commit comments

Comments
 (0)