I'm attempting to update azure SDK from v1 to v3, and hook it up to the Azure Storage Emulator for testing; using console application and .NET Framework.
It doesn't appear to like any of the triggers that worked previously, the 'SomeFunction' in the error is a simple QueueTrigger with a timeout.
Exception: Microsoft.Azure.WebJobs.Host.Indexers.FunctionIndexingException: 'Error indexing method '*.SomeFunction'
Inner Exception: InvalidOperationException: Storage account 'Storage' is not configured.
[Timeout("00:30:00")]
public static async Task SomeFunction([QueueTrigger("queue")] CloudQueueMessage message, CancellationToken cancellationToken)
{
// do stuff
}
app.config:
<connectionStrings>
<add name="AzureWebJobsDashboard" connectionString="AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;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;" />
<add name="AzureWebJobsStorage" connectionString="AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;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;" />
</connectionStrings>
<appSettings>
<add key="StorageConnectionString" value="UseDevelopmentStorage=true" />
<add key="AzureQueueName" value="queue" />
</appSettings>
Version 3 of Microsoft.Azure.WebJobs is no longer configured with an app.config
file, but with an appSettings.json
file. Place it in the root of your app and make sure the "Copy to output directory" property of the appSettings.json file is set to either Copy if newer or Copy always, or add this to your .csproj
file directly using Always or PreserveNewest:
<Project ...>
...
<ItemGroup>
<None Include="appSettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
...
</Project>
Your appSettings.json
file should have the Storage connection string:
{
"ConnectionStrings": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true"
}
}
{
"ConnectionStrings": {
"AzureWebJobsStorage": "DefaultEndpointsProtocol=https;AccountName=mystorage;AccountKey=key;..."
}
}
See this .NET Core 2.1 sample host application for more info on configuring in version 3. Though it might be somewhat different than .NET Framework that you are using.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With