Skip to content

Instantly share code, notes, and snippets.

View spotakash's full-sized avatar

akash spotakash

View GitHub Profile
@spotakash
spotakash / azure_file_v2.tf
Created April 15, 2026 13:37
Terraform: Azure Files Provisioned v2 — Decouple storage size from throughput (Premium NFS)** Provisions a Premium FileStorage account with v2 billing model and patches per-share IOPS/throughput via `azapi`, Example: enabling independent scaling of capacity (1 TB) and throughput (10 GBps) without over-provisioning storage.
#==============================================================================
# Azure Files Provisioned v2 - Premium FileStorage (Terraform)
#------------------------------------------------------------------------------
#
# Objective : Validate independent provisioning of storage size vs throughput
# Approach : Native azurerm provider resources — azurerm_storage_account
# (FileStorage / Premium) with provisioned_billing_model_version V2
# paired with azurerm_storage_share (NFS / Premium).
# azapi_update_resource patches per-share IOPS & throughput
# (not yet exposed by azurerm_storage_share).
@spotakash
spotakash / sftp_hot_lifecyle_v1.sh
Created March 20, 2026 06:00
Azure Blob Storage SFTP setup with Hot access tier and lifecycle policy (auto-tier to Cool after 30 days) — creates resource group, storage account (Standard_GZRS, HNS enabled), enables SFTP, provisions container & local user with colored step-by-step output and connection summary.
#!/usr/bin/env bash
set -euo pipefail
# -----------------------------
# Colors & Helpers
# -----------------------------
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
CYAN='\033[0;36m'
@spotakash
spotakash / sftp_cool_v1.sh
Created March 20, 2026 05:59
Azure Blob Storage SFTP setup with Cool access tier — creates resource group, storage account (Standard_GZRS, HNS enabled), enables SFTP, provisions container & local user with colored step-by-step output and connection summary.
#!/usr/bin/env bash
set -euo pipefail
# -----------------------------
# Colors & Helpers
# -----------------------------
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
CYAN='\033[0;36m'
@spotakash
spotakash / Appinsight_Aifoundry_TokenCount_Tracing
Last active February 23, 2026 06:37
🧠 KQL for GenAI Token Tracking (Agent + Model Level) This query aggregates LLM token usage (input, output, cached) across telemetry tables in Application Insights, grouped by: gen_ai.agent.id → Agent identifier name → Model name ⚙️ Key Challenges customMeasurements is dynamic JSON → requires explicit extraction Telemetry is inconsistent across e…
union isfuzzy=true
availabilityResults,
requests,
exceptions,
pageViews,
traces,
customEvents,
dependencies
| where customDimensions contains "gen_ai.agent.id"
| extend agentId = tostring(customDimensions["gen_ai.agent.id"])
@spotakash
spotakash / gist:4bc049fa4297ccec463e98dd55dd4ee1
Created November 24, 2025 10:29
📘 Azure Resource Graph Query — AKS Node Pools (K8s Version, Node OS Version, Node OS SKU)
This Azure Resource Graph (ARG) query retrieves AKS node pool details directly from the AKS cluster resource using the embedded agentPoolProfiles schema.
It extracts:
Kubernetes version → currentOrchestratorVersion
Node OS image version → nodeImageVersion
Node OS SKU → osSKU
Node count (works despite count being a reserved keyword)
@spotakash
spotakash / azcli_ephemeralodiskskuwithaz.sh
Last active September 18, 2025 07:29
Azure CLI script to list VM SKUs available in a specific region that support Ephemeral OS Disk, including the number of Availability Zones they are offered in, scoped to the currently logged-in subscription and session
#!/bin/bash
set +H
# Set your region
REGION=eastasia # Change to your desired region
# List VM SKUs in the region that support Ephemeral OS Disk and show AZ support
az vm list-skus \
-l $REGION \
--all \