Azure / azure-functions-host

The host/runtime that powers Azure Functions
https://functions.azure.com
MIT License
1.91k stars 436 forks source link

Functions v2 blob trigger fails for blob only storage account #3266

Open nzthiago opened 5 years ago

nzthiago commented 5 years ago

As per #3039 we have run into an issue with Functions v2 (haven't tried v1) and the blob trigger.

Compiled Class Library, created in Visual Studio 2017; latest updates to VS and the Functions extensions; Core tools v 44.

It fails to run the function with the following: Error indexing method 'Function1.Run'. Microsoft.WindowsAzure.Storage: No such host is known. System.Net.Http: No such host is known. System.Private.CoreLib: No such host is known.

We figured out this is because the blob storage account was a "storage only" storage account. We changed to a generic storage account and it started working fine.

Full output from host:

[15.08.2018 21:59:09] Reading host configuration file 'c:\users\jgranlund\source\repos\blobtriggerTest\FunctionApp1\bin\Debug\netstandard2.0\host.json'
[15.08.2018 21:59:09] Host configuration file read:
[15.08.2018 21:59:09] {}
[15.08.2018 21:59:09] Starting Host (HostId=communij0n4s10-1948761026, InstanceId=363fb87c-595c-4422-9115-da5c2cd0e6d2, Version=2.0.11946.0, ProcessId=31512, AppDomainId=1, Debug=False, ConsecutiveErrors=0, StartupCount=1, FunctionsExtensionVersion=)
[15.08.2018 21:59:09] Generating 1 job function(s)
[15.08.2018 21:59:10] Host lock lease acquired by instance ID '000000000000000000000000FA106ED3'.
[15.08.2018 21:59:36] Error indexing method 'Function1.Run'
[15.08.2018 21:59:36] Microsoft.Azure.WebJobs.Host: Error indexing method 'Function1.Run'. Microsoft.WindowsAzure.Storage: No such host is known. System.Net.Http: No such host is known. System.Private.CoreLib: No such host is known.
[15.08.2018 21:59:36] Function 'Function1.Run' failed indexing and will be disabled.
[15.08.2018 21:59:36] 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.).
[15.08.2018 21:59:36] Host initialized (27125ms)
[15.08.2018 21:59:36] Host started (27148ms)
[15.08.2018 21:59:36] Job host started
[15.08.2018 21:59:36] The following 1 functions are in error:
[15.08.2018 21:59:36] Run: Microsoft.Azure.WebJobs.Host: Error indexing method 'Function1.Run'. Microsoft.WindowsAzure.Storage: No such host is known. System.Net.Http: No such host is known. System.Private.CoreLib: No such host is known.
[15.08.2018 21:59:36]
[15.08.2018 21:59:36]
Listening on http://0.0.0.0:7071/
Hit CTRL-C to exit...
ghost commented 5 years ago

Thank you. I've spent hours trying to debug the cause of this exact error. I upgraded my storage account and now it works. However, I really shouldn't have to upgrade to a more expensive type of account for my azure function to work.

fabiocav commented 5 years ago

This is a documented limitation of the trigger, but it would be nice if the message was a little more helpful and stated the problem. Will flag this for follow up as I believe we had this validation in place for V1.

se7vanj commented 5 years ago

As per #3039 we have run into an issue with Functions v2 (haven't tried v1) and the blob trigger.

Compiled Class Library, created in Visual Studio 2017; latest updates to VS and the Functions extensions; Core tools v 44.

It fails to run the function with the following: Error indexing method 'Function1.Run'. Microsoft.WindowsAzure.Storage: No such host is known. System.Net.Http: No such host is known. System.Private.CoreLib: No such host is known.

We figured out this is because the blob storage account was a "storage only" storage account. We changed to a generic storage account and it started working fine.

Full output from host:

