【发布时间】:2017-11-13 23:35:11
【问题描述】:
我正在使用 PowerShell 中的 Azure CLI 2.0 来管理存储帐户。我有一个 SAS 令牌(我存储在一个变量中),我想在命令中使用它。这是我正在运行的脚本:
$sasToken = 'st=2017-11-13T10%3A55%3A06Z&se=2017-11-13T11%3A27%3A06Z&sp=w&spr=https&sv=2017-04-17&sr=c&sig=%2BA6LDTwHes6JdxEAHXSvbYc70y30OcznjMVSyFbCXog%3D'
az storage blob upload `
--account-name mystorageaccount `
--container-name mycontainer `
--file c:\temp\file.txt `
--name file.txt `
--sas-token $sasToken
当我运行这个时,我得到这个错误:
The specified resource does not exist.
'se' is not recognized as an internal or external command,
operable program or batch file.
'sp' is not recognized as an internal or external command,
operable program or batch file.
'spr' is not recognized as an internal or external command,
operable program or batch file.
'sv' is not recognized as an internal or external command,
operable program or batch file.
'sr' is not recognized as an internal or external command,
operable program or batch file.
'sig' is not recognized as an internal or external command,
operable program or batch file.
在我看来,PowerShell 每次看到与号时都会截断 SAS 令牌,而 Azure CLI 并没有将其作为同一字符串的所有部分。
有没有办法强制 PowerShell 按原样使用 SAS 令牌调用 Azure CLI?
【问题讨论】:
标签: powershell azure-cli