Using the latest version of VS 2017 I
- Create a new azure functions project.
- Add a timer trigger function
- Upgrade to latest (1.0.8) azure functions nuget package
- Add a reference to azure storage for creating table client
- run the project, and it just failes on load.
A ScriptHost error has occurred [06.03.2018 20.46.05] Exception while executing function: Function1. FunctionApp2: Could not load file or assembly 'Microsoft.WindowsAzure.Storage, Version=8.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Could not find or load a specific file. (Exception from HRESULT: 0x80131621). System.Private.CoreLib: Could not load file or assembly 'Microsoft.WindowsAzure.Storage, Version=8.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Sample code:
[FunctionName("Function1")]
public static void Run([TimerTrigger("0 */5 * * * *", RunOnStartup = true)]TimerInfo myTimer, TraceWriter log)
{
log.Info($"C# Timer trigger function executed at: {DateTime.Now}");
var storageAccount = CloudStorageAccount.Parse("[someConnectionString]");
var tbc = storageAccount.CreateCloudBlobClient();
}
How can I fix this?