provider/azure: Don't delete firewall rules on non-existent servers

This commit is contained in:
James Nugent 2016-01-07 11:00:57 -08:00
parent 7d7c8799ac
commit a52c4bce66
1 changed files with 3 additions and 0 deletions

View File

@ -209,6 +209,9 @@ func resourceAzureSqlDatabaseServerFirewallRuleDelete(d *schema.ResourceData, me
// go ahead and delete the rule:
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 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)
}