exam questions

Exam AZ-304 All Questions

View all questions & answers for the AZ-304 exam

Exam AZ-304 topic 2 question 23 discussion

Actual exam question from Microsoft's AZ-304
Question #: 23
Topic #: 2
[All AZ-304 Questions]

HOTSPOT -
You have five .NET Core applications that run on 10 Azure virtual machines in the same subscription.
You need to recommend a solution to ensure that the applications can authenticate by using the same Azure Active Directory (Azure AD) identity. The solution must meet the following requirements:
✑ Ensure that the applications can authenticate only when running on the 10 virtual machines.
✑ Minimize administrative effort.
What should you include in the recommendation? To answer, select the appropriate options in the answer area.
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:
Box 1: Create a system-assigned Managed Identities for Azure resource
The managed identities for Azure resources feature in Azure Active Directory (Azure AD) feature provides Azure services with an automatically managed identity in Azure AD. You can use the identity to authenticate to any service that supports Azure AD authentication, including Key Vault, without any credentials in your code.
A system-assigned managed identity is enabled directly on an Azure service instance. When the identity is enabled, Azure creates an identity for the instance in the Azure AD tenant that's trusted by the subscription of the instance. After the identity is created, the credentials are provisioned onto the instance.
Box 2: An Azure Instance Metadata Service Identity
See step 3 and 5 below.
How a system-assigned managed identity works with an Azure VM
1. Azure Resource Manager receives a request to enable the system-assigned managed identity on a VM.
2. Azure Resource Manager creates a service principal in Azure AD for the identity of the VM. The service principal is created in the Azure AD tenant that's trusted by the subscription.
3. Azure Resource Manager configures the identity on the VM by updating the Azure Instance Metadata Service identity endpoint with the service principal client
ID and certificate.
4. After the VM has an identity, use the service principal information to grant the VM access to Azure resources. To call Azure Resource Manager, use role-based access control (RBAC) in Azure AD to assign the appropriate role to the VM service principal. To call Key Vault, grant your code access to the specific secret or key in Key Vault.
5. Your code that's running on the VM can request a token from the Azure Instance Metadata service endpoint, accessible only from within the VM
Reference:
https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
andyR
Highly Voted 4 years, 5 months ago
should be user assigned MI
upvoted 133 times
MaxBlanche
4 years, 5 months ago
I agree
upvoted 3 times
...
idrisfl
4 years, 5 months ago
I agree, as the same identity needs to be shared across resources https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview#managed-identity-types
upvoted 6 times
...
dandirindan
4 years, 2 months ago
another question is that user managed identities can be shared among virtual machines, but system managed identities cant
upvoted 4 times
...
ElsaBBP
4 years, 2 months ago
exactly, user-assigned managed identities are shared and the same not per instance.
upvoted 4 times
...
...
nandacharya3
Highly Voted 4 years ago
Somestmes, discussions, lead to more confusion
upvoted 62 times
JayBee65
2 years, 10 months ago
I couldn't agree less. It's all good for learning
upvoted 2 times
...
china5000
3 years, 3 months ago
Rather, these kinds of decussations widen our understanding of the topic, encourage us to do our own research, try it ourselves if possible.
upvoted 12 times
Mr_wippy
3 years, 1 month ago
Agree. While my primary use of discussion is to find the right answer, I don't mind seeing a discussion with different opinions. It forces me to collate all the data the find the answer makes more sense to me
upvoted 7 times
...
...
...
Cg007
Most Recent 1 year ago
1. To provision the Azure AD identity: Create a system-assigned Managed Service Identity: This is a type of identity that is tied to the lifecycle of a specific resource, such as an Azure virtual machine. Using system-assigned identities, the identity is automatically managed by Azure and does not require any manual effort once set up. 2. To authenticate, request a token by using: An Azure AD v2.0 endpoint: The Azure AD v2.0 endpoint supports the latest protocol and allows applications to use the Microsoft identity platform to authenticate users and access secured resources in Azure. By choosing these options, you'll ensure that each of the 10 virtual machines has its own identity that can be used by the applications running on them. Since the identity is tied to the machine, the application will only be able to authenticate when running on the virtual machine. The use of system-assigned Managed Service Identity reduces administrative overhead because it doesn't require manual management of the identity lifecycle.
upvoted 1 times
...
One111
2 years, 8 months ago
User assigned managed identity = 5 apps on 10 VMs. Endpoint v2 = only one that remains supported and provide authentication. V1 depreciated. IMDS provided info about vm for all processes inside vm, anonymously.
upvoted 1 times
...
One111
2 years, 8 months ago
Azure Instance Metadata Service doesn't provide authentication channel. This is wrong answer. Https://docs.microsoft.com/en-us/azure/virtual-machines/windows/instance-metadata-service?tabs=windows Azure Instance Metadata Service (IMDS) provides information about currently running virtual machine instances. Instance Metadata Service is only accessible from within a running virtual machine instance on a non-routable IP address. VMs are limited to interacting with metadata/functionality that pertains to themselves. IMDS is not a channel for sensitive data. The API is unauthenticated and open to all processes on the VM. Information exposed through this service should be considered as shared information to all applications running inside the VM.
upvoted 1 times
...
AberdeenAngus
2 years, 11 months ago
Good link explaining how an app running on a VM can get an access token using Azure Instance Metadata Service: https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/how-to-use-vm-token#get-a-token-using-http
upvoted 2 times
...
pillow2274
3 years ago
I found this regarding the 2nd part of the question which I agree is correct and thought i'd post it. 'Your code that's running on the server can request a token from the Azure Instance Metadata service endpoint, accessible only from within the server.' https://docs.microsoft.com/en-us/azure/azure-arc/servers/managed-identity-authentication
upvoted 2 times
...
exnaniantwort
3 years, 1 month ago
can anyone explain Azure AD V1, V2 endpoint and Azure Instance Metadata service endpoint?
upvoted 3 times
...
AD3
3 years, 1 month ago
Why system assigned 1. No admin as they are created automatically and deleted automatically with the resource which is the VM. One requirement is no or less admin effort. 2. The other point is the app is authenticated only when running on these VMs. So if the VM dies and new VM is created the app will not be authenticated. This fits perfectly as the life cycle requirement. The user managed identities are created by user and hence have more admin effort & they still exists when the VM is deleted. So if new VM is created the user managed identity will get assigned and the app will still be authenticated.
upvoted 3 times
...
plmmsg
3 years, 1 month ago
1. User Assigned Managed Identity 2. Metadata Service identity endpoint
upvoted 2 times
...
us3r
3 years, 3 months ago
User-assigned managed IDENTITY (type I believe) AZ instance metadata service OAuth2 endpoint 1) minimize admin effort https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/managed-identity-best-practice-recommendations#using-user-assigned-identities-to-reduce-administration 2) you CANNOT create system-assigned MI, they are auto created. System assigned Managed Identities are automatically created along with the Azure resource and the life cycle of the managed identity depends on the Azure resource. 3) ensure app can auth only with 10 VMs the user-assigned MI will be associated only with the AZ resources (10 VMs). Yes, you can associate with more resources, but you can also create a new VM and associate its automatically created system-assigned MI with AAD. Case closed
upvoted 8 times
MARKMKENYA
2 years, 2 months ago
You didnt explain the second part of the question - why Instance metadata service OAuth2 end point? Does it even exist? The Azure Instance Metadata Service (IMDS) provides information about currently running virtual machine instances - and its not used to authentcate. https://learn.microsoft.com/en-us/azure/virtual-machines/instance-metadata-service?tabs=windows
upvoted 1 times
...
...
DonBoat
3 years, 3 months ago
Box1: User-assigned: User assigned is sharable whilst system assigned is not. Thus will defeat the requirement that all VMs must run with same identity Box2: Metadata service
upvoted 1 times
...
student22
3 years, 6 months ago
1. User Assigned Managed Identity 2. Metadata Service identity endpoint (given answer)
upvoted 6 times
...
syu31svc
3 years, 6 months ago
https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/how-managed-identities-work-vm#user-assigned-managed-identity Your code that's running on the VM can request a token from the Azure Instance Metadata Service identity endpoint, accessible only from within the VM: http://169.254.169.254/metadata/identity/oauth2/token https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview User-assigned You may also create a managed identity as a standalone Azure resource. You can create a user-assigned managed identity and assign it to one or more instances of an Azure service User-assigned managed identities and OAuth2 are the answers
upvoted 2 times
...
nkv
3 years, 7 months ago
Came in exam on 20-sep-21, i passed, answers are correct
upvoted 3 times
examineezer
3 years, 4 months ago
Rubbish
upvoted 11 times
...
...
Gautam1985
3 years, 8 months ago
Its should be user Assigned Managed Identity. Second question answer is correct.
upvoted 4 times
...
teehex
3 years, 8 months ago
Guys, the hint is this the word "Only" >>> "...authenticate only when running on the 10 virtual machines.". With system-assigned managed identity it is tied to the VM you assign only. But with user-assigned managed identity you can add it to anywhere else.
upvoted 1 times
pentium75
3 years, 8 months ago
"With system-assigned managed identity it is tied to the (!) VM you assign only" - exactly, there is a dedicated identity for EACH VM. But the requirement here is that all VMs must use "the same identity", thus system-assigned MI can't work.
upvoted 6 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago