How to use @azure/arm-appinsights - 2 common examples

To help you get started, we’ve selected a few @azure/arm-appinsights examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github HomecareHomebase / azure-bake / ingredient / ingredient-app-insights / src / functions.ts View on Github external
public async get_instrumentation_key(shortName: string, rgShortName: string | null = null): Promise {

        let util = IngredientManager.getIngredientFunction("coreutils", this.context)
        
        //App Insights telemetry will be centralized.  Therefore don't append a region code.  
        //Also, pass in shortname rather than using default.  The default is the package name being deployed but we want the App Insights resource name/group.
        const aiName = util.create_resource_name("ai", shortName, false);
        
        const rgName: string = await util.resource_group(rgShortName, false);

        const client = new ApplicationInsightsManagementClient(this.context.AuthToken, this.context.Environment.authentication.subscriptionId);

        let response = await client.components.get(rgName, aiName);

        let key: string = ""
        if (response.instrumentationKey) {
            key = response.instrumentationKey || ""
        }
        return key
    }
}
github HomecareHomebase / azure-bake / ingredient / ingredient-api-managment-base / src / plugin.ts View on Github external
public async Execute(): Promise {
        try {
            this._logger.log(`API Manamgement: Base Logging - ${this._ingredient.properties.source}`)
            let aiClient = new ApplicationInsightsManagementClient(this._ctx.AuthToken, this._ctx.Environment.authentication.subscriptionId);
            let client = new ApiManagementClient(this._ctx.AuthToken, this._ctx.Environment.authentication.subscriptionId)
            let util = IngredientManager.getIngredientFunction("coreutils", this._ctx)
            const helper = new ARMHelper(this._ctx);
            let params = await helper.BakeParamsToARMParamsAsync(this._name, this._ingredient.properties.parameters)
            let serviceName = params["apiManagementServiceName"].value
            //Import deployment parameters
            let properties = params["properties"]
            delete params["properties"]
            let loggerProps = params["logger"]
            delete params["logger"]
            
            params = await helper.ConfigureDiagnostics(params);
            //Deploy primary ARM template
            await helper.DeployTemplate(this._name, ApimTemplate, params, await util.resource_group())
            //Deploy named Key/Value pairs
            if (properties) {

@azure/arm-appinsights

ApplicationInsightsManagementClient Library with typescript type definitions for node.js and browser.

MIT
Latest version published 2 years ago

Package Health Score

73 / 100
Full package analysis

Popular @azure/arm-appinsights functions