Code Monkey home page Code Monkey logo

Comments (12)

nilshedstrom avatar nilshedstrom commented on July 19, 2024 1

Pull request #41 contains support for diagnostics on the service level.

from apimanagementarmtemplatecreator.

MLogdberg avatar MLogdberg commented on July 19, 2024

Good idea, I'll try to get that with next release

from apimanagementarmtemplatecreator.

nilshedstrom avatar nilshedstrom commented on July 19, 2024

Logger support was included in pull request #24. Is that enough?
It does not create new loggers but will create a "link" to existing ones.

from apimanagementarmtemplatecreator.

MLogdberg avatar MLogdberg commented on July 19, 2024

Guess this will be enough for now?

from apimanagementarmtemplatecreator.

joeyeng avatar joeyeng commented on July 19, 2024

It'd be nice if this was part of the tool, but creating the link is fine for us. However, I just tested this out (with commit f17cb07) and it didn't seem to generate the logger link for an API with an existing logger.

from apimanagementarmtemplatecreator.

nilshedstrom avatar nilshedstrom commented on July 19, 2024

Strange that the creation of the logger link was not working in that commit. It worked fine for me.

In pull request 32 there are code that will generate an Application Insights instance if you specify the parameter CreateApplicationInsightsInstance as true and it is used by a logger.
It will be created in the same location as the api management instance and the type will be "other".
You will not need to specify the instrumentation key as a parameter because it will be a reference from the Application Insights instance to the API Management instance.4

If you set CreateApplicationInsightsInstance=false then you still need to provide the instrumentation key as a parameter

from apimanagementarmtemplatecreator.

joeyeng avatar joeyeng commented on July 19, 2024

Hi @nilshedstrom, maybe I'm misunderstanding what you meant when you said creating a link to an existing logger. I'm expecting something similar to what I have at the bottom of my sample template (LOGGER ASSOCIATION WITH API). I just pulled latest and reran the tool against an API that has an App Insights logger configured, but I'm not seeing any "link" it in the output. Am I missing a parameter?

from apimanagementarmtemplatecreator.

nilshedstrom avatar nilshedstrom commented on July 19, 2024

Pull request 32 is not merged yet so you dont get it by pulling the latest version of the main branch.

When you get it and have the CreateApplicationInsightsInstance as $true then you will get something like this in resources for the APIM instance

{
"type": "Microsoft.Insights/components",
"name": "[parameters('apimServiceName_applicationInsights')]",
"apiVersion": "2015-05-01",
"properties": {
"Application_Type": "other"
},
"resources": [],
"dependsOn": [
"[resourceId('Microsoft.ApiManagement/service', parameters('apimServiceName'))]"
],
"location": "[parameters('apimServiceName_location')]",
"kind": "other"
},
{
"type": "Microsoft.ApiManagement/service/loggers",
"name": "[concat(parameters('apimServiceName'),'/',parameters('apimServiceName_applicationInsights'))]",
"apiVersion": "2017-03-01",
"properties": {
"loggerType": "applicationInsights",
"description": null,
"credentials": {
"instrumentationKey": "[reference(resourceId('Microsoft.Insights/components', parameters('apimServiceName_applicationInsights')), '2014-04-01').InstrumentationKey]"
},
"isBuffered": true
},
"resources": [],
"dependsOn": [
"[resourceId('Microsoft.ApiManagement/service', parameters('apimServiceName'))]",
"[resourceId('Microsoft.Insights/components',parameters('apimServiceName_applicationInsights'))]"
]
}

from apimanagementarmtemplatecreator.

joeyeng avatar joeyeng commented on July 19, 2024

This will create the logger and the app insights instance, but you need to add a diagnostics resource to assign the logger to the API.

from apimanagementarmtemplatecreator.

nilshedstrom avatar nilshedstrom commented on July 19, 2024

I realized this when I Application Insights did not log anything untill I added a ""Microsoft.ApiManagement/service/diagnostics" resource.
I hope I will have time to support for this in APIManagementARMTemplateCreator soon.

from apimanagementarmtemplatecreator.

nilshedstrom avatar nilshedstrom commented on July 19, 2024

@joeyeng Loggers are created, diagnostics resources are created and Application Insights resources can be created if requested. What else is needed before this issue can be closed?

from apimanagementarmtemplatecreator.

joeyeng avatar joeyeng commented on July 19, 2024

Great, I will close this issue now.

from apimanagementarmtemplatecreator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.