Azure cli,“az keyvault secret set”to set localDB connection string errors in powershell due to Parenthesis(localDB)

dxpyg8gm  于 2023-03-31  发布在  Shell
关注(0)|答案(1)|浏览(77)

在powershell中,
使用az keyvault secret set将localdb连接字符串设置为密钥库密码失败,原因是“\"前面有右括号“)”。
az keyvault secret set --name ConnectionString-messaging --vault-name kvtemptest --value "server=(LocalDb)\\MSSQLLocalDb;database=messaging;trusted_connection=yes;Pooling=false;"
我得到错误是
\MSSQLLocalDb此时意外。
下面也试过了
(反勾号)但结果相同az keyvault secret set --name ConnectionString-bwalk-messaging --vault-name kvsamtemptest --value "server=(LocalDb)\MSSQLLocalDb;Bwalk_Messaging;trusted_connection=yes;合并=假;“”
(大括号加倍)az keyvault secret set --name ConnectionString-bwalk-messaging --vault-name kvsamtemptest --value "server=((LocalDb))\MSSQLLocalDb;Bwalk_Messaging;trusted_connection=yes;合并=假;“`

  • 命令在git bash控制台中工作gr 8 *
nkoocmlb

nkoocmlb1#

az --% az keyvault secret set --name ConnectionString-messaging --vault-name kvtemptest --value "server=(LocalDb)\\MSSQLLocalDb;database=messaging;trusted_connection=yes;Pooling=false;"应该可以工作。
这里提到:https://learn.microsoft.com/en-us/cli/azure/use-cli-effectively?tabs=powershell%2Cpowershell2#use-quotation-marks-in-parameters和powershell文档,请访问:https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_parsing?view=powershell-7.3#the-stop-parsing-token

相关问题