I'm creating several resources in Azure using python SDK but i'm confused how to check whether the resource is successfully created or not ?
Documentation says the poller has multiple methods - done(), wait(), result() etc to check status of the resource but what is the safe way to check status on creation of a resource ?
I have checked samples from here but they only have wait() and do not check on the status
resource = client.virual_machines.begin_create_or_update(...)
count = 1
while not resource.done(): #done() returns true or false
if count > 10:
count += 1
response = resource.result() # result() returns the object of the corresponding resource
if not isinstance(response, VirtualMachine):
# check the status() function and based on the status of
# ('inprogress', 'done', 'provisioning', 'succedded')
# add a manual check and raise exception
except Exception as e:
what is the best option/way to handle/check resource creation ?
or is there any way to handle it properly ?
Thanks in advance !