New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

azure-functions-core-tools

Package Overview
Dependencies
Maintainers
5
Versions
201
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

azure-functions-core-tools - npm Package Compare versions

Comparing version 2.4.317 to 2.4.401

2

npm-shrinkwrap.json
{
"name": "azure-functions-core-tools",
"version": "2.4.317",
"version": "2.4.401",
"lockfileVersion": 1,

@@ -5,0 +5,0 @@ "requires": true,

{
"name": "azure-functions-core-tools",
"version": "2.4.317",
"version": "2.4.401",
"description": "Azure Functions Core Tools",

@@ -5,0 +5,0 @@ "scripts": {

@@ -6,4 +6,2 @@ ![Azure Functions Logo](https://raw.githubusercontent.com/Azure/azure-functions-cli/master/src/Azure.Functions.Cli/npm/assets/azure-functions-logo-color-raster.png)

|master|[![Build status](https://ci.appveyor.com/api/projects/status/max86pwo54y44j36/branch/master?svg=true)](https://ci.appveyor.com/project/appsvc/azure-functions-cli/branch/master)|
|dev|[![Build status](https://ci.appveyor.com/api/projects/status/max86pwo54y44j36/branch/dev?svg=true)](https://ci.appveyor.com/project/appsvc/azure-functions-cli/branch/dev)|
|v1.x|[![Build status](https://ci.appveyor.com/api/projects/status/max86pwo54y44j36/branch/v1.x?svg=true)](https://ci.appveyor.com/project/appsvc/azure-functions-cli/branch/v1.x)|

@@ -14,250 +12,133 @@ # Azure Functions Core Tools

## Versions
**v1** (v1.x branch): Requires .NET 4.7.1 Windows Only
**v2** (master branch): Self-contained cross-platform package
## Installing
### Windows
**NOTE**: This package only currently works on Windows, since the underlying Functions Host is not yet cross-platform. You can upvote this GitHub issue if you're interested in running on other platforms: [make the Azure Functions Core Tools cross platform](https://github.com/Azure/azure-functions-cli/issues/13).
Both v1 and v2 of the runtime can be installed on Windows.
To install globally:
To install v1 with npm:
```bash
npm i -g azure-functions-core-tools@1
```
To install v1 with chocolatey:
```bash
choco install azure-functions-core-tools --version 1.0.15
npm i -g azure-functions-core-tools
```
To install v2 with npm:
### Aliases
```bash
npm i -g azure-functions-core-tools --unsafe-perm true
```
The package sets up the following global aliases:
To install v2 with chocolatey:
```bash
choco install azure-functions-core-tools
```
func
azfun
azure-functions
```
### Mac
## Commands
**Homebrew**:
Commands have the following basic structure:
```bash
brew tap azure/functions
brew install azure-functions-core-tools
```
func [context] [context] <action> [-/--options]
```
### Linux
Output can be found at *%temp%\LogFiles*.
#### Ubuntu/Debian
### Contexts
1. Set up package feed
##### Ubuntu 18.04
```bash
wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
```
##### Ubuntu 17.10
```bash
wget -q https://packages.microsoft.com/config/ubuntu/17.10/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
azure For Azure login and working with Function Apps on Azure
function For local function settings and actions
functionapp For local function app settings and actions
host For local Functions host settings and actions
settings For local settings for your Functions host
```
##### Ubuntu 16.04 / Linux Mint 18
### Top-level actions
```bash
wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
```
2. Install
```bash
sudo apt-get update
sudo apt-get install azure-functions-core-tools
func init Create a new Function App in the current folder. Initializes git repo.
func run Run a function directly
```
#### Other Linux Distributions
### Azure actions
1. Download latest release
Actions in the "azure" context require logging in to Azure.
Download the latest release for your platform from [here](https://github.com/Azure/azure-functions-core-tools/releases).
2. 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:
```bash
unzip -d azure-functions-cli Azure.Functions.Cli.linux-x64.*.zip
```
func azure
3. Make the `func` command executable
Usage: func azure [context] <action> [-/--options]
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:
Contexts:
account For Azure account and subscriptions settings and actions
functionapp For Azure Function App settings and actions
storage For Azure Storage settings and actions
subscriptions For Azure account and subscriptions settings and actions
```bash
cd azure-functions-cli
chmod +x func
./func
Actions:
get-publish-username Get the source control publishing username for a Function App in Azure
set-publish-password Set the source control publishing password for a Function App in Azure
login Log in to an Azure account. Can also do "func azure login"
logout Log out of Azure account. Can also do "func azure logout"
portal Launch default browser with link to the current app in https://portal.azure.com
```
4. 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:
```bash
export PATH=`pwd`:$PATH
func
```
func azure account
Usage: func azure account <action> [-/--options]
[Code and test Azure Functions locally](https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local)
**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](https://docs.microsoft.com/en-us/azure/azure-functions/functions-versions#target-the-version-20-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.
```bash
func init --docker
Actions:
set <subscriptionId> Set the active subscription
list List subscriptions for the logged in user
```
### Prerequisites
* [Docker](https://docs.docker.com/install/)
* [Kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
### Deploy a function to Kubernetes
```bash
func deploy --platform kubernetes --name myfunction --registry <docker-hub-id or registry-server>
```
func azure functionapp
Usage: func azure functionapp <action> [-/--options]
### Deploy a function with a minimum of 3 instances and a maximum of 10
```bash
func deploy --platform kubernetes --name myfunction --registry <docker-hub-id or registry-server> --min 3 --max 10
Actions:
enable-git-repo Enable git repository on your Azure-hosted Function App
fetch-app-settings Retrieve App Settings from your Azure-hosted Function App and store locally. Alias: fetch
list List all Function Apps in the selected Azure subscription
```
#### Scaling out Http Trigger
Currently the solution is configured to scale out using the Horizontal Pod Autoscaler when any pod reaches a CPU of 60%.
The `func azure storage list` command will show storage accounts in the selected subscription. You can then set up a connection string locally with this storage account name using `func settings add-storage-account`.
### Get function logs
```
func logs --name myfunction --platform kubernetes
```
func azure storage
Usage: func Azure Storage <action> [-/--options]
### Provide a kubeconfig file
```bash
func deploy --platform kubernetes --name myfunction --registry <docker-hub-id or registry-server> --config /mypath/config
Actions:
list List all Storage Accounts in the selected Azure subscription
```
### Deploy a function to Knative
#### Prerequisites
### Local actions
* [Knative](https://github.com/knative/docs/tree/master/install/)
Actions that are not in the "azure" context operate on the local environment. For instance, `func settings list` will show the app settings for the current function app.
Deploying Azure Functions to knative is supported with the ```--platform knative``` flag.
The Core Tools CLI identifies non HTTP trigger functions and annotates the knative manifest with the the ```minScale``` annotation to opt out of scale-to-zero.
```bash
func deploy --platform knative --name myfunction --registry <docker-hub-id or registry-server>
```
func settings
Usage: func settings [context] <action> [-/--options]
### Deploying a function to AKS using ACR
Using the configuration options an Azure Function app can also be deployed to a [AKS](https://azure.microsoft.com/en-us/services/kubernetes-service/) (Azure Kubernetes Service) Kubernetes cluster and use [ACR](https://azure.microsoft.com/en-us/services/container-registry/) as the registry server. Do all of the following *before* you run the deployment command.
#### Create a AKS cluster
You can create an AKS cluster using the [Azure Portal](https://docs.microsoft.com/en-us/azure/aks/kubernetes-walkthrough-portal) or using [Azure CLI](https://docs.microsoft.com/en-us/azure/aks/kubernetes-walkthrough).
Once your AKS cluster is created make sure that you can access it using kubectl. To make kubectl run in the context of your cluster, configure a connection using the command below.
```azurecli
az aks get-credentials \
--name FunctionsCluster \
--resource-group <resource-group-name>
Actions:
add Add new local app setting to appsettings.json
add-storage-account Add a local app setting using the value from an Azure Storage account. Requires Azure login.
decrypt Decrypt the local settings file
delete Remove a local setting
encrypt Encrypt the local settings file
list List local settings
```
To verify the connection to your cluster run the following command
```bash
> kubectl get nodes
NAME STATUS ROLES AGE VERSION
aks-agentpool-20257154-0 Ready agent 1d v1.11.5
aks-agentpool-20257154-1 Ready agent 1d v1.11.5
aks-agentpool-20257154-2 Ready agent 1d v1.11.5
```
#### Create a ACR Registry
An ACR instance can be created using the Azure Portal or the [Azure CLI](https://docs.microsoft.com/en-us/azure/container-registry/container-registry-get-started-azure-cli#create-a-container-registry)
func function
Usage: func function [context] <action> [-/--options]
#### Login to the ACR Registry
Before pushing and pulling container images, you must log in to the ACR instance.
```azurecli
az acr login --name <acrName>
Actions:
create Create a new Function from a template, using the Yeoman generator
run Run a function directly
```
#### Give the AKS cluster access to the ACR Registry
The AKS cluster needs access to the ACR Registry to pull the container. Azure creates a service principal to support cluster operability with other Azure resources. This can be used for authentication with an ACR registry. See here for how to grant the right access here: [Authenticate with Azure Container Registry from Azure Kubernetes Service](https://docs.microsoft.com/en-us/azure/container-registry/container-registry-auth-aks)
For consistency, the `func init` command can also be invoked via `func functionapp init`.
#### Run the deployment
The deployment will build the docker container and upload the container image to your referenced ACR instance (Note: Specify the ACR Login Server in the --registry parameter this is usually of the form <container_registry_name>.azurecr.io) and then your AKS cluster will use that as a source to obtain the container and deploy it.
```bash
func deploy --platform kubernetes --name myfunction --registry <acr-registry-loginserver>
```
If the deployment is successful, you should see this:
Function deployed successfully!
Function IP: 40.121.21.192
#### Verifying your deployment
You can verify your deployment by using the Kubernetes web dashboard. To start the Kubernetes dashboard, use the [az aks browse](https://docs.microsoft.com/en-us/cli/azure/aks?view=azure-cli-latest#az-aks-browse) command.
```azurecli
az aks browse --resource-group myResourceGroup --name myAKSCluster
func functionapp init
```
In the Kubernetes dashboard look for the namespace "azure-functions" and make sure that a pod has been deployed sucessfully with your container.
### 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](https://github.com/virtual-kubelet/virtual-kubelet), such as Azure Container Instances.<br>
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:
* [Install VKubelet with ACI](https://github.com/virtual-kubelet/virtual-kubelet/tree/master/providers/azure)
* [Install VKubelet with ACI on AKS](https://docs.microsoft.com/en-us/cli/azure/aks?view=azure-cli-latest#az-aks-install-connector)
*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](https://github.com/Azure/azure-functions-core-tools/issues/367). You can install .NET Core for your platform from https://www.microsoft.com/net/download/
## Default Directories

@@ -281,2 +162,2 @@

File bugs at [Azure Functions Core Tools repo on GitHub](https://github.com/Azure/azure-functions-core-tools/issues).
File bugs at [Azure Functions Core Tools repo on GitHub](https://github.com/Azure/azure-functions-cli/issues).
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc