How to set linuxFxVersion for Azure CloudCustodian

78 Views Asked by At

Azure Functions are deprecating Python 3.6 support in a month on Sep 30, 2022 (Azure update doc)

My azure-periodic CloudCustodian rules run as Azure Functions and they either have linuxFxVersion unset or set to python|3.6 (az command based on this Azure doc):

% az functionapp config show --ids <Azure Function ID>
{
  ...
  "limits": null,
  "linuxFxVersion": "python|3.6",
  "loadBalancing": "LeastRequests",
  ...
}

I notice in AWS there is a way to configure the runtime here in CloudCustodian docs and this Medium example:

policies:
- name: sec-n-elb-internet-facing
  resource: aws.elb
  description: |
     This policy identifies all Load Balancers that are facing the
     Internet.
  filters:
    - Scheme: internet-facing
  mode:
    type: periodic
    schedule: "rate(3 days)"
    execution-options:
      output_dir: s3://example-bucket/cclogs/policy/{account_id}
    runtime: python 3.8

I looked through the azure-periodic CloudCustodian Azure Reference and couldn't find anything similar. Is there a configuration to set the linuxFxVersion value for Azure CloudCustodian?

Also asked here on CloudCustodian's GitHub discussions

1

There are 1 best solutions below

0
blim747 On

This has been responded to in the CloudCustodian GitHub discussion thread here: https://github.com/cloud-custodian/cloud-custodian/discussions/7716#discussioncomment-3538443

This is set in tools/c7n_azure/c7n_azure/constants.py

The current value is Python 3.8 so I would expect that if you let custodian recreate the function app it would be using the 3.8.

If the app already exists it won’t be modified.