[15.08.2018 21:59:09] Reading host configuration file 'c:\users\jgranlund\source\repos\blobtriggerTest\FunctionApp1\bin\Debug\netstandard2.0\host.json'
[15.08.2018 21:59:09] Host configuration file read:
[15.08.2018 21:59:09] {}
[15.08.2018 21:59:09] Starting Host (HostId=communij0n4s10-1948761026, InstanceId=363fb87c-595c-4422-9115-da5c2cd0e6d2, Version=2.0.11946.0, ProcessId=31512, AppDomainId=1, Debug=False, ConsecutiveErrors=0, StartupCount=1, FunctionsExtensionVersion=)
[15.08.2018 21:59:09] Generating 1 job function(s)
[15.08.2018 21:59:10] Host lock lease acquired by instance ID '000000000000000000000000FA106ED3'.
[15.08.2018 21:59:36] Error indexing method 'Function1.Run'
[15.08.2018 21:59:36] Microsoft.Azure.WebJobs.Host: Error indexing method 'Function1.Run'. Microsoft.WindowsAzure.Storage: No such host is known. System.Net.Http: No such host is known. System.Private.CoreLib: No such host is known.
[15.08.2018 21:59:36] Function 'Function1.Run' failed indexing and will be disabled.
[15.08.2018 21:59:36] 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.).
[15.08.2018 21:59:36] Host initialized (27125ms)
[15.08.2018 21:59:36] Host started (27148ms)
[15.08.2018 21:59:36] Job host started
[15.08.2018 21:59:36] The following 1 functions are in error:
[15.08.2018 21:59:36] Run: Microsoft.Azure.WebJobs.Host: Error indexing method 'Function1.Run'. Microsoft.WindowsAzure.Storage: No such host is known. System.Net.Http: No such host is known. System.Private.CoreLib: No such host is known.
[15.08.2018 21:59:36]
[15.08.2018 21:59:36]
Listening on http://0.0.0.0:7071/
Hit CTRL-C to exit...

Thank you so much... very helpful

bingbing8 commented 4 years ago

@se7vanj , to run the function locally, where to change the blob storage account from "storage only" to a generic storage account?

instantsquid commented 3 years ago

I am experiencing the same issue however the solution given above doesn't appear to be relevant anymore. My storage account is of type "BlockBlobStorage". I have created a container which my function is monitoring, and I can see another container has been created called "azure-webjobs-hosts" containing receipts and locks. The function app starts, and after a short delay exits with the exception "Microsoft.Azure.Storage.Common: No such host is known. System.Net.Http: No such host is known. System.Private.CoreLib: No such host is known."

gabalesev commented 3 years ago

I am experiencing a slightly similar issue:

"Microsoft.WindowsAzure.Storage: No such host is known. System.Net.Http: No such host is known. System.Private.CoreLib: No such host is known."

My storage account is of type "StorageV2 (general purpose v2)"

I'm not sure what to do at this point.

instantsquid commented 3 years ago

@gabalesev - I should have replied to my own comment above. Apologies!

Have you tried using a general purpose storage account but NOT V2? This appears to be working for me now.

gabalesev commented 3 years ago

@gabalesev - I should have replied to my own comment above. Apologies!

Have you tried using a general purpose storage account but NOT V2? This appears to be working for me now.

Thanks for your quick reply.

Unfortunately, I can't do that easily: https://stackoverflow.com/questions/57388796/is-it-possible-to-downgrade-a-v2-storage-account-to-v1

docklander commented 2 years ago

@instantsquid my blob is general v2, but i'm still getting exactly same as your description.

any further information? what went wrong here? it's all scripted and worked fine but it started happening after applying new subnet. which i don't think matters

instantsquid commented 2 years ago

@instantsquid my blob is general v2, but i'm still getting exactly same as your description.

any further information? what went wrong here? it's all scripted and worked fine but it started happening after applying new subnet. which i don't think matters

As I mentioned before - I recreated the storage account as "Storage" rather than "StorageV2" and that fixed it. I've not touched it since!

Davlomsft commented 2 years ago

Try adding the setting BLOB_FUNCTION_GO value "true"

Robinlievrouw commented 1 year ago

Try adding the setting BLOB_FUNCTION_GO value "true"

This does not work.