Usefull Az commands and Powershell Equivalents

Login and default subscription Login: az login (Connect-AzAccount) List subscriptions: az account list --output table Set default subscription: az account set --subscription "subscription name or Id" (Set-AzContext -SubscriptionId "suscription Id") Delete a web app: az webapp delete --name MyWebapp --resource-group MyResourceGroup Tags Get list of tags for a resource group: az group show -n <resource group name> --query tags Get tags for a specific resource type: az resource show -n <resource name> -g <resource group name> --resource-type "Microsoft. [Read More]
Azure 

Replacing IIS Express self signed certificate

Firefox does not allow sites with self signed certificates, which is the case when using IIS Express. Best solution I’ve found thus far is go generate a certificate as per Installing a localhost certificate (for use in IIS), then replacing the IIS Express certificate using the answer to the Stackoverflow question at How do I change my IIS Express SSL certificate for one that will work with Chrome 58+? Works a treat (and means that I’m using the same localhost cert across front end (Aurelia), legacy WCF service and a ASP. [Read More]

Testing whether CORS is configured for an ORIGIN from command line

Confirming whether CORS has been configured for a specific origin can be done with curl. As an example the following request should include the Access-Control-Allow-Origin header in the response if CORS is configured for the https://www.test.net origin

curl -H “Origin: https://www.test.net” –verbose https://testservices.test.net/api/v1/ping

Installing a localhost certificate (for use in IIS)

What used to be a fairly cumbersome exercise is now almost trivial thanks to mkcert In short: Install mkcert (see options in the mkcert link above - my preference is to install through chocolatey and create certificate choco install mkcert mkcert -install mkcert -pkcs12 localhost Install the certificate in the Machine Certificate Store Open Manage computer certificates control panel Find the .p12 certificate file at C:\Users<your user> Right click and install - go through wizard, selecting appropriate options To assign certificate to IIS binding [Read More]

Moving files/folders in git

File system move would result in files appearing in git as deleted from their original location and added to the new location. A better approah is to use git move - it will track the files and they’ll appear as renamed in git.

git mv <source> <destination>

Refer git command to move a folder inside another

oidc-client-js silent renew Frame window timed out error

Implementing silent renewal of authentication token with Identity Server 4 and oidc-client.js is almost trivially easy, provided you set all the appropriate configuration settings on server (RedirectUris) and client (automaticSilentRenew, silent_redirect_uri). And it works a treat…until it doesn’t. Handling the silent renew callback in our Aurelia app through an Aurelia component worked - provided you are on the browser tab where the app is running when the silent renew request is made. [Read More]

Preparing for Exam AZ-103: Microsoft Azure Administrator

Exam info Resources: Microsoft Azure Administrator Tracking Document Thomas Thornton’s Microsoft Azure Exam AZ-103 Study Notes Sysadmin-central Study Notes Microsoft Azure Administrator (AZ-103) Pluralsight training skylines academy AZ-103 course Skills measured: Manage Azure subscriptions and resources Manage Azure subscriptions assign administrator permissions > Add or change Azure subscription administrators : Portal: In Azure portal open Subscriptions and select subscription Click Access Control (IAM) Click Add > Add Role Assignment Select Owner role In Select select user or search by name or email CLI: Set default subscription to work with: az account set -s <subscription Id> Create role assignment: az role assignment create --assignee <user>@<custom domain> --role owner --scope /subscriptions/<subscription Id> configure cost center quotas and tagging > Azure subscription and service limits, quotas, and constraints Quotas Quotas are generally defined per-subscription unless managed by Azure Resource Groups, in which case they are managed per-region Quota increases can be requested via support request, provided they don’t exceed the Maximum Limit and the subscription is not a Free Trial Subscription To view quotas: Select Subscription > Usage + Quotas Quotas for resources in Azure resource groups are per-region accessible by your subscription, not per-subscription as the service management quotas are [Read More]
Azure