Giter VIP home page Giter VIP logo

azure-functions-core-tools's Introduction

Azure Functions Logo

Branch Status
master Build status
v1.x Build status

Azure Functions Core Tools

The Azure Functions Core Tools provide a local development experience for creating, developing, testing, running, and debugging Azure Functions.

Versions

v1 (v1.x branch): Requires .NET 4.7.1 Windows Only

v2 (master branch): Self-contained cross-platform package

Installing

Windows

Both v1 and v2 of the runtime can be installed on Windows.

To install v1 with npm:

npm i -g azure-functions-core-tools@1

To install v1 with chocolatey:

choco install azure-functions-core-tools --version 1.0.15 

To install v2 with npm:

npm i -g azure-functions-core-tools --unsafe-perm true

To install v2 with chocolatey:

choco install azure-functions-core-tools

Mac

Homebrew:

brew tap azure/functions
brew install azure-functions-core-tools

Linux

Ubuntu/Debian

  1. Set up package feed
Ubuntu 18.04
wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
Ubuntu 17.10
wget -q https://packages.microsoft.com/config/ubuntu/17.10/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
Ubuntu 16.04 / Linux Mint 18
wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
  1. Install
sudo apt-get update
sudo apt-get install azure-functions-core-tools

Other Linux Distributions

  1. Download latest release

Download the latest release for your platform from here.

  1. Unzip release zip

Using your preferred tool, unzip the downloaded release. To unzip into an azure-functions-cli directory using the unzip tool, run this command from the directory containing the downloaded release zip:

unzip -d azure-functions-cli Azure.Functions.Cli.linux-x64.*.zip
  1. Make the func command executable

Zip files do not maintain the executable bit on binaries. So, you'll need to make the func binary executable. Assuming you used the instructions above to unzip:

cd azure-functions-cli
chmod +x func
./func
  1. Optionally add func to your $PATH

To execute the func command without specifying the full path to the binary, add its directory to your $PATH environment variable. Assuming you're still following along from above:

export PATH=`pwd`:$PATH
func

Code and test Azure Functions locally

NOTE: npm can be used on all platforms. On unix platforms, you may need to specify --unsafe-perm if you are running npm with sudo. That's due to npm behavior of post install script.

NOTE: If you're running the v2 on Windows, Linux, or Mac, make sure to enable the beta runtime in function app settings, otherwise you may not see the same results as running locally.

Getting Started on Kubernetes

Using the Core Tools, you can easily run Azure Functions on 1.7+ Kubernetes clusters. The Core Tools will build and push a Docker image of the function to a given registry and create corresponding Kubernetes objects including a Deployment, Service and Horizontal Pod Autoscaler.

First, make sure you init a Docker file.

func init --docker

Prerequisites

Deploy a function to Kubernetes

func deploy --platform kubernetes --name myfunction --registry <docker-hub-id or registry-server>

Deploy a function with a minimum of 3 instances and a maximum of 10

func deploy --platform kubernetes --name myfunction --registry <docker-hub-id or registry-server> --min 3 --max 10

Get function logs

func logs --name myfunction --platform kubernetes

Provide a kubeconfig file

func deploy --platform kubernetes --name myfunction --registry <docker-hub-id or registry-server> --config /mypath/config

Deploying Azure Functions with Virtual-Kubelet

Azure Functions running on Kubernetes can take advantage of true serverless containers model by getting deployed to different providers of Virtual Kubelet, such as Azure Container Instances.

Functions deployed to Kubernetes already contain all the tolerations needed to be schedulable to Virtual Kubelet nodes. All you need to do is to set up VKubelet on your Kubernetes cluster:

Important note: Virtual Kubelet does not currently allow for Kubernetes Services to route external traffic to pods. This means that HTTP triggered functions will not receive traffic running on a VKubelet provider (including ACI).

A good usage scenario for using functions with VKubelet would be with event triggered / time triggered functions that do not rely on external HTTP traffic.

Known Issues:

func extensions command require the dotnet cli to be installed and on your path. This requirement is tracked here. You can install .NET Core for your platform from https://www.microsoft.com/net/download/

Default Directories

  • CurrentDirectory: is the default directory the functions runtime looks for functions in.
  • %TMP%\LogFiles\Application\Functions: is the default directory for logs. It mirrors the logs directory on Azure as well.

License

This project is under the benevolent umbrella of the .NET Foundation and is licensed under the MIT License

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Contact Us

For questions on Azure Functions or the tools, you can ask questions here:

File bugs at Azure Functions Core Tools repo on GitHub.

azure-functions-core-tools's People

Contributors

acesyde avatar ahmelsayed avatar alrod avatar ankitkumarr avatar asavaritayal avatar brettsam avatar dariuszparzygnat avatar elprans avatar fabiocav avatar forki avatar jdneo avatar joescars avatar lindydonna avatar lukecolburn avatar mathewc avatar mhoeger avatar mhutch avatar nelak avatar orrosenblatt avatar pragnagopa avatar sdras avatar shaggygi avatar soninaren avatar tdykstra avatar tylerleonhardt avatar vfedonkin avatar watashishun avatar wilsonge avatar yaron2 avatar yevster avatar

Watchers

 avatar  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.