Azure / azure-functions-vs-build-sdk

MSBuild task for Azure Functions
MIT License
96 stars 62 forks source link

Function core tools generates the wrong metadata in the `function.json` file #618

Closed yashints closed 11 months ago

yashints commented 11 months ago

I have a .Net7 function with below specs:

<PackageReference Include="Microsoft.Azure.DocumentDB.Core" Version="2.20.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.EventGrid" Version="3.3.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage.Blobs" Version="5.1.3" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.2.0" />
<PackageReference Include="Azure.Storage.Blobs" Version="12.17.0" />

Function core tools: v4.0.5198

The function declaration:

[FunctionName("ProcessImage")]
        public static async Task Run([EventGridTrigger]CloudEvent eventGridEvent,
            [Blob(blobPath: "{data.url}", access: FileAccess.Read,
                Connection = "dataLakeConnection")] Stream incomingPlate,
            ILogger log)

When I generate the function by using either dotnet publish or func publish the generated function.json is missing the direction property for both trigger and input binding:

"bindings": [
    {
      "type": "eventGridTrigger",
      "name": "eventGridEvent"
    },
    {
      "type": "blob",
      "connection": "dataLakeConnection",
      "blobPath": "{data.url}",
      "access": 1,
      "name": "incomingPlate"
    }
  ],

This will cause the function app to be in an invalid state and not responding to event grid events firing. Below is a screenshot of the integration page of the function:

image

Not sure what's happening, but seems like the updates have caused some sort of attribute issue for the function app generator

kshyju commented 11 months ago

FYI: .NET 7 is supported on the isolated model only.

yashints commented 11 months ago

Thanks @kshyju