0
votes

The deployment 'template-mssql-serverless-main' failed with error(s). Showing 1 out of 1 error(s). Status Message: No registered resource | provider found for location 'southcentralus' and API version '2017-12-01' for type 'servers'. The supported api-versions are '2014-01-01, 2014-04-01, | 2014-04-01-preview, 2015-05-01-preview, 2017-03-01-preview, 2017-10-01-preview, 2018-06-01-preview, 2019-06-01-preview, 2020-02-02-preview, | 2020-08-01-preview'. The supported locations are 'australiacentral, australiaeast, australiasoutheast, brazilsouth, canadacentral, canadaeast, | centralindia, centralus, eastasia, eastus, eastus2, francecentral, germanywestcentral, japaneast, japanwest, koreacentral, koreasouth, northcentralus, | northeurope, norwayeast, southafricanorth, southcentralus, southindia, southeastasia, switzerlandnorth, uaenorth, uksouth, ukwest, westcentralus, | westeurope, westindia, westus, westus2'. (Code:NoRegisteredProviderFound) CorrelationId: 5780c889-0b76-4800-9e50-d2305cf23dbb

{
    "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "administratorLogin": {
            "type": "string"
        },
        "administratorLoginPassword": {
            "type": "securestring"
        },
        "location": {
            "type": "string"
        },
        "serverName": {
            "type": "string"
        },
        "skuName": {
            "type": "string"
        },
        "tags": {
            "type": "object",
            "defaultValue": {}
        },
        "collation": {
            "type": "string"
        },
        "sqlDBName": {
            "type": "string"
        },
        "tier": {
            "type": "string"
        },
        "maxSizeBytes": {
            "type": "int"
        },
        "zoneRedundant": {
            "type": "bool",
            "defaultValue": false
        },
        "licenseType": {
            "type": "string",
            "defaultValue": ""
        },
        "readScaleOut": {
            "type": "string",
            "defaultValue": "Disabled"
        },
        "numberOfReplicas": {
            "type": "int",
            "defaultValue": 0
        },
        "minCapacity": {
            "type": "string",
            "defaultValue": ""
        },
        "autoPauseDelay": {
            "type": "string",
            "defaultValue": ""
        }
        
    },
    "resources": [
     {
            "apiVersion": "2020-08-01-preview",
            "location": "[parameters('location')]",
            "name": "[parameters('serverName')]",
            "properties": {
                "administratorLogin": "[parameters('administratorLogin')]",
                "administratorLoginPassword": "[parameters('administratorLoginPassword')]"  
            },
            "tags": "[parameters('tags')]",
            "type": "Microsoft.Sql/servers"//,
            // "resources": [
            //     {
            //         "type": "databases",
            //         "apiVersion": "2017-10-01-preview",
            //         "name": "[parameters('sqlDBName')]",
            //         "location": "[parameters('location')]",
            //         "properties": {
            //             "collation": "[parameters('collation')]",
            //             "maxSizeBytes": "[parameters('maxSizeBytes')]",
            //             "zoneRedundant": "[parameters('zoneRedundant')]",
            //             "licenseType": "[parameters('licenseType')]",
            //             "readScale": "[parameters('readScaleOut')]",
            //             "readReplicaCount": "[parameters('numberOfReplicas')]",
            //             "minCapacity": "[parameters('minCapacity')]",
            //             "autoPauseDelay": "[parameters('autoPauseDelay')]"
            //         },
            //         "sku": {
            //             "name": "[parameters('skuName')]",
            //             "tier": "[parameters('tier')]"
            //         },
            //         "dependsOn": [
            //             "[resourceId('Microsoft.Sql/servers', concat(parameters('serverName')))]"
            //         ]
            //     }
            // ]
        }
    ],
     "outputs": {
        "deployedObject": {
            "value": "[reference(parameters('serverName'), '2017-12-01', 'Full')]",
            "type": "object"
        },
        "postgresDBName": {
            "value": "[parameters('serverName')]",
            "type": "string"
        }
    },
    "variables": {}
}
1
Do you have any update? - Jim Xu
i got issue, it's with output deployedObject and removed the '2017-12-01', then it started working. - Basavaraj Biradar
The arm templater function reference function use the resource provide API to get the resource details. Regarding the API version of Azure SQL resource, please refer to docs.microsoft.com/en-us/azure/templates/microsoft.sql/… - Jim Xu

1 Answers

0
votes

Regarding the error NoRegisteredProviderFound, it may be caused by the following reasons.

  • The required resource provider hasn't been registered for your subscription

  • API version not supported for the resource type

  • Location not supported for the resource type

Regarding how to fix it, you can use the following script

  1. Check the available resource provider in your subscription
Get-AzResourceProvider -ListAvailable
  1. Register the resource provider
Register-AzResourceProvider -ProviderNamespace Microsoft.Sql
  1. Check the available locations and apiVersion of the resource provider
#get API version
((Get-AzResourceProvider -ProviderNamespace Microsoft.Sql).ResourceTypes |  Where-Object ResourceTypeName -eq servers).ApiVersions

#get location
((Get-AzResourceProvider -ProviderNamespace Microsoft.Sql).ResourceTypes |  Where-Object ResourceTypeName -eq servers).Locations

For more details, please refer to here.