Is there some tool/command to run azcli files from powershell? Is there some tool/command to run azcli files from powershell? powershell powershell

Is there some tool/command to run azcli files from powershell?


I'm not aware of an easy way to do this in PowerShell. If someone knows, I would like to know as well.

If you have Windows Subsystem for Linux installed, you can run .azcli files just like .sh shell scripts inside WSL from PowerShell. WSL will need to have Azure CLI installed as well, so depending on the distribution you pick(Ubuntu or Debian are ussually safe), you will need to follow the instructions from Install the Azure CLI.

To run script in WSL from PowerShell terminal:

bash -c "./file.azcli"

Or directly in WSL terminal:

./file.azcli

You can use parameters in a .azcli file just like .sh shell scripts:

resourceGroup=MyRGtopicName=MyTopicNamenamespace=myNameSpaceNameaz servicebus topic create -g $resourceGroup -n $topicName --namespace-name $namespace

You could also create a .vscode/tasks.json, similar to what this GitHub issue recommends.