Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The listener for function was unable to start. Why?

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 on

Host 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?

like image 886
vivek nuna Avatar asked Jan 19 '18 07:01

vivek nuna


Video Answer


2 Answers

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

like image 118
Tahir Alvi Avatar answered Nov 04 '22 09:11

Tahir Alvi


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.

like image 21
RichS Avatar answered Nov 04 '22 09:11

RichS