Skip to content

Instantly share code, notes, and snippets.

View ChrisRomp's full-sized avatar
:shipit:
I :octocat: Codespaces.

Chris Romp ChrisRomp

:shipit:
I :octocat: Codespaces.
  • Microsoft
  • San Francisco, CA
  • 20:18 (UTC -07:00)
  • LinkedIn in/chrisromp
View GitHub Profile
@ChrisRomp
ChrisRomp / env-create.sh
Last active February 16, 2023 18:38
Azure .env File Generation
#!/bin/bash
# requires azure cli client and jq
# Get account info from Azure CLI
ACCOUNT=$(az account show)
# Get tenant name (from user query)
TENANT_NAME=$(az ad signed-in-user show --query 'userPrincipalName' | cut -d '@' -f 2 | sed 's/\"//')
# Parse tenant ID
@ChrisRomp
ChrisRomp / Show-Certificate.ps1
Last active April 27, 2023 18:25
Fetches a host's SSL certificate and displays the cert chain info.
$checkHost = "www.azure.com"
try {
# Create a TCP client and connect to the server using the URL and port 443
$client = New-Object System.Net.Sockets.TcpClient($checkHost, 443)
# Create an SslStream using the TCP client and set the remote certificate validation callback
$sslStream = New-Object System.Net.Security.SslStream($client.GetStream(), $false, { $true })
# Authenticate the client
@ChrisRomp
ChrisRomp / func-asev3.sh
Created June 28, 2023 17:28
Azure ASEv3 Function App
#!/bin/bash
# Vars
RG=TEST-asev3
LOC=westus3
VNET_NAME=vnet-asev3
VNET_CIDR=10.0.0.0/16
SUBNET_NAME=subnet-vnet-asev3-00
SUBNET_CIDR=10.0.0.0/24
ASE_NAME=cr1asev3a01
@ChrisRomp
ChrisRomp / policy-api.xml
Last active February 6, 2024 18:45
APIM Load Balancing Policy - Round Robin with Azure OpenAI (AOAI)
<!-- This shows the policy as implemented with references to {{named values}} and fragments -->
<!-- Named values: https://learn.microsoft.com/en-us/azure/api-management/api-management-howto-properties -->
<!-- Policy fragments: https://learn.microsoft.com/en-us/azure/api-management/policy-fragments -->
<policies>
<inbound>
<base />
<!-- This requires enabling the managed identity on APIM, and granting it access to AOAI -->
<authentication-managed-identity resource="https://cognitiveservices.azure.com" output-token-variable-name="msi-access-token" ignore-error="false" />
<set-header name="Authorization" exists-action="override">
@ChrisRomp
ChrisRomp / copilot-instructions.md
Created April 8, 2025 04:47
Some GitHub Copilot custom instructions

Development Guidelines for GitHub Copilot

Test-Driven Development (TDD)

  1. Write a failing test first
  2. Write the minimum code to make the test pass
  3. Refactor while keeping tests green
  4. Follow Red-Green-Refactor cycle strictly

Commit Guidelines

  1. Maximum 50 lines of changes per commit