Azure DevOps Workload Identity Federation with Azure Overview. NO MORE SECRETS!

John Savill's Technical Training
27 Feb 202421:56

Summary

TLDRThis video explores leveraging workload identity federations in Azure DevOps to securely authenticate and authorize service connections without relying on secrets. It highlights the drawbacks of traditional app registration methods with secrets and introduces using OpenID Connect with Azure Active Directory (AAD) to establish a federated identity and generate access tokens. The process streamlines security, simplifies maintenance, and grants specific pipelines controlled access to service connections representing app registrations. Additionally, the video covers converting existing secret-based service connections, bulk conversion scripts, and utilizing managed identities as an alternative for those without app registration permissions.

Takeaways

  • πŸ’» Azure DevOps can leverage Workload Identity Federations to securely authenticate service-to-service communications, eliminating the need for storing secrets.
  • πŸ”‘ Traditionally, app registrations and service principles in Azure AD (ENT) facilitated authentication, requiring secrets for service connections in Azure DevOps.
  • πŸ› οΈ With Identity Federation, the reliance on secrets is removed, enhancing security and simplifying maintenance by using OpenID Connect for authentication.
  • πŸ“š Azure DevOps automatically integrates with Azure AD, simplifying the initial setup for OpenID Connect-based authentication.
  • πŸ›‘οΈ Workload Identity Federation service connections in Azure DevOps eliminate the need for secrets by establishing a federation link to app registrations.
  • πŸ“ Managed identities offer an alternative to app registrations, useful when permissions to create app registrations are restricted.
  • πŸ“ˆ The process involves creating a federated credential for the managed identity, specifying issuer URL and subject identifier.
  • πŸ”§ Azure DevOps supports converting existing service connections to use Workload Identity Federation, streamlining the transition to a more secure setup.
  • πŸ”¨ Role-Based Access Control (RBAC) in Azure ensures that the app registration or managed identity has the necessary permissions on target resources.
  • πŸ“Š Managed identities and service principals enable Azure DevOps pipelines to authenticate without secrets, relying on tokens issued by Azure AD.

Q & A

  • What is the purpose of using workload identity federations in Azure DevOps?

    -The purpose of using workload identity federations in Azure DevOps is to securely authenticate services without the need for secrets, allowing pipelines to interact with Azure resources securely and efficiently.

  • What role does Azure Active Directory (Azure AD) play in the authentication process between Azure DevOps and Azure?

    -Azure Active Directory (Azure AD), formerly known as Entra, acts as the identity provider that binds Azure DevOps and Azure together, facilitating the authentication process by trusting app registrations and issuing tokens for secure interactions.

  • How does the traditional authentication method using service principals and secrets work in Azure DevOps?

    -Traditionally, Azure DevOps uses an app registration in Azure AD to create a service principal, which is then configured with a secret. This secret is used by a service connection in Azure DevOps to authenticate and interact with Azure resources.

  • What are the drawbacks of using secrets for authentication in Azure DevOps?

    -Using secrets for authentication in Azure DevOps poses security risks, as it requires storing and managing sensitive information, which could be misused if compromised. It also involves additional management tasks, such as secret rotation and expiry handling.

  • How does OpenID Connect improve the authentication process in Azure DevOps?

    -OpenID Connect improves the authentication process by allowing Azure DevOps to authenticate using identity tokens instead of secrets. This method leverages a standard protocol for authentication, reducing the need for managing secrets and enhancing security.

  • What is required to create a new workload identity federation-based service connection in Azure DevOps?

    -To create a new workload identity federation-based service connection, one needs permission to create an app registration in the Azure AD tenant. This app registration will be linked to the service connection without requiring a secret.

  • How does Azure DevOps authenticate using workload identity federation and OpenID Connect?

    -Azure DevOps authenticates using workload identity federation and OpenID Connect by issuing an identity token from Azure DevOps, which is then validated and exchanged for an access token by Azure AD, allowing secure access to Azure resources.

  • Can existing service connections using secrets be converted to use workload identity federation?

    -Yes, existing service connections using secrets can be easily converted to use workload identity federation, enhancing security by eliminating the need for secrets and simplifying maintenance.

  • What alternative is available in Azure DevOps if creating app registrations is not permitted?

    -If creating app registrations is not permitted, managed identities can be used as an alternative in Azure DevOps. This allows for secure authentication without needing to manage app registrations or secrets.

  • What are the benefits of using workload identity federation in Azure DevOps?

    -The benefits of using workload identity federation in Azure DevOps include improved security by avoiding secrets, simplified management without the need for secret rotation, and streamlined authentication processes using standard protocols like OpenID Connect.

