简体   繁体   English

使用Powershell为Azure云存储帐户创建共享访问签名(SAS)

[英]Create a Shared Access Signature (SAS) for an Azure Cloud Storage Account with powershell

How do I create a SAS url for my entire cloud storage account? 如何为整个云存储帐户创建SAS URL?

I noticed the azure powershell cmdlets have a lot of ways to create SAS urls for specific resources (eg blob, queue, etc..), but I would like to create one SAS for all of them with powershell 我注意到azure powershell cmdlet有很多方法可以为特定资源(例如blob,queue等)创建SAS url,但是我想为所有使用powershell的SAS创建一个SAS URL。

I assume that you want to use Azure storage account SAS . 我假设您要使用Azure存储帐户SAS More details please refer to the New-AzureStorageAccountSASToken 更多详细信息,请参阅New-AzureStorageAccountSASToken

New-AzureStorageAccountSASToken
   -Service <SharedAccessAccountServices>
   -ResourceType <SharedAccessAccountResourceTypes>
   [-Permission <String>]
   [-Protocol <SharedAccessProtocol>]
   [-IPAddressOrRange <String>]
   [-StartTime <DateTime>]
   [-ExpiryTime <DateTime>]
   [-Context <IStorageContext>]
   [<CommonParameters>]



example : New-AzureStorageAccountSASToken -Service Blob,File,Table,Queue -ResourceType Service,Container,Object -Permission "racwdlup" -Context $ctx

Edit: 编辑:

I have already tried this API. 我已经尝试过此API。 It does not allow you to specify which Azure StorageAccount to generate the SAS for. 它不允许您指定要为其生成SAS的Azure存储帐户。

I test with resource mangment storage account, it works correctly on my side. 我使用资源管理存储帐户进行了测试,它在我这方面可以正常工作。 Details please refer to the screenshot. 详细信息请参考屏幕截图。

$resourceGroup = "Resource group"
$storageAccountName = "account name "

Login-AzureRmAccount

$storageAccount = Get-AzureRmStorageAccount -ResourceGroupName $resourceGroup -Name $storageAccountName 

$ctx = $storageAccount.Context

$accountSAS = New-AzureStorageAccountSASToken -Service Blob,File,Table,Queue -ResourceType Service,Container,Object -Permission "racwdlup" -Context $ctx

在此处输入图片说明

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 整个存储帐户的 Azure 共享访问签名 - Azure Shared Access Signature for whole storage account Azure Blob 存储共享访问签名 (SAS) - 签名不匹配 - Azure Blob Storage Shared Access Signature (SAS) - Signature did not match Azure Powershell-如何使用“仅写”共享访问签名(SAS)将文件上传到Blob存储? - Azure Powershell - How to upload file to Blob Storage using “write-only” shared access signature (SAS)? 使用 SAS(共享访问签名)使用 Azure 存储上传文件 - Upload file with Azure Storage using SAS (Shared Access Signature) 构建帐户SAS(共享访问签名) - Constructing an Account SAS (Shared Access Signature) 带有客户端工具(Cloudberry 或 Azure 存储资源管理器)的 Azure 共享访问签名 (SAS) - Azure Shared Access Signature (SAS) with client tool (Cloudberry or Azure Storage Explorer) Windows Azure-共享访问签名(SAS URI) - Windows Azure - Shared Access Signature (SAS URI) 什么是S3上Azure存储的SAS(共享访问签名)功能? - What is equivalent of SAS (shared access signature) feature of Azure Storage on S3? 是否可以在azure blob存储中为给定目录生成具有写许可权的SAS(共享访问签名) - Is it possible to generate SAS (Shared Access Signature) with write permission for given directory in azure blob storage 使用Node.js Azure存储为一个文件生成共享访问签名(SAS) - Generate Shared Access Signature (SAS) for one file using nodejs azure storage
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM