New-AzDataLakeGen2SasToken
Generates a SAS token for Azure DatalakeGen2 item.
Syntax
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>]
Description
The New-AzDataLakeGen2SasToken cmdlet generates a Shared Access Signature (SAS) token for an Azure DatalakeGen2 item.
Examples
Example 1: Generate a SAS token with full permission
New-AzDataLakeGen2SasToken -FileSystem "filesystem1" -Path "dir1/dir2" -Permission racwdlmeop
This example generates a DatalakeGen2 SAS token with full permission.
Example 2: Generate a SAS token with specific StartTime, ExpireTime, Protocal, IPAddressOrRange, Encryption Scope, by pipeline a datalakegen2 item
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
This example generates a DatalakeGen2 SAS token by pipeline a datalake gen2 item, and with specific StartTime, ExpireTime, Protocal, IPAddressOrRange, Encryption Scope.
Parameters
-Context
Azure Storage Context Object
Type: | IStorageContext |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.
Type: | IAzureContextContainer |
Aliases: | AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-EncryptionScope
Encryption scope to use when sending requests authorized with this SAS URI.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ExpiryTime
Expiry Time
Type: | Nullable<T>[DateTimeOffset] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-FileSystem
FileSystem name
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-FullUri
Display full uri with sas token
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-InputObject
Azure Datalake Gen2 Item Object to remove.
Type: | AzureDataLakeGen2Item |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-IPAddressOrRange
IP, or IP range ACL (access control list) that the request would be accepted by Azure Storage.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Path
The path in the specified FileSystem that should be retrieved. Can be a file or directory In the format 'directory/file.txt' or 'directory1/directory2/'. Skip set this parameter to get the root directory of the Filesystem.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Permission
Permissions for a blob. Permissions can be any not-empty subset of "racwdlmeop".
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Protocol
Protocol can be used in the request with this SAS token.
Type: | Nullable<T>[SasProtocol] |
Accepted values: | None, HttpsAndHttp, Https |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-StartTime
Start Time
Type: | Nullable<T>[DateTimeOffset] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |