Files
cmdb-insight/docs/AZURE-SERVICE-CONNECTION-TROUBLESHOOTING.md
Bert Hausmans 73660cdf66 Fix TypeScript compilation errors in frontend components
- Remove unused variables in ApplicationInfo, ArchitectureDebugPage
- Fix type errors in Dashboard, GovernanceAnalysis, GovernanceModelHelper (PageHeader description prop)
- Add null checks and explicit types in DataValidationDashboard
- Fix ObjectDetailModal type errors for _jiraCreatedAt and Date constructor
- Remove unused imports and variables in SchemaConfigurationSettings
- Update PageHeader to accept string | ReactNode for description prop
2026-01-21 23:19:06 +01:00

8.6 KiB

Azure DevOps Service Connection - Troubleshooting

🔴 Probleem: "Could not fetch access token for Managed Service Principal" (MSI Error)

Error Message:

Could not fetch access token for Managed Service Principal. 
Please configure Managed Service Identity (MSI) for virtual machine

Oorzaak: De service connection is geconfigureerd om Managed Service Identity (MSI) te gebruiken, maar dit werkt niet met Azure DevOps Services (cloud). MSI werkt alleen met Azure DevOps Server (on-premises) met Managed Identity geconfigureerd.

Oplossing: Herconfigureer Service Connection met Service Principal

Stap 1: Verwijder Bestaande Service Connection

  1. Ga naar Azure DevOpsProject SettingsService connections
  2. Zoek de service connection: zuyderland-cmdb-acr-connection
  3. Klik op ... (three dots) → Delete
  4. Bevestig verwijdering

Stap 2: Maak Nieuwe Service Connection met Service Principal

  1. Project SettingsService connectionsNew service connection
  2. Kies "Docker Registry"
  3. Kies "Azure Container Registry"
  4. Belangrijk: Selecteer "Service Principal" als Authentication type (NIET Managed Identity!)
  5. Vul in:
    • Azure subscription: Selecteer je subscription
    • Azure container registry: Selecteer je ACR (zdlasacr)
    • Service connection name: zuyderland-cmdb-acr-connection
  6. Klik "Save" (of "Verify and save")

Dit zou nu moeten werken!

Alternatief: Gebruik "Others" Optie met Admin Credentials

Als de Azure Container Registry optie nog steeds problemen geeft:

  1. Kies "Docker Registry" → "Others"

  2. Vul handmatig in:

    • Docker Registry: zdlasacr.azurecr.io
    • Docker ID: (ACR admin username)
    • Docker Password: (ACR admin password)
  3. Haal ACR admin credentials op:

    az acr credential show --name zdlasacr
    

    Gebruik username en passwords[0].value uit de output.

  4. Service connection name: zuyderland-cmdb-acr-connection

  5. Save


🔴 Probleem: "Loading Registries..." blijft hangen

Als de Azure Container Registry dropdown blijft laden zonder resultaten, probeer deze oplossingen:


Oplossing 1: Check Subscription Toegang

Probleem: Je hebt mogelijk geen toegang tot de subscription waar de ACR staat.

Oplossing:

  1. Check in Azure Portal:

    • Ga naar je Container Registry (zdlas)
    • Klik op "Access control (IAM)"
    • Check of je de juiste rol hebt (bijv. Owner, Contributor, of AcrPush)
  2. Check Subscription:

    • Ga naar je Azure Subscription
    • Klik op "Access control (IAM)"
    • Check of je toegang hebt tot de subscription
  3. Probeer opnieuw:

    • Ga terug naar Azure DevOps
    • Selecteer de juiste subscription
    • Wacht even (kan 10-30 seconden duren)

Oplossing 2: Refresh/Herlaad de Pagina

Soms helpt een simpele refresh:

  1. Refresh de browser pagina (F5 of Cmd+R)
  2. Of sluit en open opnieuw de service connection wizard
  3. Probeer opnieuw de registry te selecteren

Oplossing 3: Check Resource Group Locatie

Probleem: Soms laadt Azure DevOps alleen registries in bepaalde regio's.

Oplossing:

  1. Check waar je ACR staat:

    az acr show --name zdlas --query location -o tsv
    
  2. Check of de subscription toegang heeft tot die regio

  3. Probeer handmatig de registry naam in te vullen (zie Oplossing 4)


Oplossing 4: Handmatig Registry Naam Invoeren

Als de dropdown niet werkt, kun je handmatig de registry naam invoeren:

  1. In de service connection wizard:

    • Laat de dropdown leeg (of selecteer "Enter value manually")
    • Typ handmatig: zdlas
    • Of de volledige naam: zdlas.azurecr.io
  2. Save en test

