azure.appserviceplan

Application Service Plan

example

Find all App Service Plans that are of the Basic sku tier.

policies:
  - name: basic-tier-plans
    resource: azure.appserviceplan
    filters:
      - type: value
        key: sku.tier
        op: eq
        value: Basic

Filters

Actions

resize-plan

Resize App Service Plans

example

Resize App Service Plan to B1 plan with 2 instance.

policies:
- name: azure-resize-plan
  resource: azure.appserviceplan
  actions:
   - type: resize-plan
     size: B1
     count: 2
example

Resize app service plans with on/off hours and resource tagging

policies:
  - name: on-hours
    resource: azure.appserviceplan
    filters:
      - type: onhour
        default_tz: pt
        onhour: 8
        tag: onoffhour_schedule
    actions:
      - type: resize-plan
        size:
            type: resource
            key: tags.on_hour_sku
            default-value: P1

  - name: off-hours
    resource: azure.appserviceplan
    filters:
      - type: offhour
        default_tz: pt
        offhour: 19
        tag: onoffhour_schedule
    actions:
      - type: tag
        tag: on_hour_sku
        value:
            type: resource
            key: sku.name
      - type: resize-plan
        size: S1
anyOf:
- required:
  - size
- required:
  - count
properties:
  count:
    oneOf:
    - oneOf:
      - additionalProperties: false
        properties:
          default-value:
            type: integer
          key:
            type: string
          type:
            enum:
            - resource
            type: string
        required:
        - type
        - key
      type: object
    - type: integer
  size:
    oneOf:
    - oneOf:
      - additionalProperties: false
        properties:
          default-value:
            enum:
            - F1
            - B1
            - B2
            - B3
            - D1
            - S1
            - S2
            - S3
            - P1
            - P2
            - P3
            - P1V2
            - P2V2
            - P3v2
            - PC2
            - PC3
            - PC4
            type: string
          key:
            type: string
          type:
            enum:
            - resource
            type: string
        required:
        - type
        - key
      type: object
    - enum:
      - F1
      - B1
      - B2
      - B3
      - D1
      - S1
      - S2
      - S3
      - P1
      - P2
      - P3
      - P1V2
      - P2V2
      - P3v2
      - PC2
      - PC3
      - PC4
      type: string
  type:
    enum:
    - resize-plan