Coder Social home page Coder Social logo

typescript-azure-functions's Introduction

Azure Functions ❤️'s TypeScript

This is an example of a simple function app written in TypeScript. Most of the contents come from default templates that are available through both the VS Code extension for Azure Functions and Azure Functions Core Tools. The HelloWorldNpm function is modified from a default template to import and use an npm module.

Prerequisites

  • Install latest Active LTS version of Node.js
  • Install latest azure-functions-core-tools if you do not already have it.
    • npm install -g azure-functions-core-tools
  • Run npm install from project root to install dev dependencies.

The basics

Build

To build this Function app run npm run build. (Note that npm start and F5 already include a build step.) If you are using binding extensions, the necessary binaries are also installed.

On build, all TypeScript code in the root directory is transpiled into JavaScript and placed in an output directory called dist, as configured in tsconfig.json by outDir. We don't advise changing this configuration. The default scriptFile property of each function assumes that the transpiled JavaScript output will be located in dist (example: ../dist/FunctionName/index.js).

Run

To run your code, use npm start. If you are using VS Code, you can press F5 to build and run instead.

This command builds your Function app and starts the Azure Functions host to run your code. If you only want to run your built code, you can run func start or npm run start:host.

Develop

npm run test can be implemented to test your code. To ignore specific files and folders when deploying, add them to .funcignore.

Deploy

To prepare your function app for deployment, use npm run build:production. If you are using VS Code, deploy by clicking Deploy to Function App. If you already have a deployed Function app in Azure and want to update its contents, you can also use func azure functionapp publish <FunctionAppName>.

Learn More

If you are getting started with Azure Functions, you can follow this tutorial to create and deploy your first JavaScript function. We recommend that you use Visual Studio Code and the Azure Functions extension.

The Azure Functions developer guide and the JavaScript-specific developer guide are good resources to gain an understanding of more Azure Functions concepts.

typescript-azure-functions's People

Contributors

mhoeger avatar gtrevisani avatar

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.