Skip to content

Commit

Permalink
Merge pull request #17 from ggailey777/shreya
Browse files Browse the repository at this point in the history
[Edits] Clarify info about package collisions
  • Loading branch information
shreyabatra4 authored Dec 11, 2023
2 parents b89de21 + 225510c commit 502dd59
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 3 additions & 2 deletions articles/azure-functions/functions-reference-python.md
Original file line number Diff line number Diff line change
Expand Up @@ -973,9 +973,10 @@ requests==2.19.1
```bash
pip install -r requirements.txt
```
In an App Service Plan, customer-defined dependencies take precedence, potentially causing conflicts when using Python's built-in modules, like 'logging,' if they share the same names as directories in your code. In a Consumption Plan, such conflicts are less likely, as customer dependencies are not prioritized by default.

To prevent such issues, it's recommended not to name your directories the same as Python's native import modules. In addition, avoid including Python native libraries in the 'requirements.txt' file.
When running your functions in an [App Service plan](./dedicated-plan.md), dependencies that you define in requirements.txt are given precedence over built-in Python modules, such as `logging`. This precedence can cause conflicts when built-in modules have the same names as directories in your code. When running in a [Consumption plan](./consumption-plan.md) or an [Elastic Premium plan](./functions-premium-plan.md), conflicts are less likely because your dependencies aren't prioritized by default.

To prevent issues running in an App Service plan, don't name your directories the same as any Python native modules and don't including Python native libraries in your project's requirements.txt file.

## Publishing to Azure

Expand Down
7 changes: 2 additions & 5 deletions articles/azure-functions/recover-python-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,10 @@ If your function app is using the Python pickle library to load a Python object
If your function app is using the popular ODBC database driver [pyodbc](https://github.com/mkleehammer/pyodbc), it's possible that multiple connections are open within a single function app. To avoid this issue, use the singleton pattern, and ensure that only one pyodbc connection is used across the function app.

---
## Sync triggers failed

The error 'Sync triggers failed' could represent various issues, one possible cause is a conflict between customer-defined dependencies and Python's built-in modules.

In an App Service Plan, customer-defined dependencies take precedence, potentially causing conflicts when using Python's built-in modules, like 'logging,' if they share the same names as directories in customer code. In a Consumption Plan, such conflicts are less likely, as customer dependencies are not prioritized by default.
## Sync triggers failed

To prevent such issues, it's recommended not to name directories the same as Python's native import modules. Additionally, avoid including Python native libraries in your 'requirements.txt' file.
The error `Sync triggers failed` can be caused by several issues. One potential cause is a conflict between customer-defined dependencies and Python built-in modules when your functions run in an App Service plan. For more information, see [Package management](functions-reference-python.md#package-management).

---

Expand Down

0 comments on commit 502dd59

Please sign in to comment.