Giter VIP home page Giter VIP logo

Comments (10)

daniloraisi avatar daniloraisi commented on May 3, 2024 1

@Jefiozie I forked the project and modified some behaviours so it can work as expected.

Can I do a Pull Request to integrate?

from azure-func-http.

kamilmysliwiec avatar kamilmysliwiec commented on May 3, 2024 1

@daniloraisi PRs are more than welcome!

from azure-func-http.

kamilmysliwiec avatar kamilmysliwiec commented on May 3, 2024

@Jefiozie have you encountered such an issue before?

from azure-func-http.

Jefiozie avatar Jefiozie commented on May 3, 2024

hi @kamilmysliwiec, I've not seen this. I think the main reason that I've not seen this is that I've used the introduced --project flag when switching to the monorepo setup.

@daniloraisi I think you could setup our your project by using the following steps:

  1. Create a new NestJS project using CLI nest new my-project
  2. Create a Monorepo adding new app with nest g app my-app
  3. Add azure-http-func to the first app: nest add @nestjs/azure-func-http --project my-project
  4. Try add azure-http-func to the second app: nest add @nestjs/azure-func-http --project my-app
  5. Navigate to apps/my-app/src
  6. run npx func host start

Let us know if this worked out for you or if this is not working for your use case.

from azure-func-http.

pawelbart avatar pawelbart commented on May 3, 2024

@Jefiozie Thanks for your solution. Locally its work well but what is the proper way to publish function?
I built app by nest built app and publish by func azure functionapp publish but App Service doesn't contain any function.

from azure-func-http.

Jefiozie avatar Jefiozie commented on May 3, 2024

Hi @pawelbart, did you already seen the blog here they use a extension in vscode. I don't know the exact commands for publishing them with the func cmdline tool. Is this related to this issue or is it a other issue you are experiencing?

from azure-func-http.

daniloraisi avatar daniloraisi commented on May 3, 2024

@Jefiozie it works, but there are some caveats:

  1. Function files are generated per app basis, but nest build will generate everything into dist folder. So, as @pawelbart pointed, we have problems publishing them.

  2. nest-cli.json is altered with webpack: true and webpackConfig:... on a project basis, but if I try a default build executing just nest build it uses NestJS default webpack.

  3. Script start:azure generated on package.json will not work, since all function files are available only on each app directory.

I know that probably this is kind an edge case, but it's interesting to talk about.

from azure-func-http.

pawelbart avatar pawelbart commented on May 3, 2024

@Jefiozie Yes, I read the blog article and everything works for me for standard app (without monorepo structure).

VSCode extension Azure Functions under the hood calls the following sequence:
npm install, npm run build, npm prune --production, func azure functionapp publish <app-name>

For monorepo nest build generates path dist/apps/api/main.js. Because function.json has "scriptFile": "../../../../dist/apps/<app-name>/main/index.js" I run nest build <app-name>, which generates such path.

I noticed that during deployment there are uploaded only files from apps/<app-name>/src (excluding files from .funcignore) instead of the entire project. That's why dist/apps/<app-name>/main/index.js does't exist in wwwroot folder on Azure Storage account.

I'm looking for the best way to send the entire project to Azure. Maybe it is possible to set project root path in function.json or somewhere else?

I agree with @daniloraisi that this is an interesting topic. Thanks for your help.

from azure-func-http.

daniloraisi avatar daniloraisi commented on May 3, 2024

Some news @kamilmysliwiec?

from azure-func-http.

kamilmysliwiec avatar kamilmysliwiec commented on May 3, 2024

Just merged your PR and published as 0.6.0

from azure-func-http.

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.