Use Managed Identities

This IT Pro Challenge lab teaches you how to use the Azure portal to provision a virtual machine, assign it a role, and enable system-assigned managed identity. You will also grant permissions to that managed identity as well as verify a managed identity access token. Finally, you will learn how to remove permissions.

0
45
M
Time
Beginner
difficulty
1
ceu/cpe

Course Content

No items found.
No items found.
Course Description

In this IT Pro Challenge, you will use the Azure portal and Remote Desktop Protocol (RDP) to create and verify a virtual machine with a system-assigned managed identity. You will also assign a role to the virtual machine, which grants permissions to the managed identity and make a request to the managed identity to receive an access token. This lab helps develop knowledge of network access, identity, and access management, which is important for careers in system administration, system security, or as a database administrator.

Overview

The scenario for this virtual lab is that you are a system administrator, and your company is migrating its web services from an on-premise datacenter to Azure. Your job is to deploy an Azure virtual machine and enable managed identities. As proof of concept, you will enable and test a system-assigned managed identity.

A system-assigned managed identity allows Azure resources to authenticate to the Azure Key Vault without storing credentials in code. Once you enable system-assigned managed identities, all permissions are granted via Azure Role-Based Access Control (RBAC).

Create an Azure VM with a system-assigned managed identity

To begin, launch the Azure portal and create a virtual machine that uses Windows Server 2016 Datacenter. Enable System-assigned managed identity and then use Remote Desktop Protocol (RDP) to connect to the virtual machine and verify its availability.

Grant permissions to a managed identity

For the provided Azure resource group, you need to assign the LOD Reader role to the virtual machine. To do this, go to the Azure portal and navigate to the resource group blade and use the Access Control (IAM) page to assign the LOD Reader role to the virtual machine.

Verify a managed identity access token

On the first Azure virtual machine, launch an RDP session, and open the Windows PowerShell command-line interface. Now you need to use the Invoke-webRequest cmdlet to make a request to the managed identity to receive an access token for the Azure Resource Manager (ARM) endpoint:

$response = Invoke-WebRequest -Uri 'http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com/' -Method GET -Headers @{Metadata="true"}

Extract the full response, which is stored in JSON format in the $response variable, by using the following code: $content = $response.Content | ConvertFrom-Json. Then extract the ARM access token from the response by using the following code: $ArmToken = $content.access_token.

Finally, you will call ARM with the access token by using the following code, replacing SUBSCRIPTION_ID and RESOURCE_GROUP as appropriate:

