From ef6e3b6cee29c9142b17056a8ddd600c0ff7a24f Mon Sep 17 00:00:00 2001 From: Polaire Date: Thu, 30 Jan 2025 17:10:20 +0100 Subject: [PATCH] Actualiser 01 - Infrastructure Azure --- 01 - Infrastructure Azure.-.md | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/01 - Infrastructure Azure.-.md b/01 - Infrastructure Azure.-.md index 9ca2e78..3ccfa3e 100644 --- a/01 - Infrastructure Azure.-.md +++ b/01 - Infrastructure Azure.-.md @@ -9,10 +9,15 @@ Il faut notamment installer : Connexion à Azure az login -[OPTIONNEL] -a- Créer un Service Principal dans Azure : -az ad sp create-for-rbac --name "AnsibleServicePrincipal" --role="Contributor" --scopes="/subscriptions/" + + +## a- Créer un Service Principal dans Azure : + +`az ad sp create-for-rbac --name "AnsibleServicePrincipal" --role="Contributor" --scopes="/subscriptions/"` + 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 @@ -20,6 +25,17 @@ autorisations d’accès. --scopes "/subscriptions/" Définit la portée des permissions. Ici, on applique le rôle à tout l’abonnement Azure. Tu dois remplacer par l’ID de ton abonnement. + +| **Option** | **Description** | +| -------- | -------- | +| az ad sp create-for-rbac| Crée un Service Principal avec un rôle basé sur RBAC (Role-Based Access Control). | + + + + + + + { "appId": "212debe2-a0fa-XXXX-9aa5-97f7524036cf", "displayName": "AnsibleServicePrincipal", @@ -56,9 +72,9 @@ A ajouter dans le fichier yml : changed_when: false - name: Afficher les informations du compte Azure debug: - ANSIBLE Page 2 - debug: - msg: "{{ azure_account.stdout }}" + msg: "{{ azure_account.stdout }}" + + # 2- Déploiement via Ansible On commence par créer le mot de passe sécurisé :