Role Assignments - List For Resource

Bir kaynağa uygulanan tüm rol atamalarını listeleyin.

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/roleAssignments?api-version=2022-04-01
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/roleAssignments?api-version=2022-04-01&$filter={$filter}&tenantId={tenantId}

URI Parametreleri

Name İçinde Gerekli Tür Description
resourceGroupName
path True

string

Kaynak grubunun adı. Ad büyük/küçük harfe duyarsız.

resourceName
path True

string

Rol atamaları için kaynağın adı.

resourceProviderNamespace
path True

string

Kaynak sağlayıcısının ad alanı.

resourceType
path True

string

Kaynağın kaynak türü.

subscriptionId
path True

string

Hedef aboneliğin kimliği.

api-version
query True

string

minLength: 1

Bu işlem için kullanılacak API sürümü.

$filter
query

string

İşlemde uygulanacak filtre. Kapsamın üzerindeki veya üzerindeki tüm rol atamalarını döndürmek için $filter=atScope() kullanın. Belirtilen sorumlunun kapsamının üstündeki veya altındaki tüm rol atamalarını döndürmek için $filter=principalId eq {id} kullanın.

tenantId
query

string

Kiracılar arası istek için kiracı kimliği

Yanıtlar

Name Tür Description
200 OK

RoleAssignmentListResult

İstek başarılı oldu.

Other Status Codes

ErrorResponse

Beklenmeyen bir hata yanıtı.

İzinler

Bu API’yi çağırmak için aşağıdaki izinlere sahip bir rol atanması gerekir. Daha fazla bilgi için bkz. Azure yerleşik rolleri.

Microsoft.Authorization/roleAssignments/read

Güvenlik

azure_auth

Azure Active Directory OAuth2 Flow.

Tür: oauth2
Akış: implicit
Yetkilendirme URL’si: https://login.microsoftonline.com/common/oauth2/authorize

Kapsamlar

Name Description
user_impersonation kullanıcı hesabınızın kimliğine bürünme

Örnekler

List role assignments for a resource

Örnek isteği

GET https://management.azure.com/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/resourceGroups/testrg/providers/Microsoft.DocumentDb/databaseAccounts/test-db-account/providers/Microsoft.Authorization/roleAssignments?api-version=2022-04-01

Örnek yanıt

{
  "value": [
    {
      "name": "b0f43c54-e787-4862-89b1-a653fa9cf747",
      "type": "Microsoft.Authorization/roleAssignments",
      "id": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleAssignments/b0f43c54-e787-4862-89b1-a653fa9cf747",
      "properties": {
        "roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d",
        "principalId": "ce2ce14e-85d7-4629-bdbc-454d0519d987",
        "principalType": "User",
        "scope": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2"
      }
    },
    {
      "name": "96786e4b-dede-4c2e-8736-8ab911987f08",
      "type": "Microsoft.Authorization/roleAssignments",
      "id": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/resourceGroups/testrg/providers/Microsoft.Authorization/roleAssignments/96786e4b-dede-4c2e-8736-8ab911987f08",
      "properties": {
        "roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d",
        "principalId": "ce2ce14e-85d7-4629-bdbc-454d0519d987",
        "principalType": "User",
        "scope": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/resourceGroups/testrg"
      }
    },
    {
      "name": "05c5a614-a7d6-4502-b150-c2fb455033ff",
      "type": "Microsoft.Authorization/roleAssignments",
      "id": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/resourceGroups/testrg/providers/Microsoft.DocumentDb/databaseAccounts/test-db-account/providers/Microsoft.Authorization/roleAssignments/05c5a614-a7d6-4502-b150-c2fb455033ff",
      "properties": {
        "roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d",
        "principalId": "ce2ce14e-85d7-4629-bdbc-454d0519d987",
        "principalType": "User",
        "scope": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/resourceGroups/testrg/providers/Microsoft.DocumentDb/databaseAccounts/test-db-account"
      }
    }
  ]
}

