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-webapp-container

v0.1.115

Published

Ingredient for deploying an instance of an Azure WebApp for Container

Downloads

170

Readme

Changelogs

Overview

The Web App ingredient is a plugin for Bake. When included in a recipe, this plugin will install a instance of an azure Web App for Containers. An instance of the web app will be included with each region specified in your environment. This ingredient only supports deployment of a web site inside of 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.

Usage

Recipe

name: My package
shortName: mypkg
version: 0.0.1
ingredients:
  - "@azbake/ingredient-webapp-container@~0"
resourceGroup: true
recipe:
  mypkg-web-site:
    properties:
      type: "@azbake/ingredient-webapp-container"
      source: "[coreutils.get_app_svc_name('ngapp')]"
      tokens:
        BASE_URL: "[coreutils.variable('svc_base_url')]"
        PROPERTY: "some value"
      parameters:
        container_image_name: "myregistry.azurecr.io/mypkg:latest"
        container_registry_url: "[coreutils.variable('container_registry_url')]"
        container_registry_user: "[coreutils.variable('container_registry_user')]"
        container_registry_password: "[coreutils.variable('container_registry_password')]"

|property|required|description| |---------|--------|-----------| |source|yes|the linux based app service plan used to host this website. Format <resourceGroup>/<resource> ***| |container_image_name|yes|The name of the image to be deployed to web app.| |container_registry_url|yes|The url to the container registry containing your image| |container_registry_user|yes|the user name with access to pull images from the registry| |container_registry_password|yes|the password for the user specified with access to the registry|

*** Please note that you can supply just the name of the azure resource for the source if the resource exists within the same resource group that is currently being deployed for traffic manager.

*** Please note that all values should be in the parameters section of the recipe except for source

Tokens

The token section of the ingredient can be used to specify any values you wished to be pushed into the environment variables of the container running your web application. Very useful for updating configuration files. Tokens are optional and can be omitted if not needed.

Best Practices

Since there is some secure information required to deploy your web site in a container, it si 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.

webapp class

|function|description| |--------|-----------| |create_profile()|Gets or creates the profile name used to deploy the web app| |get_resource_profile()|Gets the resource group and web app name in the format <resourceGroup>/<resource>.|

Function Details

create_profile()

Gets or creates the name of the web app in the format <environment_name><region_code>webapp<pkg_shortname>

...
parameters:
  appName: "[webapp.create_profile()]"
...

Returns

string

get_resource_profile()

Gets the resource group and web app profile name as a single string in the format <resourceGroup>/<resource>

This is useful inside of a recipe when another ingredient needs to reference the web application deployed with this ingredient (such as a traffic manager endpoint)

...
source: "[webapp.get_resource_profile()]"
...

Returns

string - Formatted as <resourceGroup>/<resource>