Outlines

00:00

πŸ‘¨β€πŸ« Introducing Azure DevOps Workload Identity Federations

The speaker introduces the topic of workload identity federations in Azure DevOps. He explains that when services need to authenticate with each other, an identity must be established to validate that the service is allowed to act on behalf of a certain identity with roles on the target resource. The traditional approach involves creating an app registration in Azure AD (now known as Entra) that gives a service principal with a secret. This secret is then used in Azure DevOps to create a service connection, which is configured with the app registration details and secret. The pipeline is given permission to use this service connection, which sends the details to Entra to generate an access token. The pipeline can then use this access token to perform operations against the Azure Resource Manager. However, managing secrets is not ideal as it raises security concerns and requires ongoing maintenance like rotation.

05:01

πŸ”‘ Leveraging OpenID Connect for Secure Identity Federation

The speaker introduces OpenID Connect as a secure alternative to using secrets. OpenID Connect is an authentication protocol built on top of OAuth 2.0, which is an authorization protocol. OpenID Connect provides proof of identity through JSON Web Tokens (JWT) that are signed by the issuer. Azure DevOps is already integrated with Entra (formerly Azure AD), allowing for an OpenID Connect federation to be leveraged. This approach creates an app registration behind the scenes, but this app registration is linked to a specific service connection through a federated credential. There are no secrets or certificates involved, just the federated credential. The speaker explains the details of the issuer URL, subject identifier, and audience used in the federation.

10:05

πŸ”„ Workload Identity Federation Workflow

The speaker walks through the workflow of using workload identity federation. First, the pipeline is granted permission to use the specific service connection. The pipeline then requests a token from Azure DevOps, which acts as the local identity provider. Azure DevOps generates an identity token and returns it to the pipeline. The pipeline then passes this identity token to Entra (Azure AD) and requests an access token. Entra validates the identity token by checking the well-known OpenID Connect configuration endpoint to verify the certificates used for signing. Once validated, Entra creates and returns an access token to the pipeline. The pipeline can then use this access token to perform operations against the Azure Resource Manager endpoint using the permissions granted to the associated app registration.

15:06

πŸ› οΈ Setting Up Workload Identity Federation

The speaker explains the process of setting up a workload identity federation service connection in Azure DevOps. Creating a new service connection defaults to using workload identity federation, and the user can select the target subscription, management group, or resource group. Granting access to specific pipelines rather than all pipelines is recommended. Existing service connections using secrets can be converted to use workload identity federation with the click of a button or through a bulk conversion script. If the user cannot create app registrations, they can use managed identities instead. The speaker demonstrates how to add a federated credential to a managed identity and the necessary information needed from the managed identity and Azure DevOps to set up the federation manually.

20:07

🎯 Advantages of Workload Identity Federation

The speaker concludes by emphasizing the key advantage of workload identity federation: eliminating the need for secrets. Just as passwordless technologies are preferred for users, eliminating secrets for service-to-service authentication is a more secure approach. Workload identity federation allows pipelines to be granted specific permissions to use certain service connections, which can then be used to obtain an access token from Entra (Azure AD) with the appropriate roles granted to the associated app registration or managed identity. This approach removes the need to manage and maintain secrets, improves security, and simplifies maintenance.

Mindmap

Keywords

πŸ’‘Workload Identity Federation

