Deployment of APIM, Azure function and SQL Database

Mahmoodi, Somayeh (Admin) 80 Reputation points
2025-10-17T15:06:29.6766667+00:00

Hi. I created an ARM template, and tried to deploy it. I was able to create some resources., but noth the three mentioned one. I have errors for resource types like Microsoft.Web/sites/functions, Microsoft.ApiManagement/service/apis/wikis, Microsoft.Sql/servers and the errors are 1. "code": "InternalServerError", "message": "Request processing failed due to internal error." 2. "code": "BadRequest", "message": "Encountered an error (ServiceUnavailable) from host runtime." 3. "code": "ValidationError", "target": "scope", "message": "Subscription scope should be one of '/apis', '/apis/{apiId}', '/products/{productId}'" 4. "type": "Microsoft.ApiManagement/service/apis/wikis" "code": "InternalServerError" and 5. below. I would appreciate it if anyone can help.

{
  "code": "InvalidParameterValue",
  "message": "Invalid value given for parameter Password. Specify a valid parameter value."
}
Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
{count} votes

2 answers

Sort by: Most helpful
  1. Pashikanti Kumar 1,080 Reputation points Microsoft External Staff Moderator
    2025-10-17T16:27:08.4566667+00:00

    Hi Mahmoodi, Somayeh,

     Thank you for posting your question in the Microsoft Q&A forum

    The error message indicates that the password provided for the SQL Database in your ARM template does not meet Azure SQL Database's password requirements. This issue prevents the deployment of the SQL Database and may also affect dependent resources such as API Management (APIM) and Azure Functions if they rely on the database connection.

    Let’s troubleshoot and resolve the issue step-by-step:

     

    Verify SQL Database Password Requirements

    Azure SQL Database passwords must meet the following criteria:

    • Length: 8 to 128 characters.
    • Complexity: Must contain at least three of the following:

    One uppercase letter (A-Z)

    One lowercase letter (a-z)

    One number (0-9)

    One special character (!@#$%^&*()-_=+[]{}|;:,.<>?/)

    Restrictions:

    Cannot contain the username or "password".

    Avoid common or easily guessable passwords.

     

     

    Check Your ARM Template

    Locate the SQL Database resource in your ARM template and inspect the administratorLoginPassword parameter. Ensure the password meets the requirements.

    Example SQL Database Resource in ARM Template

    {
      "type": "Microsoft.Sql/servers",
      "apiVersion": "2022-02-01-preview",
      "name": "[variables('sqlServerName')]",
      "location": "[parameters('location')]",
      "properties": {
        "administratorLogin": "[parameters('sqlAdministratorLogin')]",
        "administratorLoginPassword": "[parameters('sqlAdministratorLoginPassword')]"
      },
      "resources": []
    }
    

    Ensure the sqlAdministratorLoginPassword value meets the complexity requirements.

    Validate Parameter Passing

    If you're using parameters in your deployment, ensure the password is being passed correctly.

    Example Deployment Command:

    az deployment group create \
      --resource-group <resource-group-name> \
      --template-file <path-to-arm-template.json> \
      --parameters <path-to-parameters.json>
    
    

    Ensure the parameters.json file contains a valid password and is correctly referenced in the deployment command.

    Reference

    Create parameter file - Azure Resource Manager | Microsoft Learn

    Templates overview - Azure Resource Manager | Microsoft Learn

    Security Overview - Azure SQL Database & Azure SQL Managed Instance & Azure Synapse Analytics | Microsoft Learn

    I hope the provided answer is helpful,

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    Thanks

    1 person found this answer helpful.
    0 comments No comments

  2. Luis Arias 9,011 Reputation points Volunteer Moderator
    2025-10-17T16:40:46.6033333+00:00

    Hello Mahmoodi, Somayeh (Admin),

    Welcome to Microsoft Q&A, Your deployment errors stem from a mix of misconfigured parameters and unsupported scopes without your ARM code use on the deployment I can't help you with your current errors. However I can proposed another option using bicep:

    main.bicep:

    param location string = resourceGroup().location
    param sqlAdmin string = 'sqladm'
    @secure()
    param sqlPassword string = 'QAP@ssw0rd1'
    
    resource appPlan 'Microsoft.Web/serverfarms@2022-03-01' = {
      name: 'myAppServicePlanQA1'
      location: location
      sku: {
        name: 'Y1'
        tier: 'Dynamic'
      }
    }
    
    resource functionApp 'Microsoft.Web/sites@2022-03-01' = {
      name: 'myFunctionAppQA1'
      location: location
      kind: 'functionapp'
      properties: {
        serverFarmId: appPlan.id
        siteConfig: {
          appSettings: [
            {
              name: 'AzureWebJobsStorage'
              value: 'DefaultEndpointsProtocol=https;AccountName=yourStorage;AccountKey=yourKey;EndpointSuffix=core.windows.net'
            }
          ]
        }
      }
    }
    
    resource sql 'Microsoft.Sql/servers@2022-02-01-preview' = {
      name: 'mySqlServerQA1'
      location: location
      properties: {
        administratorLogin: sqlAdmin
        administratorLoginPassword: sqlPassword
      }
    }
    
    resource apim 'Microsoft.ApiManagement/service@2022-08-01' = {
      name: 'myApimServiceQA1'
      location: location
      sku: {
        name: 'Consumption'
        capacity: 0
      }
      properties: {
        publisherEmail: 'admin@example.com'
        publisherName: 'My Company'
      }
    }
    
    

    Deploy as you do with arm templates:

    az deployment group create \
        --resource-group <your-resource-group> \
        --template-file main.bicep
    

    If this doesn't help you let me know what your current ARM template looks like so I can help pinpoint the exact issues.

    Reference:

    If the information helped address your question, please Accept the answer.

    Luis

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.