# To Stop Multiple Azure VMs

**URL:** <https://forum.ansible.com/t/to-stop-multiple-azure-vms/31870>\
**Category:** Ansible Project\
**Tags:** azure\
**Created:** [December 25, 2019, 3:43pm UTC](https://forum.ansible.com/t/to-stop-multiple-azure-vms/31870 "2019-12-25T15:43:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ashadeep\_Parida](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@Ashadeep\_Parida](https://forum.ansible.com/u/Ashadeep_Parida)\
**Post date:** [December 25, 2019, 3:43pm UTC](https://forum.ansible.com/t/to-stop-multiple-azure-vms/31870/1 "2019-12-25T15:43:09Z")

</div>

Hi All,

I’m new to this group and much more interested to learn ansible. So this time I need your help. I’m trying to stop or shut down all the azure VMs by using ansible but it’s failed all the time. Kindly check the screenshots and let me know where I did the mistake.

 ![image.png](https://us1.discourse-cdn.com/ansible/original/2X/9/9428b3dc88119ca51a9dc6a46e50335c16fc8438.png)

 ![image.png](https://us1.discourse-cdn.com/ansible/original/2X/2/2bf9ad65750708ad04c1ff822b61251c9985eb93.png)

 ![image.png](https://us1.discourse-cdn.com/ansible/original/2X/8/8d869bcdbd93cfbb5a424e9e3d08e1a69e28140b.png)

---

<div class="post-metadata">

**Author:** ![Ashadeep\_Parida](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@Ashadeep\_Parida](https://forum.ansible.com/u/Ashadeep_Parida)\
**Post date:** [December 25, 2019, 5:41pm UTC](https://forum.ansible.com/t/to-stop-multiple-azure-vms/31870/2 "2019-12-25T17:41:05Z")

</div>

> ![stop all azure Vm.JPG](https://us1.discourse-cdn.com/ansible/original/2X/3/35b45c67659a8c0036b395d296d2f31c4f8ca31d.jpeg)

---

<div class="post-metadata">

**Author:** ![Ashadeep\_Parida](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@Ashadeep\_Parida](https://forum.ansible.com/u/Ashadeep_Parida)\
**Post date:** [December 25, 2019, 5:42pm UTC](https://forum.ansible.com/t/to-stop-multiple-azure-vms/31870/3 "2019-12-25T17:42:22Z")

</div>

It’s resolved by using the below yml file

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [December 25, 2019, 9:36pm UTC](https://forum.ansible.com/t/to-stop-multiple-azure-vms/31870/4 "2019-12-25T21:36:30Z")

</div>

Hi

I don’t see any yml file below? Are you referring to the (two) previous replies that contains image attachments?

Next time please do everyone a favor by just sending copied text instead of fiddling with image attachments.  
That will increase the chance of getting useful responses, plus you can actually not include passwords instead of scribbling over them.

From the docs at [https://docs.ansible.com/ansible/latest/modules/azure\_rm\_virtualmachine\_module.html](https://docs.ansible.com/ansible/latest/modules/azure_rm_virtualmachine_module.html) the first thing that comes to mind when one needs a VM to be stopped, is using  
“started: no”.
