For deploying Azure resources with Terraform via Azure pipelines we use service principals (SPN) to connect to Azure from Azure DevOps. You might encounter "403 Insufficient privileges" errors while trying to read Azure AD groups data, which you might want to use to create role assignment in the new resources you are provsioning with Terraform. For example it can be a Azure AD group referred as data as shown below.
# refer to sub_owners AD group to assign as aks admins
data "azuread_group" "myteam" {
display_name = "sub_owners"
security_enabled = true
}
Let's look at the how to resolve the exception "403 Insufficient privileges".