azure-cli: Encountered internal server error while processing the deployment what-if request

Describe the bug

We have begun to see this error while running az deployment group create with the --confirm-with-what-if locally.

The command az deployment group what-if also fails sporadically when running in a Azure DevOps pipeline.

Command Name az deployment group create

Errors:

InternalServerError - Encountered internal server error while processing the deployment what-if request. Diagnostic information: timestamp '20220509T102450Z', scope '/subscriptions/[removed]/resourceGroups/[removed]', tracking id 'd8ecec98-a358-4ecd-8a5d-c1b18aecc96d', request correlation id '2950457c-ae21-4f90-a8f9-3b97587b950e'.

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • az deployment group create --subscription {} --resource-group {} --template-file {} --parameters {} --parameters {} --name {} --mode {} --confirm-with-what-if --debug

Expected Behavior

What-if output

Environment Summary

Windows-10-10.0.18363-SP0,
Python 3.9.6
Installer: PIP

azure-cli 2.36.0

Extensions:
azure-devops 0.25.0
ssh 1.1.1

Dependencies:
msal 1.17.0
azure-mgmt-resource 20.0.0

Additional Context

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 25 (7 by maintainers)

Most upvoted comments

Just got a confirmation on my support request that the product team has created a fix for the bug and that it will pushed out in about two weeks.

The support engineer has found what triggers the issue in the what-if engine.

We have a parameter like this in our templates:

param tags object = resourceGroup().tags

However that seems to break what-if when used in modules where we don’t pass in the tags from the main template.

So the workaround for now is to pass in the tags in all module usages.

@JayChase I recently opened a Microsoft Support Ticket and looking for a solution. I’m able to deploy my bicep code when I do not call the module which refers to resources within another subscription & resourcegroup. However, this was working for quite a while, so it seems like a bug for me. But maybe this helps you to deploy a part of your bicep code. I’ll give an update once I have an answer.

Hi @RakeshMohanMSFT, when can we expect a fix? I have the same problem as @birdnathan. We are currently not able to deploy via Azure Bicep! Thanks!

@JayChase I recently opened a Microsoft Support Ticket and looking for a solution. I’m able to deploy my bicep code when I do not call the module which refers to resources within another subscription & resourcegroup. However, this was working for quite a while, so it seems like a bug for me. But maybe this helps you to deploy a part of your bicep code. I’ll give an update once I have an answer.

I have a ticket open too, definitely a bug it would seem. Just need somebody to confirm and own it. Will report back if i get a resolution.

@birdnathan This is related to the backend and not CLI per se, therefore we closed the issue. We request you to open a support ticket if you need further help.

@linusryl The status at this point is that the support engineer has been able to reproduce the issue and they’re looking into it.

@RakeshMohanMSFT Thank you. I have created support request no. 2205120050000404.

@RakeshMohanMSFT, we are experiencing the same issue running the “az deployment sub what-if” command. The error seems somewhat random. We are running the what-if on three different environments (test, stage, prod) in the same pipeline. Two days ago it worked for all environments but yesterday it failed on different stages of the run, with no changes to the code. Usually on the first (test) stage but a few times that succeeded and it failed on a later stage instead.

These are two of our latest error messages:

ERROR: InternalServerError - Encountered internal server error while processing the deployment what-if request. Diagnostic information: timestamp ‘20220510T154205Z’, scope ‘/subscriptions/[removed]’, tracking id ‘6a56e175-4f66-4211-8406-17f33a428e7d’, request correlation id ‘151ce519-5341-47b6-bfc0-d7aed062e2dd’. (Failed on the second stage)

ERROR: InternalServerError - Encountered internal server error while processing the deployment what-if request. Diagnostic information: timestamp ‘20220510T153523Z’, scope ‘/subscriptions/[removed]’, tracking id ‘a5d636b8-9077-473f-9488-41b14249ab94’, request correlation id ‘6eea4332-41bb-42a8-995a-6b2af4273e3a’. (Failed on the first stage)

I’m experiencing the same issue, both with Azure CLI and pwsh Az module… 👎

ERROR: InternalServerError - Encountered internal server error while processing the deployment what-if request. Diagnostic information: timestamp ‘20220511T062037Z’, scope ‘/subscriptions/<subscriptionId>’, tracking id ‘a9d0c66e-7ade-4d35-aaec-c8fe70844b70’, request correlation id ‘fc98d582-d438-464d-aa58-f2cf053395b6’.

Get-AzDeploymentWhatIfResult: /home/vsts/work/1/s/iac/deploy.ps1:53 Line | 53 | $Output = Get-AzDeploymentWhatIfResult @Arguments | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | InternalServerError - Long running operation failed with | status ‘Failed’. Additional Info:'Encountered internal server | error while processing the deployment what-if request. | Diagnostic information: timestamp ‘20220511T065704Z’, scope | ‘/subscriptions/<subscriptionId>, | tracking id ‘4140e5cb-c155-4ae4-8704-13c4b4b333b9’, request | correlation id ‘e109a7ef-ff98-46c6-9e76-d82b1e63c2be’.’

@kvakulo Missed the timestamp earlier, let me look into it further.

@RakeshMohanMSFT

Thanks for your reply.

The timestamp seems to be part of the error message: timestamp '20220509T102450Z' 😄

Here are a few more errors from the same template:

2022-05-10T11:11:30.6427747Z ERROR: InternalServerError - Encountered internal server error while processing the deployment what-if request.
Diagnostic information: timestamp '20220510T111116Z', scope '/subscriptions/[removed]/resourceGroups/[removed]', tracking id '0557c748-dae2-4e2d-a5bd-8499ad951b35', request correlation id '8bf1c02e-fed5-42c3-96b2-50e32bf1e779'.

2022-05-10T09:21:06.3987074Z ERROR: InternalServerError - Encountered internal server error while processing the deployment what-if request.
Diagnostic information: timestamp '20220510T092051Z', scope '/subscriptions/[removed]/resourceGroups/[removed]', tracking id '66212893-d23e-4f98-8406-5198a4f1c161', request correlation id '69a7b3e7-db05-4780-b56a-eb65bde0d88b'.

2022-05-10T09:22:31.5671852Z ERROR: InternalServerError - Encountered internal server error while processing the deployment what-if request.
Diagnostic information: timestamp '20220510T092217Z', scope '/subscriptions/[removed]/resourceGroups/[removed]', tracking id 'ec305e34-0b53-479b-94ec-251a00102806', request correlation id 'eb60741a-3f87-4992-bac9-63902430b9f1'.