Merge pull request #4552 from hashicorp/b-delete-azure-firewall-rule
provider/azure: Don't delete firewall rules on non-existent servers
This commit is contained in:
commit
d612dcabad
|
@ -209,6 +209,9 @@ func resourceAzureSqlDatabaseServerFirewallRuleDelete(d *schema.ResourceData, me
|
||||||
// go ahead and delete the rule:
|
// go ahead and delete the rule:
|
||||||
log.Printf("[INFO] Issuing deletion of Azure Database Server Firewall Rule %q in Server %q.", name, serverName)
|
log.Printf("[INFO] Issuing deletion of Azure Database Server Firewall Rule %q in Server %q.", name, serverName)
|
||||||
if err := sqlClient.DeleteFirewallRule(serverName, name); err != nil {
|
if err := sqlClient.DeleteFirewallRule(serverName, name); err != nil {
|
||||||
|
if strings.Contains(err.Error(), "Cannot open server") {
|
||||||
|
break
|
||||||
|
}
|
||||||
return fmt.Errorf("Error deleting Azure Database Server Firewall Rule %q for Server %q: %s", name, serverName, err)
|
return fmt.Errorf("Error deleting Azure Database Server Firewall Rule %q for Server %q: %s", name, serverName, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue