Azure / azure-functions-templates

Azure functions templates for the azure portal, CLI, and VS
MIT License
340 stars 193 forks source link

Patch .NET isolated DF templates #1513

Closed davidmrdavid closed 3 months ago

davidmrdavid commented 3 months ago

We've received recent reports that the DF templates for .NET isolated have stopped working out of the box. This PR makes 3 fixes to address the feedback:

  1. Updates the DF isolated extension to version 1.1.1 (can I use a * pattern to have it always download the latest?)

  2. Updates the Http extension to version 3.1.0 (was getting the following warning otherwise)

""" Warning As Error: Detected package downgrade: Microsoft.Azure.Functions.Worker.Extensions.Http from 3.1.0 to 3.0.13. Reference the package directly from the project to select a different version.

FunctionApp2 -> Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore 1.2.0 -> Microsoft.Azure.Functions.Worker.Extensions.Http (>= 3.1.0)

FunctionApp2 -> Microsoft.Azure.Functions.Worker.Extensions.Http (>= 3.0.13)

"""

  1. changes the use of CreateCheckStatusResponse to CreateCheckStatusResponseAsync which should address a runtime failure reading:

""" Exception: System.InvalidOperationException: Synchronous operations are disallowed. Call WriteAsync or set AllowSynchronousIO to true instead. """

davidmrdavid commented 3 months ago

I see the CI tests are failing to run, probably permissions-based. I think @soninaren has the permissions to run them?

davidmrdavid commented 3 months ago

@fabiocav - can we get an approval for this change? I see the tests aren't passing for what seems like a permission error. Usually I'd ping Naren to get those resolved (I think he has the right permissions) but I know he's OOF. Do you know how to get the CI passing?

fabiocav commented 3 months ago

/azp run

azure-pipelines[bot] commented 3 months ago
Azure Pipelines successfully started running 1 pipeline(s).
fabiocav commented 3 months ago

@jviau had already approved, but I just fixed a pipeline issue that was causing the build to break. Once that is green, you should be good to merge.

fabiocav commented 3 months ago

Just went ahead and merged it

javtec commented 2 months ago

I was able to finally get the sample code to work from the instructions above. However, the instructions were not complete to solve the issue. @davidmrdavid you had mentioned to simply replace "CreateCheckStatusResponse" with "CreateCheckStatusResponseAsync". But the final fix was to replace the whole line of code from this:

"return client.CreateCheckStatusResponse(req, instanceId);"

to this:

"return await client.CreateCheckStatusResponseAsync(req, instanceId);"

I added "await" and that got the code working.