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.

Created azure function app in azure portal



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:

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!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With