Skip to content

Instantly share code, notes, and snippets.

@chrismckelt
chrismckelt / cosmos-queries.kql
Last active March 14, 2024 01:36
Cosmos DB Queries
// Consumed RU/s in last 24 hours
// Identify consumed RU/s on Cosmos databases and collections.
// To create an alert for this query, click '+ New alert rule'
//You can compare the RU/s consumption with your provisioned RU/s to determine if you should scale up or down RU/s based on your workload.
AzureDiagnostics
| where Category == "DataPlaneRequests"
//| where collectionName_s == "CollectionToAnalyze" //Replace to target the query to a collection
| summarize ConsumedRUsPerMinute = sum(todouble(requestCharge_s)) by collectionName_s, _ResourceId, bin(TimeGenerated, 1m)
| project TimeGenerated , ConsumedRUsPerMinute , collectionName_s, _ResourceId
| render timechart
@chrismckelt
chrismckelt / cloud-workload-modernisation-strategy.drawio
Last active November 13, 2023 13:11
Cloud Workload Modernisation Strategy
graph LR;
note1[Retire = to be removed]
style note1 fill:#fff, color:#788A75, stroke:#75788A
note2[Sweat = Lifetime < 1 year]
style note2 fill:#fff, color:#788A75, stroke:#75788A
note3[Maintain = Lifetime > 1 year]
style note3 fill:#fff, color:#788A75, stroke:#75788A
note4[Invest = Lifetime > 1 year]
style note4 fill:#fff, color:#788A75, stroke:#75788A
@chrismckelt
chrismckelt / role-integration.md
Created June 29, 2023 12:20
Senior Integration Engineer/Architect

Overview

As part of the product engineering team this role is to design, implement and maintain the integrations between key systems that facilitate business operations. A key objective is the development and maintenance of integrations across various platforms which integrates with our key student management system.

The incumbent of this role should be capable of managing their own tasks within an agreed framework. They should be capable of working independently on a task to completion within the overall development project with minimal supervision.

Key Accountabilities:

Supports the Data Services team by:

sequenceDiagram
participant ControlM participant HiLight participant Server participant APIGateway participant Eclipse

rect rgb(250, 242, 242) ControlM->>+APIGateway: HTTP POST to API endpoint to start publishing claims workflow https://TBD/job1

@chrismckelt
chrismckelt / EndToEndTest.cs
Created March 26, 2023 21:38
Subcutaneous end to end test
using Demo.Core.ReadModels.LoanApplication;
using Demo.TestsUtility.TestAttributes;
using TestStack.BDDfy;
using Xunit;
namespace Demo.Subcutaneous.Tests.Scenarios.V2
{
[Story(
AsA = "As Scenario 1 tester",
IWant = "I want create an end to end small loan quote",
@chrismckelt
chrismckelt / test.md
Last active April 27, 2022 12:51
test

graph TD A[Chris] -->|Get pills| B(Go disco) B --> C{Let me dance} C -->|One| D[pants] C -->|Two| E[poo] C -->|Three| F[fa:fa-car Car]

@chrismckelt
chrismckelt / ProductionIssueBugTemplate.txt
Last active June 7, 2021 13:30
Production Issue Bug Template
#### Issue Name
#### Priority high|medium|low
#### Issue Summary
- What? – What has happened with the application?
- How? – What did we click/do to produce the bug?
- Where? – Where exactly in the app did we find the bug? What is the webpage and/or server (environment)?
- Who? noticed the issue? staff ID or customer ID?
@chrismckelt
chrismckelt / Impersonation.cs
Created June 6, 2021 00:30
Impersonation.cs
using System;
using System.Runtime.InteropServices;
using System.Security.Permissions;
using System.Security.Principal;
namespace ExampleNameSpace
{
public class Impersonation : IDisposable
{
@chrismckelt
chrismckelt / Get-AccessToken .ps1
Created June 24, 2020 01:46
PowerShell Get-AccessToken
function Get-AccessToken {
$context = Get-AzContext
$myprofile = [Microsoft.Azure.Commands.Common.Authentication.Abstractions.AzureRmProfileProvider]::Instance.Profile
$profileClient = New-Object -TypeName Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient -ArgumentList ($myprofile)
$token = $profileClient.AcquireAccessToken($context.Subscription.TenantId)
return $token.AccessToken
}
@chrismckelt
chrismckelt / configure-log-analytics.ps1
Created June 17, 2020 01:10
Turn on log analytics diagnostics settings for specified resource type
# Turn on log analytics diagnostics settings for specified resource type
$name = 'your subscription name goes here'
$subscription = Get-AzSubscription -SubscriptionName $name
Select-AzSubscription -SubscriptionName $name
$log_analytics_resource_group = 'log analytics resource group name'
$target_resource_group = 'resource group you want to setup'
$workspaces = Get-AzOperationalInsightsWorkspace -ResourceGroupName $log_analytics_resource_group
if (@($workspaces).Length -eq 0)