1

This is my original format of a azure storage queue trigger function, it use to work, however after I updated the Microsoft.Net.Functions NuGet package from 1.0.24 to 3.0.3, changed zip deployment to web deployment, and did a publish, this setup have stopped working.

[FunctionName("FunctionEmailQueueTrigger")]
public static async Task Run([QueueTrigger("%emailqueue%")]string myQueueItem, ILogger log)
{
        //....Actions
}```

So, I thought it is the setup format changed from 1.0.24 to 3.0.3 so I changed to this format: This is my update storage Queue trigger setup which is also not fire

public static async Task Run([QueueTrigger("emailqueue", Connection = "DefaultEndpointsProtocol=https;AccountName=name;AccountKey=XXXXXXX;EndpointSuffix=core.windows.net")]string myQueueItem, ILogger log)
{
        //....Actions
}```

When I check the function and click at it on azure, it throws me an error:

Error: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

it deployed on azure with a standard plan so I assume there should not have cold start, I have chacked the queue name, its match.

Thank you for the help.

Wanming Hu
  • 28
  • 5

1 Answers1

1

For now the problem I could get from your code is your Connection, this should be your storage account connection name not the connection string, if in your local it should be the connection in local.settings.json, if on the azure go to Configuration check your storage account setting key.

And in my test v3 function still could use the bind expression with %%, however if you use 3.0.3 function package, not set the version in the .csproj file like this doc shows:Visual Studio runtime versions, it will run without logs.

After following the doc setting your function, you still get the problem, you could try to catch the exception to get the detail information with this answer:How to retrieve the LoaderException property? and share your full code to let me have a test.

Hope this could help you, if you still have other problem please feel free to let me know.

George Chen
  • 13,703
  • 2
  • 11
  • 26
  • Thank you for helping me with this, This is the correct answer, I have followed the documents you showed me and re-published the function, now things works totally fine – Wanming Hu Feb 18 '20 at 15:53