Azure RBAC(Azure 역할 기반 액세스 제어)는 Azure 리소스에 대한 액세스를 관리하는 데 사용하는 권한 부여 시스템입니다. Azure 리소스에서 액세스를 제거하려면 역할 할당을 제거합니다. 이 문서에서는 Azure Portal, Azure PowerShell, Azure CLI 및 REST API를 사용하여 역할 할당을 제거하는 방법을 설명합니다.
필수 조건
역할 할당을 제거하려면 다음이 있어야 합니다.
- 
              
Microsoft.Authorization/roleAssignments/delete권한(예: 역할 기반 액세스 제어 관리자) 
REST API의 경우 다음 버전을 사용해야 합니다.
- 
              
2015-07-01이상 
자세한 내용은 Azure RBAC REST API의 API 버전을 참조하세요.
Azure 포털
액세스를 제거하려는 관리 그룹, 구독, 리소스 그룹 또는 리소스와 같은 범위에서 IAM(Access Control) 을 엽니다.
역할 할당 탭을 클릭하여 이 범위의 모든 역할 할당을 봅니다.
역할 할당 목록에서 제거하려는 역할 할당을 가진 보안 주체의 역할 할당 옆을 체크합니다.
제거를 클릭합니다.
표시되는 역할 할당 제거 메시지에서 예를 클릭합니다.
상속된 역할 할당을 제거할 수 없다는 메시지가 표시되면 자식 범위에서 역할 할당을 제거하려고 합니다. 역할이 할당된 범위에서 액세스 제어(IAM)를 열고 다시 시도해야 합니다. 올바른 범위에서 액세스 제어(IAM)를 여는 빠른 방법은 범위 열을 보고 옆에 있는 링크 (상속됨)를 클릭하는 것입니다.
Azure PowerShell
Azure PowerShell에서는 Remove-AzRoleAssignment를 사용하여 역할 할당을 제거합니다.
다음 예제에서는 pharma-sales 리소스 그룹의 사용자에서 patlong@contoso.comVirtual Machine 기여자 역할 할당을 제거합니다.
PS C:\> Remove-AzRoleAssignment -SignInName patlong@contoso.com `
-RoleDefinitionName "Virtual Machine Contributor" `
-ResourceGroupName pharma-sales
구독 범위에서 ID가 222222222-2222-2222-2222-2222222222222인 Ann Mack 팀 그룹에서 읽기 권한자 역할을 제거합니다.
PS C:\> Remove-AzRoleAssignment -ObjectId 22222222-2222-2222-2222-222222222222 `
-RoleDefinitionName "Reader" `
-Scope "/subscriptions/00000000-0000-0000-0000-000000000000"
관리 그룹 범위의 사용자에서 alain@example.com기 역할을 제거합니다.
PS C:\> Remove-AzRoleAssignment -SignInName alain@example.com `
-RoleDefinitionName "Billing Reader" `
-Scope "/providers/Microsoft.Management/managementGroups/marketing-group"
ID 33333333-3333-3333-3333-333333333333의 주체에서 ID 18d7d88d-d35e-4fb5-a5c3-7773c20a72d9의 사용자 액세스 관리자 역할을 ID 00000000-0000-0000-0000-000000000000의 구독 범위에서 제거합니다.
PS C:\> Remove-AzRoleAssignment -ObjectId 33333333-3333-3333-3333-333333333333 `
-RoleDefinitionId 18d7d88d-d35e-4fb5-a5c3-7773c20a72d9 `
-Scope /subscriptions/00000000-0000-0000-0000-000000000000
"제공된 정보가 역할 할당에 매핑되지 않음"이라는 오류 메시지가 표시되면 매개 변수도 -Scope 지정 -ResourceGroupName 해야 합니다. 자세한 내용은 Azure RBAC 문제 해결을 참조하세요.
Azure 커맨드 라인 인터페이스 (CLI)
Azure CLI에서는 az role assignment delete를 사용하여 역할 할당을 제거합니다.
다음 예제에서는 pharma-sales 리소스 그룹의 사용자에서 patlong@contoso.comVirtual Machine 기여자 역할 할당을 제거합니다.
az role assignment delete --assignee "patlong@contoso.com" \
--role "Virtual Machine Contributor" \
--resource-group "pharma-sales"
구독 범위에서 ID가 222222222-2222-2222-2222-2222222222222인 Ann Mack 팀 그룹에서 읽기 권한자 역할을 제거합니다.
az role assignment delete --assignee "22222222-2222-2222-2222-222222222222" \
--role "Reader" \
--scope "/subscriptions/00000000-0000-0000-0000-000000000000"
관리 그룹 범위의 사용자에서 alain@example.com기 역할을 제거합니다.
az role assignment delete --assignee "alain@example.com" \
--role "Billing Reader" \
--scope "/providers/Microsoft.Management/managementGroups/marketing-group"
REST API
REST API에서 역할 할당 - 삭제를 사용하여 역할 할당을 제거합니다.
GUID(역할 할당 식별자)를 가져옵니다. 이 식별자는 역할 할당을 처음 만들거나 역할 할당을 나열하여 가져올 때 반환됩니다.
다음 요청으로 시작합니다.
DELETE https://management.azure.com/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentId}?api-version=2022-04-01URI 내에서 {scope} 를 역할 할당을 제거하기 위한 범위로 바꿉니다.
Scope 유형 providers/Microsoft.Management/managementGroups/{groupId1}관리 그룹 subscriptions/{subscriptionId1}Subscription subscriptions/{subscriptionId1}/resourceGroups/myresourcegroup1리소스 그룹 subscriptions/{subscriptionId1}/resourceGroups/myresourcegroup1/providers/microsoft.web/sites/mysite1Resource {roleAssignmentId}를 역할 할당의 GUID 식별자로 바꿉니다.
다음 요청은 구독 범위에서 지정된 역할 할당을 제거합니다.
DELETE https://management.azure.com/subscriptions/{subscriptionId1}/providers/microsoft.authorization/roleassignments/{roleAssignmentId1}?api-version=2022-04-01다음은 출력의 예를 보여줍니다.
{ "properties": { "roleDefinitionId": "/subscriptions/{subscriptionId1}/providers/Microsoft.Authorization/roleDefinitions/a795c7a0-d4a2-40c1-ae25-d81f01202912", "principalId": "{objectId1}", "principalType": "User", "scope": "/subscriptions/{subscriptionId1}", "condition": null, "conditionVersion": null, "createdOn": "2022-05-06T23:55:24.5379478Z", "updatedOn": "2022-05-06T23:55:24.5379478Z", "createdBy": "{createdByObjectId1}", "updatedBy": "{updatedByObjectId1}", "delegatedManagedIdentityResourceId": null, "description": null }, "id": "/subscriptions/{subscriptionId1}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentId1}", "type": "Microsoft.Authorization/roleAssignments", "name": "{roleAssignmentId1}" }
ARM template
ARM 템플릿(Azure Resource Manager 템플릿)을 사용하여 역할 할당을 제거하는 방법은 없습니다. 역할 할당을 제거하려면 Azure Portal, Azure PowerShell, Azure CLI 또는 REST API와 같은 다른 도구를 사용해야 합니다.