Function not getting deployed in Azure function using VS Code

K B 35 Reputation points
2024-01-04T13:37:08.5666667+00:00

First I created a new azure function using vs code having basic http trigger function, it tested successfully, and then got deployed properly. Then I updated my code, which basically takes a json file from blob container in azure Storage account, converts it into an XML file and stores back in Blob container. This code is working fine in workspace (local) User's image

When I try to Re-deploy the Function app with the updated function(Http Trigger),

only the function app is re-deployed, not the function User's image

The local.host.json file has everything, User's image

Also here is my code ( updated function(Http Trigger)) snippet

User's image

User's image

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,909 questions
{count} vote

Accepted answer
  1. MuthuKumaranMurugaachari-MSFT 22,441 Reputation points Moderator
    2024-01-05T15:31:12.8566667+00:00

    K B Thanks for sharing the additional info. Quickly reviewed the deployment of the function app and found ModuleNotFoundError: No module named 'xmltodict' in the backend logs for your function app. So, following troubleshooting steps described in Troubleshoot ModuleNotFoundError doc would help.

    I was able to repro this issue by adding import xmltodict statement in the function app without adding package in the requirements.txt and deploying to azure function (logs suggest this package was not added in your requirements.txt also). After adding this package in the requirements.txt, the issue was resolved. I suggest you try adding the package and deploy the function.

    Also, as per discussion: Add support for python 3.11 in the python repo, the support for python 3.11 is yet to be added officially (source: https://pypi.org/project/xmltodict/#files). I was able to deploy but features might not work as expected if you use Python 3.11.6.

    User's image

    I hope this helps and let me know if any questions.


    If you found the answer to your question helpful, please take a moment to mark it as Yes for others to benefit from your experience. Or simply add a comment tagging me and would be happy to answer your questions.

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.