(Invoke-WebRequest -Uri https://management.azure.com/subscriptions/SUBSCRIPTION_ID>/resourceGroups/RESOURCE_GROUP?api-version=2016-06-01 -Method GET -ContentType "application/json" -Headers @{ Authorization ="Bearer $ArmToken"}).content

Remove permissions from a managed identity

Finally, in the Azure portal, remove the role assignment from the provided Azure resource group on the second virtual machine. Then, you will return to the RDP session on the virtual machine with Windows PowerShell and enter the following command once more:

(Invoke-WebRequest -Uri https://management.azure.com/subscriptions/8d7ebc7f-6c63-47b5-bbdc-6df02452b2bd/resourceGroups/corp-datalod12693745?api-version=2016-06-01 -Method GET -ContentType "application/json" -Headers @{ Authorization ="Bearer $ArmToken"}).content

Now you will see the failure after the permissions are removed.

Summary Conclusion

By taking this virtual lab, you will learn how to use the Azure portal to create an Azure virtual machine with a system-assigned identity, grant permissions to a managed identity, and use Windows PowerShell to verify a managed identity access token. As a proof of concept, you will remove permissions from a managed identity to see the difference after those permissions are removed.

This course is part of a Career Path:
No items found.

Instructed by

No items found.
Provider
Cybrary Logo
Certification Body
Certificate of Completion

Complete this entire course to earn a Use Managed Identities Certificate of Completion

Course
This is some text inside of a div block.

Use Managed Identities

Course

This IT Pro Challenge lab teaches you how to use the Azure portal to provision a virtual machine, assign it a role, and enable system-assigned managed identity. You will also grant permissions to that managed identity as well as verify a managed identity access token. Finally, you will learn how to remove permissions.

Path Releasing Q2 2025
Full access included with 
Insider Pro
 and 
Teams

0

H

45

M
Time

Beginner

i
This is some text inside of a div block.
Experience Level

1

i

This is some text inside of a div block.
CEU's

1

Enrollees

Heading

H

Heading

M
Time

Heading

i
This is some text inside of a div block.
Experience Level

Heading

i

This is some text inside of a div block.
CEU's

Heading

Enrollees

Learners at 96% of Fortune 1000 companies trust Cybrary

About this course

This IT Pro Challenge lab teaches you how to use the Azure portal to provision a virtual machine, assign it a role, and enable system-assigned managed identity. You will also grant permissions to that managed identity as well as verify a managed identity access token. Finally, you will learn how to remove permissions.

Read More

Course Description

In this IT Pro Challenge, you will use the Azure portal and Remote Desktop Protocol (RDP) to create and verify a virtual machine with a system-assigned managed identity. You will also assign a role to the virtual machine, which grants permissions to the managed identity and make a request to the managed identity to receive an access token. This lab helps develop knowledge of network access, identity, and access management, which is important for careers in system administration, system security, or as a database administrator.

Overview

The scenario for this virtual lab is that you are a system administrator, and your company is migrating its web services from an on-premise datacenter to Azure. Your job is to deploy an Azure virtual machine and enable managed identities. As proof of concept, you will enable and test a system-assigned managed identity.

A system-assigned managed identity allows Azure resources to authenticate to the Azure Key Vault without storing credentials in code. Once you enable system-assigned managed identities, all permissions are granted via Azure Role-Based Access Control (RBAC).

Create an Azure VM with a system-assigned managed identity

To begin, launch the Azure portal and create a virtual machine that uses Windows Server 2016 Datacenter. Enable System-assigned managed identity and then use Remote Desktop Protocol (RDP) to connect to the virtual machine and verify its availability.

Grant permissions to a managed identity

For the provided Azure resource group, you need to assign the LOD Reader role to the virtual machine. To do this, go to the Azure portal and navigate to the resource group blade and use the Access Control (IAM) page to assign the LOD Reader role to the virtual machine.

Verify a managed identity access token

On the first Azure virtual machine, launch an RDP session, and open the Windows PowerShell command-line interface. Now you need to use the Invoke-webRequest cmdlet to make a request to the managed identity to receive an access token for the Azure Resource Manager (ARM) endpoint:

$response = Invoke-WebRequest -Uri 'http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com/' -Method GET -Headers @{Metadata="true"}

Extract the full response, which is stored in JSON format in the $response variable, by using the following code: $content = $response.Content | ConvertFrom-Json. Then extract the ARM access token from the response by using the following code: $ArmToken = $content.access_token.

Finally, you will call ARM with the access token by using the following code, replacing SUBSCRIPTION_ID and RESOURCE_GROUP as appropriate:

(Invoke-WebRequest -Uri https://management.azure.com/subscriptions/SUBSCRIPTION_ID>/resourceGroups/RESOURCE_GROUP?api-version=2016-06-01 -Method GET -ContentType "application/json" -Headers @{ Authorization ="Bearer $ArmToken"}).content

Remove permissions from a managed identity

Finally, in the Azure portal, remove the role assignment from the provided Azure resource group on the second virtual machine. Then, you will return to the RDP session on the virtual machine with Windows PowerShell and enter the following command once more:

(Invoke-WebRequest -Uri https://management.azure.com/subscriptions/8d7ebc7f-6c63-47b5-bbdc-6df02452b2bd/resourceGroups/corp-datalod12693745?api-version=2016-06-01 -Method GET -ContentType "application/json" -Headers @{ Authorization ="Bearer $ArmToken"}).content

Now you will see the failure after the permissions are removed.

Summary Conclusion

By taking this virtual lab, you will learn how to use the Azure portal to create an Azure virtual machine with a system-assigned identity, grant permissions to a managed identity, and use Windows PowerShell to verify a managed identity access token. As a proof of concept, you will remove permissions from a managed identity to see the difference after those permissions are removed.

Train Your Team

Cybrary’s expert-led cybersecurity courses help your team remediate skill gaps and get up-to-date on certifications. Utilize Cybrary to stay ahead of emerging threats and provide team members with clarity on how to learn, grow, and advance their careers within your organization.

Included in a Path

No items found.
Learn

Learn core concepts and get hands-on with key skills.

Practice

Exercise your problem-solving and creative thinking skills with security-centric puzzles

Prove

Assess your knowledge and skills to identify areas for improvement and measure your growth

Get Hands-on Learning

Put your skills to the test in virtual labs, challenges, and simulated environments.

Measure Your Progress

Track your skills development from lesson to lesson using the Cybrary Skills Tracker.

Connect with the Community

Connect with peers and mentors through our supportive community of cybersecurity professionals.

Success from Our Learners

"Cybrary really helped me get up to speed and acquire a baseline level of technical knowledge. It offers a far more comprehensive approach than just learning from a book. It actually shows you how to apply cybersecurity processes in a hands-on way"

Don Gates

Principal Systems Engineer/SAIC

"Cybrary’s SOC Analyst career path was the difference maker, and was instrumental in me landing my new job. I was able to show the employer that I had the right knowledge and the hands-on skills to execute the role."

Cory

Cybersecurity analyst/

"I was able to earn my CISSP certification within 60 days of signing up for Cybrary Insider Pro and got hired as a Security Analyst conducting security assessments and penetration testing within 120 days. This certainly wouldn’t have been possible without the support of the Cybrary mentor community."

Mike

Security Engineer and Pentester/

"Cybrary really helped me get up to speed and acquire a baseline level of technical knowledge. It offers a far more comprehensive approach than just learning from a book. It actually shows you how to apply cybersecurity processes in a hands-on way"

Don Gates

Principal Systems Engineer/SAIC

"Cybrary’s SOC Analyst career path was the difference maker, and was instrumental in me landing my new job. I was able to show the employer that I had the right knowledge and the hands-on skills to execute the role."

Cory

Cybersecurity analyst/

"I was able to earn my CISSP certification within 60 days of signing up for Cybrary Insider Pro and got hired as a Security Analyst conducting security assessments and penetration testing within 120 days. This certainly wouldn’t have been possible without the support of the Cybrary mentor community."

Mike

Security Engineer and Pentester/

"Becoming a Cybrary Insider Pro was a total game changer. Cybrary was instrumental in helping me break into cybersecurity, despite having no prior IT experience or security-related degree. Their career paths gave me clear direction, the instructors had real-world experience, and the virtual labs let me gain hands-on skills I could confidently put on my resume and speak to in interviews."

Cassandra

Information Security Analyst/Cisco Systems

"I was able to earn both my Security+ and CySA+ in two months. I give all the credit to Cybrary. I’m also proud to announce I recently accepted a job as a Cyber Systems Engineer at BDO... I always try to debunk the idea that you can't get a job without experience or a degree."

Casey

Cyber Systems Engineer/BDO

"Cybrary has helped me improve my hands-on skills and pass my toughest certification exams, enabling me to achieve 13 advanced certifications and successfully launch my own business. I love the practice tests for certification exams, especially, and appreciate the wide-ranging training options that let me find the best fit for my goals"

Angel

Founder,/ IntellChromatics.