SUNILE MANJEE: Hi, this is Sunile Manjee, senior principal
solution architect at Elastic.
Today I'll be talking about how to instrument
your containerized dot net application
running within Azure App service and instrumenting the elastic APM.
The architecture is very similar to the previous blog which
I containerize the Java app running within Azure app service.
Same exact architecture.
You mount a storage container, that storage
container has your elastic APM,
which is mounted to your application,
which essentially then sends telemetry
data over to elastic service.
If you're interested in replicating this demo,
what you'll need is an Azure account and a storage container.
You'll upload the elastic APM to the storage container.
There's a great video from the Azure folks.
It's super simple how to create a storage container
and mount it to your Azure app service.
So there's no reason for me to download that.
The Azure folks did a great job.
There's also an...
You also need an elastic service,
which you'll fetch the APM URL and token.
I'll show you how to do that.
You also need here's a documentation link
to the documentation on the APM,
the dot net agent profiler.
And then if you just wanna go to the binary download itself,
there's a link right there and then you can
containerize any dot net application.
The one I'm using, here's a tiny URL for that.
I basically dockerized in and upload it to my
own registry coincidentally in Azure as well.
So first you'll need your APM URL and token.
The reason why I put this on a slide is because
some of it has sensitive information.
I don't want the public to know about, like my APM and URL endpoint.
So first you just go to Kibana, you click on integrations,
then you click on Elastic APM.
I like to always click on the Java one or the Opentelemetry.
It just tells you exactly the URL and here's
the token and that's all you'll need.
Next we have to download the dot net agent
and I already provide the tiny URL to that.
You click on the latest release.
For now it's 119 and then you scroll down
and download and you unzip that folder.
So once you have that asset or that zip unzipped, you'll see a folder,
it'll be elastic profile or APM profiler with the version number,
you simply take that and you upload that,
either using the Azure storage viewer,
I believe that's what it's called.
You can upload it there or to the portal itself.
And I created a container called dot net here.
You call it whatever you like.
And then I uploaded the folder right there
and I'll be using that in the next step.
So here's a view of my application.
If I scroll down to configurations to path mapping,
I'm going to make this mount available.
So you call it whatever you want.
I called it Sunman and you select your storage account here.
I removed it just so I don't want to share it with the public.
And then also name your storage container.
And remember, I showed you in the previous
slide that it's mine is called dot net.
And then I mounted this is important because I mount this dot net as APM
and that's what will be shown within that's what you'll see within your,
your mount point, within your application itself.
If you wanna run this locally.
And I highly recommend you to try this first locally,
and then once you have this instrumented,
then you go and do this in Azure App Services.
Here's a little bit of this is the Docker
Command run command for local testing.
You can see here that I'm mounting my local path, my elastic.
APM profiler and I'm mounting it just like I'm
doing on Azure with the APM on mount point,
your APM, your URL, your token,
it shows you do that and then any service name go anything
silly or something serious doesn't matter.
Just call it something because it'll show up in the service map.
The rest of the configurations are documented
pretty well in the elastic documentation,
so go there for more information.
What's important is the elastic APM profiler home.
You do wanna dash exactly what the route is 'cause
that's where I'll look for the rest of the files.
So you can see here that elastic profiler integrations,
APM, this is looking for the root.
And then integrations.yml.
And then lastly, you must have this set the disable metrics.
And then you can call it any obviously,
this is my silly application called my awesome container.
So the next step is just a quick sanity check on whether
the application is running itself, right?
So again, it's a slide because it has my subscription
number and all other private information.
I don't wanna share.
Sharing a screenshot, this is the URL
to my application if I click on it,
this particular one, it says, hey, yeah, it's working.
OK, nothing fancy.
So here's the part where the instrument comes into play.
You go down to your Configuration in your app configuration,
in your Azure app service.
And over here you can see that all the environment
variables that I was running locally,
how I'm using them in Azure app service.
Same exact stuff here, right?
So you can see here that I have the Elastic APM disabled
metrics very similar to what you saw on the local.
Very similar, right?
And I'm calling out the Mount point.
You notice here it's APM, dash APM Again,
I called my dot net mount point- APM.
That's what we referencing.
You'll be putting your token all the places where I showed.
The arrows here it's very important to pay attention to that.
Is you only set this up properly you restart your application.
You should hit paydirt.
So I've essentially done that and restarted my application.
So let me head over to Elastic now.
I click on observability.
And now click on service map and the dot net application,
in fact, does show up.
It's interactive we'll give you more details.
And then I'll click on services and I can see that that in fact...
And by the way, this is the name of the service
name that you can call it whatever you want.
I call that profiler random.
Some digits here.
And this will show up and you can click on it.
It's interactive and I'll give you a lot
of information about your service.
So what are we talking about today?
Today we showed how simple it is to instrument your elastic APM with
your containerized dot net application on Azure App Service.
I talked about how to download the APM and mount it to your application.
Some of the configurations that are incredibly important
and then restarting your application.
And finally going over to Elastic and verifying
that in fact it does show up on.
Your service map and your services.
Hope you enjoyed the video.
Talk to you later.