Hi Azure Support Team,
I am encountering an issue where a SQL database that I deleted reappeared and caused unexpected high costs on our Azure account.
Background:
- On June 11, my boss asked me to review our Azure bill and remove any unnecessary resources. I am the only person actively using Azure in our company.
I found a SQL database resource costing $5 per month and deleted it on that day. I saw the deletion completion message.
Issue:
- A week ago, I noticed an extra $200 charge on our Azure cost report. Upon investigation, I found that the SQL database I had deleted was still there and had been recreated.
- After spending some time to understand what happened, it seems that an unused API was attempting to access the SQL database using a SQL connection string with SQL user credentials. This action appears to have caused the SQL server to automatically recreate the SQL database.
- Only after I removed the SQL server, I was able to delete SQL database.
My expected behavior:
- I remove a database and any other resource trying to use it will just stop working.
Questions:
Expected Behavior or Bug?: Is this automatic recreation of the SQL database expected behavior, or is it a bug? I was under the impression that resource creation required explicit actions via Azure Web Application or Application Registration.
Cost Discrepancy: We were using a basic level SQL database, which cost $5 per month. How did it turn into a production-level database with significantly higher costs?
Relevant Code:
var sqlConBuilder = new SqlConnectionStringBuilder();
sqlConBuilder.ConnectionString = builder.Configuration.GetConnectionString("SQLDbConnection");
builder.Services.AddDbContext<AppDbContext>(opt => opt.UseSqlServer(sqlConBuilder.ConnectionString));
builder.Services.AddScoped<IUsageRepo, UsageRepo>();
public class UsageRepo : IUsageRepo
{
private readonly AppDbContext _context;
public UsageRepo(AppDbContext context)
{
_context = context;
}
public async Task CreateUsage(Usage usage)
{
if (usage == null)
{
throw new ArgumentNullException(nameof(usage));
}
await _context.AddAsync(usage);
}
// Other methods...
}
Screenshot of Azure Monitor for deletion logs (There is no log for SQL Database created, after I removed it I can see the database update log with the same database name):
Thank you for your support.
Best regards,
Mert