The resource group created with Azure python SDK is reported as created, but actually gets created only hours later.
I'm creating the resource group with the SDK using.
client.resource_groups.create_or_update(resource_group, {"location": location}})
I wait for it to be created by checking the value of:
client.resource_groups.get(resource_group).properties.provisioning_state
Which eventually has the value of "Succeeded.
Several seconds after that, my script attempts to create an Azure Network within that resource group, again, using the same python azure sdk. This fails with "resource groupe could not be found".
client.virtual_networks.create_or_update(resource_group,
name, {
"location": location,
"address_space": {
"address_prefixes": [netmask]
}
}).result()
Note: up until recently this worked perfectly fine.
Only late last week things started failing (approx 40-60% of the time).
And indeed, if shortly after such a failure I list the azure resource groups in my subscription using the "az" cli, the resource group indeed is not in the list.
However, in some cases (not always), the resource group does eventually (e.g. after 30-120 minutes) show up in the resource group listing.
I'm perplexed, to say the least.
Packages I'm using:
python-azure-sdk-2.0.0
python-msrestazure-0.4.7
I know that AWS has a concept of eventual consistency. I.e. some resources, after being created, might take some time before they are available in the entire region. But in this case we're talking about hours. And in some case the resource group does not eventually show up at all.
Again, I must stress this very same code with the very same SDK packages used to work just fine until late last week. I'm eager to conclude something changed on the Azure's end.
I should add that I run several instances of this script in parallel (several different resource groups and networks created at the same time). This is when I often see this problem. So far I did not see it if I run only a single instance of this script.
I'm seeing this issue for several different regions.