0

I have written a python package and want to share the functionality of the package to the internet by using azure functions and therefore creating some http triggered functions. My own package has a setup script and installs some more python packages on which it depends.

The project works fine locally when running func host start on the command line after installing my own package locally. But when deploying the azure function project my own package is not being installed.

The projects has one azure function which (simplified) looks like this:

from my_own_package import SomeModule # The import fails because my own package isn't installed
from xml.etree import ElementTree  

def main(req: func.HttpRequest) -> func.HttpResponse:
    result = SomeModule.doSomething()
    return func.HttpResponse(result, status_code=200)

How can I make sure my package is being installed and how can I include my own package in an azure functions project?

Matthias Herrmann
  • 2,650
  • 5
  • 32
  • 66

1 Answers1

0

When you create a Python Function App it only comes with the basics packages of the language. But you can easily create your own virtual environment and install all the packages you need. This is a stack answear that explains how to do it. Good luck.

I hope that helps.