Giter VIP home page Giter VIP logo

Comments (12)

jaliyaudagedara avatar jaliyaudagedara commented on July 21, 2024

Seems this is caused by changes in #2313

Tried using the latest prerelease, and not seeing the issue there.

<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.17.3-preview1" />

Since this wasn't captured by an E2E test, should we add a test? .azurefunctions folder is too important to be missing.

@kshyju @jviau

from azure-functions-dotnet-worker.

jviau avatar jviau commented on July 21, 2024

@jaliyaudagedara I used your FunctionApp2.zip and the .azurefunctions folder is present for me. My guess is this was an MSBuild oddity - perhaps some stale targets or intermediate files on your machine

from azure-functions-dotnet-worker.

jaliyaudagedara avatar jaliyaudagedara commented on July 21, 2024

@jviau,

ugh, that's weird.

Did you look inside the project that references the function app project: FunctionApp2\FunctionApp2.Tests\bin\Debug\net8.0?. That's where .azurefunctions is missing.
It creates .azurefunctions inside the function app project: FunctionApp2\FunctionApp2\bin\Debug\net8.0.

Even in the build pipeline, .azurefunctions wasn't there. So likely not specific to my machine.

from azure-functions-dotnet-worker.

jviau avatar jviau commented on July 21, 2024

@jaliyaudagedara the test project is not expected to have .azurefunctions folder in it, it is not a function app. Only projects that directly reference the Function SDK should have it.

The fact that it is present in 1.17.0, 1.17.1 and 1.17.3-preview1 is not intentional. What use case do you have for having that folder and its contents in your test app?

from azure-functions-dotnet-worker.

jaliyaudagedara avatar jaliyaudagedara commented on July 21, 2024

@jviau,

Thanks for the message.

Ah I see. The use case is I have a bunch of integration test projects that spin up a function and run against it.

The concept is as follows: https://github.com/jaliyaudagedara/azure-functions-integration-tests/blob/main/tests/HelloAzureFunctions.Tests.Integration/Fixtures/AzureFunctionFixture.cs

If .azurefunctions project isn't going to be there, I am going to be in trouble 😢. But when you think about it, especially in a test project, when you reference a project, SUTs executables should be in the output, isn't it?

from azure-functions-dotnet-worker.

jviau avatar jviau commented on July 21, 2024

If .azurefunctions project isn't going to be there, I am going to be in trouble 😢.

You can always manually copy the contents over via msbuild targets. Or you can get the output directory of the functions project and directly launch it from there.

But when you think about it, especially in a test project, when you reference a project, SUTs executables should be in the output, isn't it?

Possibly, but there are also cases you may not want this. Consider a function app referencing another. Having 2 .azurefunctions folders attempting to copy to the output may be problematic. I'd rather err on the side of not copying it, and let those that do want it copy it over themselves.

from azure-functions-dotnet-worker.

jaliyaudagedara avatar jaliyaudagedara commented on July 21, 2024

You can always manually copy the contents over via msbuild targets. Or you can get the output directory of the functions project and directly launch it from there.

Yeah, I was thinking about using msbuild targets.

Possibly, but there are also cases you may not want this. Consider a function app referencing another. Having 2 .azurefunctions folders attempting to copy to the output may be problematic. I'd rather err on the side of not copying it, and let those that do want it copy it over themselves.

Right, that's a valid case. If someone wants to opt-in, they can do it. That makes sense.

from azure-functions-dotnet-worker.

jviau avatar jviau commented on July 21, 2024

With all that said, the current preview version 1.17.3-preview1 will copy that folder. I think I will block that copying before GA'ing this version.

from azure-functions-dotnet-worker.

jaliyaudagedara avatar jaliyaudagedara commented on July 21, 2024

yes please. If it's not supposed to be there, then we shouldn't have it. Otherwise people like me can depend on that

from azure-functions-dotnet-worker.

jviau avatar jviau commented on July 21, 2024

@jaliyaudagedara after further thinking, I am going to leave the copying behavior in - it will be available in 1.17.3-preview1 on. If you decide to not want the copying behavior, you can mark the project with Private="false" metadata in the ProjectReference.

To disable copying of .azurefunctions folder:

<ProjectReference Include="{MyFunctionApp}.csproj" Private="false" />

from azure-functions-dotnet-worker.

jviau avatar jviau commented on July 21, 2024

Resolved by #2347

from azure-functions-dotnet-worker.

jaliyaudagedara avatar jaliyaudagedara commented on July 21, 2024

@jviau,

Perfect, thank you!

Updated Microsoft.Azure.Functions.Worker.Sdk to 1.17.3-preview1, and can now see .azurefunctions.

from azure-functions-dotnet-worker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.