[BUG] Azure.AppService.PlanInstanceCount incorrectly applies to Flex Consumption (FC1) plans
Maintainers usually reply within 4 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
Research direction
Start in src/PSRule.Rules.Azure/rules/Azure.AppService.Rule.ps1 at the IsConsumptionPlan helper referenced in the issue, then inspect the Azure.AppService.PlanInstanceCount precondition. Reproduce with the supplied PowerShell input and verify that FC1 or FlexConsumption is excluded while Dedicated plans still require sku.capacity >= 2.
Written by the indexing model from the issue text.
Description
🤖
Existing rule
Azure.AppService.PlanInstanceCount (AZR-000071)
Description of the issue
The rule evaluates Azure Functions Flex Consumption App Service plans (sku.name: FC1, sku.tier: FlexConsumption) as though they were Dedicated plans and requires sku.capacity >= 2.
Flex Consumption scales dynamically and does not use the Dedicated-plan instance-count configuration. The rule already excludes classic Consumption and Elastic Premium, but IsConsumptionPlan only recognizes Y1 or the Dynamic tier. Consequently a valid FC1 plan without sku.capacity fails the rule instead of being excluded as not applicable.
Expected behavior: exclude Flex Consumption when identified by either its SKU name (FC1) or tier (FlexConsumption), while preserving the existing checks for Dedicated plans.
Error messages
Reproduced with the PowerShell input below:
RuleName : Azure.AppService.PlanInstanceCount
Outcome : Fail
OutcomeReason : Processed
Reason : {Path sku.capacity: Does not exist.}
Reproduction
With PSRule 2.9.0 and PSRule.Rules.Azure 1.47.0 installed, run:
Import-Module PSRule -RequiredVersion 2.9.0
Import-Module PSRule.Rules.Azure -RequiredVersion 1.47.0
$plan = [pscustomobject]@{
name = 'flex-example'
type = 'Microsoft.Web/serverfarms'
apiVersion = '2025-03-01'
location = 'eastus'
kind = 'functionapp'
sku = @{
name = 'FC1'
tier = 'FlexConsumption'
}
properties = @{
reserved = $true
}
}
$plan | Invoke-PSRule -Module PSRule.Rules.Azure `
-Name Azure.AppService.PlanInstanceCount -Outcome All |
Select-Object RuleName, Outcome, OutcomeReason, Reason
No suppression groups are required to reproduce the failure.
Version of PSRule
2.9.0
Version of PSRule for Azure
1.47.0
Additional context
- The relevant helper: https://github.com/Azure/PSRule.Rules.Azure/blob/e259e104429a7faa894d9e2c1eb3386c5c7cede9/src/PSRule.Rules.Azure/rules/Azure.AppService.Rule.ps1#L249-L258
- The rule precondition is
!(IsConsumptionPlan) -and !(IsElasticPlan). RecognizingFC1/FlexConsumptionin the consumption helper should correct this applicability issue. - Functions Flex Consumption documentation: https://learn.microsoft.com/azure/azure-functions/flex-consumption-plan
- Encountered while validating Azure/bicep-registry-modules#7299. A narrowly scoped FC1 suppression was added as a temporary workaround, and the reviewer requested reporting the underlying rule issue: https://github.com/Azure/bicep-registry-modules/pull/7299#discussion_r4104301141
- The same omission is present in the repository's current
mainsource as of this report.
- Dominant language
- PowerShell
- Stars
- 448
- Forks
- 110
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 11
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Azure/PSRule.Rules.Azure
-
Export-AzRuleData fails with HTTP 400 for DefenderForStorageSettings due to deprecated API versionOpenbug feature: in-flight-export
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Azure/PSRule.Rules.Azure#3865 · 1 comment · 1 reaction ·
Maintainers usually reply within 4 days
-
Difficulty 3/5 1-2 days Newbie friendliness 75/100
Azure/PSRule.Rules.Azure#3920 ·
Maintainers usually reply within 4 days
-
Difficulty 4/5 3-5 days Newbie friendliness 62/100
Azure/PSRule.Rules.Azure#3909 ·
Maintainers usually reply within 4 days
-
bug feature: bicep-language feature: pre-flight-expansion
Difficulty 4/5 3-5 days Newbie friendliness 55/100
Azure/PSRule.Rules.Azure#3907 ·
Maintainers usually reply within 4 days
-
bug feature: bicep-language feature: pre-flight-expansion
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Azure/PSRule.Rules.Azure#3884 ·
Maintainers usually reply within 4 days
All issues in Azure/PSRule.Rules.Azure
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
opengovsg/FormSG#10118 · 1 comment ·
Maintainers usually reply within 1 day
-
tagbot-manual
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
JuliaGraphics/Colors.jl#589 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
WingedGuardian/GENesis-AGI#2410 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kubernetes-sigs/headlamp#7766 ·
Maintainers usually reply within 1 day
-
[Bug]: launchd osascript "do shell script" wrapper delays external display wake ~10s on macOS 27Opencomp/gateway P2 type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NousResearch/hermes-agent#123595 ·
Maintainers usually reply within 1 day