Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[BUG] Azure.AppService.PlanInstanceCount incorrectly applies to Flex Consumption (FC1) plans

Open Beginner friendly
#3,929 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 4 days

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
azure, powershell
Domain
devops, tooling

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
Dominant language
PowerShell
Stars
448
Forks
110
Avg merge
2d 18h
Merged PRs (30d)
11

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Azure/PSRule.Rules.Azure

All issues in Azure/PSRule.Rules.Azure

Similar issues

More DevOps issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.