Skip to content

Instantly share code, notes, and snippets.

@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 / 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

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:

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

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)

lint bicep

  # Lint bicep
  - script: |
      az bicep build -f src\main.bicep

dotnet format

 - task: DotNetCoreCLI@2

Managed Identity auth with simple app authentication (via Add identity provider from the Authentication tab of the app that needs to be protected) is outlined here. This covers the most rudimentary case.

However, often we want to be more specific as to which actions should be protected and which not, where something such as what is outlined here would be done. In this case code is used to configure Auth via the Services.AddAuthentication pattern or the like.

Calling such a web API with Managed identity is achieved using app roles described here

App roles are nece

App IDs

App IDs provide metadata and capabilities for an iOS application.

The app is uniquely identified in the app store via its Bundle ID

The App ID Prefix is pre-pended to the Bundle ID to allow the app to be searchable and should be set to the Team ID (allowing apps developed by the Team to be easily identified)

  • Explicit App IDs: are used for a single app, and required when distributing to the App Store
  • Wildcard App IDS: are used for a set of apps and cannot be distributed to the App Store
@jackawatts
jackawatts / AAD v 2.0 auth protected Web API with REACT SPA end-to-end.md
Last active August 29, 2024 00:24
AAD v 2.0 auth protected Web API with REACT SPA end-to-end

A WIP (work in progress), collected from a variety of sources...

Securing the Web API

Create an App registration

eg. my-app-api

We will refer to it as {nameOfAppRegistration} from this point forward. (This can be pretty much anything but adding the suffix -api may help distinguish it from the spa registration at a later stage.)

  1. no redirect is required as there is no interactive user sign-in