如何使用 powershell 命令为 Azure DataLake Store 中的 Azure Active directory 应用程序设置权限

How to set permission for Azure Active directory application in Azure DataLake Store using powershell commands

嗨,

我正在尝试使用 powershell 命令在 ADLS(Azure DataLakeStore) 中设置 AAD(Azure Active Directory) 应用程序权限(read/write/execute 和其他设置)。

我尝试使用以下 powershell 命令:

Set-AzureRmDataLakeStoreItemAclEntry -AccountName "adls" -Path / -AceType User -Id (Get-AzureRmADApplication -ApplicationId 490eee0-2ee1-51ee-88er-0f53aerer7b).ApplicationId -Permissions All

但是此命令 sets/displays ADLS 中 "Access" 属性下的 ApplicationId 仅具有 read/write/execute 访问权限。但是这个设置不正确,因为我在 ADLS 中执行了服务身份验证的手动步骤。

有没有其他方法可以在ADLS中设置AAD应用程序的权限?

您需要将 ObjectId(不是应用程序 ID)作为 Id 参数设置为 Set-AzureRmDataLakeStoreItemAclEntry

Set-AzureRmDataLakeStoreItemAclEntry -AccountName "adls" -Path / -AceType User -Id (Get-AzureRmADApplication -ApplicationId 490eee0-2ee1-51ee-88er-0f53aerer7b).Id -Permissions All

Set-AzureRmDataLakeStoreItemAclEntry 命令的参数 User 应该是要修改的 AzureActive Directory 用户、组或 服务主体 的对象 ID ACE.

您可以参考以下命令分配权限:

Set-AzureRmDataLakeStoreItemAclEntry -AccountName "accountName" -Path / -AceType User -Id
(Get-AzureRmADServicePrincipal -ServicePrincipalName "{applicationId}").Id -Permissions All

关于此命令的更多详细信息,您可以参考下面link:

Set-AzureRmDataLakeStoreItemAclEntry