Hello Microsoft Azure SQL Team,
We are experiencing intermittent ResourceNotFound (HTTP 404) errors during Azure SQL Database rename operations in an automated daily database refresh process.
Environment:
Service Tier: General Purpose – Serverless
Hardware: Gen5
Compute: 1 vCore
Source and target SQL servers: Same Azure region
Execution: Daily PowerShell automation using Azure CLI
Current process:
Copy the source database to a temporary database using az sql db copy.
Update the temporary database configuration.
Disable auto-pause on the existing target and temporary databases.
Wait approximately 30 seconds.
Rename the existing reporting database to a backup name.
Rename the temporary database to the reporting database name.
Validate the new reporting database and delete the old database.
Issue:
The database copy and configuration update generally succeed. However, the rename operation intermittently fails with the following error:
ERROR: (ResourceNotFound)
The Resource 'Microsoft.Sql/servers/<server>/databases/<database>'
under resource group '<resource-group>' was not found.
Code: ResourceNotFound
HTTP Status: 404
The issue occurs intermittently in Production, while the same PowerShell refresh logic works in Nonprod.
Azure Activity Log confirms that the first rename request in an affected execution returned ResourceNotFound. The previous day's refresh had completed successfully.
Questions:
What conditions could cause Azure SQL to return ResourceNotFound when renaming an existing database?
Could serverless auto-pause/resume or pending database configuration updates affect rename operations?
Are there known limitations or timing considerations for Azure SQL database rename operations?
What is the recommended approach for validating database readiness before renaming?
Should we implement state-aware retries instead of retrying the same rename command?
Is there a more reliable approach to maintaining a complete reporting database copy, including schema, stored procedures, and data?
We would appreciate guidance on identifying the root cause and improving the reliability of this process.
Thank you.Hello Microsoft Azure SQL Team,
We are experiencing intermittent ResourceNotFound (HTTP 404) errors during Azure SQL Database rename operations in an automated daily database refresh process.
Environment:
Azure SQL Database
Service Tier: General Purpose – Serverless
Hardware: Gen5
Compute: 1 vCore
Source and target SQL servers: Same Azure region
Execution: Daily PowerShell automation using Azure CLI
Current process:
Copy the source database to a temporary database using az sql db copy.
Update the temporary database configuration.
Disable auto-pause on the existing target and temporary databases.
Wait approximately 30 seconds.
Rename the existing reporting database to a backup name.
Rename the temporary database to the reporting database name.
Validate the new reporting database and delete the old database.
Issue:
The database copy and configuration update generally succeed. However, the rename operation intermittently fails with the following error:
ERROR: (ResourceNotFound)
The Resource 'Microsoft.Sql/servers/<server>/databases/<database>'
under resource group '<resource-group>' was not found.
Code: ResourceNotFound
HTTP Status: 404
The issue occurs intermittently in Production, while the same PowerShell refresh logic works in Nonprod.
Azure Activity Log confirms that the first rename request in an affected execution returned ResourceNotFound. The previous day's refresh had completed successfully.
Questions:
What conditions could cause Azure SQL to return ResourceNotFound when renaming an existing database?
Could serverless auto-pause/resume or pending database configuration updates affect rename operations?
Are there known limitations or timing considerations for Azure SQL database rename operations?
What is the recommended approach for validating database readiness before renaming?
Should we implement state-aware retries instead of retrying the same rename command?
Is there a more reliable approach to maintaining a complete reporting database copy, including schema, stored procedures, and data?
We would appreciate guidance on identifying the root cause and improving the reliability of this process.
Thank you.