0

Hello Stack Overflow community,

We are working on an application that uses Azure Functions with the Python runtime v2 model to interact with a PostgreSQL database. Our functions require specific libraries, namely gcc and libpq, to be installed on the server end to enable communication with the database.

Our preference is to use the consumption-based model of Azure Functions, but we are facing a critical challenge:

Consumption-Based Model Limitations: This model doesn't provide access to the ssh connect tool, preventing us from installing the necessary libraries on the server end. As a result, our functions are failing. ** Premium Level Considerations: **We considered upgrading to a premium level, where SSH access is available. While this allows us to install the gcc and libpq packages, these libraries are lost every time the server instance is rebooted, leading to the failure of our functions again.

Our preference for the consumption-based model is due to its cost-effectiveness and scalability, but the issues mentioned above are hindering our progress.

Has anyone faced a similar issue or have any insights on how to maintain the required libraries across server reboots, specifically in the consumption-based model? Any guidance or alternative solutions that align with our preference for the consumption-based model would be greatly appreciated.

  • the question needs sufficient code for a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) – D.L Aug 14 '23 at 08:19

1 Answers1

0

I was looking through Python developer reference for Azure Functions guide; and here are some options to try:

  • Local build; take the app contents of your local app and push to your azure function.
  • Install local packages which allows you to post packages to your own repo and pull them down.

If either one of those isn't an option or doesn't work, the best course of action is a containerizing your app. Consumption plans however aren't available for container apps so when it comes to scale, you'll need to consider those rules.

Ryan Hill
  • 1,821
  • 2
  • 8
  • 21