Workload Identity Federation is a concept that allows Azure DevOps pipelines to authenticate with Azure resources without the need for secrets or certificates. It leverages OpenID Connect to provide an identity token that can be exchanged for an access token to perform operations against Azure Resource Manager. This approach eliminates the need for storing and managing secrets, improving security and simplifying maintenance. The video discusses how to configure Workload Identity Federation in Azure DevOps and the benefits it provides over the traditional method of using app registrations with secrets.

πŸ’‘OpenID Connect

OpenID Connect is an authentication protocol built on top of OAuth 2.0. It provides a standardized way for applications to prove their identity, known as authentication, as opposed to OAuth 2.0, which is primarily about authorization. OpenID Connect uses JSON Web Tokens (JWTs) to convey claims about the identity of the user or application. In the context of the video, OpenID Connect is used by Azure DevOps to issue identity tokens that can be validated by Azure Active Directory (Azure AD) and exchanged for access tokens, enabling secure communication between Azure DevOps and Azure resources.

πŸ’‘Service Connection

A Service Connection in Azure DevOps is a configuration that provides the necessary details for a pipeline to authenticate and connect to external services or resources, such as Azure Resource Manager. It contains information like the app registration, subscription details, and authentication credentials. The video discusses how traditional service connections relied on secrets or certificates, while Workload Identity Federation allows for the creation of service connections that leverage OpenID Connect for authentication, eliminating the need for secrets.

πŸ’‘App Registration

An App Registration, also known as a Service Principal, is a representation of an application or service in Azure Active Directory (Azure AD). It is used to grant permissions and access to Azure resources. In the context of the video, traditional service connections required creating an App Registration with a secret or certificate. With Workload Identity Federation, an App Registration is still created behind the scenes, but it is linked to the service connection and does not require a secret. This improves security and simplifies maintenance.

πŸ’‘Managed Identity

Managed Identity is a feature of Azure that provides an automatically managed identity for Azure resources, such as virtual machines or Azure Functions. Managed Identities are essentially Service Principals that do not require storing and managing credentials. The video mentions that if a user does not have permission to create App Registrations, they can use Managed Identities and configure Federated Credentials to leverage Workload Identity Federation without the need for secrets.

πŸ’‘Federation

Federation, in the context of the video, refers to the process of establishing a trust relationship between Azure DevOps and Azure Active Directory (Azure AD). This allows Azure DevOps to issue identity tokens that can be validated and trusted by Azure AD. Federation enables the exchange of identity information and authentication between different systems or domains without the need for shared secrets or credentials. It is a key component of Workload Identity Federation, which eliminates the need for storing and managing secrets in Azure DevOps.

πŸ’‘Identity Token

An Identity Token is a type of security token issued by an identity provider, such as Azure DevOps in the context of Workload Identity Federation. It contains claims about the identity of the subject, such as the application or service that is requesting authentication. Identity tokens are signed and can be validated by the recipient, in this case, Azure Active Directory (Azure AD). They are used to exchange authentication information between different systems and are a fundamental part of the OpenID Connect protocol.

πŸ’‘Access Token

An Access Token is a type of security token that is used to grant access to protected resources. In the context of the video, Azure Active Directory (Azure AD) issues access tokens to Azure DevOps pipelines after validating the identity token received from Azure DevOps. These access tokens contain information about the permissions and roles assigned to the app registration (Service Principal) and allow the pipeline to perform operations against Azure Resource Manager, such as deploying resources or managing configurations.

πŸ’‘Well-Known Configuration

Well-Known Configuration is a standardized way for OpenID Connect providers to publish their configuration details, such as supported scopes, signing keys, and endpoints. It is accessible through a well-known URL format, typically `https://<issuer>/.well-known/openid-configuration`. In the video, it is mentioned that Azure Active Directory (Azure AD) can use the Well-Known Configuration to validate the identity tokens issued by Azure DevOps and verify the signature using the published signing keys. This allows Azure AD to trust the identity tokens and issue access tokens accordingly.

