Skip to content

Encountered internal server error while processing the deployment what-if request #31893

@scrocquesel-ml150

Description

@scrocquesel-ml150

Describe the bug

I am trying to run az deploy what-if and keep getting InternalServerError as output

Related command

none

Errors

$ az deployment group what-if --resource-group test --template-file solution.bicep 
InternalServerError - Encountered internal server error while processing the deployment what-if request. Diagnostic information: timestamp '20250730T145310Z', scope '/subscriptions/71236681-3afb-467d-aca8-613d6681ab28/resourceGroups/test-scl', tracking id '6883a4df-f349-479a-bf3d-1842b09e1a4c', request correlation id '8d5a9795-84a4-4c58-aa8c-245b11860ee2'.

Issue script & Debug output

N/A: The debug didn't show anything interesting related to the error as the task is executed on Azure

Expected behavior

Should see the expected change output of the what-if command

Environment Summary

$ az version
{
  "azure-cli": "2.75.0",
  "azure-cli-core": "2.75.0",
  "azure-cli-telemetry": "1.1.0",
  "extensions": {
    "apic-extension": "1.1.0",
    "azure-devops": "1.0.1",
    "azure-iot": "0.25.0",
    "rdbms-connect": "1.0.7",
    "resource-graph": "2.1.1"
  }
}

$ az bicep version
Bicep CLI version 0.36.1 (a727ed087a)

Additional context

I think the error is related to the evaluation of the name of a resource.

Here some snippet of my biceps

// '/subscriptions/[2]/resourceGroups/[4]/providers/Microsoft.Web/serverfarms/[8]'
var applicationPlanResourceIdParts = split(applicationPlanResourceId, '/')
resource serverFarm 'Microsoft.Web/serverfarms@2024-11-01' existing = {
  scope: resourceGroup(applicationPlanResourceIdParts[2], applicationPlanResourceIdParts[4])
  name: applicationPlanResourceIdParts[8]
}

var isWindows = !serverFarm.properties.reserved

module functionApp 'br/public:avm/res/web/site:0.15.0' = {
  name: 'dp-avm-res-web-site-${uniqueString(functionName)}'
  params: {
    // when the name is dynamically resolved from the serverFarm properties, it fails
    name: isWindows ? uniqueString(functionName) : uniqueString(functionName, 'linux')
    // ... other params
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Auto-AssignAuto assign by botAzure Deploymentsaz deployment/bicep/stack/deployment-scripts/ts/group exportPossible-SolutionService AttentionThis issue is responsible by Azure service team.Similar-IssuebugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions