Skip to content

Instantly share code, notes, and snippets.

View sajeetharan's full-sized avatar
Debugging "Object reference not set to an instance of an object." 😬

Sajeetharan sajeetharan

Debugging "Object reference not set to an instance of an object." 😬
View GitHub Profile
sajeetharan / azurecosmosdb-linux-emulator
Last active August 14, 2023 10:33
Deploy emulator linux
version: '2.4'
external: false
driver: default
- subnet: ""
sajeetharan / gist:3d1c53bdd450f6c74dbe696860bc1943
Created May 24, 2023 16:27
Azure synapse change data capture
val configuration = Map(
"spark.cosmos.accountEndpoint" -> "",
"spark.cosmos.accountKey" -> "xxx",
"spark.cosmos.database" -> "cdc",
"spark.cosmos.container" -> "product",
"spark.cosmos.cdc" -> "true",
"spark.cosmos.cdc.initialRun" -> "true",
"spark.cosmos.cdc.fullFidelity" -> "false",
@description('The location to deploy the Cosmos DB account to. Default value is the location of the resource group.')
param location string = resourceGroup().location
@description('Name of our application')
param applicationName string = uniqueString((resourceGroup().id))
@description('The secondary replica region for the Cosmos DB account')
param secondaryRegion string = 'australiasoutheast'
@description('Name of our Cosmos DB account that will be deployed')
$ipath1 = New-AzCosmosDBSqlIncludedPathIndex -DataType String -Precision -1 -Kind Hash
$ipath2 = New-AzCosmosDBSqlIncludedPathIndex -DataType String -Precision -1 -Kind Hash
$IncludedPath = New-AzCosmosDBSqlIncludedPath -Path "/*" -Index $ipath1, $ipath2
$SpatialSpec = New-AzCosmosDBSqlSpatialSpec -Path "/mySpatialPath/*" -Type "Point", "LineString", "Polygon", "MultiPolygon"
$cp1 = New-AzCosmosDBSqlCompositePath -Path "/abc" -Order Ascending
FUNCTION GenerateMasterKeyAuthorizationSignature
[Parameter(Mandatory=$true)][String] $verb, # HTTP verb, such as GET, POST, or PUT
[Parameter(Mandatory=$true)][String] $resourceLink, # Case SeNsItIvE!!! (this is the parent path for the $resourceType)
[Parameter(Mandatory=$true)][String] $resourceType, # type of resource that the request is for, Eg. "dbs", "colls", "docs"
[Parameter(Mandatory=$true)][String] $dateTime, # Must exactly match x-ms-date in header (and be lower case)
[Parameter(Mandatory=$true)][String] $key, #
sajeetharan / gist:8213f9c160ab5bc53111bc7047ca81c6
Created May 24, 2021 17:50
Kubelet_identity for AKS cluster
locals {
global_resource_group = "stackover"
resource_group = "stackover-${var.env_prefix}"
cluster_name = "stackover-${var.env_prefix}-cluster"
ingress_address_res_name = "stackover-${var.env_prefix}-ingress-ip"
# --- Existing resources -----------------------------------------------------
data "azurerm_container_registry" "container_registry" {
sajeetharan / Install tye
Created December 20, 2020 14:17
Install Project Tye
dotnet tool install -g Microsoft.Tye --version "0.2.0-alpha.20258.3"
sajeetharan / gist:de85e9cce3b5aa2bd0647a8ddae68b98
Created October 14, 2020 11:46
Schedule ACI with Azure function
using System;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Logging;
using Microsoft.Azure.Management.Fluent;
namespace AciManagerFuncApp
sajeetharan / Deploy function
Created September 27, 2020 16:18
⚡ C:\processOrder>func kubernetes deploy --name processorder --registry sajeetharan
sajeetharan / EnableKeda
Last active September 27, 2020 16:16
Enable KEDA on AKS
⚡ C:\processOrder>func kubernetes install --namespace kube-system --dry-run > keda.yaml
kubectl apply -f keda.yaml --namespace="kube-system"