Skip to content

Instantly share code, notes, and snippets.

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
@jackawatts
jackawatts / Uninstalling Visual Studio Extensions via the command line.md
Last active August 29, 2024 00:26
Uninstalling Visual Studio Extensions via the command line

Find the VSIX identifier by:

  1. Renaming the VSIX to .zip
  2. Opening the .manifest file
  3. Copy the ID from the ID attribute

Then:

vsixinstaller  /q /a /u:"<VSIX Identifier Here>"
@jackawatts
jackawatts / Vscode as default merge tool for git.bat
Created January 16, 2019 22:54
Vscode as default merge tool for git
git config --global merge.tool vscode
git config --global mergetool.vscode.cmd "code --wait $MERGED"
git config --global diff.tool vscode
git config --global difftool.vscode.cmd "code --wait --diff $LOCAL $REMOTE"