# Azure DevOps Service Connection - Troubleshooting ## 🔴 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:** ```bash 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:** ```bash # Login bij Azure az login # Maak Service Principal aan az ad sp create-for-rbac --name "zuyderland-cmdb-acr-sp" \ --role acrpush \ --scopes /subscriptions//resourceGroups//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:** ```bash # 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 ```bash # 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 ```bash # 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//resourceGroups//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 - [Azure DevOps Service Connections Troubleshooting](https://learn.microsoft.com/en-us/azure/devops/pipelines/library/service-endpoints) - [ACR Access Control](https://learn.microsoft.com/en-us/azure/container-registry/container-registry-authentication) - [Service Principal Permissions](https://learn.microsoft.com/en-us/azure/container-registry/container-registry-roles) --- ## 🆘 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.