I've written a bat file that needs to do daily maintenance on the storage accounts. The issue is I'm using az login logging in with a service principal, and then after that I have the commands for the az storage command. Problem is that the login runs but then does not run the next command. I have to manually copy this to command line and then it runs. I want to automate this task, so currently it's not ideal.
Any ideas?
I figured it out, had to add call before any az command
For example, this script will not execute commands after az login
@echo off
az login
az network nsg rule update 1...
az network nsg rule update 2...
This script will execute the az commands in order, waiting for one to complete before running the next.
@echo off
call az login
call az network nsg rule update 1...
call az network nsg rule update 2...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With