I'm trying to extend on the basic tutorial that allows you to log information after a file is uploaded to blob storage. The code from the tutorial works, and was pulled from here:
I am now trying to add an output that makes a copy of that file to another container. I am using code found in an output example found here:
My code is just a small add on to the original example.
run.csx:
using System.IO;
using System.Collections.Generic;
using Microsoft.Azure.WebJobs;
public static void Run([BlobTrigger("samples-workitems/{name}")] Stream myBlob, [Blob("copytwotkelly/{name}", FileAccess.Write)] Stream duplicateUpload, string name, ILogger log)
{
log.LogInformation($"C# Blob trigger function Processed blob\n Name:{name} \n Size: {myBlob.Length} Bytes");
myBlob.CopyTo(duplicateUpload);
}
function.json:
{
"bindings": [
{
"name": "myBlob",
"type": "blobTrigger",
"direction": "in",
"path": "samples-workitems/{name}",
"connection": "AzureWebJobsStorage"
},
{
"name": "duplicateUpload",
"path": "copytwotkelly/{name}",
"connection": "AzureWebJobsStorage",
"direction": "out",
"type": "blob"
}
]
}
When the function triggers I get the error messages:
2020-11-25T06:29:57.518 [Error] run.csx(5,25): error CS0246: The type or namespace name 'BlobTriggerAttribute' could not be found (are you missing a using directive or an assembly reference?) 2020-11-25T06:29:57.580 [Error] run.csx(5,25): error CS0246: The type or namespace name 'BlobTrigger' could not be found (are you missing a using directive or an assembly reference?) 2020-11-25T06:29:57.672 [Error] run.csx(5,82): error CS0246: The type or namespace name 'BlobAttribute' could not be found (are you missing a using directive or an assembly reference?) 2020-11-25T06:29:57.729 [Error] run.csx(5,82): error CS0246: The type or namespace name 'Blob' could not be found (are you missing a using directive or an assembly reference?)
but as far as I can tell, I have followed the configuration directions from the tutorial properly. It doesn't actually show the .json file in the example so I'm not sure what I'm doing wrong. What am I missing? Aren't these classes it's asking for in using Microsoft.Azure.WebJobs; that I referenced? Thanks in advance for any help.