Env variables are not recognized in the following function deployment

I am deploying the function from serverless with kubeless provider.

I defined env variables in the provider but they are not accessible in the function handler code.

eg:
provider:
name: kubeless
runtime: python2.7
environment:
KEY1: VALUE1
KEY2: VALUE2

Issue: The above keys are not accessible via os.environ[‘KEY1’]

Whereas same are accessible when they are defined under a function.

Are you indenting correctly?

provider:
  name: kubeless
  runtime: python2.7
  environment:
    KEY1: VALUE1
    KEY2: VALUE2

Hi Jeremy,
Thank you very much for responding back. Yes, I am indenting them correctly as shown above.