πŸ’‘Role-Based Access Control (RBAC)

Role-Based Access Control (RBAC) is a method of controlling access to resources based on the roles assigned to users or applications. In the context of the video, the app registration (Service Principal) created for the Workload Identity Federation service connection is granted specific roles within the Azure subscription or resource group. These roles determine the permissions and allowed actions for the app registration. RBAC is used to apply the principle of least privilege, granting only the necessary permissions for the pipeline to perform its required tasks.

Highlights

Introduction to Azure DevOps and its integration with Azure using service connections.

Explanation of traditional app registration and service principle in Azure AD for Azure DevOps.

Issues associated with using secrets for service connections, such as security risks and management difficulties.

Introduction to the concept of workload identity federations to eliminate the need for secrets.

How OpenID Connect and OAuth 2.0 are leveraged for secure authentication without secrets.

Detailed walkthrough of converting traditional secret-based service connections to workload identity federation.

Step-by-step guide on creating new workload identity federation based service connections.

Explanation of automatic and manual configurations for workload identity federation.

Benefits of workload identity federation, such as improved security and simplified maintenance.

Use of managed identities as an alternative to app registrations when necessary.

How to grant specific pipelines permission to use new service connections securely.

Detailed explanation of the token exchange process between Azure DevOps and Azure AD.

The role of issuer, subject identifier, and audience in the authentication process.

Conversion process for existing service connections to use workload identity federation.

Overview of the benefits of removing secrets and transitioning to a more secure, federated identity model.

Transcripts

play00:00

hey everyone in this video I want to

play00:02

talk about the Azure devops capability

play00:05

to leverage workload identity

play00:08

federations whenever we have any service

play00:11

talking to another service it has to be

play00:13

a to authenticate it needs some way to

play00:16

validate it's allowed to act as a

play00:18

certain identity that can be given roles

play00:21

on that Target resource so in this

play00:24

example what we're focusing on is we

play00:27

have our azure

play00:28

devops

play00:30

and our Azure devops remember we have

play00:34

the idea of pipelines and so we have

play00:36

some

play00:37

Pipeline and that pipeline is going to

play00:40

be

play00:41

performing certain types of task and

play00:44

what I want to run that pipeline against

play00:46

in this case is azure so over here I

play00:50

have my Azure try and draw an Azure

play00:52

logos good as I

play00:56

can so it needs to act as some identity

play01:00

that Azure knows about and can all be

play01:02

authenticated with that would have

play01:04

certain roles against subscriptions

play01:06

resource groups whatever I

play01:09

need and the identity provider that

play01:12

binds all of these together is entra

play01:15

formerly known as Azure ad so we have

play01:18

our particular ENT tenant for our

play01:23

organization and what we have

play01:25

traditionally done is obviously in this

play01:27

case both Azure devops and and aure they

play01:31

integrate and they trust entra they

play01:34

trust a particular

play01:36

tenant and so what we would have is we

play01:38

would create an app registration which

play01:42

would then give us a service principle

play01:43

in entra that would be leveraged by a

play01:47

service connection that we could then

play01:49

leverage so I could think about well

play01:51

okay great we will go and create this

play01:54

app registration so we'll say it's app r

play01:58

one

play02:01

but the key Point here is it has a

play02:04

secret so we say hey it's got secret one

play02:07

and then what I do in my Azure devops is

play02:11

well I go ahead and create a service

play02:17

connection and that service

play02:20

connection is configured with this

play02:23

details it's configured with hey app

play02:25

regge one and it's configured with that

play02:29

secret

play02:32

and then I give the pipeline

play02:34

permission to use that service

play02:38

connection and then the flow is simply

play02:40

okay well I want to be able to use that

play02:43

so what would happen is well the PIP

play02:46

line it can use the service connection

play02:48

it knows the app registration now

play02:50

there's other bits of detail about the

play02:51

client ID Etc but fundamentally it knows

play02:54

the detail to be able to use this secret

play02:57

so it would send that detail to ENT so

play03:01

