Skip to content

Instantly share code, notes, and snippets.

@jackawatts
jackawatts / Basic Azure VPN Setup.md
Last active November 27, 2023 15:36
Setting up a Basic, Policy-Based Site-to-site Azure VPN for *TEST* purposes

Getting started

This is some doco covering how to set-up a VPN for TESTING PURPOSES within Azure

This simple scenario will use: A Policy Bases VPN Type on a Site-to-site network using the Basic gateway SKU

This can be done via PowerShell and the Azure Portal, what follows is essentially a copy of: https://docs.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-howto-site-to-site-resource-manager-portal

Naming of the italicised components is up to the end user, however naming should be consistent between components

@jackawatts
jackawatts / ts-jest.md
Last active June 14, 2023 08:09
Getting started with Typescript, React and Jest

Getting Started

  1. Install:
  • jest: npm install --save-dev jest
  • ts-jest: npm install --save-dev ts-jest @types/jest
  1. Modify package.json
"jest": {
  "transform": {
 "^.+\\.tsx?$": "ts-jest"

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

Azure

Structured Data

  1. Do you have any tables with more than 1 billion rows?
    • Synapse Dedicated pools distribute each row into 1 of 60 distributions, small tables will see little performance increase
  2. Is your database larger than 1 TB?
    • Synapse performance gains typically start to be seen between 1-5TB
  3. Are you issuing more than 128 queries simultaneously?
    • Synapse starts queueing queries after 128 simultaenous queries, SQL Analytics may be a better solution
  4. Are data requirements ad-hoc or continuous?

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 June 1, 2021 11:36
AAD v 2.0 auth protected Web API with REACT SPA end-to-end

A WIP (work in progreess), 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 / Add an Azure Resource Manager service connection.md
Last active April 1, 2020 10:35
Adding an Azure Resource Manager Service Connection in AzureDevOps

Taken from: https://blogs.msdn.microsoft.com/mihansen/2018/03/31/granular-vststfs-deployment-privileges-using-service-principals/

AzureDevOpsAR is simply the name of the app registration AzureDevOps will be associated with, don't like the name? Simply change the references below.

  1. Create an App Registration to act as a Service Principal:
    1. Log in to portal.azure.com
    2. Azure Active Directory => App Registrations => New Application Registration
    3. Name: AzureDevOpsAR, Type: Web app/API, Url: http://azuredevopsar (Url isn't important as it won't be used)
    4. Copy the Application ID as this will be the Service principal client ID
  2. Settings => Keys => Add
@jackawatts
jackawatts / gist:3f55cd9e80d86a6c56c08207b531fd8b
Created November 19, 2019 00:40
Uninstalling VSIX from 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:
```CMD
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"