Creation of an AKS cluster using Ansible.
-
Create a service principal using the below, keeping track of the generated JSON:
az ad sp create-for-rbac --name ServicePrincipalName --sdk-auth
-
Update the project secrets to the following using the service principal JSON output above:
AZ_CREDENTIALS
set to use the entire JSON block. This is used by theazure\login
GitHub action to provision the clusterCLIENT_ID
set to theclientId
from the JSON block. This is used to allow the SP to connect to the clusterCLIENT_SECRET
set to theclientSecret
from the JSON block. This is used to allow the SP to connect to the clusterSSH_KEY
set to single line SSH RSA from the JSON block. This is used as the public key to connect to the cluster. This can be found in C:\Users\[username]\.ssh\id_rsa.pub