# ansible azure module - deletion of cloud services when deleting vm's

**URL:** <https://forum.ansible.com/t/ansible-azure-module-deletion-of-cloud-services-when-deleting-vms/18897>\
**Category:** Ansible Project\
**Tags:** azure\
**Created:** [July 30, 2015, 1:46am UTC](https://forum.ansible.com/t/ansible-azure-module-deletion-of-cloud-services-when-deleting-vms/18897 "2015-07-30T01:46:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Patrick\_Crews](https://avatars.discourse-cdn.com/v4/letter/p/d26b3c/32.png) [@Patrick\_Crews](https://forum.ansible.com/u/Patrick_Crews)\
**Post date:** [July 30, 2015, 1:46am UTC](https://forum.ansible.com/t/ansible-azure-module-deletion-of-cloud-services-when-deleting-vms/18897/1 "2015-07-30T01:46:34Z")

</div>

Hello,

I have been working with the azure module: [http://docs.ansible.com/ansible/azure\_module.html](http://docs.ansible.com/ansible/azure_module.html)  
and have found it very functional so far.

The one request I would have is that the user be provided the option of also deleting the associated cloud service when deleting vm’s.  
Otherwise, my experience has shown that the user must delete the cloud services themselves if they wish to use the ansible playbook to recreate said vm’s  
I am iterating on setting up some test vm’s and looking for efficiency in repeated test runs.

For example, I can create a vm once via playbook and delete it as well, however, subsequent attempts result in this error:  
failed: [localhost → 127.0.0.1] =\> (item={‘name’: ‘TESTMACHINE\_NAME’, ‘location’: ‘LOCATION’}) =\> {“failed”: true, “item”: {“location”: “LOCATION”, “name”: “TESTMACHINE\_NAME”}}  
msg: failed to lookup the deployment information for TESTMACHINE\_NAME, error was: Not found (Not Found)

This requires other intervention by the user to be able to use the playbook with the same vm name(s)  
While it is possible to script / playbook calls to the cli to handle the deletion of the service(s), I am hoping to avoid installing and setting up the azure cli on machines in the future.

Any thoughts on this are welcome.

Thanks,  
Patrick

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [July 30, 2015, 1:53am UTC](https://forum.ansible.com/t/ansible-azure-module-deletion-of-cloud-services-when-deleting-vms/18897/2 "2015-07-30T01:53:07Z")

</div>

Open a ticket in the github issue tracker so this is 'on the list'.

---

<div class="post-metadata">

**Author:** ![rsimbirtsev](https://avatars.discourse-cdn.com/v4/letter/r/54ee81/32.png) [@rsimbirtsev](https://forum.ansible.com/u/rsimbirtsev)\
**Post date:** [August 7, 2015, 7:13pm UTC](https://forum.ansible.com/t/ansible-azure-module-deletion-of-cloud-services-when-deleting-vms/18897/3 "2015-08-07T19:13:51Z")

</div>

Hi Brian,

Do you know if this has been addressed??
