npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@azbake/ingredient-functions

v0.1.176

Published

Ingredient for deploying a function app from a docker image.

Downloads

195

Readme

Changelogs

Overview

The Functions ingredient is a plugin for Bake. When included in a recipe, this plugin will install an instance of a Function App on Linux inside a Linux-based Docker container.

This ingredient does not deploy an instance of an App Service plan and expects that a Linux-based App Service plan has already been created for the app. It also does not create Storage Account and Application Insights resources and expects them to be deployed prior to deploying the Function App.

Usage

Recipe

name: functions deployment
shortName: funcdepl
version: 0.1.0
ingredients:
  - "@azbake/ingredient-app-insights@~0"
  - "@azbake/ingredient-functions@~0"
resourceGroup: true
#rgOverride: "" 
variables:
  funcAppResourceGroup:  func-apps-test-rg
  storageAccountConnectionString: DefaultEndpointsProtocol=https;AccountName=funcappsstorageaccount;AccountKey=***;EndpointSuffix=core.windows.net
  hostingPlanName: func-apps-app-service-plan
  hostingEnvironment: func-apps-test-rg-hosting-environment
recipe:
  functions:
    properties:
      type: "@azbake/ingredient-functions"
      source: ./arm.json
      parameters:
        funcAppName: hello-docker-function-1
        funcAppResourceGroup: "[coreutils.variable('funcAppResourceGroup')]"
        storageAccountConnectionString: "[coreutils.variable('storageAccountConnectionString')]"
        container_registry_url: "[coreutils.variable('container_registry_url')]"
        container_registry_user: "[coreutils.variable('container_registry_user')]"
        container_registry_password: "[coreutils.variable('container_registry_password')]"
        container_image_name: func-apps-test/hello-docker-functions:latest
        hostingPlanName: "[coreutils.variable('hostingPlanName')]"
        location: East US
        hostingEnvironment: "[coreutils.variable('hostingEnvironment')]"
        appInsightsKey: "[appinsights.get_instrumentation_key('hellodockerfunctions','appinsights')]"

|property|required|description| |---------|--------|-----------| | funcAppName | Yes | Unique name of the function app to create or update. | | funcAppResourceGroup | No | App Service resource group. If not set, it defaults to the resource group of the Bake deployment context. | | storageAccountConnectionString | Yes | Connection string of the storage account. | | container_registry_url | Yes | Docker container registry address. | | container_registry_user | Yes** | Docker container registry user name. | | container_registry_password | Yes** | Docker container registry password. | | container_image_name | Yes | Name of the Linux-based Docker image to deploy. This image should contain the function app artifacts. | | hostingPlanName | Yes | Name of the App Service hosting plan. | | location | Yes | Resource location. | | hostingEnvironment | Yes | App Service environment to use for the function app. | | appInsightsKey | Yes | Application Insights instrumentation key. |

** Not required for public repositories.

Best Practices

Since there is some secure information required to deploy your web site in a container, it is recommended that this information should be stored inside of the environment and referenced through coreutils.variable(). Do not set these values in the recipe itself as it could risk exposing this information publicly. Sample above uses this method to keep secure user credentials and password for the container registry.

Utilities

Utility classes can be used inside of the bake.yaml file for parameter and source values.

functions class

|function|description| |--------|-----------| |create_resource_name(shortName)|Creates the full function app name by passing a short name.|

Function Details

create_resource_name(shortName)

Creates the full function app name in the format <environment_name>fa<shortname>

...
parameters:
  funcAppName: "[functions.create_resource_name('hello-docker-function-1')]"
...

Returns

string