it's sending hey at Bridge one it's

play03:02

sending the secret this will now

play03:05

generate an access

play03:07

token give it to my Pipeline and now my

play03:11

pipeline can take that access token and

play03:14

use it

play03:16

against the management endpoint for the

play03:19

Azure resource manager and again this

play03:23

app registration would be given certain

play03:25

roles on

play03:26

here and we can see this so if we

play03:29

quickly jump over so if we go and look

play03:32

if I look in my Azure devops environment

play03:34

I have two service connections but we'll

play03:37

look at this first

play03:39

one and we can see it's got a certain

play03:43

name ay devops for Dev and notice it's

play03:46

giving us this little notification hey

play03:48

you could convert this for improved

play03:51

security and simplified maintenance but

play03:53

we'll come back to that and what this

play03:56

represents is this at registration which

play04:01

again is a service principle but the key

play04:03

Point here is it it has this secret it

play04:06

has this certain secret which has a

play04:08

certain value it has a certain expiry

play04:11

date so there's a certain amount of now

play04:14

work in terms of the rotation of that

play04:18

the good news is there's somewhat

play04:20

automated for us by Azure devops but it

play04:23

exists like this is not an ideal

play04:26

scenario to have these things existing

play04:29

and so when we think about this all up

play04:31

solution the idea of having this

play04:34

secret we really just don't like it we

play04:38

would like to get rid we give this a

play04:39

frowny face because hey how do I Ure the

play04:43

security someone else doesn't use that

play04:46

secret and do something as that identity

play04:49

against our Azure resource manager and

play04:51

those resources and again I have to

play04:53

think well it has a certain expiry

play04:55

there's certain rotation so there's

play04:57

management tasks associated with that

play05:01

which in an Ideal World I really just

play05:04

don't want to have to deal with um and

play05:07

so what what can we do better and so the

play05:11

most secure way is well let's just get

play05:13

rid of this secret and that's the whole

play05:16

idea of the identity Federation and so

play05:20

let's look at what we can do with that

play05:22

now we have our same actors again so I'm

play05:24

going to have to quickly redraw so once

play05:26

again we have the idea of aure over here

play05:30

and I still can't really draw that logo

play05:32

very

play05:34

well once again we have our ENT

play05:41

tenant and then once again we'll have

play05:43

our Azure devops so we have the same

play05:45

actors nothing is

play05:47

changing with regards to the components

play05:51

that are being

play05:53

used but this time we want to try and

play05:56

avoid having to have that secret that's

play05:58

the key point point of this and so what

play06:01

we're going to leverage now is open ID

play06:03

connect so open ID connect sits on top

play06:06

of aarf 2 ooff 2 is really an

play06:09

authorization protocol we use it to say

play06:12

hey I'm going to allow this certain

play06:14

service to act on my behalf against this

play06:17

target resource I own it's about

play06:20

delegated authorization IE Facebook can

play06:23

access my photos on this Photograph

play06:26

cloud service well open ID connect is

play06:29

all about authentication and providing

play06:32

some proof of I am who I say I am it's

play06:36

Al always ajon web token we say it as a

play06:39

jot even though it's

play06:40

JWT and it has header it has claims we

play06:43

can crack this open and look at it but

play06:47

it's going to provide authenticity from

play06:50

the issuer by virtue of the fact it has

play06:52

a signature and there are well-known end

play06:54

points I can go and check hey for this

play06:56

issuer which certificates are they using

play06:58

so I can prove hey it really is coming

play07:01

through it says it is and GitHub I did a

play07:04

video on this in the past about GitHub

play07:07

and its use of open ID connect

play07:09

Federation so I don't have to maintain

play07:11

Secrets there well now we have it here

play07:14

as well with Azure devops and so the

play07:17

point is because Azure devops is so

play07:20

integrated with ENT or Azure IDE as it

play07:23

was formerly known already I don't

play07:25

actually have to do anything in most

play07:28

cases for that initial configuration so

play07:31

what we have available to us is we have

play07:34

this open ID

