Files
cmdb-insight/docs/NEXT-STEPS-ACR-CREATED.md
Bert Hausmans 55c8fee3b8 Add Azure Container Registry setup and documentation
- Configure ACR name: zdlas in azure-pipelines.yml
- Add Azure Container Registry documentation and guides
- Add scripts for ACR creation and image building
- Add docker-compose config for ACR deployment
- Remove temporary Excel lock file
2026-01-14 12:25:25 +01:00

8.1 KiB

Next Steps - ACR Created! 🎉

Je Azure Container Registry is aangemaakt! Volg deze stappen om Docker images automatisch te bouwen en te pushen.

📋 Checklist

  • Stap 1: Verifieer ACR naam
  • Stap 2: Update pipeline variabelen (als nodig)
  • Stap 3: Service Connection aanmaken in Azure DevOps
  • Stap 4: Pipeline aanmaken en runnen
  • Stap 5: Verifieer images in ACR

🔍 Stap 1: Verifieer ACR Naam

Vind je ACR naam:

Via Azure Portal:

  1. Ga naar je Container Registry
  2. Klik op "Overview"
  3. Noteer de "Login server" (bijv. zuyderlandcmdbacr.azurecr.io)
  4. De naam vóór .azurecr.io is je ACR naam (bijv. zuyderlandcmdbacr)

Via Azure CLI:

az acr list --query "[].{Name:name, LoginServer:loginServer}" -o table

Noteer je ACR naam! (bijv. zuyderlandcmdbacr)


🔧 Stap 2: Update Pipeline Variabelen

Check of azure-pipelines.yml de juiste ACR naam heeft:

  1. Open azure-pipelines.yml

  2. Controleer regel 17:

    acrName: 'zuyderlandcmdbacr'  # ← Pas aan naar jouw ACR naam
    
  3. Als je ACR naam anders is, pas het aan:

    acrName: 'jouw-acr-naam-hier'
    
  4. Commit en push (als je het hebt aangepast):

    git add azure-pipelines.yml
    git commit -m "Update ACR name in pipeline"
    git push origin main
    

Als de naam al klopt, ga door naar Stap 3!


🔗 Stap 3: Service Connection Aanmaken in Azure DevOps

Deze connection geeft Azure DevOps toegang tot je ACR.

Stappen:

  1. Ga naar je Azure DevOps project

    • Open je project in Azure DevOps
  2. Ga naar Project Settings

    • Klik op ⚙️ Project Settings (onderaan links in het menu)
  3. Open Service Connections

    • Scroll naar "Pipelines" sectie
    • Klik op "Service connections"
  4. Maak nieuwe connection

    • Klik op "New service connection" (of "Create service connection")
    • Kies "Docker Registry"
    • Klik "Next"
  5. Selecteer Azure Container Registry

    • Kies "Azure Container Registry"
    • Klik "Next"
  6. Configureer connection

    • Azure subscription: Selecteer je Azure subscription
    • Azure container registry: Selecteer je ACR uit de dropdown (bijv. zuyderlandcmdbacr)
    • Service connection name: zuyderland-cmdb-acr-connection
      • ⚠️ Belangrijk: Deze naam moet overeenkomen met dockerRegistryServiceConnection in azure-pipelines.yml!
    • Description: Optioneel (bijv. "ACR for CMDB GUI production")
  7. Save

    • Klik "Save" (of "Verify and save")
    • Azure DevOps test automatisch de connection

Service connection is aangemaakt!

Troubleshooting:

  • Als je ACR niet ziet in de dropdown, check of je de juiste subscription hebt geselecteerd
  • Als verificatie faalt, check of je toegang hebt tot de ACR in Azure Portal

🎯 Stap 4: Pipeline Aanmaken en Run

Stappen:

  1. Ga naar Pipelines

    • Klik op "Pipelines" (links in het menu)
  2. Create New Pipeline

    • Klik op "New pipeline" of "Create Pipeline"
  3. Selecteer Repository

    • Kies "Azure Repos Git" (of waar je code staat)
    • Selecteer je repository: "Zuyderland CMDB GUI" (of jouw repo naam)
  4. Kies YAML File

    • Kies "Existing Azure Pipelines YAML file"
    • Selecteer:
      • Branch: main (of jouw default branch)
      • Path: /azure-pipelines.yml
  5. Review Configuration

    • Azure DevOps toont de pipeline configuratie
    • Controleer of alles klopt
  6. Run Pipeline

    • Klik "Run" om de pipeline te starten
    • De pipeline start automatisch met het bouwen van de images

Pipeline is gestart!

Wat gebeurt er nu?

De pipeline zal:

  1. Code uitchecken
  2. Backend Docker image bouwen
  3. Frontend Docker image bouwen
  4. Images naar Azure Container Registry pushen

Verwachte tijd: ~5-10 minuten (afhankelijk van build tijd)


