Giter Club home page Giter Club logo

azure-functions-v3's Introduction

Azure Functions v3

A sample Azure Functions 3.0 project with dependency injection, github action deploy routine, ready for local development.

Notes

  • Ignore the version 2.0 in host.json, it is not related to the runtime version
  • Timeout limit and other settings can be specified in host.json
  • Create as many folders and functions as you want in the Functions folder
  • New functions will appear in Function app after a deploy

How to run Azure functions locally

Azure Functions will run locally like they run in Azure, if you want to start a timer on demand you can trigger it with a script or use Postman to send requests. Azure blob storage credentials can be added to local.settings.json if you don't like the additional step of starting Azurite manually.

# Prerequisites
npm i -g azure-functions-core-tools@3 --unsafe-perm true
npm i -g azurite

# Build the project
dotnet build

# Run the blob storage emulator
azurite-blob

# Start function host with a single active function
func start --functions HorseTimer

# While function host is running, you can trigger functions with a POST request
http://localhost:7071/admin/functions/HorseTimer

Use the Dependency Injection container

This works just like it does in ASP.NET Core applications

Deploy functions to Azure with Github Actions

  • Create an Azure blob storage account in Azure Portal
  • Create an App setting named AzureWebJobsStorage with blob account connection string
  • Download publish settings from Azure Function App in Azure Portal
  • Create a Github secret named AZURE_FUNCTIONAPP_PUBLISH_PROFILE, paste publish settings
  • Insert application name in Github action workflow Azure.yml
  • Deploy to Azure by pushing a commit to main branch

Related documentation

azure-functions-v3's People

Contributors

honeymustard avatar

Stargazers

 avatar

Watchers

 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.