0

Use gulp with azure function. Is it possible to use gulp for all azure functionApp?

process.env.NODE_CONFIG_DIR = `${process.cwd()}/config/env`;

import gulp from 'gulp';
import requireDir from 'require-dir';

requireDir('./lib/tasks');

gulp.task('default', ['update-project', 'run-webpack'], () => {
  gulp.src('host.json')
    .pipe(gulp.dest('.deploy/'));

  const devBuild = process.env.NODE_ENV !== 'production';

  if (devBuild) {
    gulp.src('local.settings.json')
      .pipe(gulp.dest('.deploy/'));
  }`enter code here`
});
Gopal Meena
  • 99
  • 1
  • 7

1 Answers1

0

It seems that the code with gulp you post comes from the GitHub Gisp jordanyaker/gulpfile.babel.js.

If you want to integrate it with Azure Functions and make it run on Azure Functions, I think it's impossible, and Azure Functions is not designed for doing the streaming build operations, and there are not enough resources like time for building and persistent storage.

If you just want to help building your Azure Function automatically by gulp at the develepment stage and deploy a function to Azure after built, I recommended that you can try to use Azure DevOps to do it. Please refer to the offical docuemnts as below to know how to.

  1. Build, test, and deploy JavaScript and Node.js apps
  2. Continuous delivery by using Azure DevOps for Azure Functions
  3. Gulp task
  4. Azure Function App task
Peter Pan
  • 23,476
  • 4
  • 25
  • 43