New-AzureRmRoleAssignment:无法使用指定的命名参数解析参数集

时间:2018-03-20 16:05:08

标签: azure variable-assignment role

我正在尝试从用户更改角色。在我看来,这必须由New-AzureRmRoleAssignment完成,因为没有更改或设置命令。当我尝试将角色分配给用户时,我收到消息:

New-AzureRmRoleAssignment -SignInName "tyler.xxxxx_xxxxx-europe.com"  -RoleDefinitionid 4befb2f4-78ae-4354-9bbe-91f67ac41224 -ResourceGroupName "Default-Networking"

我正在使用的命令是:

$.ajax({
    method: "GET",
    url: "https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=<app ID>&redirect_uri=http%3A%2F%2Flocalhost/myapp%2F&response_type=code&state=1234&scope=mail.read",
    async: true,
    cache: false,
    dataType: "json",
    complete: function(response){
        console.log(response.responseText);
    },
});

我在做了一个get角色后复制了id。

我不知道为什么收到这条消息,有人可以给我建议吗?

莱昂

1 个答案:

答案 0 :(得分:0)

似乎不支持这些参数组合。

您可以使用角色定义名称而不是ID来执行此操作:

New-AzureRmRoleAssignment -SignInName 'user@company.com' -ResourceGroupName 'resource-group-name' -RoleDefinitionName 'Reader'