play07:37

connect

play07:39

Federation that we are going to

play07:43

leverage and so how are we going to

play07:46

leverage this now the point is we are

play07:50

going to go ahead and we're going to

play07:52

create a new workload identity

play07:55

Federation based service connection and

play07:58

so I'm going to say hey I want to

play08:01

leverage this

play08:03

new

play08:04

um workload identity

play08:08

Federation service

play08:12

connection now when I do this it's still

play08:15

now going to go ahead and

play08:19

create an app registration that

play08:22

represents this I.E behind the scenes

play08:24

there is a service principal now what

play08:27

that means is the person

play08:29

creating this service connection has to

play08:33

have the permission to create an app

play08:36

registration in that tenant now I have

play08:38

to do that anyway if I was using the old

play08:40

Secrets based approach But realize hey I

play08:43

have to have this permission now later

play08:45

on we'll talk about well if I can't do

play08:47

that there is a way to use managed

play08:49

identity as well so we we'll come back

play08:51

to that later on but what it's going to

play08:53

do is it's going to go ahead and create

play08:55

this app registration but this app

play08:58

registration is now going to have a

play09:00

federation

play09:02

link to this particular service

play09:06

connection uh and so let's take a look

play09:08

at that so if we jump over we're now

play09:12

going to look at this second um actually

play09:15

let go back over here I have another

play09:17

service

play09:19

connection and notice on this service

play09:22

connection it's telling me hey I am

play09:24

using workload identity Federation with

play09:27

open ID connect

play09:30

and if I go and look at the app

play09:31

registration for this well the first

play09:33

thing we'll notice is there are no

play09:36

secrets there's no certificate there is

play09:38

no secret all we have is this Federated

play09:42

credential and if we go and look at it

play09:45

we'll see some interesting

play09:47

things so the things we're going to

play09:49

focus on here is the

play09:51

issuer is voken dod. azure.com so what's

play09:55

happening here is azure devops is going

play09:57

to issue us this identity

play10:00

token it has a subject identifier so

play10:05

this is the name of my or the name of my

play10:08

project and the name of my service

play10:11

connection and when it's talking to

play10:13

entra for know as Azure ad its

play10:17

audience is the Azure ad token exchange

play10:21

they're obviously not renaming that to

play10:23

entra they probably never will um but

play10:26

those are key pieces of information so

play10:28

what this is telling is

play10:31

for this app registration it has been

play10:35

linked to this service connection now as

play10:37

part of that remember so this is now an

play10:39

issuer so this has the ability to issue

play10:42

identity tokens and that issuer is this

play10:46

vs

play10:47

token

play10:49

dodev do

play10:52

azure.com

play10:54

so this as part of that communication is

play10:56

going to be the issuer and obviously it

play10:59

had that

play11:01

subject

play11:03

identifier as well which had that

play11:05

breakdown of those

play11:08

components so now we have that key

play11:10

information again it's going to go and

play11:11

talk to hey I want to exchange this for

play11:14

that Azure ad token

play11:16

exchange so what will happen now if

play11:19

entra receives an identity

play11:22

token that hey comes from this issuer

play11:25

has that subject ID that has been

play11:27

configured and the audience is that

play11:29

token exchange it can now go and give it

play11:31

an access token so let's walk through

play11:35

what that flow actually looks

play11:38

like so once again I'm going to have a

play11:40

pipeline nothing is changing there so

play11:43

I'm going to go ahead and I've got my

play11:45

particular

play11:50

pipeline now one thing we have to do is

play11:54

this particular service

play11:57

connection

play11:59

we're going to give

play12:03

permission very rarely will we say hey

play12:05

all pipelines can use it so we will at

play12:08

very specific levels say hey this

play12:11

pipeline is allowed to use this so if we

play12:14

were to go back for a

play12:16

second and have a look at the security

play12:19

so I'm up here at the top clicking the

play12:21

little three dots and then looking at

play12:25

security we'll see the

play12:27

option for hey no permitted

play12:30

