[Python] Azure function python app - getting nested environments variables

Discussão em 'Python' iniciado por Stack, Janeiro 23, 2025.

  1. Stack

    Stack Membro Participativo

    I have an azure function app written in python that does not return environment variables from other sections than values.

    localsettings.json:

    {
    "IsEncrypted": false,
    "IBAN": {
    "API_KEY": "xx",
    "CURRENCY": "USD"
    },
    "Values": {
    "AzureWebJobsStorage": "",
    "FUNCTIONS_WORKER_RUNTIME": "python",
    "APPINSIGHTS_CONNECTION_STRING": "InstrumentationKey=xx-xx-xx-9c3c-4d3c4d3c4d3c",

    }
    }


    I have tried:

    os.getenv('IBAN:API_KEY', '')
    and
    os.getenv('IBAN_API_KEY', '')


    Both fails getting value. Is it not an option like in .NET to use nested sections in python?

    Continue reading...

Compartilhe esta Página