New-AzDataLakeGen2SasToken
Generates a SAS token for Azure DatalakeGen2 item.
Syntax
ReceiveManual (Default)
New-AzDataLakeGen2SasToken
[-FileSystem] <String>
[-Path <String>]
[-Permission <String>]
[-Protocol <SasProtocol>]
[-IPAddressOrRange <String>]
[-StartTime <DateTimeOffset>]
[-ExpiryTime <DateTimeOffset>]
[-EncryptionScope <String>]
[-FullUri]
[-Context <IStorageContext>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
ItemPipeline
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, Protocol, 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, Protocol, IPAddressOrRange, Encryption Scope.
Parameters
-Context
Azure Storage Context Object
Parameter properties
Type: IStorageContext
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: True
Value from remaining arguments: False
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.
Parameter properties
Type: IAzureContextContainer
Default value: None
Supports wildcards: False
DontShow: False
Aliases: AzureRmContext, AzureCredential
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-EncryptionScope
Encryption scope to use when sending requests authorized with this SAS URI.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ExpiryTime
Expiry Time
Parameter properties
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-FileSystem
FileSystem name
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ReceiveManual
Position: 0
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-FullUri
Display full uri with sas token
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
Azure Datalake Gen2 Item Object to remove.
ItemPipeline
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-IPAddressOrRange
IP, or IP range ACL (access control list) that the request would be accepted by Azure Storage.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: 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.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ReceiveManual
Position: Named
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-Permission
Permissions for a blob.
Permissions can be any not-empty subset of "racwdlmeop".
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Protocol
Protocol can be used in the request with this SAS token.
Parameter properties
Type: Nullable<T> [ SasProtocol ]
Default value: None
Accepted values: None, HttpsAndHttp, Https
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-StartTime
Start Time
Parameter properties
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters .
Outputs