Introduction
Sometimes you want to run the same commands many times with small changes. Using variables and loops in scripts helps you do this easily and saves time.
When you need to create multiple Azure resources with similar settings.
When you want to update several virtual machines one by one.
When you want to automate repetitive tasks like starting or stopping services.
When you want to test different configurations quickly.
When you want to clean up many resources without typing each name.