Category Archives: Microsoft Azure

Calling Azure Functions from JavaScript – The CORS configuration

You cannot call Azure Functions from JavaScript unless you configure the CORS settings for your Function Apps: This is because Microsoft have by default enabled CORS and only allows only some azure domains to access the Function Apps: So to … Continue reading

Posted in Microsoft Azure | Tagged , , | Leave a comment

Azure Functions CRON expressions

When creating Microsoft Azure Functions, you can have a timer that triggers your function. The time for when the function should run is specified in a CRON expression: The CRON format is widely used in UNIX environments, so therefore a … Continue reading

Posted in Microsoft Azure | Tagged , , , | Leave a comment

Read blob file from Microsoft Azure Storage with .NET Core

In order to read a blob file from a Microsoft Azure Blob Storage, you need to know the following: The storage account connection string. This is the long string that looks like this: DefaultEndpointsProtocol=https; AccountName=someaccounfname; AccountKey=AVeryLongCrypticalStringThatContainsALotOfChars== The blob storage container … Continue reading

Posted in .NET Core, Microsoft Azure | Tagged , | Leave a comment

Serilog – Add thread ID to the log file

Serilog is more or less the default file logger when developing .NET Core applications. The simple logger can easily be modified to – for example – add the thread ID. FIRST THINGS FIRST: THE SERILOG NUGET PACKAGES You need these … Continue reading

Posted in .NET Core, c#, Microsoft Azure | Tagged , , | Leave a comment

Azure ApplicationInsights track custom metrics using the TelemetryClient

The Microsoft.ApplicationInsights nuget package is your code gateway to the Microsoft Application Insights portal, and also to the Azure Monitor universe. You use these tools as a shared place for your log data, telemetry, alerts, diagnostics etc. The Application Insights comes … Continue reading

Posted in .net, c#, Microsoft Azure | Tagged , , , , | Leave a comment

Azure Application Insights – Multiple services from same server

This trick enables you to have multiple services from the same server log to the same Application Insights instance, and at the same time distinguish between each service. In the example above, I have 2 services from the same server. … Continue reading

Posted in c#, General .NET, Microsoft Azure | Tagged , | Leave a comment

Azure Functions – How to retry messages in the poison queue

When working with a scenario where your Microsoft Azure Function reads data from a queue, your azure functions is automatically triggered when an entry is added to the queue you wish to read from. The SDK will call your function … Continue reading

Posted in c#, Microsoft Azure | Tagged , , | 3 Comments

Azure API Management configure CORS in the policy

Cross-Origin Resource Sharing (CORS) allows a user agent gain permission to access a web- or REST service from a server on a different domain than the site currently in use. Modern browsers does not allow websites with Javascript that calls … Continue reading

Posted in Microsoft Azure | Tagged , , , , , , , | Leave a comment

Webhook Event Receiver with Azure Functions

Microsoft Azure Functions is a solution to run small pieces of code in the cloud. If your code is very small and have only one purpose, an Azure Function could be the cost effective solution. This is an example of … Continue reading

Posted in .net, c#, General .NET, Microsoft Azure | Tagged , , , | 1 Comment