你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
New-AzDataLakeGen2SasToken
为 Azure DatalakeGen2 项生成 SAS 令牌。
语法
New-AzDataLakeGen2SasToken
[-FileSystem] <String>
[-Path <String>]
[-Permission <String>]
[-Protocol <SasProtocol>]
[-IPAddressOrRange <String>]
[-StartTime <DateTimeOffset>]
[-ExpiryTime <DateTimeOffset>]
[-EncryptionScope <String>]
[-FullUri]
[-Context <IStorageContext>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
New-AzDataLakeGen2SasToken
-InputObject <AzureDataLakeGen2Item>
[-Permission <String>]
[-Protocol <SasProtocol>]
[-IPAddressOrRange <String>]
[-StartTime <DateTimeOffset>]
[-ExpiryTime <DateTimeOffset>]
[-EncryptionScope <String>]
[-FullUri]
[-Context <IStorageContext>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
说明
New-AzDataLakeGen2SasToken cmdlet 为 Azure DatalakeGen2 项生成共享访问签名 (SAS) 令牌。
示例
示例 1:生成具有完全权限的 SAS 令牌
New-AzDataLakeGen2SasToken -FileSystem "filesystem1" -Path "dir1/dir2" -Permission racwdlmeop
此示例生成具有完全权限的 DatalakeGen2 SAS 令牌。
示例 2:通过管道 datalakegen2 项目生成具有特定 StartTime、ExpireTime、Protocal、IPAddressOrRange、加密范围的 SAS 令牌
Get-AzDataLakeGen2Item -FileSystem test -Path "testdir/dir2" | New-AzDataLakeGen2SasToken -Permission rw -Protocol Https -IPAddressOrRange 10.0.0.0-12.10.0.0 -StartTime (Get-Date) -ExpiryTime (Get-Date).AddDays(6) -EncryptionScope scopename
此示例通过管道 datalake gen2 项生成 DatalakeGen2 SAS 令牌,并使用特定的 StartTime、ExpireTime、Protocal、IPAddressOrRange、Encryption Scope。
参数
-Context
Azure 存储上下文对象
类型: | IStorageContext |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
类型: | IAzureContextContainer |
别名: | AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-EncryptionScope
发送经此 SAS URI 授权的请求时要使用的加密范围。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ExpiryTime
到期时间
类型: | Nullable<T>[DateTimeOffset] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-FileSystem
FileSystem 名称
类型: | String |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-FullUri
使用 sas 令牌显示完整 URI
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-InputObject
要删除的 Azure Datalake Gen2 项对象。
类型: | AzureDataLakeGen2Item |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-IPAddressOrRange
Azure 存储将接受请求的 IP 或 IP 范围 ACL (访问控制列表)。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Path
应检索的指定 FileSystem 中的路径。 可以是文件或目录,格式为“directory/file.txt”或“directory1/directory2/”。 跳过设置此参数以获取文件系统的根目录。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-Permission
Blob 的权限。 权限可以是“racwdlmeop”的任何非空子集。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Protocol
协议可以在请求中使用此 SAS 令牌。
类型: | Nullable<T>[SasProtocol] |
接受的值: | None, HttpsAndHttp, Https |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-StartTime
开始时间
类型: | Nullable<T>[DateTimeOffset] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |