Azure App Service File And Configuration Change Monitoring - azure

As part of our production environment we have several App Services running inside of Azure. I would like to implement notifications to be sent to a specific email address upon file or configuration changes within those App Services. I have tried enabling Application Changes for the service but it does not appear to provide the capability to set up alerts on the changes,
I have also tried enabling App Service alerts but it does not appear that any of the test configuration changes that I have made were captured by the signal "Apply Web App Configuration".
The last thing that I tried was to enable Diagnostic Settings to capture AppServicePlatformLogs and AppServiceFileAuditLogs and stream them to an Event Hub, however, I cannot determine how to set up the email notification from the hub for the events.
I am hoping that there may be an easier way to set this up and was hoping that someone may have some pointers or resources that I can follow.

I was able to accomplish this under "Monitoring" -> "Alerts". A more detailed walkthrough can be found here https://perituza.com/blog/azure-app-service-monitoring-and-alerts/. The key was selecting "Activity Log - Administrative" as the Monitor Service in the Condition.

Related

Azure Linux App Service Not Displaying Application Logs

I've set up a linux based azure app service and am unable to see log messages from the application itself in both the "log stream" and "logs" tab of the monitoring options. It is important to note I can see start up messages in the logs for the deployed application and can see outputs when get and post requests are made to the corresponding connection url so i know its running (Also the tasks the application is written to perform are carried out). Additionally, in the "App Service Logs" tab I have "Application Logging" set to "File System" as is standard for what I'm trying to output but this hasn't resulted in any in-application logs being visible.
Lastly about a year ago I managed to set up two other linux based azure app services that work completely as desired and output the in app log messages to the stream and cannot replicate this behaviour with this one. I feel there is just some setting or property somewhere i have overlooked but no matter how many different setting tabs I investigate I cannot spot any significant differences.
Are there any somewhat hidden options or requirements to be aware of in order to get in-application logs to be outputted to a linux based app services "log stream"? Or some other solution at a higher level in the azure resource group, workspace, application insights etc that may solve this issue? Any help and suggestions are greatly appreciated thank you.
I have tested in my environment.
Go to Your App Service --> Select Diagnose and Solve Problems --> Click on Availability and Performance --> Select Application Logs
You should be able to see the Application Logs, Platform Logs and Deployment Logs here.
Log Stream gives you the live logs of your application. The logs displayed in the Application logs should be seen in the Log Stream.

Azure Logic App Workflow Runtime

Having difficulty getting diagnostic details out of my logic app. I have enabled the diagnostics, bit the event hub and log analytics for work flow runtime. But at this time I'm not seeing anything coming out. I have also checked the diagnostic logs table and nothing. this is a very basic POC logic app.
Do I need to do anything else.
You can set up the log analytics(OMS) workspace in azure and link it with the logic app. For the existing logic apps, we can add this via diagnostics settings under monitoring.

How to use OMS for Azure web app

I want to explore OMS (especially Service Map) for Azure webApps, but it shows following error, "In order to on-board a server to Service Map, the Microsoft Dependency Agent needs to be installed on a server being monitored by OMS. Documentation can be found".
Alos, Microsoft claims that 'Monitor service' is used to view the data across multiple subscriptions, resource group etc. But when I view Metrics, it requires 'Resource Name'. Although comments says, 'select or all resources', but It does not give option to select all.
I think it's too late but here it goes, Application insight is what you will need to get the metrics, Have you looked at it as an option?
OMS, is more useful when you are running stuff on Infrastructure as service resources not on Paas/Saas, I guess because the shared responsibility monitoring etc is different in such environment & PaaS/SaaS should already have means to log, monitor & alert.
Though there is workaround to integrate your app for logging that I am aware of, All you need to do integrate the log analytics for your app service, from there you can setup alerting etc.
Installing agent on shared service would never work out, considering there will be other neighbors using the resources however dedicated instances of app will give you greater flexibility.
Thanks

AzureWebApp: Monitor Application Logs

I'm building an Azure web-app and if there are certain unexpected errors, I want to be able to bubble it up in the Azure Dashboard / add alerts.
Any System.Diagnostics.Trace.TraceError() messages are logged to the ApplicationLog. Is there a way to add alert/monitoring-graphs for these in Azure Portal?
I think and most flexible option for configuring alerts on Web Apps is enabling the Application insights have the App Insight be one of your event sources:
https://azure.microsoft.com/en-us/documentation/articles/app-insights-search-diagnostic-logs/
Once you have the Application Insight setup then you can easily set any kind of alerts based on the diagnostics that are collected:
https://azure.microsoft.com/en-gb/documentation/articles/app-insights-alerts/
Aram's links below really helps. Please read them.
To Get this working:
Add the ApplicationInsights to your project.
(Optional) If you want log traces (System.Diagnostics.Trace) to be searchable on insights, add Microsoft.ApplicationInsights.TraceListener nuget to your project.
Use telemetryClient.TrackException() to place a server exception
when you hit a critical error.
Add an alert on Azure portal to check for ServerExceptions within the given time window.

Azure Websites Application Insights - switching config

I have an Azure Website. For the sake of this question, the production version of the website runs on example.com, and a test version of the website runs on sandbox.example.com.
The only difference between the two is that they have different configuration.
At present, they are running under different websites, and I deploy the same website to each azure website via git.
I'd like to separate out the Application Insights data. Is there a technique or process that anyone uses - apart from editing the ApplicationInsights.config file in the sandbox environment post deploy?
Or would using a deployment slot handle this in some way?
There was a new blog post about exactly this today: Application Insights Support for Multiple Environments, Stamps and App Versions.
The destination of the telemetry is determined by the instrumentation
key (iKey), which is sent along with every telemetry message. In the
Application Insights portal, similar events and metrics with the same
iKey are aggregated to give you charts of average durations, event
counts, the sum of users, and so on. The iKey appears in two places in
your project. One is in ApplicationInsights.config:
<InstrumentationKey>94843456-2345-3456-4567-324562759284</InstrumentationKey>
If your application has web pages, the iKey also appears in a script
in the head of every web page. Usually, it’s only coded once in a
master page such as Views\Shared\_Layout.cshtml.
To direct telemetry to different application resources, we can create
several resources with different iKeys. Then we only have to change
the iKeys in the application at each transition in its lifecycle –
along with other configuration data such as connection strings,
certificates, and subscriptions.
The article then goes on how to do this in code, confg, etc:
1) Add iKey as a property in Web.config:
2) Instead of using the iKey from ApplicationInsights.config, we’ll
set it in the code. In global.asax.cs.
To avoid confusion, remove the <InstrumentationKey> node from
ApplicationInsights.config.
3) Configure the web pages to pick up instrumentationKey: "#Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration.Active.InstrumentationKey". This is
the script usually found in View\Shared\_Layout.cshtml.
4) Don’t forget to update your Web.config with appropriate iKey
configuration during the deployment process. You might devise a way of
setting it appropriately as part of your build, but I’ll leave that to
you.
Found this semi-related question: How to support multiple Azure subscriptions for a single application with application insights this is for using by cloud services, and it works!
Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration.Active.InstrumentationKey = ConfigurationManager.AppSettings["appInsightsKey"];
I have done this in my unity registertypes method, it works there.
In the Azure portal for websites, on the config tab there is a section called App Settings. You can put your different configuration settings here. When publishing, azure will inject those settings into web.config.
Then just use WebConfigurationManager.AppSettings as you would normally and it will pull the injected values.

Resources