Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Azure powershell列出容器上的现有sastoken_Powershell_Azure_Azure Storage_Azure Powershell_Azure Blob Storage - Fatal编程技术网

使用Azure powershell列出容器上的现有sastoken

使用Azure powershell列出容器上的现有sastoken,powershell,azure,azure-storage,azure-powershell,azure-blob-storage,Powershell,Azure,Azure Storage,Azure Powershell,Azure Blob Storage,通过powershell创建SAS令牌时,它会从新的AzureStorageContainerAstoken comdlet中重新调用创建的SAS令牌url $Context = New-AzureStorageContext -StorageAccountName $StorageAccount -StorageAccountKey $StorageAccountKey $now =

通过powershell创建SAS令牌时,它会从新的AzureStorageContainerAstoken comdlet中重新调用创建的SAS令牌url

$Context = New-AzureStorageContext -StorageAccountName $StorageAccount -StorageAccountKey $StorageAccountKey                                                        
$now = Get-Date

$sasUrl = New-AzureStorageContainerSASToken -Name mycontainer -Permission rwdl -StartTime $now.AddHours(-1) -ExpiryTime $now.AddMonths(1) -Context $context -FullUri  
echo $sasUrl 
但现在万一我丢失了它,我如何列出现有的sastoken?同一容器上可能有几个

已尝试获取AzureStorageContainer,但此信息不可用。
与其他Get-AzureStorage*一起玩,但找不到它。

powershell是否支持此操作?

无法获取SAS URL列表,因为它们未存储在Azure存储中的任何位置。

可能有点晚了。。。。但在这一页上:

它说: “Azure存储不会以任何方式跟踪存储客户端库生成的SAS令牌。您可以在客户端创建数量不限的SAS令牌。”

嗯!
Paul

使用Powershell可能不会,但使用REST API可能会:


对于POST请求,需要填写一些请求正文参数,这需要反复试验,因为您可能不记得SAS允许的持续时间。但是,如果以某种方式记录了处的所有值,那么应该可以通过编程方式获取SAS令牌本身。

意思是,如果我丢失了它们,我必须重新创建它们?这是正确的。请记住,SAS令牌用于授予对您的存储的临时访问权限。您能否在文档中提供有关此行为的一些参考信息?我查阅了文档,但遗憾的是,我找不到明确声明SAS URL未存储在任何位置的任何位置。我想你得相信我的话:)。如果您感兴趣,请阅读以下内容:。注意,您始终可以创建基于访问策略的SAS令牌。与SAS不同,访问策略存储在存储帐户上,并且始终可以修改。例如,您可以删除访问策略。这将使每一个基于它的SAS都变得无用。优点是您不必触摸帐户密钥。