az role definition

Rol tanımlarını yönetme.

Komutlar

az role definition create

Özel bir rol tanımı oluşturun.

az role definition delete

Rol tanımını silin.

az role definition list

Rol tanımlarını listeleyin.

az role definition update

Rol tanımını güncelleştirme.

az role definition create

Özel bir rol tanımı oluşturun.

az role definition create --role-definition

Örnekler

Depolama ve ağ kaynaklarına salt okunur erişime ve VM'leri başlatma veya yeniden başlatma özelliğine sahip bir rol oluşturun. (Bash)

az role definition create --role-definition '{
    "Name": "Contoso On-call",
    "Description": "Perform VM actions and read storage and network information.",
    "Actions": [
        "Microsoft.Compute/*/read",
            "Microsoft.Compute/virtualMachines/start/action",
            "Microsoft.Compute/virtualMachines/restart/action",
            "Microsoft.Network/*/read",
        "Microsoft.Storage/*/read",
            "Microsoft.Authorization/*/read",
        "Microsoft.Resources/subscriptions/resourceGroups/read",
        "Microsoft.Resources/subscriptions/resourceGroups/resources/read",
        "Microsoft.Insights/alertRules/*",
            "Microsoft.Support/*"
    ],
    "DataActions": [
        "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/*"
    ],
    "NotDataActions": [
        "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/write"
    ],
    "AssignableScopes": ["/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"]
}'

JSON açıklaması içeren bir dosyadan rol oluşturun.

az role definition create --role-definition @ad-role.json

Gerekli Parametreler

--role-definition

JSON rolü açıklaması veya JSON açıklaması içeren dosyanın yolu.

az role definition delete

Rol tanımını silin.

az role definition delete --name
                          [--custom-role-only {false, true}]
                          [--resource-group]
                          [--scope]

Örnekler

Rol tanımını silin. (otomatik olarak oluşturulmuş)

az role definition delete --name MyRole

Gerekli Parametreler

--name -n

Rolün adı.

İsteğe Bağlı Parametreler

--custom-role-only

Yalnızca özel roller (yerleşik rollerle karşılaştırması).

kabul edilen değerler: false, true
--resource-group -g

Bunu yalnızca rol veya atama bir kaynak grubu düzeyinde eklenmişse kullanın.

--scope

Rol atamasının veya tanımın uygulandığı kapsam; örneğin, /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333, /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333/resourceGroups/myGroup veya /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333/resourceGroups/myGroup/providers/Microsoft.Compute/virtualMachines/myVM.

az role definition list

Rol tanımlarını listeleyin.

az role definition list [--custom-role-only {false, true}]
                        [--name]
                        [--resource-group]
                        [--scope]

İsteğe Bağlı Parametreler

--custom-role-only

Yalnızca özel roller (yerleşik rollerle karşılaştırması).

kabul edilen değerler: false, true
--name -n

Rolün adı.

--resource-group -g

Bunu yalnızca rol veya atama bir kaynak grubu düzeyinde eklenmişse kullanın.

--scope

Rol atamasının veya tanımın uygulandığı kapsam; örneğin, /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333, /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333/resourceGroups/myGroup veya /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333/resourceGroups/myGroup/providers/Microsoft.Compute/virtualMachines/myVM.

az role definition update

Rol tanımını güncelleştirme.

az role definition update --role-definition

Örnekler

"az role definition list" çıktısını kullanarak bir rolü güncelleştirin. (Bash)

az role definition update --role-definition '{
    "roleName": "Contoso On-call",
    "Description": "Perform VM actions and read storage and network information.",
    "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/providers/Microsoft.Authorization/roleDefinitions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "roleType": "CustomRole",
    "type": "Microsoft.Authorization/roleDefinitions",
    "Actions": [
        "Microsoft.Compute/*/read",
            "Microsoft.Compute/virtualMachines/start/action",
            "Microsoft.Compute/virtualMachines/restart/action",
            "Microsoft.Network/*/read",
        "Microsoft.Storage/*/read",
            "Microsoft.Authorization/*/read",
        "Microsoft.Resources/subscriptions/resourceGroups/read",
        "Microsoft.Resources/subscriptions/resourceGroups/resources/read",
        "Microsoft.Support/*"
        ],
        "DataActions": [
            "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/*"
    ],
    "NotDataActions": [
        "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/write"
    ],
    "AssignableScopes": ["/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"]
}'

Gerekli Parametreler

--role-definition

JSON olarak mevcut bir rolün açıklaması veya JSON açıklaması içeren bir dosyanın yolu.