Skip to content

Instantly share code, notes, and snippets.

Check if exists before deletion without using exists

Write-Host "Checking if '$(legacy_functionapp_name) exists"
$functionAppCheck = az functionapp list --query "[?name=='$(legacy_functionapp_name)']" | ConvertFrom-Json
$functionAppExists = $functionAppCheck.Length -gt 0

Write-Host "Exists: $functionAppExists"
if ($functionAppExists) {
    Write-Host "Deleting legacy function app"
 az functionapp delete -n $(legacy_functionapp_name) -g $(resourcegroup_name)

Getting the Azure DevOps ServicePrincipalId

  1. Find the (either direct from the portal or "Manage Service Principal" from Azure DevOps)
  2. Get the ServicePrincipalId
az ad sp show --id <appId> --query id

Compose a basic Azure .NET dev env

name: project-name-dev
services:
  seq:
    image: datalust/seq:latest
    container_name: project-name-seq
    environment:
      ACCEPT_EULA: "Y"
 ports:
@jackawatts
jackawatts / Ryzen series model number explainer.md
Last active December 10, 2024 23:49
Ryzen series model number explainer

Ryzen series cpu model number explainer

RYZEN 7 9|9|00|X

Segment

  • 3: Budget
  • 5: Mainstream
  • 7: Performance
  • 9: Very high performance
@jackawatts
jackawatts / compose.yaml
Created February 21, 2025 08:07
Docker Azurite compose.yaml with --skipApiVersionCheck
name: <project_name>
services:
storage:
image: mcr.microsoft.com/azure-storage/azurite
container_name: <project_name>-azurite
command: "azurite -l /data --blobHost 0.0.0.0 --queueHost 0.0.0.0 --tableHost 0.0.0.0 --skipApiVersionCheck"
ports:
- 10000:10000
- 10001:10001
- 10002:10002
@jackawatts
jackawatts / Check if a build is a PR build in Azure Devops pipelines.md
Created March 14, 2025 01:29
Check if a build is a PR build in Azure Devops pipelines
${{ if eq(variables['Build.Reason'], 'PullRequest') }}
@jackawatts
jackawatts / Downloading data from Azure Table Storage.md
Last active June 4, 2025 00:55
Downloading data from Azure Table Storage

The current version of AzCopy no longer supports copying data from Azure Table Storage.

With that in mind, we are left using an earlier version developed using the .NET Framework which introduces a different set of problems.

Instructions follow:

  1. Download and install AzCopy 7.3
  2. Navigate to the relevant install directory eg. C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy
  3. AzCopy 7.3 does not support the latest TLS version OOTB and will fail without enabling it. To do so, copy the following with the filename: AzCopy.exe.config into the install directory