Home > database >  Python Azure function not working after deployment from VSCode
Python Azure function not working after deployment from VSCode

Time:12-03

I am new to Azure and tried some python scripting based on our business logic to interact with other Azure services. I have followed the documentation and successfully achieved the task in VS Code, but later after deploying my function to Azure it is not working as expected and throwing some internal server errors.

Below are the files which are configured by following Microsoft Azure Documentation:

  • local.settings.json
  • function.json
  • function --> init.py

Looking forward for any help on this, thanks much..

CodePudding user response:

When Azure function is working fine locally it should work after the deployment as well. In few cases after deploying our function we will get internal server errors when we run our code.

Below are two ways we can get rid of it.

  1. Add Application Settings ( Add all the variables from local.settings.json under Configurations ) and Save. enter image description here

  2. If our Azure function is interacting with any of Azure Service or Blob storage we need to add the API link in CORS, or you can try adding “*”. enter image description here

The above two issues will help us in Internal Server errors.

Refer to this MS Docs for adding Application Settings

  • Related