How to Resolve the Call To Microsoft.Sql/servers Failed Error
Issue
You receive the following error message:
Call to Microsoft.Sql/servers failed. Error message: The Resource 'Microsoft.Sql/servers/{serverIdentifier}' under resource group 'proxl-uk' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
Environment
- All database connectors
- Connection method: Private networking
Understanding the problem
This error means that Azure can’t find a SQL server named {serverIdentifier} in the proxl-uk resource group of your current subscription.
Causes and solutions
Causes include:
- Typo in the SQL server name
{serverIdentifier}or resource groupproxl-uk. - You selected the wrong Azure subscription.
- The SQL server
{serverIdentifier}was never created or was deleted. - The server was moved to a different resource group or a different subscription after setup.
- The deployment referenced the server before it was fully provisioned or before a dependent resource existed.
Resolution
Verify that the SQL server exists and that you’re pointing to the right subscription and resource group.
Verify if the SQL server exists
Azure portal
- Sign in to the Azure portal with an account that can view the target subscription.
- Confirm the active subscription in the top bar. Switch to the correct one if needed.
- Search for
{serverIdentifier}in the global search. - Open Resource groups and search
proxl-uk. - Open
proxl-ukand look for a SQL server named{serverIdentifier}.
Azure CLI
Set the correct subscription context.
az account set --subscription "<your-subscription-id>"Get SQL server details.
az sql server show --name {serverIdentifier} --resource-group proxl-ukIf the server exists, this command returns the JSON details. If not, it returns
ResourceNotFound.
Azure PowerShell
Set the correct subscription context.
Set-AzContext -Subscription "<your-subscription-id>" # Replace with the correct sub_idGet SQL server details.
Get-AzSqlServer -ResourceGroupName "proxl-uk" -ServerName "{serverIdentifier}"If the server exists, this command returns the server object. If not, it returns an error.
Fix the issue
- If the server doesn’t exist, create it.
- If the name is different, update your config to the exact server name.
- If the resource group is different, update your config to the correct group.
- If the subscription is different, switch context or use the full resource ID with the correct subscription ID.
- If it’s a deployment order issue, add proper
dependsOnand useresourceId()orreference()correctly so the server deploys before dependents.
The https://aka.ms/ARMResourceNotFoundFix link in the error points to Microsoft’s general guide for ResourceNotFound errors in Azure Resource Manager. It also covers other common causes.