Automating Azure Instrumentation and Monitoring – Part 5: Log Alerts

In the previous part of this series, we looked at the basic structure of Azure Monitor alerts, and then specifically at metric alerts. In this part we will consider other types of alert that Azure Monitor can emit. We will first discuss application log alerts – sometimes simply called log alerts – which let us be notified about important data emitted into our application logs. Next we will discuss activity log alerts, which notify us when events happen within Azure itself.… [Keep reading] “Automating Azure Instrumentation and Monitoring – Part 5: Log Alerts”

Automating Azure Instrumentation and Monitoring – Part 4: Metric Alerts

One of the most important features of Azure Monitor is its ability to send alerts when something interesting happens – in other words, when our telemetry meets some criteria we have told Azure Monitor that we’re interested in. We might have alerts that indicate when our application is down, or when it’s getting an unusually high amount of traffic, or when the response time or other performance metrics aren’t within the normal range. We can also have alerts based on the contents of log messages, and on the health status of Azure resources as reported by Azure itself.… [Keep reading] “Automating Azure Instrumentation and Monitoring – Part 4: Metric Alerts”

Automating Azure Instrumentation and Monitoring – Part 3: Custom Metrics

One of the core data types that Azure Monitor works with is metrics – numerical pieces of data that represent the state of an Azure resource or of an application component at a specific point in time. Azure publishes built-in metrics for almost all Azure services, and these metrics are available for querying interactively as well as for use within alerts and other systems. In addition to the Azure-published metrics, we can also publish our own custom metrics.… [Keep reading] “Automating Azure Instrumentation and Monitoring – Part 3: Custom Metrics”

Low-Cost Rate Limiting for Azure Functions APIs with API Management’s Consumption Tier

Azure Functions can be used as a lightweight platform for building APIs. They support a number of helpful features for API developers including custom routes and a variety of output bindings that can implement complex business rules. They also have a consumption-based pricing model, which provides a low-cost, pay-per-use pricing model while you have low levels of traffic, but can scale or burst for higher levels of demand.

The Azure Functions platform also provides Azure Functions Proxies, which gives another set of features to further extend APIs built on top of Azure Functions.… [Keep reading] “Low-Cost Rate Limiting for Azure Functions APIs with API Management’s Consumption Tier”

Integration Testing Timer-Triggered Precompiled v2 Azure Functions

In a recent post, I described a way to run integration tests against precompiled C# Azure Functions using the v2 runtime. In that post, we looked at an example of invoking an HTTP-triggered function from within an integration test.

Of course, there are plenty of other triggers available for Azure Functions too. Recently I needed to write an integration test against a timer-triggered function and decided to investigate the best way to do this.

The Azure Functions runtime provides a convenient API for invoking a timer-trigger function.… [Keep reading] “Integration Testing Timer-Triggered Precompiled v2 Azure Functions”

Automating Azure Instrumentation and Monitoring – Part 2: Application Insights

Application Insights is a component of Azure Monitor for application-level instrumentation. It collects telemetry from your application infrastructure like web servers, App Services, and Azure Functions apps, and from your application code. In this post we’ll discuss how Application Insights can be automated in several key ways: first, by setting up an Application Insights instance in an ARM template; second, by connecting it to various types of Azure application components through automation scripts including Azure Functions, App Services, and API Management; and third, by configuring its smart detection features to emit automatic alerts in a configurable way.… [Keep reading] “Automating Azure Instrumentation and Monitoring – Part 2: Application Insights”

Automating Azure Instrumentation and Monitoring – Part 1: Introduction

Instrumentation and monitoring is a critical part of managing any application or system. By proactively monitoring the health of the system as a whole, as well as each of its components, we can mitigate potential issues before they affect customers. And if issues do occur, good instrumentation alerts us to that fact so that we can respond quickly.

Azure provides a set of powerful monitoring and instrumentation tools to instrument almost all Azure services as well as our own applications.… [Keep reading] “Automating Azure Instrumentation and Monitoring – Part 1: Introduction”

Integration Testing Precompiled v2 Azure Functions

Azure Functions code can often contain important functionality that needs to be tested. The two most common ways of testing code are unit testing and integration testing. Unit testing runs pieces of code in isolation, and this is relatively simple to do with Azure Functions. Integration testing can be a little trickier though, and I haven’t found any good documentation about how do this with version 2 of the Functions runtime. In this post I’ll outline the approach I’m using to run integration tests against my Azure Functions v2 code.… [Keep reading] “Integration Testing Precompiled v2 Azure Functions”

Creating Azure Storage SAS Tokens with ARM Templates

Shared access signatures, sometimes also called SAS tokens, allow for delegating access to a designated part of an Azure resource with a defined set of permissions. They can be used to allow various types of access to your Azure services while keeping your access keys secret.

In a recent update to Azure Resource Manager, Microsoft has added the ability to create SAS tokens from ARM templates. While this is a general-purpose feature that will hopefully work across a multitude of Azure services, for now it only seems to work with Azure Storage (at least of the services I’ve checked).… [Keep reading] “Creating Azure Storage SAS Tokens with ARM Templates”

Deploying App Services with ‘Run From Package’, Azure Storage, and Azure Pipelines

Azure App Service recently introduced a feature called Run From Package. Rather than uploading our application binaries and other files to an App Service directly, we can instead package them into a zip file and provide App Services with the URL. This is a useful feature because it eliminates issues with file locking during deployments, it allows for atomic updates of application code, and it reduces the time required to boot an application. It also means that the ‘release’ of an application simply involves the deployment of a configuration setting.… [Keep reading] “Deploying App Services with ‘Run From Package’, Azure Storage, and Azure Pipelines”