-
Notifications
You must be signed in to change notification settings - Fork 778
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linter warning BCP334 is not correct when using several string functions. #12271
Comments
There are two workarounds you can use:
Fixing the analysis here will be a bit tricky. Because the value of The type system currently only knows about string literals (like |
Sounds like by design to me. The message is a warning and does say "could be". The proper fix it is the disable-next-line. |
This warning breaks my ADO build because it's uses BuildQualityChecks to ensure no new warnings. I could suppress this one in one way or another, but I'd like it not to be emitted in the first place. Here's my file: param dcResourceGroupName string
param clusterPrefix string
param stamp string
param environment string
param location string
var azureRegionLookup = {
westus: {
azureRegionAbbreviation: 'wus'
}
westus2: {
azureRegionAbbreviation: 'wus2'
}
westus3: {
azureRegionAbbreviation: 'wus3'
}
}
var storageAccountName = '${clusterPrefix}${stamp}${environment}${azureRegionLookup[location].azureRegionAbbreviation}os'
resource storage 'Microsoft.Storage/storageAccounts@2023-04-01' existing = {
name: storageAccountName
scope: resourceGroup(dcResourceGroupName)
} Proposal: since the warning says "may" and my resource is marked as |
@abatishchev The type system could be updated to detect that |
Sure, this makes sense and is the simplest one, would clearly hint the validation system that the sum length is >3 But what about this one:
Why to run validation on existing resources in the first place? If it exists, then it's valid by definition. |
True, but the deployment would still fail if it tried to query a storage account with a two-letter name (which is what the That seems fairly niche, though, so I'd still like to see more upvotes before we commit to this. |
|
Bicep version
0.22.6
Describe the bug
I am receiving a BCP334 warning for a case that cannot occur. I am starting the name with the static value of
stflow
.To Reproduce
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: