'Is it safe to create admin groups in Azure AD using infrastructure as code?

I would like to deploy an AKS cluster that is integrated with Azure Active Directory and, as far as I understood, the first step is to create an Azure Active Directory group and then give admin privileges for the AKS cluster to this group. To create this group I would like to use Terraform (something like this example) but for this, I need to create and use an identity with high privileges.

My question is: Is using Terraform, with high privileges to create the admin group in Azure AD, ok from the security point of view or it is safer to manually create the Active Directory group?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source