- Write a failing test first
- Write the minimum code to make the test pass
- Refactor while keeping tests green
- Follow Red-Green-Refactor cycle strictly
- Maximum 50 lines of changes per commit
#!/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 |
$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 |
#!/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 |
<!-- 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"> |