Azure / Azure/azure-quickstart-templates
NotFound","message":"Resource /subscription........Microsoft.Network/loadBalancers/VMSSNAME6LB not found.
- Dominant language
- Bicep
- Stars
- 14.9k
- Forks
- 16.2k
- Avg merge
- 6d 21h
- Merged PRs (30d)
- 6
Description
[Template Name goes here](VM Scale Set with autoscale running an IIS WebApp)
### Issue Details
When I try to deploy main.bicep after creating resopurce group I get the error message
> {"status":"Failed","error":{"code":"DeploymentFailed","target":"/subscriptions/f151ee3f-4725-460d-8e3b-82512dfda843/resourceGroups/bicepquickstart/providers/Microsoft.Resources/deployments/main","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"InvalidResourceReference","message":"Resource /subscriptions/f151ee3f-4725-460d-8e3b-82512dfda843/resourceGroups/BICEPQUICKSTART/providers/Microsoft.Network/loadBalancers/**VMSSNAME6LB referenced by resource /subscriptions/f151ee3f-4725-460d-8e3b-82512dfda843/resourceGroups/BICEPQUICKSTART/providers/Microsoft.Compute/virtualMachineScaleSets/vmssname6 was not found**. Please make sure that the referenced resource exists, and that both resources are in the same region.","details":[{"code":"NotFound","message":"Resource /subscriptions/f151ee3f-4725-460d-8e3b-82512dfda843/resourceGroups/BICEPQUICKSTART/providers/Microsoft.Network/loadBalancers/VMSSNAME6LB not found."}]}]}}
In spite of the fact that **VMSSNAME6LB** is created as you can notice in the azure screen

### Repro steps (*if necessary, delete otherwise*)
1. Create resource group
2. az deployment group create --resource-group bicepquickstart --parameters vmssName=vmssfrombicep --template-file main.bicep
3.
4.
5.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with main.bicep and reproduce the deployment using the stated az deployment group create command. Inspect how the VM scale set references VMSSNAME6LB, including the resource name and region, then compare that with the load balancer created during deployment. Done means the template deploys without the InvalidResourceReference error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- cloud, infrastructure
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100