< Back

New-AzureStorageContainerSASToken

Tue Jan 29, 2019 9:27 pm

NAME New-AzureStorageContainerSASToken



SYNOPSIS

Generates an SAS token for an Azure storage container.





SYNTAX

New-AzureStorageContainerSASToken [-Name] <String> [-Context <IStorageContext>] [-ExpiryTime <DateTime>] [-FullUri] [-IPAddressOrRange <String>]

[-Permission <String>] [-Protocol {HttpsOnly | HttpsOrHttp}] [-StartTime <DateTime>] [<CommonParameters>]



New-AzureStorageContainerSASToken [-Name] <String> [-Context <IStorageContext>] [-ExpiryTime <DateTime>] [-FullUri] [-IPAddressOrRange <String>]

-Policy <String> [-Protocol {HttpsOnly | HttpsOrHttp}] [-StartTime <DateTime>] [<CommonParameters>]





DESCRIPTION

The New-AzureStorageContainerSASToken cmdlet generates a Shared Access Signature (SAS) token for an Azure storage container.





PARAMETERS

-Context <IStorageContext>

Specifies an Azure storage context. You can create it by using the New-AzureStorageContext cmdlet.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName, ByValue)

Accept wildcard characters? false



-ExpiryTime <DateTime>

Specifies the time at which the shared access signature becomes invalid.



If the user sets the start time but not the expiry time, the expiry time is set to the start time plus one hour. If neither the start time nor

the expiry time is specified, the expiry time is set to the current time plus one hour.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-FullUri [<SwitchParameter>]

Indicates that this cmdlet return the full blob URI and the shared access signature token.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-IPAddressOrRange <String>

Specifies the IP address or range of IP addresses from which to accept requests, such as 168.1.5.65 or 168.1.5.60-168.1.5.70. The range is

inclusive.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Name <String>

Specifies an Azure storage container name.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName, ByValue)

Accept wildcard characters? false



-Permission <String>

Specifies permissions for a storage container.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Policy <String>

Specifies an Azure Stored Access Policy.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Protocol <SharedAccessProtocol>

Specifies the protocol permitted for a request. The acceptable values for this parameter are: * HttpsOnly



* HttpsOrHttp





The default value is HttpsOrHttp.





Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-StartTime <DateTime>

Specifies the time at which the shared access signature becomes valid.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

IStorageContext

Parameter 'Context' accepts value of type 'IStorageContext' from the pipeline



String

Parameter 'Name' accepts value of type 'String' from the pipeline





OUTPUTS

System.String







NOTES









Example 1: Generate a container SAS token with full container permission



PS C:\\>New-AzureStorageContainerSASToken -Name "Test" -Permission rwdl



This example generates a container SAS token with full container permission.





Example 2: Generate multiple container SAS token by pipeline



PS C:\\>Get-AzureStorageContainer -Container test* | New-AzureStorageContainerSASToken -Permission rwdl



This example generates multiple container SAS tokens by using the pipeline.





Example 3: Generate container SAS token with shared access policy



PS C:\\>New-AzureStorageContainerSASToken -Name "Test" -Policy "PolicyName"



This example generates a container SAS token with shared access policy.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... ersastoken

New-AzureStorageBlobSASToken