Showing posts with label AD. Show all posts
Showing posts with label AD. 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".

Tuesday, 14 April 2015

TFS on Azure – 07. Add Azure VM to Domain in a Azure VM

To setup TFS environment in Azure Virtual Network it is required to join the SQL, TFS, RM etc VM to the domain in Azure VM (Using AAD is another option). Before adding the VM to domain controller static internal IP should be assigned.

For example the VM created below is for setting up SQL server.
01
02

Selecting pre-created cloud service is not mandatory here. Setting the virtual network as shown below is required.
03
04

Set static internal IP.
05
To add to the domain go to server manager, local server. Click on Workgroup.
06
Click change.
07

Provide domain name.
08

Provide domain administrator credentials to add to domain.
09
10

Restart the VM.
11
12
13
14

Friday, 3 April 2015

TFS on Azure – 05. Set DNS in Virtual Network

To complete setting up the AD in Azure VM, next step is to setup the DNS for the Virtual Network. Setting up DNS is required to join other machine (TFS, RM server etc,) to the domain.
Go to the server manager of the AD server in Azure VM. Click on Toos—> DNS.
23

In the DNS Manager right click on Domain Controller and click on Properties.
24 

In the Forwarded tab of the Properties window click on IP address and click Edit.
25

In Edit Forwarders select the IP and click Delete.
26

Then click OK.
27

Click Apply and close DNS Properties.
28

Now go to the Azure Management portal click on the Virtual Network and go to Configure tab.
29
30

In the dns servers provide Domain Controller name and the static internal IP assigned to it. Click on Save.
31

Click Yes for the below message.
32

This will update the Virtual Network
33
34

35

DNS setup done for the Virtual network.
36

Tuesday, 31 March 2015

TFS on Azure – 04. Setup AD on Azure VM

To create a TFS environment in Azure, AAD can be used with Corporate AD as explained here. The other option is setting up the AD as a Azure VM or use AAD. For the TFS demonstration & training environment purpose, setting up AD as Azure VM is described in this post.

In Server manger in the Azure VM created click on Add roles and features.

01

02

Select Role –based or feature-based installation.
03

Select the server. Note the static IP set in “Adding Static Internal IP to Azure VM”.
04

Select Active Directory Domain Services.
05

06

07

08

Click Install.
09

10

Click on Promote this server to a domain controller.
11

In Deployment Configuration select Add a new forest and provide a root domain name.
12

Skip DNS options by clicking next. This can be set up later.
13
Provide a NetBIOS name.
14

15

Specify paths.
16

Review and Install. Ignore DNS warnings as it can be setup later.
17

18

19

Once setup completed and restarted can be logged in to the server using Administrator password provided for the machine, which will be valid for the domain administrator.
20

21

Thursday, 19 June 2014

Create Non AD User in TFS in a Domain


If you want to create a non existing user for some purpose to TFS (For example assign all removed User Stories and Bugs to a non existing user, this was the requirement I got from a client :))  and if you do not like to add this user to Active Directory since there is no such actual Person, you can achieve this by creating the user in the TFS box as a windows user.

First create a windows user in TFS box

Capture

Add this user to the team project (do it inside the TFS box and you will not have any issues). My domain is ALM and my TFS box is TFS.

Capture1 

From any client machine having access to the TFS, login with the new user.

Capture2
Capture3

It works like a charm!

Popular Posts