Outline the issue here:
I first noticed this issue with my full az vm create command, and I progressively simplified it until it was basically just az vm create --resource-group TEST --name TEST-VNAS --public-ip-address "" and it still threw the error: az vm create: error: argument --public-ip-address: expected one argument. That's when I finally thought maybe this is just an issue with az under PowerShell. So I tried my original full command under a simple Command Prompt window, and it worked fine.
Install Method: How did you install the CLI? (e.g. pip, interactive script, apt-get, Docker, MSI, nightly)
Answer here: MSI on Windows 10 Pro
CLI Version: What version of the CLI and modules are installed? (Use az --version)
Answer here: 2.0.9 (same version under PowerShell and CMD)
OS Version: What OS and version are you using?
Answer here: Windows 10 Pro
Shell Type: What shell are you using? (e.g. bash, cmd.exe, Bash on Windows)
Answer here: PowerShell (throws error) and CMD (no issues)
Powershell is not a supported shell for Azure CLI 2.0. You might try using double single quotes instead of double quotes.... OR (this is a hacky workaround) you could try something like "''" (two singles wrapped in double) or '""' (two doubles wrapped in singles).
I guess MS has reasons for not supporting the cli under their own shell,
but oh well. One more reason to use my Linux box! :)
On Jun 29, 2017 11:33 AM, "Travis Prescott" notifications@github.com
wrote:
Closed #3917 https://github.com/Azure/azure-cli/issues/3917.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/Azure/azure-cli/issues/3917#event-1144456336, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AY5HnXtVW3GZD0Q4jGRlFEQaD3iC0uy1ks5sI8PTgaJpZM4OJMvv
.
The main reason is because it is assumed that people using Powershell would be using the Powershell cmdlets for working with Azure rather than Azure CLI 2.0.
Ah, now that makes sense! I've just started exploring command line
interaction with Azure and didn't realize there was PS commands for it
too.
On Jun 29, 2017 4:02 PM, "Travis Prescott" notifications@github.com wrote:
The main reason is because it is assumed that people using Powershell
would be using the Powershell cmdlets for working with Azure rather than
Azure CLI 2.0.—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/Azure/azure-cli/issues/3917#issuecomment-312088173,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AY5HneU_-0c1T_pDINXkWe70EmopeEJ_ks5sJALZgaJpZM4OJMvv
.
https://github.com/Azure/azure-powershell
Enjoy (or use our product on your Linux box :grin:)
"Powershell is not a supported shell for Azure CLI 2.0." What do you mean by it? I can't run az cli commands in PowerShell window? Why can't I create a VM without a public IP address using AZ CLI in PowerShell window, but it works fine in command line? To me it should work in both.
The CLI was not designed for use in Powershell. It was designed for use in CMD.exe and bash. As a result, while it does work in Powershell, it means that some of the syntax is much more cumbersome in Powershell. Online docs are written for bash specifically.
--public-ip-address '""' worked. thanks.
Most helpful comment
--public-ip-address '""' worked. thanks.