Skip to content

Can not create blob storage binding in c# using visual studio 2017 #6

@sbailey476

Description

@sbailey476

Trying to remake the this example in c# using visual studio but having issues making the azure function trigger be triggered by the event grid and bind to the blob storage.

Current Code:

using Microsoft.Azure.WebJobs.Extensions.EventGrid;
using Microsoft.Azure.WebJobs.Host;
using Microsoft.Azure.WebJobs;
using Microsoft.WindowsAzure.Storage.Blob;

namespace FunctionApp
{
    public static class CreateIndex
    {
        [FunctionName("CreateIndex")]
        [StorageAccount("backup_STORAGE")]
        public static void Run(
            [EventGridTrigger()] EventGridEvent myEvent, 
            [Blob("{data.url}")] CloudBlockBlob inputBlob, 
            TraceWriter log)
        {
            log.Info(myEvent.ToString());
            log.Info(inputBlob.ToString());
        }
    }
}

Generated function.json:

{
  "generatedBy": "Microsoft.NET.Sdk.Functions.Generator-1.0.6",
  "configurationSource": "attributes",
  "bindings": [
    {
      "type": "eventGridTrigger",
      "name": "myEvent"
    }
  ],
  "disabled": false,
  "scriptFile": "../bin/FunctionApp.dll",
  "entryPoint": "FunctionApp.CreateIndex.Run"
}

The binding is working for the event grid trigger but not the Blob input.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions