Aracılığıyla paylaş


Role Assignments - Create By Id

Role atamayı kimliğine göre oluşturun veya güncelleştirin.

PUT https://management.azure.com/{roleAssignmentId}?api-version=2022-04-01

URI Parametreleri

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

string

Kapsam, kaynak adı ve kaynak türü dahil olmak üzere rol atamasının tam kimliği. Biçim: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Örnek: /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>

api-version
query True

string

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

İstek Gövdesi

Name Gerekli Tür Description
properties.principalId True

string

Asıl kimlik.

properties.roleDefinitionId True

string

Rol tanımı kimliği.

properties.condition

string

Rol ataması koşulları. Bu, atanabileceği 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.delegatedManagedIdentityResourceId

string

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

properties.description

string

Rol atamasının açıklaması

properties.principalType

PrincipalType

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

Yanıtlar

Name Tür Description
200 OK

RoleAssignment

Rol atamasını döndürür.

201 Created

RoleAssignment

Rol atamasını döndürür.

Other Status Codes

ErrorResponse

İşlemin neden başarısız olduğunu açıklayan hata yanıtı.

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

Create or update role assignment by ID

Örnek isteği

PUT https://management.azure.com/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleAssignments/b0f43c54-e787-4862-89b1-a653fa9cf747?api-version=2022-04-01

{
  "properties": {
    "roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d",
    "principalId": "ce2ce14e-85d7-4629-bdbc-454d0519d987",
    "principalType": "User"
  }
}

Örnek yanıt

{
  "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"
  },
  "id": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleAssignments/b0f43c54-e787-4862-89b1-a653fa9cf747",
  "type": "Microsoft.Authorization/roleAssignments",
  "name": "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"
  },
  "id": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleAssignments/b0f43c54-e787-4862-89b1-a653fa9cf747",
  "type": "Microsoft.Authorization/roleAssignments",
  "name": "b0f43c54-e787-4862-89b1-a653fa9cf747"
}

Tanımlar

Name Description
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ı

RoleAssignmentCreateParameters

Rol ataması parametreleri oluşturur.

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ü.

Name Tür Description
Device

string

ForeignGroup

string

Group

string

ServicePrincipal

string

User

string

RoleAssignment

Rol Atamaları

Name Tür Default value Description
id

string

Rol atama kimliği.

name

string

Rol ataması adı.

properties.condition

string

Rol ataması koşulları. Bu, atanabileceği 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

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

Güncelleştirme zamanı

type

string

Rol atama türü.

RoleAssignmentCreateParameters

Rol ataması parametreleri oluşturur.

Name Tür Default value Description
properties.condition

string

Rol ataması koşulları. Bu, atanabileceği 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

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

Güncelleştirme zamanı