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
import logging | |
import threading | |
from typing import Dict, List | |
from azure.monitor.opentelemetry.exporter import ( | |
AzureMonitorLogExporter, | |
AzureMonitorTraceExporter, | |
) | |
from flow_nodes.core.ConfigProvider import ( | |
IsDevelopmentEnvironment, |
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.EntityFrameworkCore; | |
Console.WriteLine("Hello, World!"); | |
using var x = new MyDbContext(); | |
x.Database.EnsureCreated(); | |
var paramValueDateTimeOffset = DateTimeOffset.Now.AddDays(-1); | |
var paramValueDateTime = DateTime.Now.AddDays(-1); | |
var query = x.CustomerLeases.Where(c => c.TextDateTime >= DateTimeOffset.Now |
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
/* | |
More about Azure.Identity client library: https://devblogs.microsoft.com/azure-sdk/azure-identity-august-2020-ga/ | |
Guidance on migrating from old Microsoft.Azure.Services.AppAuthentication library: https://docs.microsoft.com/en-us/dotnet/api/overview/azure/app-auth-migration | |
This is useful when the user account running the application locally in Visual Studio doesn't have permissions to the resources (i.e. Due to network restrictions/vpn or policy requirements). | |
We create a SP/AppRegistration and use that identity when running things locally. | |
TokenCredential is the base class for all credential types used for identity in Azure | |
like DefaultAzureCredential, ManagedIdentityCredential, EnvironmentCredential, ClientSecretCredential, VisualStudioCrdential etc (https://devblogs.microsoft.com/azure-sdk/azure-identity-august-2020-ga/#more-credential-types) |
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
// Reading | |
// https://tsuyoshiushio.medium.com/correlation-with-activity-with-application-insights-1-overview-753a48a645fb | |
// https://tsuyoshiushio.medium.com/correlation-with-activity-with-application-insights-2-activity-deep-dive-2a4147919659 | |
// https://medium.com/prospa-engineering/implementing-distributed-tracing-with-azures-application-insights-5a09cc1c200c | |
var activity = new Activity("Call to CosmosDB"); | |
// activity.SetParentId("correlation id from request") | |
//RequestTelemetry for Request, DependencyTelemtry for Dependencies | |
using var operation = telemetryClient.StartOperation<DependencyTelemetry>(activity); |