Skip to content

Migrate dn-bot-dnceng-workitems-rw to Managed Identity (WI 10135)#6480

Open
missymessa wants to merge 9 commits intomainfrom
migrate-dn-bot-dnceng-workitems-rw-to-mi
Open

Migrate dn-bot-dnceng-workitems-rw to Managed Identity (WI 10135)#6480
missymessa wants to merge 9 commits intomainfrom
migrate-dn-bot-dnceng-workitems-rw-to-mi

Conversation

@missymessa
Copy link
Copy Markdown
Member

Summary

Migrate the \dn-bot-dnceng-workitems-rw\ PAT (work_write scope, dnceng org) to Managed Identity in DotNet.Status.Web. The \AzureDevOpsClient\ shared library already supports MI auth via \ManagedIdentityClientId\ — this is a config-only change.

Changes (4 files)

  • settings.json: Remove [vault(dn-bot-dnceng-workitems-rw)]\ from \AzureDevOps:dnceng\ section
  • settings.Production.json: Add \AzureDevOps:dnceng:ManagedIdentityClientId\ → \d2580e46-e758-4778-a864-18f909438b45\
  • settings.Staging.json: Add \AzureDevOps:dnceng:ManagedIdentityClientId\ → \�9d81917-4c98-44cc-8a6e-601311ac3c07\
  • dotneteng-status-secrets.yaml: Remove \dn-bot-dnceng-workitems-rw\ vault entry

How it works

The \AzureDevOpsClient\ constructor (in src/Telemetry/AzureDevOpsClient/) already has MI support:

  1. If \AccessToken\ is set → PAT Basic auth (existing behavior)
  2. If \ManagedIdentityClientId\ is set → \ManagedIdentityCredential\ bearer token for \499b84ac-.../default\

By removing the vault reference and adding per-env MI client IDs, the client will automatically use MI auth in staging/production.

Related: AB#10135

missymessa and others added 4 commits March 18, 2026 09:07
The AzureDevOpsClient shared library already supports MI auth via
ManagedIdentityClientId. This change is config-only:

- settings.json: Remove [vault(dn-bot-dnceng-workitems-rw)] from AzureDevOps:dnceng
- settings.Production.json: Add AzureDevOps:dnceng:ManagedIdentityClientId (d2580e46-...)
- settings.Staging.json: Add AzureDevOps:dnceng:ManagedIdentityClientId (e9d81917-...)
- dotneteng-status-secrets.yaml: Remove dn-bot-dnceng-workitems-rw vault entry

The AzureDevOpsClient constructor already:
1. Prefers AccessToken (PAT) if present
2. Falls back to ManagedIdentityCredential if ManagedIdentityClientId is set
3. Uses the AzDO resource scope (499b84ac-.../default) for bearer tokens
1. Remove leftover comment from dotneteng-status-secrets.yaml (garath)
2. Replace wrong helix-cluster MI client IDs with UseManagedIdentity flag
   - Production and Staging settings now use 'UseManagedIdentity: true'
   - System-assigned MIs don't need a client ID (garath)
3. Add UseManagedIdentity bool to AzureDevOpsClientOptions
   - When true without ManagedIdentityClientId: system-assigned MI
   - When true with ManagedIdentityClientId: user-assigned MI
4. Split bearer auth test into user-assigned and system-assigned cases
5. Remove placeholder client IDs from post-deployment tests
garath
garath previously approved these changes Mar 30, 2026
The AzureDevOpsTimeline class implemented IServiceImplementation from
Microsoft.DotNet.ServiceFabric.ServiceHost, which ships as an x64-only
assembly. This caused FileNotFoundException / BadImageFormatException on
ARM64 machines (and potentially in CI if pool architecture changed).

Extract the business logic into AzureDevOpsTimelineProcessor (no SF
dependency) and reduce AzureDevOpsTimeline to a thin Service Fabric
wrapper. Tests now target the processor directly and no longer trigger
the ServiceHost assembly load.

All 11 AzureDevOpsTimeline tests now pass on both ARM64 and x64.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants