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: azure-functions-core-tools@2.0.1-beta.22
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?
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.
if you are run via storage emulator locally then run func settings add AzureWebJobsStorage
UseDevelopmentStorage=true
inlocal.setting.json
and if with a normal Azure Storage connection string using func, must set the AzureWebJobsStorage in
local.setting.json
for more view
I was getting this issue when I was using
ServiceBusTrigger
in my Azure functions.In my visual studio solution I had two
Azure Functions
and I was using the sameSubscription Name
for my two Functions, where one function is to send the data to the Azure Service Bus and the other is for receiving the data.To Send
To Receive
As you could see that the value of the
_subscriptionName
issubs1
in both case, and this is wrong, so after changing this to my other subscription name (subs2
) in theFetchDataFromSubscription
function, the issue was resolved.I don't know the root cause of this issue, but I solved it by just copying the same code to a different location on my PC. I faced this issue many times and every time I have copied the project to the different location and it always works.
You can track this issue here.
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 runnpm run start
.