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-app-insights

v0.1.114

Published

Ingredient for deploying an instance of an Application Insights resource

Downloads

2,694

Readme

Changelogs

Overview

The Application Insights ingredient is a plugin for Bake. When included in a recipe, this plugin will install a instance of an Application Insights resource. A region parameter is provided to allow for a deployment to a specific region. The Smart Detection settings within the arm.json ARM template will turn off the default email notification but still leave the Smart Detection alerts enabled. Also, the naming convention for the Failure Anomalies alert is very specific and a duplicate alert may result if it is modified. Lastly, Microsoft is deprecating Smart Detection settings so this will be updated as needed once that occurs.

Usage

Recipe for creating a resource

name: Deploys all Application Insights resources
#shortName will be a component of the resource group name.  ie <env><shortName> --> prodappinsights
shortName: appinsights
version: 0.0.2
ingredients:
  - "@azbake/ingredient-app-insights@~0"
resourceGroup: true
recipe:
  appinsights-property:
    properties:
      type: "@azbake/ingredient-app-insights"
      source: ""
      parameters:
        #App Insights resource name
        appInsightsName: "[appinsights.get_resource_name('property')]"

  appinsights-payroll:
    properties:
      type: "@azbake/ingredient-app-insights"
      source: ""
      parameters:
        #App Insights resource name
        appInsightsName: "[appinsights.get_resource_name('payroll')]"

Recipe for referencing a resource

name: Deploys all Application Insights resources
#shortName will be a component of the resource group name.  ie <env><shortName> --> prodappinsights
shortName: propertywebappcontainer
version: 0.0.2
ingredients:
  - "@azbake/ingredient-webapp-container@~0"
  - "@azbake/ingredient-app-insights@~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"
        APPINSIGHTS_INSTRUMENTATIONKEY: "[appinsights.get_instrumentation_key('property','appinsights')]"
      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')]"

Utilities

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

appinsights class

|function|description| |--------|-----------| |get_resource_name()|Gets a full App Insights resource name. | |get_instrumentation_key()|Gets an App Insights instrumentation key.|

Function Details

get_resource_name()

Gets an full App Insights resource name by passing a short name. Returns in the format <environment_name>ai<shortname>. For example, prodaipayroll.

...
parameters:
  appInsightsName: "[appinsights.get_resource_name('payroll')]"
...

Returns

string

get_instrumentation_key()

Gets an App Insights instrumentation key by passing a short name and resource group short name.

This is useful inside of a recipe when another ingredient needs to reference an App Insights resource deployed in a different recipe. In the example below, the instrumentation key is returned from an App Insights resource named aiproperty that's in a resource group named appinsights.

...
      tokens:
        APPINSIGHTS_INSTRUMENTATIONKEY: "[appinsights.get_instrumentation_key('property','appinsights')]"
...

Returns

string

##Addendum The package.json file of this ingredient includes a dependency on "@azure/ms-rest-js": "^1.8.1". This was added so the Event Hub and Service Bus Namespace will compile. Those ingredients reference version 3.2 of their respective Azure Javascript SDK packages (@azure/arm-eventhub, @azure/arm-servicebus). An alternative is to use version 3.1 of those two packages.