Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure functions deploying fail from VS Code

I am trying to deploy my azure function (python) from VS code and it's giving the below error.

I was able to debug my code in my local machine without any error, and I am not understanding why deployment is failing.

11:55:51 PM nhtsacleanse: Detecting platforms...
11:55:51 PM nhtsacleanse: Error: Oops... An unexpected error has occurred.
11:55:53 PM nhtsacleanse: /opt/Kudu/Scripts/starter.sh oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform python --platform-version 3.7 -p packagedir=.python_packages/lib/site-packages
11:55:57 PM nhtsacleanse: Deployment failed.

enter image description here

Created azure function app in azure portal

enter image description here

enter image description here

enter image description here

like image 751
Rahul Avatar asked Apr 19 '26 08:04

Rahul


1 Answers

This was the shortest path to a solution for me. This reference:

Key Sample value AzureWebJobsStorage DefaultEndpointsProtocol=https;AccountName=...

https://learn.microsoft.com/en-us/azure/azure-functions/functions-app-settings#azurewebjobsstorage

Lead me to inspecting my azure function app configuration:

enter image description here

And seeing that the AzureWebJobsStorage was missing.

I had already created a storage account, when I tried to deploy my function previously, and evidently, the deployment step created the storage account for me, but failed to add that storage account to the function app configuration.

I retrieved the connection string from:

storage account -> access keys -> connection string

and used the value in the source value of the AzureWebJobsStoage configuration setting.

After adding that configuration, I was able to then run the following command from Visual Studio Code, with the Azure Function App workspace open:

func azure functionapp publish Text-To-Image --build remote

And received a confirmation stating:

Deployment successful. Remote build succeeded!

like image 169
Jason D. Avatar answered Apr 21 '26 04:04

Jason D.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!