pipelines we have open access but we're

play12:33

not going to do that instead if we click

play12:36

plus I can select the particular

play12:38

pipelines that I want to be allowed to

play12:41

use this service connection which could

play12:44

then act on that behalf so that's one of

play12:46

the the key things we do we still have

play12:48

full control over which particular

play12:50

pipelines are allowed to do

play12:53

this so what's going to now happen this

play12:56

pipeline runs and there's tasks in there

play12:59

that need to use that service

play13:01

connection so what it's going to

play13:04

do is it's going to talk to this as kind

play13:08

of its local identity provider and it's

play13:10

going to say hey um I need a token

play13:15

please this is kind of step

play13:17

one because it has permission to act as

play13:20

that it's going to generate that

play13:21

identity

play13:23

token and return it to the

play13:26

pipeline the pipeline will now take that

play13:30

identity

play13:31

token and it's going to go and pass

play13:35

it to entra and what it's asking for now

play13:40

is hey I would like an access

play13:43

token but before this happens before it

play13:46

gets the access token entra will

play13:49

actually

play13:51

validate now there are well-known end

play13:55

points for the open ID connect so we

play13:59

know it came the issue was at VST token.

play14:01

d. azure.com and so what I can do is I

play14:05

can go to that

play14:07

URL and then we add onto it wellknown

play14:11

openen ID

play14:13

configuration and it tells us what what

play14:15

do we

play14:16

support So this scope is only open ID we

play14:20

can see subject types and what we can

play14:22

see

play14:22

here is well this is the

play14:26

detail about the actual certificates

play14:29

that it's using so what entry is going

play14:31

to do is go to that well-known point and

play14:34

it can see all of the keys the

play14:36

certificates has been used for the

play14:37

signing so that will let it confirm okay

play14:40

yeah this this is

play14:42

valid this is who it says it is so at

play14:46

this point once it's done that

play14:48

validation

play14:49

now it will create the access

play14:55

token return the access token and now

play14:58

great now the pipeline can take the

play15:00

access token and send

play15:03

it along with its request to the

play15:05

management. azure.com

play15:08

I.E the endpoint where I'm going to

play15:11

perform operations against the Azure

play15:12

resource manager and again the key idea

play15:16

here is this app

play15:18

registration will be given Ro based

play15:21

Access Control here so whatever that app

play15:24

registration is at a subscription level

play15:27

or Resource Group level whatever I want

play15:30

there will be role-based Access Control

play15:33

giving hey app registration because

play15:35

that's who the token is this access

play15:38

token is the app registration one that

play15:40

service principle hey app regge has um

play15:44

contributor for example again we always

play15:47

think least privilege um the least rol

play15:49

is required to do what it needs to do

play15:52

but now it will be out to go and perform

play15:53

those operations and so if we looked at

play15:56

this we would see in the Azure

play16:00

subscription we'll see those

play16:05

various service principles in this case

play16:08

have the contributor

play16:10

right and that's the

play16:12

flow now when I was going to go ahead

play16:15

and create one of these if we went back

play16:17

a

play16:18

step so if I'm looking at all of these

play16:20

if I just want to do a new service

play16:22

connection and I want to talk to

play16:26

arm it's default

play16:29

is hey workload identity Federation

play16:33

automatic and from there all I have to

play16:35

do is Select well what is my target is

play16:38

it subscription is it Management Group I

play16:40

could optionally add in a certain

play16:41

Resource Group so I I can select these

play16:44

details give it a name a description

play16:47

again I don't typically do this grant

play16:50

access to all pipelines I would rather

play16:52

go in and add it to the specific ones I

play16:55

want but this would just go ahead and

play16:58

create

play16:59

that service connection and again that

play17:01

would go and create the service

play17:02

principle that app registration and it

play17:04

would set up all of those Federation

play17:07

goodness things for

play17:10

me now what if I already

play17:13

have ones that are using the secrets

play17:17

today well exactly as you can see here

play17:19

when I look at one of them it has a

play17:22

