This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
Nous devons notamment mettre en place les Pré-requis nécessaires au déploiement de l'infrastructure dans Azure.
Il faut notamment installer :
AzureCLI
la collection Ansible lié à Azure
Connexion à Azure
az login
a- Créer un Service Principal dans Azure :
az ad sp create-for-rbac --name "AnsibleServicePrincipal" --role="Contributor" --scopes="/subscriptions/<subscription_id>"
Option
Description
az ad sp create-for-rbac
Crée un Service Principal avec un rôle basé sur RBAC (Role-Based Access Control).
--name "AnsibleServicePrincipal"
Donne un nom au Service Principal (ici, AnsibleServicePrincipal). Tu peux le remplacer par un autre nom si besoin.
--role "Contributor"
Attribue le rôle Contributor au Service Principal. Ce rôle lui permet de gérer toutes les ressources dans la portée définie, sans pouvoir modifier les
autorisations d’accès.
--scopes "/subscriptions/<subscription_id>"
Définit la portée des permissions. Ici, on applique le rôle à tout l’abonnement Azure. Tu dois remplacer <subscription_id> par l’ID de ton abonnement