Open Faustish opened 8 months ago
This looks like it may be the issue fixed with #24174.
@Faustish - from the logs I see you're using Az.Resources:6.15.1
. Please could you try upgrading to the latest release (6.16.0), and confirming whether this fixes the problem?
Hey all, thanks for the feedback.
I've tested the same deployment now, manually with Az.Resources:6.16.0
, and the same issue persists. Both when deploying initially and also when re-running the same deployment. Even when the resources are created, and re-ran the only feedback I get is the infamous "Object reference not set to..."
Hey again,
Are there any other possible fixes we can try for this issue? Or any other information you guys need to troubleshoot this further?
@Faustish - would you mind testing this again with the -Debug
flag set, and sharing the logs? I added logging in a recent change to include more information about the source of the error.
@anthony-c-martin
I'm currently testing this and will update the thread soon.
Testing locally resulted in a working deployment without error this time, but testing through pipeline gave the same error.
Trying to replicate the error locally again, suspecting there was a mistake in generating the error.
Will update in some days due to vacation.
Description
Azure PowerShell (PowerShell Module AZ) fails deployments with the vague error: "New-AzResourceGroupDeployment: Object reference not set to an instance of an object." while de-facto the resources get deployed in Azure.
PowerShell states that the deployment fails, the resources DO get deployed successfully: Using the same template and parameters from the pipelines when run manually (locally) causes the same failure.
Here are the commands used for Azure PowerShell Deployment: Set-AzContext -SubscriptionId ****----** -TenantId ****---**-*****
New-AzResourceGroupDeployment -TemplateFile .\template.json -TemplateParameterFile .\parameters.json -ResourceGroupName ----bff-rg -SkipTemplateParameterPrompt -Debug -DeploymentDebugLogLevel All
When run with AzureCLI the deployment succeeds without any issues. Here are the commands used for AzureCLI Deployment:
az account set --subscription ****----**
az deployment group create --name **-test-01 --resource-group ----bff-rg --template-file .\template.json --parameters .\parameters.json
Details:
PowerShell “Az” module versions where the bug manifests: 9.3.0 11.2.0 11.3.1
What-If deployments succeed both manually and in the pipelines.
AzureCLI (az) works, and does not cause any issues.
Tested with Bicep-Modules and Templates that contain User Defined Types and without in order to disqualify a recent bug that could have caused this.
Bug was discovered when updating a pipeline to use a new Bicep-Template Tag.
PS: Due to sensitive information a lot of output can't be placed in this report. Resources created in the template is an ASP with autoscale settings, app service, deployment slots, private endpoints and site configs, Consider this a general question to see if any in the community has had the same issue with the general information supplied, please let me know if any other information is required.
Issue script & Debug output
Environment data
Module versions
Error output
No response