False positive for use-resource-id-functions, should not fail on resourceGroup().id or similar
- Dominant language
- Bicep
- Stars
- 3.6k
- Forks
- 830
- Avg merge
- 1d 21m
- Merged PRs (30d)
- 79
Description
```bicep
param vaultName string = 'vault${uniqueString(resourceGroup().id)}'
param diskName string = 'disk${uniqueString(resourceGroup().id)}'
resource backupVault 'Microsoft.DataProtection/backupVaults@2021-01-01' existing = {
name: vaultName
}
resource backupInstance 'Microsoft.DataProtection/backupvaults/backupInstances@2021-01-01' = {
parent: backupVault
name: diskName
properties: {
policyInfo: {
policyParameters: {
dataStoreParametersList: [
{
objectType: 'AzureOperationalStoreParameters'
dataStoreType: 'OperationalStore'
resourceGroupId: resourceGroup().id // <<<<<<<<<<<<<<<<<<<<<<< SHOULDN'T FAIL BUT DOES
}
]
}
}
}
}
```
Contributor guide
Research direction
Start with the use-resource-id-functions rule and reproduce the reported false positive using the Bicep snippet in this issue. The work is done when resourceGroup().id is accepted in the shown contexts while the rule continues to report the cases it is intended to catch, with coverage for the regression.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100