Tanımlar

Name Description
createdByType

Kaynağı oluşturan kimliğin türü.

ErrorAdditionalInfo

Kaynak yönetimi hatası ek bilgileri.

ErrorDetail

Hata ayrıntısı.

ErrorResponse

Hata yanıtı

PrincipalType

Atanan asıl kimliğin asıl türü.

RoleAssignment

Rol Atamaları

RoleAssignmentListResult

Rol atama listesi işlem sonucu.

systemData

Kaynağın oluşturulması ve son değiştirilmesiyle ilgili meta veriler.

createdByType

Kaynağı oluşturan kimliğin türü.

Değer Description
User
Application
ManagedIdentity
Key

ErrorAdditionalInfo

Kaynak yönetimi hatası ek bilgileri.

Name Tür Description
info

object

Ek bilgiler.

type

string

Ek bilgi türü.

ErrorDetail

Hata ayrıntısı.

Name Tür Description
additionalInfo

ErrorAdditionalInfo[]

Hata ek bilgileri.

code

string

Hata kodu.

details

ErrorDetail[]

Hata ayrıntıları.

message

string

Hata iletisi.

target

string

Hata hedefi.

ErrorResponse

Hata yanıtı

Name Tür Description
error

ErrorDetail

Hata nesnesi.

PrincipalType

Atanan asıl kimliğin asıl türü.

Değer Description
User

User

Group

Grup

ServicePrincipal

Hizmet İlkesi (ServicePrincipal)

ForeignGroup

ForeignGroup

Device

Cihaz

RoleAssignment

Rol Atamaları

Name Tür Default value Description
id

string

Kaynağın tam kaynak kimliği. Örn - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

name

string

Kaynağın adı

properties.condition

string

Rol ataması koşulları. Bu, atanabilen kaynakları sınırlar. Örneğin: @Resource[Microsoft. Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'

properties.conditionVersion

string

Koşulun sürümü. Şu anda kabul edilen tek değer '2.0'

properties.createdBy

string

Atamayı oluşturan kullanıcının kimliği

properties.createdOn

string (date-time)

Oluşturulduğu zaman

properties.delegatedManagedIdentityResourceId

string

Temsilci olarak atanan yönetilen kimlik kaynağının kimliği

properties.description

string

Rol atamasının açıklaması

properties.principalId

string

Asıl kimlik.

properties.principalType

PrincipalType

User

Atanan asıl kimliğin asıl türü.

properties.roleDefinitionId

string

Rol tanımı kimliği.

properties.scope

string

Rol atama kapsamı.

properties.updatedBy

string

Atamayı güncelleştiren kullanıcının kimliği

properties.updatedOn

string (date-time)

Güncelleştirilen zaman

systemData

systemData

Azure Resource Manager metadata içeren createdBy ve modifiedBy bilgileri.

type

string

Kaynağın türü. Örneğin "Microsoft. Compute/virtualMachines" veya "Microsoft. Depo/Depolama Hesapları"

RoleAssignmentListResult

Rol atama listesi işlem sonucu.

Name Tür Description
nextLink

string (uri)

Öğelerin bir sonraki sayfasına bağlantı

value

RoleAssignment[]

Bu sayfadaki RoleAssignment öğeleri

systemData

Kaynağın oluşturulması ve son değiştirilmesiyle ilgili meta veriler.

Name Tür Description
createdAt

string (date-time)

Kaynak oluşturma (UTC) zaman damgası.

createdBy

string

Kaynağı oluşturan kimlik.

createdByType

createdByType

Kaynağı oluşturan kimliğin türü.

lastModifiedAt

string (date-time)

Kaynağın son değişikliğinin zaman damgası (UTC)

lastModifiedBy

string

Kaynağı en son değiştiren kimlik.

lastModifiedByType

createdByType

Kaynağı en son değiştiren kimlik türü.