resourcemanager/pollers
: updating LRO Pollers to also check the provisioningState
/ resource existence
#307
Labels
Community Note
Description
There’s a number of Azure APIs which are LROs but mark themselves as successfully provisioned (e.g. the LRO is completed) before the
provisioningState
is fully updated.Some example of this can be found in:
azurerm_netapp_volume_group_sap_hana
terraform-provider-azurerm#21290azurerm_mssql_server
andazurerm_mssql_database
- upgrade fromv5.0/sql
to2023-02-01-preview
terraform-provider-azurerm#23721This is true both in the Create/Update cases (where the Resource isn’t fully usable) and during Deletion (where the Resource continues to kick around despite being deleted) - whilst these are both API bugs - this is something we should be able to workaround by polling.
This is exacerbated when a resource uses a Private Endpoint, since these take longer to provision/can kick around (which this PR looks to fix) - however this attempts to fix this on individual resources.
As such there’s a couple of scenarios to be concerned about here:
provisioningState
poller.Proposal
We should introduce a new “combined”/unified poller type (needs a better name) for Resource Manager handling both Create/Update and Deletions.
In the event that the LRO fails, we shouldn’t attempt to proceed to the
provisioningState
poller - but instead surface this error.In the event that the Resource doesn’t have a
provisioningState
, we should skip this and return to remain compatible?Pseudo-code (for the Create/Update scenario):
Two separate pollers would be needed - one for Create/Update (PUT/POST/PATCH LROs) and Delete (DELETE LROs) - but this should be possible to configure this in `resourcemanager.PollerFromResponse to have this hooked up across the SDK.
Notes
Doing this would introduce an extra ARM call (minimum) per resource, but this would increase the reliability which feels like a worthwhile tradeoff.
The text was updated successfully, but these errors were encountered: