admin管理员组文章数量:1208155
I'm setting up a SQL Server using CLI. It works as supposed to.
$Group = @("--resource-group", "groupy")
$Name = @("--name", "servy")
$User = @("--admin-user", "BigCahoona")
$Pass = @("--admin-password", "Abcde12345#¤%")
az sql server create $Group $Name $User $Pass
Recently, I've been advised that for practical reasons, I should use another password, one that contains parentheses. I replaced it as required, which led me to a surprising discovery: the parantheses are interpreted in a special way, on two levels which confuses me additionally.
This change: $Pass = @("--admin-password", "Abcde12345()")
results in a created resource but produces the error below. NB! Those are not commands I typed. It's just a printout that the computer gave after displaying the JSON of the created resource.
C:\source\dev>echo Failed to load python executable.
Failed to load python executable.
C:\source\dev>exit /b 1
This change: $Pass = @("--admin-password", "Abcde12345()()")
doesn't create jack, only producing the error below.
() was unexpected at this time.
C:\source\dev> "C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin\..\python.exe" -IBm azure.cli
sql server create --resource-group groupy --name servy --admin-user BigCahoona --admin-password Abcde12345()()
I strongly suspect that the CLI somehow considers my new password as a function call or, possibly, a variable value to be rendered. What I'm stuck on, however, is how to resolve it (otherwise than picking a different set of characters). The consistent observation is that nothing is allowed to succeed the closing parenthesis and that some parameter is expected inside the parentheses.
I've found resources suggesting that should sourround or escape somehow, so I've tried apostrophes and quotes in different combinations as well as backslashes and dollar signs. Nothing of that helped. I'm certain that I've missed some alternative due to the mundane process of trial and horror.
I'm setting up a SQL Server using CLI. It works as supposed to.
$Group = @("--resource-group", "groupy")
$Name = @("--name", "servy")
$User = @("--admin-user", "BigCahoona")
$Pass = @("--admin-password", "Abcde12345#¤%")
az sql server create $Group $Name $User $Pass
Recently, I've been advised that for practical reasons, I should use another password, one that contains parentheses. I replaced it as required, which led me to a surprising discovery: the parantheses are interpreted in a special way, on two levels which confuses me additionally.
This change: $Pass = @("--admin-password", "Abcde12345()")
results in a created resource but produces the error below. NB! Those are not commands I typed. It's just a printout that the computer gave after displaying the JSON of the created resource.
C:\source\dev>echo Failed to load python executable.
Failed to load python executable.
C:\source\dev>exit /b 1
This change: $Pass = @("--admin-password", "Abcde12345()()")
doesn't create jack, only producing the error below.
() was unexpected at this time.
C:\source\dev> "C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin\..\python.exe" -IBm azure.cli
sql server create --resource-group groupy --name servy --admin-user BigCahoona --admin-password Abcde12345()()
I strongly suspect that the CLI somehow considers my new password as a function call or, possibly, a variable value to be rendered. What I'm stuck on, however, is how to resolve it (otherwise than picking a different set of characters). The consistent observation is that nothing is allowed to succeed the closing parenthesis and that some parameter is expected inside the parentheses.
I've found resources suggesting that should sourround or escape somehow, so I've tried apostrophes and quotes in different combinations as well as backslashes and dollar signs. Nothing of that helped. I'm certain that I've missed some alternative due to the mundane process of trial and horror.
Share Improve this question edited Jan 19 at 20:08 Daniel Mann 59k13 gold badges105 silver badges127 bronze badges asked Jan 19 at 10:16 Konrad VilterstenKonrad Viltersten 39.1k84 gold badges284 silver badges505 bronze badges1 Answer
Reset to default 2These seems working (at least no error when I run, worth checking what's the final password in the server). It should be single quote + double quote
as illustrated here. Setting the value with double quotes inside single quotes (one for PowerShell, one for Command Prompt).
$Group = @("--resource-group", "rg-shared")
$Name = @("--name", "servy")
$User = @("--admin-user", "BigCahoona")
$Pass = @("--admin-password", '"Abcde12345()()"')
az sql server create $Group $Name $User $Pass
or
az sql server create --resource-group rg-shared `
--name servy `
--admin-user BigCahoona `
--admin-password '"Abcde12345()()"'
本文标签: pythonCan39t create password containing parentheses in Azure CLIStack Overflow
版权声明:本文标题:python - Can't create password containing parentheses in Azure CLI - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738741922a2109901.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论