Hi Charlie,
Please try the book examples with Bash. More details below.
I'm assuming you are referring to Azure Cookbook by Reza Salehi. Please correct me if my assumption is wrong. Early in the book under "What You Will Need" it says Terminal with Bash or Z shell (Zsh).
Azure CLI can be used within multiple different shell environments, however, depending on which you are using it you will need to modify some of your syntax to fit the specific environment. In general, Azure CLI is more suited to those familiar with Bash.
Which Azure command-line tool is right for you?
You can use Bash under Windows. For example, you can use Git Bash app, or via Windows Subsystem for LInux, or other ways:
Install Linux on Windows with WSL
https://learn.microsoft.com/en-us/windows/wsl/install
You can also use Bash via Azure Cloud Shell in the Azure portal.
Please click Accept Answer if the above is useful.
Thanks.
-TP