This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Integration.Observability.Constants; | |
using Microsoft.Extensions.Logging; | |
using System; | |
namespace Integration.Observability.Extensions | |
{ | |
/// <summary> | |
/// ILogger extensions for structured logging using typed signatures. | |
/// </summary> | |
public static class LoggerExtensions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Integration.Observability.Constants | |
{ | |
/// <summary> | |
/// Constants used for Logging and Tracing | |
/// </summary> | |
public class LoggingConstants | |
{ | |
/// <summary> | |
/// To identify the tracing span checkpoints (e.g. start or finish of each span) | |
/// Enum values follow the structure spanId + checkPoint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using Microsoft.Azure.WebJobs; | |
using Microsoft.Extensions.Options; | |
using Newtonsoft.Json; | |
using ServerlessRequestBin.DurableFunctions.Models; | |
namespace ServerlessRequestBin.DurableFunctions | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Upload-FileToWebApp($resourceGroupName, $webAppName, $slotName = "", $localPath, $kuduPath){ | |
$kuduApiAuthorisationToken = Get-KuduApiAuthorisationHeaderValue $resourceGroupName $webAppName $slotName | |
if ($slotName -eq ""){ | |
$kuduApiUrl = "https://$webAppName.scm.azurewebsites.net/api/vfs/site/wwwroot/$kuduPath" | |
} | |
else{ | |
$kuduApiUrl = "https://$webAppName`-$slotName.scm.azurewebsites.net/api/vfs/site/wwwroot/$kuduPath" | |
} | |
$virtualPath = $kuduApiUrl.Replace(".scm.azurewebsites.", ".azurewebsites.").Replace("/api/vfs/site/wwwroot", "") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
traces | |
| sort by timestamp desc | |
| where customDimensions.EventId > 1 | |
| where customDimensions.LogLevel == 'Error' | |
| project EventId = tostring(customDimensions.EventId) | |
| summarize Count = count(EventId) by EventId |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Properties used with Azure Functions structure logging are logged as customDimensions.prop__{name} | |
//To filter events created by our custom structured logging, get only those traces where EventId > 1 | |
traces | |
| sort by timestamp desc | |
| where customDimensions.EventId > 1 | |
| project Level = customDimensions.LogLevel | |
, EventId = customDimensions.EventId | |
, CheckPoint = customDimensions.prop__CheckPoint | |
, CorrelationId = customDimensions.prop__CorrelationId | |
, Description = customDimensions.prop__Description |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "2.0", | |
"logging": { | |
"logLevel": { | |
"default": "Information" | |
}, | |
"aggregator": { | |
"batchSize": 100, | |
"flushTimeout": "00:00:10" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Azure.WebJobs; | |
using Microsoft.Extensions.Logging; | |
using Newtonsoft.Json; | |
using System; | |
using System.IO; | |
namespace PacodelaCruz.AzureFunctions.Logging | |
{ | |
public static class ProcessOrder |