convert button I can just hit convert

play17:25

and it will convert it to use now that

play17:28

workload identity Federation it's super

play17:31

easy to do and if you look at the

play17:34

documentation it even has

play17:36

scripts that will walk through bulk

play17:39

doing those conversions for you and

play17:42

there's information all over the place

play17:44

so there's kind of a learn

play17:46

more and it talks about hey how we want

play17:48

to use these

play17:50

things and then it's got hey multiple

play17:53

conversions with a script so it's all

play17:56

there it's all uh trying to help you

play17:58

with that now I did mention One

play18:02

Challenge you may face is if you're not

play18:04

allowed to create app

play18:06

registrations and so additionally I can

play18:08

use managed identities which is a

play18:10

different type of it's just a special

play18:13

service principle fundamentally and the

play18:16

only thing different here is that if we

play18:18

went ahead and looked if I look at a

play18:21

managed

play18:24

identity so I've got a user assign

play18:26

managed identity and I'm just going to

play18:28

look up one of them doesn't matter which

play18:29

one we do have this option for Federated

play18:34

credentials so I can go ahead and

play18:37

add a Federated credential so I'm going

play18:39

to select this other option but notice

play18:42

it has hooks into GitHub actions and

play18:45

kubernetes now notice it's asking for

play18:47

the issuer URL and the subject

play18:49

identifier notice by default it's

play18:52

putting in the right hey we want the API

play18:55

Azure ad token exchange and I would give

play18:57

a name name for this credential so

play19:00

there's really two parts to this I don't

play19:02

know this issue a URL and subject

play19:04

identifier

play19:05

yet and there's also some information I

play19:07

would need from this managed identity

play19:11

because I'm going to need this sort of

play19:13

tenant ID and the client ID data that it

play19:16

gives me over here on the right because

play19:20

all I have to do in Azure devops if I do

play19:24

no I can

play19:27

say well Cloe identity Federation

play19:33

manual I would give it a name do

play19:36

test and then it's giving me this is the

play19:39

issuer so this is the issuer value what

play19:42

I'd have to put in for the manage

play19:43

identity this is the subject identifier

play19:46

I would have to put

play19:48

in I can then tell it the scope level I

play19:52

want and this is where I would put in

play19:53

the details from the managed identity

play19:56

that client ID value and the tenant ID

play19:59

that it showed me so I would populate

play20:02

these values in kind of both the spaces

play20:05

and now I'm using managed identity

play20:07

instead of a service principal so I

play20:08

still get all the benefit that there is

play20:10

no secret that exists I'm not having to

play20:13

worry about any of that but hey if I

play20:16

can't create an app registration I can

play20:18

use manage identity so there you have it

play20:22

I mean fundamentally this boils down to

play20:24

the fact that we don't like Secrets when

play20:27

we think about for users we like

play20:29

password list we want to get rid of that

play20:31

password and use password list

play20:33

Technologies well the same applies to

play20:35

everything I want to get rid of Secrets

play20:37

I have to store I have to worry about

play20:39

the maintenance of and so instead of

play20:42

this scenario where we have that secret

play20:45

when we move to the Federation scenario

play20:49

there is no secret we're using that open

play20:51

ID connect Federation capability that

play20:54

hey I'll get that identity token I can

play20:57

exchange it once that's validated it's

play20:59

been signed by the right place we can

play21:01

specifically give certain pipelines

play21:02

permission to use certain service

play21:04

connections I can then give it to entra

play21:07

it will give me an Access token and then

play21:09

I get whatever roles I've granted that

play21:12

service

play21:13

principal so there's nothing hugely new

play21:16

here than what we've done in the past

play21:17

with service connections and Azure

play21:18

devops it's just now we have this great

play21:20

option to remove the secret and again we

play21:23

can do that individual convert existing

play21:26

ones or we can use the script to bulk

play21:29

convert if I can't create app

play21:31

registrations hey I can use manage

play21:33

identities as well I hope that was

play21:35

useful till next video take

play21:54

care