Let op: Soms accepteert Azure DevOps alleen de registry naam zonder .azurecr.io


Oplossing 5: Check Service Principal Permissions

Probleem: De Service Principal die Azure DevOps probeert aan te maken heeft mogelijk niet de juiste permissions.

Oplossing:

  1. Maak handmatig een Service Principal aan:

    # Login bij Azure
    az login
    
    # Maak Service Principal aan
    az ad sp create-for-rbac --name "zuyderland-cmdb-acr-sp" \
      --role acrpush \
      --scopes /subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.ContainerRegistry/registries/zdlas
    
  2. Gebruik deze credentials in Azure DevOps:

    • Kies "Docker Registry" → "Others"
    • Vul in:
      • Registry URL: zdlas.azurecr.io
      • Username: (van de Service Principal output)
      • Password: (van de Service Principal output)

Oplossing 6: Gebruik "Others" in plaats van "Azure Container Registry"

Als de Azure Container Registry optie niet werkt, gebruik dan "Others":

  1. In de service connection wizard:

    • Kies "Docker Registry"
    • Kies "Others" (in plaats van "Azure Container Registry")
  2. Vul handmatig in:

    • Docker Registry: zdlas.azurecr.io
    • Docker ID: (leeg laten of je ACR admin username)
    • Docker Password: (je ACR admin password)
  3. Haal ACR credentials op:

    # Login bij Azure
    az login
    
    # Haal admin credentials op
    az acr credential show --name zdlas
    

    Gebruik de username en passwords[0].value uit de output.

  4. Save en test

⚠️ Let op: Met "Others" moet je handmatig credentials beheren. Service Principal is veiliger, maar dit werkt als tijdelijke oplossing.


Oplossing 7: Check Browser/Network

Probleem: Browser of network issues kunnen de dropdown blokkeren.

Oplossingen:

  1. Probeer een andere browser (Chrome, Firefox, Edge)
  2. Disable browser extensions (ad blockers, etc.)
  3. Check network connectivity naar Azure
  4. Probeer incognito/private mode

Oplossing 8: Wacht Even en Probeer Later

Soms is het een tijdelijk Azure issue:

  1. Wacht 5-10 minuten
  2. Probeer opnieuw
  3. Check Azure Status: https://status.azure.com/

🔍 Diagnose Stappen

Om te diagnosticeren wat het probleem is:

1. Check ACR Bestaat en is Toegankelijk

# Login bij Azure
az login

# Check of ACR bestaat
az acr show --name zdlas

# Check ACR credentials
az acr credential show --name zdlas

# Check ACR permissions
az acr show --name zdlas --query "networkRuleSet" -o table

2. Check Azure DevOps Subscription Toegang

  1. Ga naar Azure Portal
  2. Ga naar je Subscription
  3. Check "Access control (IAM)"
  4. Check of je account toegang heeft

3. Check Service Principal Permissions

# List Service Principals
az ad sp list --display-name "zuyderland-cmdb-acr-sp" -o table

# Check permissions op ACR
az role assignment list --scope /subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.ContainerRegistry/registries/zdlas

💡 Aanbevolen Aanpak

Probeer in deze volgorde:

  1. Refresh de pagina (Oplossing 2)
  2. Check subscription toegang (Oplossing 1)
  3. Handmatig registry naam invoeren (Oplossing 4)
  4. Gebruik "Others" optie (Oplossing 6) - als tijdelijke oplossing
  5. Maak handmatig Service Principal (Oplossing 5) - voor permanente oplossing

🎯 Quick Fix (Aanbevolen)

Als de dropdown niet werkt, gebruik deze workaround:

  1. Kies "Docker Registry" → "Others"
  2. Vul in:
    • Registry URL: zdlas.azurecr.io
    • Username: (haal op met az acr credential show --name zdlas)
    • Password: (haal op met az acr credential show --name zdlas)
  3. Service connection name: zuyderland-cmdb-acr-connection
  4. Save

Dit werkt altijd, ook als de Azure Container Registry optie niet werkt.

Later kun je:

  • De service connection verwijderen
  • Opnieuw aanmaken met "Azure Container Registry" optie (als die dan wel werkt)
  • Of de "Others" optie behouden (werkt ook prima)

📚 Meer Informatie


🆘 Nog Steeds Problemen?

Als niets werkt:

  1. Check Azure DevOps logs (als je toegang hebt)
  2. Contact Azure Support (als je een support plan hebt)
  3. Gebruik "Others" optie als workaround (werkt altijd)

De "Others" optie is een volledig werkende oplossing, alleen iets minder geautomatiseerd dan de Azure Container Registry optie.