Skip to content

Commit

Permalink
private_dns_zone_virtual_network_link waitLRO (#15872)
Browse files Browse the repository at this point in the history
  • Loading branch information
shu-ying789 committed Apr 6, 2022
1 parent 67fb4c6 commit c0d41cb
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -172,9 +172,13 @@ func resourcePrivateDnsZoneVirtualNetworkLinkDelete(d *pluginsdk.ResourceData, m
}

etag := ""
if _, err := client.Delete(ctx, id.ResourceGroup, id.PrivateDnsZoneName, id.Name, etag); err != nil {
future, err := client.Delete(ctx, id.ResourceGroup, id.PrivateDnsZoneName, id.Name, etag)
if err != nil {
return fmt.Errorf("deleting Virtual Network Link %q (Private DNS Zone %q / Resource Group %q): %+v", id.Name, id.PrivateDnsZoneName, id.ResourceGroup, err)
}
if err := future.WaitForCompletionRef(ctx, client.Client); err != nil {
return fmt.Errorf("waiting for deletion of %q: %+v", id, err)
}

// whilst the Delete above returns a Future, the Azure API's broken such that even though it's marked as "gone"
// it's still kicking around - so we have to poll until this is actually gone
Expand Down

0 comments on commit c0d41cb

Please sign in to comment.