- Article
- 11 minutes to read
As a global administrator in Azure Active Directory (Azure AD), you might not have access to all subscriptions and management groups in your directory. This article describes how to increase your access to all subscriptions and management groups.
Use
For information on viewing or deleting personal data, seeAzure data subject requests for GDPR. For more information on GDPR seeGDPR section in the Microsoft Trust Centerit's himGDPR section of the Service Trust portal.
Why should you increase your access?
If you are a global admin, there may be times when you want to do the following:
- Regain access to an Azure subscription or management group when a user loses access
- Gewähren Sie sich selbst oder einem anderen Benutzer Zugriff auf ein Azure-Abonnement oder eine Verwaltungsgruppe
- View all management groups or Azure subscriptions in an organization
- Allow an automation application (such as a billing or monitoring application) to access any Azure management group or subscription
How does elevated access work?
Azure AD and Azure resources are backed up independently. That is, Azure AD role assignments don't grant access to Azure resources and Azure role assignments don't grant access to Azure AD. However, if you aglobal adminIn Azure AD, access can be assigned to all management groups and Azure subscriptions in your directory. Use this feature when you don't have access to your Azure subscription resources, such as virtual machines or storage accounts, and want to use your global admin permission to access those resources.
If you upgrade your access, you will receive theuser access managerRole in Azure in the root scope (/
). This allows you to view all resources and assign access to any subscription or management group in the directory. Administrator role assignments for user access can be removed using Azure PowerShell, Azure CLI, or REST API.
You must remove this elevated access after making the necessary changes to the root scope.
blue portal
Elevate access to a global admin
Follow these steps to increase access to a global admin from the Azure portal.
login inblue portalor theAzure Active Directory Admin Centeras a global administrator.
Se us Azure AD Privileged Identity Management,Activate your global admin role assignment.
Open mindedAzure Active Directory.
UnderTut, Selectcharacteristics.
UnderAccess management for Azure resources, switch toSim.
When you set the switch toSim, get the User Access Administrator role in Azure RBAC in the root (/) scope. This gives you permission to assign roles to all Azure subscriptions and management groups associated with this Azure AD directory. This option is only available for users who have been assigned the global administrator role in Azure AD.
When you set the switch toNot, the User Access Administrator role in Azure RBAC is removed from your user account. You can no longer assign roles for all Azure subscriptions and management groups associated with this Azure AD directory. You can only view and manage Azure subscriptions and management groups to which you have been granted access.
Use
if you usePrivileged Identity Management, disabling your role assignment doesn't change theAccess management for Azure resourcesswitch toNot. To retain least privileged access, we recommend setting this option toNotbefore deactivating your role assignment.
give clickSave on computerto save your settings.
This setting is not a global property and only applies to the currently logged in user. You cannot increase access for all members of the global administrator role.
Log out and back in to refresh your access.
You should now have access to all subscriptions and management groups in your directory. If you view the Access Control Panel (IAM), you will see that you have been assigned the User Access Administrator role at the root level.
Make the required changes to Elevated Access.
For information about assigning roles, seeAssign Azure roles through the Azure portal. If you use Privileged Identity Management, seeDiscover Azure resources to manageÖAssign Azure resource roles.
Follow the steps in the next section to remove your increased access.
remove elevated access
How to remove admin role assignment for user access in root scope (/
), follow these steps.
Sign in as the same user used to elevate access.
Click in the navigation listAzure Active Directoryand then clickcharacteristics.
ChooseAccess management for Azure resourcesswitch back toNot. Because this is a per-user configuration, you must log in as the same user that was used to elevate access.
When you try to remove the user's role assignment for Access Administrator in Access Control Panel (IAM), the following message is displayed. To remove the role assignment, you must reconfigure the switchNoto Use o Azure PowerShell, a CLI for Azure or an API REST.
Log in as a global administrator.
If you're using Privileged Identity Management, disable your global admin role assignment.
Use
if you usePrivileged Identity Management, disabling your role assignment doesn't change theAccess management for Azure resourcesswitch toNot. To retain least privileged access, we recommend setting this option toNotbefore deactivating your role assignment.
Azure-PowerShell
Use
We recommend that you use the Azure Az PowerShell module to interact with Azure. To lookInstall Azure PowerShellBegin. For information on migrating to the Az PowerShell module, seeMigrate Azure PowerShell from AzureRM to Az.
List role assignment in root scope (/)
To list the User Access Administrator role assignment for a user at root (/
), not usefulGet-AzRoleAssignmentDomain.
Get-AsRoleAssignment | where {$_.RoleDefinitionName -eq "User Access Manager" ` -y $_.SignInName -eq "<username@example.com>" -y $_.Scope -eq "/"}
ROLEASSIGNmentId: /providers/microsoft.authorization/roleassignments/11111111111111111-111111111111111111scope:/displayName: userNameSigninName: userName@example.ComrolEdinitionName: AdministratRolEDefinitIdidIdidIdIdIdidIdInition@example.ChroledEfinitionName: AdministratrolEDefinitIdid: 2222-2222-222222222222ObjectType: UserCanDelegate: Falso
remove elevated access
To unassign user access admin roles for yourself or another user at root level (/
), follow these steps.
Sign in as a user who can remove elevated access. This can be the same user used to elevate access, or another global admin with elevated access at the root scope.
Use oRemove-AzRoleAssignmentCommand to unassign administrator roles for user access.
Remove-AzRoleAssignment -SignInName <username@example.com> ` -RoleDefinitionName "User Access Manager" -Scope "/"
CLI power Azure
Elevate access to a global admin
Use the following basic steps to elevate access to a global admin using the Azure CLI.
Use othe restcommand to call
elevarAccess
endpoint, giving it the role of user access manager in the root scope (/
).See AlsoThe COM Elevation Nickname: Win32 ApplicationsAzure AD Connect: Use a SAML 2.0 Identity Provider for Single Sign-On - Azure - MicrosoftSlmgr.vbs options for getting volume activation informationTroubleshoot authentication errors when using RDP to connect to Azure VM - Virtual Machinesaz rest --method post --url "/providers/Microsoft.Authorization/elevateAccess?api-version=2016-07-01"
Make the required changes to Elevated Access.
For information about assigning roles, seeAssign Azure roles using the Azure CLI.
Follow the steps in a later section to remove your extended access.
List role assignment in root scope (/)
To list the User Access Administrator role assignment for a user at root (/
), not usefulaz role assignment listDomain.
az role assignment list --role "admin user access" --scope "/"
[ { "canDelegate": null, "id": "/providers/Microsoft.Authorization/roleAssignments/11111111-1111-1111-1111-111111111111", "name": "11111111-1111-1111-1111-111111111111", " principalId": "22222222-2222-2222-2222-222222222222", "principalName": "username@example.com", "principalType": "Usuário", "roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/18d7d88d -d35e-4fb5-a5c3-7773c20a72d9", "roleDefinitionName": "User Access Manager", "scope": "/", "type": "Microsoft.Authorization/roleAssignments" }]
remove elevated access
To unassign user access admin roles for yourself or another user at root level (/
), follow these steps.
Sign in as a user who can remove elevated access. This can be the same user used to elevate access, or another global admin with elevated access at the root scope.
Use oRemove role assignmentCommand to unassign administrator roles for user access.
Remove az role assignment --assignee username@example.com --role "User Access Admin" --scope "/"
API-REST
previous requirements
You must use the following versions:
01.07.2015
or later to list and remove role assignments01.07.2016
or at the back for better access2018-07-01 forecast
or later to list rejected assignments
For more information, seeAPI versions of the Azure RBAC REST APIs.
Elevate access to a global admin
Use the following basic steps to increase access to a global admin using the REST API.
Call with REST
elevarAccess
, giving him the Administrator role for user access in the root scope (/
).POST https://management.azure.com/providers/Microsoft.Authorization/elevateAccess?api-version=2016-07-01
Make the required changes to Elevated Access.
For information about assigning roles, seeAssign Azure roles using REST API.
Follow the steps in a later section to remove your extended access.
List role assignments in root scope (/)
You can list all role assignments for a user in the root scope (/
).
ConnectRole Assignments - Scope ListWhere from
{objectIdOfUser}
is the object ID of the user whose role assignments you want to retrieve.GET https://management.azure.com/providers/Microsoft.Authorization/roleAssignments?api-version=2022-04-01&$filter=principalId+eq+'{objectIdOfUser}'
List of deny mappings in the root area (/)
You can list all denied roles for a user in the root scope (/
).
Chame um GET denyAssignments onde
{objectIdOfUser}
is the object ID of the user whose deny assignments you want to retrieve.GET https://management.azure.com/providers/Microsoft.Authorization/denyAssignments?api-version=2022-04-01&$filter=gdprExportPrincipalId+eq+'{objectIdOfUser}'
remove elevated access
when you callelevarAccess
, create a role assignment for yourself. To revoke these permissions, you must remove the User Access Admin role assignment for yourself at root (/
).
ConnectFunction Definitions - GetWhere from
paper name
equals User Access Administrator to determine the User Access Administrator role name ID.GET https://management.azure.com/providers/Microsoft.Authorization/roleDefinitions?api-version=2022-04-01&$filter=roleName+eq+'User Access Manager'
{ "value": [ { "properties": { "roleName": "User Access Manager", "type": "BuiltInRole", "description": "Approve access rights or access to use Azure recursions" , " AssignableScopes": [ "/" ], "permissions": [ { "actions": [ "*/read", "Microsoft.Authorization/*", "Microsoft.Support/*" ], "notActions": [ ] } ]," createdOn": "0001-01-01T08:00:00.0000000Z", "updatedOn": "2016-05-31T23:14:04.6964687Z", "createdBy": null, "updatedBy": null } , " id": "/providers/Microsoft.Authorization/roleDefinitions/18d7d88d-d35e-4fb5-a5c3-7773c20a72d9", "type": "Microsoft.Authorization/roleDefinitions", "name": "18d7d88d-d35e-4fb5-a5c3 -7773c20a72d9 " } ] , "next link": null}
Salve o ID
Name
parameters, in this case18d7d88d-d35e-4fb5-a5c3-7773c20a72d9
.You must also list the Directory Admin role assignment in the Directory pane. List all directory related mappings for the
Principal ID
by the directory administrator who placed the elevated access call. This lists all mappings in the dictionary for the object ID.GET https://management.azure.com/providers/Microsoft.Authorization/roleAssignments?api-version=2022-04-01&$filter=principalId+eq+'{objectid}'
Use
A directory manager should not have too many assignments. If the query above returns too many associations, you can also query all associations at the directory scope level only, and then filter the results:
GET https://management.azure.com/providers/Microsoft.Authorization/roleAssignments?api-version=2022-04-01&$filter=atScope()
The above calls return a list of role assignments. Locate the role assignment where the scope resides
"/"
it's himfunction definition ID
ends with the ID of the function name you found in step 1 andPrincipal ID
matches the directory manager's object ID.Example role assignment:
{ "value": [ { "properties": { "roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/18d7d88d-d35e-4fb5-a5c3-7773c20a72d9", "principalId": "{objectID}", "scope" : "/", "created on": "2016-08-17T19:21:16.3422480Z", "updated on": "2016-08-17T19:21:16.3422480Z", "created by": "22222222-2222 -2222- 2222-222222222222", "updated by": "22222222-2222-2222-2222-222222222222" }, "id": "/providers/Microsoft.Authorization/roleAssignments/11111111-1111-1111-1111-111" , "type": "Microsoft.Authorization/roleAssignments", "name": "11111111-1111-1111-1111-111111111111" } ], "nextLink": null}
Save the ID of the again
Name
Parameters, in this case 11111111-1111-1111-1111-111111111111.Finally, use the role assignment ID to remove the role added by
elevarAccess
:REMOVER https://management.azure.com/providers/Microsoft.Authorization/roleAssignments/11111111-1111-1111-1111-111111111111?api-version=2022-04-01
View elevated access logs
When access is increased, an entry is added to the logs. As a global admin in Azure AD, you may want to review when and by whom access was elevated. Elevated log entries do not appear in standard activity logs, but appear in directory activity logs. This section describes different ways to view elevated access logs.
View elevated access logs through the Azure portal
Follow the steps earlier in this article to increase your access.
login inblue portalas a global administrator.
Open mindedMonitor>activity log.
change thatactivitysoon toDirectory activity.
Look for the following operation which means the elevated access action.
Assigns the user access manager role to the caller
Follow the steps earlier in this article to remove elevated access.
View elevated access logs using the Azure CLI
Follow the steps earlier in this article to increase your access.
Use oregister azCommand to login as global administrator.
Use othe restCommand to make the following call where you need to filter on a date as shown with the sample timestamp and specify a filename to save the records as.
Him
URL
calls an API to get the records in Microsoft.Insights. The output is saved to your file.az rest --url "https://management.azure.com/providers/Microsoft.Insights/eventtypes/management/values?api-version=2015-04-01&$filter=eventTimestamp ge '2021-09-10T20:00 :00Z'" > salida.txt
Look in the output file
elevarAccess
.The log looks like this, where you can see the timestamp of when the action took place and who called it.
"submissionTimestamp": "2021-08-27T15:42:00.1527942Z", "subscriptionId": "", "tenantId": "33333333-3333-3333-3333-333333333333"},{ "authorization": { "action" : "Microsoft.Authorization/elevateAccess/action", "scope": "/providers/Microsoft.Authorization" }, "caller": "user@example.com", "category": { "localizedValue": "Administrative", "Wert": "Administrativ" },
Follow the steps earlier in this article to remove elevated access.
Delegate access to a group to view elevated access logs using the Azure CLI
If you want to periodically get elevated access logs, you can delegate access to a group and use the Azure CLI.
Open mindedAzure Active Directory>The group.
Create a new security group and note the group's object ID.
Follow the steps earlier in this article to increase your access.
Use oregister azCommand to login as global administrator.
Use oCreation of an az role assignmentCommand to assign theReaderRole for the group that can only read directory-level records located under
Microsoft/Insights
.az Rollenzuweisung create --assignee "{groupId}" --role "Reader" --scope "/providers/Microsoft.Insights"
Add a user who will read the logs to the group created above.
Follow the steps earlier in this article to remove elevated access.
A group user can now regularly run thethe restCommand to display elevated access logs.
az rest --url "https://management.azure.com/providers/Microsoft.Insights/eventtypes/management/values?api-version=2015-04-01&$filter=eventTimestamp ge '2021-09-10T20:00 :00Z'" > salida.txt
Next Steps
- Understand the different roles.
- Assign Azure roles using REST API