The listener for function was unable to start. Why?
Solution 1
For anyone that is encountering this issue the following may help...
Azure Durable Functions rely on TableStorage, and the latest version of Azurite (v3) currently doesn't support TableStorage. As such, pull the Azurite repo and switch to the legacy-master
(v2) branch and then run npm run start
.
Solution 2
I just witnessed this. This link https://github.com/Azure/azure-functions-core-tools/issues/357 indicates Local Storage Emulator may not be running. I stopped debugging. Went to the Cloud Explorer and opened the local nodes to see blob content. This must have started the Local storage emulator. When I hit run again, Azure Functions Tools started up.
Solution 3
if you are running via storage emulator locally then run func settings add AzureWebJobsStorage UseDevelopmentStorage=true
in local.settings.json
and if with a normal Azure Storage connection string using func, must set the AzureWebJobsStorage in local.settings.json
for more view
Solution 4
I solved the issue doing the following steps: Open up a new terminal and type "azurite". The program will open and keep the window opened. Open visual studio and try to run the function again. Voi la.
Solution 5
For me this error was showing up because I didn't have Storage Emulator installed and running. You can install Storage emulator as VS Code plugin from following link. After installing go to VS Code command palette and run Azurite: Start Blob Service
. Then run your function locally. It will work fine.
https://marketplace.visualstudio.com/items?itemName=Azurite.azurite
Comments
-
vivek nuna almost 2 years
I'm getting the following error when I run the azure function from visual studio.
A ScriptHost error has occurred [1/19/2018 6:40:52 AM] The listener for function 'MyFunctionName' was unable to start. Microsoft.WindowsAzure.Storage: Server encountered an internal error. Please try again after some time.
When I run from the command prompt by running
func host start
command. I get the following warning. and then it gets stuck onHost lock lease acquired by instance ID
.
No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. config.UseServiceBus(), config.UseTimers(), etc.).
Azure function version:
[email protected]
I'm using Storage Accounts Blob containers and queues.I'm connecting to Development Storage account, I have checked it that storage emulator is started.
{ "IsEncrypted": false, "Values": { "ConnectionStrings:Default": "Server=.\\SQLEXPRESS; Database=TestDb; Trusted_Connection=True;", "ConnectionStrings:BlobStorageAccount": "UseDevelopmentStorage=true", "AzureWebJobsStorage": "UseDevelopmentStorage=true", "AzureWebJobsDashboard": "UseDevelopmentStorage=true", } }
FYI.
It was working fine before, But I have got this message in Visual Studio.
your license has gone stale and must be updated. Check for an updated license to continue using this product
So I just deleted the %localappdata% and %temp%, then I tried to run Azure function and after this, I have started getting
The listener for function was unable to start error
So is it related to my visual studio subscription or I mistakenly deleted any required file? Or is this related to something else?
-
Mike Cole over 4 yearsThe filename must be
local.settings.json
. Setting needs to be plural. -
Max Ivanov over 3 yearsAzurite is the way to run Storage Emulator on Mac and Linux. Alternatives to the VS Code plugin are running via a Docker container and installing the Azurite npm package: github.com/azure/azurite
-
Viacheslav Yankov over 3 yearsThat was a reason of my problem. Thanks!
-
Stephan over 3 yearsTo keep track of v3 support for TableStorage, see this issue: github.com/Azure/Azurite/issues/614. You may install the alpha version
npm install -g azurite@alpha
(not tested, though). -
Marcel Gelijk about 3 yearsThe timer in azure-webjobs-hosts was corrupt. It was fixed after deleting the entry.
-
BorisD about 2 yearsExecuting durable functions was working great (uses Azurite) but "regular functions" could not start (Like it was trying to reach the Azure Storage Emulator instead of Azurite) The solution changin
"AzureWebJobsStorage"
inlocal.settings.json
to the real local connection stringAccountName=devstoreaccount1;AccountKey=*****;DefaultEndpointsProtocol=http;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;QueueEndpoint=http://127.0.0.1:10001/devstoreaccount1;TableEndpoint=http://127.0.0.1:10002/devstoreaccount1;
That forces using Azurite in any case. -
zameb about 2 yearsInteresting. Visual Studio was always an integrated development IDE. If "Azurite" is needed, is it an integrated environment yet?
-
delta2_ almost 2 yearsInteresting question. After running the function for a few times there is no need to run azurite from outside visual studio. Don´t ask me why, it´s just a weird behaviour from VS.