Problem solved now
Azure bicep deployment error "New-AzResourceGroupDeployment: The deployment validation failed"
I am starting my learning for bicep and following the Azure Bicep learning modules. When I was trying out the exercise of (https://learn.microsoft.com/en-gb/learn/modules/build-first-bicep-template/8-exercise-refactor-template-modules?pivots=powershell). It didn't work and threw me an error when I run the command "New-AzResourceGroupDeployment -TemplateFile main.bicep -environmentType nonprod", see error as below:
New-AzResourceGroupDeployment: 10:15:18 PM - Error: Code=InvalidTemplateDeployment; Message=The template deployment 'main' is not valid according to the validation procedure. The tracking id is '4572273f-8839-4ca3-88bb-e092743a4b5f'. See inner errors for details.
New-AzResourceGroupDeployment: 10:15:18 PM - Error: Code=; Message=Object reference not set to an instance of an object.
New-AzResourceGroupDeployment: The deployment validation failed
Before hitting the error, the previous exercise were running fine without any issue. I am sure that I have established the connection successfully via powershell terminal with connect-AzAccount and set the active subscription correctly and I was able to see the subscription, learning resource group information in portal.azure.com/#home and able to see the output of running "Get-azsubscription" from my powershell terminal on my laptop.