How to handle mutiple .py files in Azure Functions?

Victor Skou Fertin 25 Reputation points

Hi all,

I am trying to deploy an azure function which utilizes a lot of my own scripts and classes, which are to be executed via a blob trigger. I do not want to copy all the code into the, but rather have it imported but have yet to succeed.

I have tried to host the code on Github and then import it. This was successful when testing locally using Azure Function Core Tools and VS Code, but did not work when deployed and did not even show up in the functions list in the portal.

Second attempt was to work with subfolders (see image), but again: worked locally but not when deployed.

User's image

Do anyone have an idea how to handle this or why my previous attempts has not worked?

Thanks. :)

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,605 questions
0 comments No comments
{count} votes

Accepted answer
  1. Pieter de Bruin 321 Reputation points Microsoft Employee

    Hi Victor,

    Sorry to hear about your experience.

    Can you explain more about your environment and steps to reproduce?

    From the screenshot it looks like you just have other .py files in your Function project which are in a folder and you also tried without folder.

    I just tried to add a .py file with a regular method to the project, which worked locally and in Azure.

    • with myfunc()
    • imported using: from mytest import myfunc
    • call the myfunc() in

    Hope that helps,


0 additional answers

Sort by: Most helpful