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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.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 Cli使用SAS访问Azure存储_Azure_Azure Storage_Azure Storage Blobs_Azure Cli - Fatal编程技术网

使用Azure Cli使用SAS访问Azure存储

使用Azure Cli使用SAS访问Azure存储,azure,azure-storage,azure-storage-blobs,azure-cli,Azure,Azure Storage,Azure Storage Blobs,Azure Cli,是否有方法使用SAS(共享访问签名)从CLI访问Azure存储容器 这显然是可能的,或者使用连接字符串。但是我想在脚本中使用CLI,该脚本应该只能从容器中读取。使用sas列出BLOB的功能(通过--sas命令行参数)已经存在了一段时间 最新的CLI(0.10.2)现在在上载/下载blob时也有一个--sas命令行选项。所以 azure storage blob upload --sas <sas> -c <connection-string> ... azure stor

是否有方法使用SAS(共享访问签名)从CLI访问Azure存储容器


这显然是可能的,或者使用连接字符串。但是我想在脚本中使用CLI,该脚本应该只能从容器中读取。

使用sas列出BLOB的功能(通过
--sas
命令行参数)已经存在了一段时间

最新的CLI(0.10.2)现在在上载/下载blob时也有一个
--sas
命令行选项。所以

azure storage blob upload --sas <sas> -c <connection-string> ...
azure storage blob list --sas <sas> ...
azure storage blob download --sas <sas> ...
azure存储blob上载--sas-c。。。
azure存储blob列表--sas。。。
azure存储blob下载--sas。。。

在最新版本的Azure CLI中:

az storage blob upload --connection-string "<your SAS connection string>"
az storage blob list --connection-string "<your SAS connection string>"
az storage blob download --connection-string "<your SAS connection string>"
az存储blob上载--连接字符串“”
az存储blob列表--连接字符串“”
az存储blob下载--连接字符串“”

未来的读者-请注意,
--sas
参数只接受sas参数和签名。不是整个uri。此外,sas包含在某些情况下必须转义的字符(
%
&
等)。一定要这样做。