Feature request: validate resource type in resourceId() call
See original GitHub issueI was pairing with @jorgecotillo on some ARM templates, and we were using this ARM output parameter:
"outputs": {
"pcf-subnet-nsg-id": {
"type": "string",
"value": "[resourceId('Microsoft.Network/networkSecurityGrops', variables('pcf-nsg-name'))]"
}
}
There is a typo in the resource provider that was causing this error in ARM:
{
"code": "InvalidJsonReferenceFormat",
"message": "Reference Id /subscriptions/cf0c53fb-06f5-4fe3-9c25-cabce6811cb1/resourceGroups/contoso-pcf-net-rg/providers/Microsoft.Network/networkSecurityGrops/pcf-nsg is not formatted correctly. The Id is expected to reference resources of type networkSecurityGroups. Path properties.subnets[0].properties.networkSecurityGroup."
}
It took us ~5-10 minutes to debug the issue because we missed the typo in the Resource Provider name. Once we fixed the typo, it resolved our issue.
By checking the validity of the Resource Provider that will help users be able to catch issues like ours much faster.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Feature request: validate resource type in resourceId() call #135
I was pairing with @jorgecotillo on some ARM templates, and we were using this ARM output parameter: "outputs": { "pcf-subnet-nsg-id": ...
Read more >Get By Id - REST API (Azure Resource Management)
Learn more about Resource Management service - Gets a resource by ID. ... fully qualified ID of the resource, including the resource name...
Read more >Resolve template validation or template format errors in ... - AWS
Confirm that resource logical IDs and parameters are defined in your template. In the following JSON and YAML templates, test is referenced for ......
Read more >Improve code inspection with annotations - Android Developers
Validating resource types can be useful because Android references to ... The build tools will flag incorrect code that passes a color resource...
Read more >Resource IDs - Smile CDR Documentation
In this mode, clients may not assign a resource ID. Attempts to write to a resource ID that does not already exist will...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Common scenarios could be handled in the extension.
Depends on https://github.com/microsoft/vscode-azurearmtools/issues/718