Showing posts with label spn. Show all posts
Showing posts with label spn. Show all posts

Thursday, 13 July 2023

Fix Terraform Azure AD App Registration (SPN) Read Permssions Running with Azure DevOps Pipelines

 Azure DevOps use service principals (SPN or Azure AD app registration) to make a service connection to Azure to be able to run Terraform or other IaC based resource deployments targeting Azure. You may run into issue while trying to read another Azure AD app registration information, within terraform. For example consider below code segment.

# aks kv app
data "azuread_application" "akskv" {
  display_name = "${var.PREFIX}-${var.PROJECT}-aks-kv-app"
}

data "azuread_service_principal" "akskv" {
  application_id = data.azuread_application.akskv.application_id
}

Saturday, 24 June 2023

Fix Terraform Azure AD Group Read with "403 Insufficient privileges" in Azure Pipelines

 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".

Monday, 31 August 2020

Authorizing Terraform to Apply Changes to Azure Using SPN

We have discussed setting up a Windows 10 environment to develop terraform scripts in previous post. Let’s understand how to authenticate terraform to deploy infrastructure on Azure platform using a service principle with this post.

Popular Posts