Stap 5: Verifieer Images in ACR

In Azure Portal:

  1. Ga naar je Container Registry

    • Open Azure Portal
    • Ga naar je Container Registry (zuyderlandcmdbacr)
  2. Bekijk Repositories

    • Klik op "Repositories" (links in het menu)
    • Je zou moeten zien:
      • zuyderland-cmdb-gui/backend
      • zuyderland-cmdb-gui/frontend
  3. Bekijk Tags

    • Klik op een repository (bijv. zuyderland-cmdb-gui/backend)
    • Je zou tags moeten zien:
      • latest
      • 123 (of build ID nummer)

Images zijn succesvol gebouwd en gepusht!

Via Azure CLI:

# Lijst repositories
az acr repository list --name zuyderlandcmdbacr

# Lijst tags voor backend
az acr repository show-tags --name zuyderlandcmdbacr --repository zuyderland-cmdb-gui/backend --orderby time_desc

# Lijst tags voor frontend
az acr repository show-tags --name zuyderlandcmdbacr --repository zuyderland-cmdb-gui/frontend --orderby time_desc

In Azure DevOps:

  1. Ga naar je Pipeline

    • Klik op "Pipelines"
    • Klik op je pipeline run
  2. Bekijk Logs

    • Klik op een job (bijv. "Build Docker Images")
    • Bekijk de logs per stap
    • Bij success zie je:
      Backend Image: zuyderlandcmdbacr.azurecr.io/zuyderland-cmdb-gui/backend:123
      Frontend Image: zuyderlandcmdbacr.azurecr.io/zuyderland-cmdb-gui/frontend:123
      

🚨 Troubleshooting

Pipeline Fails: "Service connection not found"

Oplossing:

  • Controleer of de service connection naam in azure-pipelines.yml (regel 19) overeenkomt met de naam in Azure DevOps
  • Ga naar Project Settings → Service connections en verifieer de naam
  • Pas dockerRegistryServiceConnection aan in azure-pipelines.yml als nodig

Pipeline Fails: "ACR not found"

Oplossing:

  • Controleer of de acrName variabele correct is in azure-pipelines.yml (regel 17)
  • Verifieer dat de ACR bestaat: az acr list
  • Check of je de juiste subscription hebt geselecteerd in de service connection

Pipeline Fails: "Permission denied"

Oplossing:

  • Controleer of de service connection de juiste permissions heeft
  • Verifieer dat je Azure subscription toegang heeft tot de ACR
  • Check of de service connection is geverifieerd (groen vinkje in Azure DevOps)
  • Probeer de service connection opnieuw aan te maken

Images worden niet gepusht

Oplossing:

  • Check de pipeline logs voor specifieke errors
  • Verifieer dat de Docker build succesvol is
  • Controleer of de ACR admin-enabled is (voor development)
  • Check of de service connection correct is geconfigureerd

Build Fails: "Dockerfile not found"

Oplossing:

  • Verifieer dat backend/Dockerfile.prod en frontend/Dockerfile.prod bestaan
  • Check of de paths correct zijn in azure-pipelines.yml
  • Controleer of de files zijn gecommit en gepusht naar de repository

🎉 Success!

Als alles goed is gegaan, heb je nu:

  • Azure Container Registry aangemaakt
  • Service Connection geconfigureerd
  • Pipeline aangemaakt en gerund
  • Docker images gebouwd en gepusht naar ACR

Je images zijn nu beschikbaar op:

  • Backend: zuyderlandcmdbacr.azurecr.io/zuyderland-cmdb-gui/backend:latest
  • Frontend: zuyderlandcmdbacr.azurecr.io/zuyderland-cmdb-gui/frontend:latest

🚀 Volgende Stappen

Nu je images in ACR staan, kun je ze deployen naar:

  1. Azure Container Instances (ACI) - Eenvoudig, snel
  2. Azure App Service (Container) - Managed service
  3. Azure Kubernetes Service (AKS) - Voor complexere setups
  4. VM met Docker Compose - Volledige controle

Zie docs/AZURE-DEPLOYMENT-SUMMARY.md voor deployment opties.


📚 Meer Informatie

  • Quick Start Guide: docs/AZURE-ACR-QUICKSTART.md
  • Azure DevOps Setup: docs/AZURE-DEVOPS-SETUP.md
  • Container Registry Guide: docs/AZURE-CONTAINER-REGISTRY.md
  • Deployment Options: docs/AZURE-DEPLOYMENT-SUMMARY.md

💡 Tips

  1. Automatische Triggers: De pipeline triggert automatisch bij elke push naar main branch
  2. Version Tags: Gebruik git tags (bijv. v1.0.0) voor versie-specifieke builds
  3. Monitor Costs: Check Azure Portal regelmatig voor storage gebruik
  4. Cleanup: Overweeg oude images te verwijderen om kosten te besparen

Veel succes! 🚀