If you get the following error when trying to logon to your CloudShell then this simple fix will resolve your error: Fix: rm -rf ~/.local/share/powershell/Modules
Category: Powershell
Export app registrations with expiring secrets and certificates
Copy the entire contents into a ps1 file and dont edit anything. Reference: https://learn.microsoft.com/en-us/entra/identity/enterprise-apps/scripts/powershell-export-apps-with-expiring-secrets
Storage Account + Container + Get account keys
login to tenant Install-Module AzImport-Module AzConnect-AzAccount change subscriptions Set-AzContext -Subscription “5cf7452e-….” Create a new Resource Group container $ResourceGroupName = “allen-tf-sandbox”$location = “southafricanorth”New-AzResourceGroup -Name $ResourceGroupName-Location $location -Tag @{CustomerName=”Customer01″;AutoShutdownSchedule=”None”; `Environment=”sandbox”;} st.acc variables $StorageAccName = ‘devopssandboxterraf01’$StorageType = ‘Standard_LRS’ create your storage account New-AzStorageAccount -ResourceGroupName $ResourceGroupName-Name $StorageAccName -Type $StorageType-Location $location -Tag @{CustomerName=”Customer01″;AutoShutdownSchedule=”None”; `Environment=”sandbox”;} create your container $azstorageacc = Get-AzStorageAccount… Continue reading Storage Account + Container + Get account keys
Deploying an Azure Database for PostgreSQL flexible server
This powershell script will deploy the following elements of your PostgreSQL server: An Azure Database for PostgreSQL flexible server, With subnet integration, With a private DNS zone, With public access denied with firewall enablement, High availability enabled,
Creating a Service Principal
How to quickly create a dummy / self-signed certificate for sandbox testing
This is quick, simple recipe on how to creat a self-signed .pfx certificate for your sandbox in 1 minute using powershell. Step 1 – Create a new a self-signed certificate The New-SelfSignedCertificate cmdlet enables you to create a self-signed certificate. $cert = New-SelfSignedCertificate -DnsName www.domainname.co.za `-Type CodeSigning -CertStoreLocation Cert:\CurrentUser\My Step 2 – Verify that the… Continue reading How to quickly create a dummy / self-signed certificate for sandbox testing
Azure Internal load balancer
Load balancing refers to the practice of evenly distributing traffic load (incoming network traffic) across a group of backend resources or servers. Azure Load Balancer operates at layer 4 of the Open Systems Interconnection (OSI) model. The Azure load balancer the single point of contact for clients. Load balancers distribute inbound flows that arrive at the… Continue reading Azure Internal load balancer
Create an Azure metric alert
This recipe explains how to create an Azure Monitor Metric Alert in 5 minutes using the Powershell script below. The alert is scoped across an entire subscription and will trigger for any vm cpu average exceeding a predefined threshold. This powershell is broken into 2 parts, along with what components you need to consider during… Continue reading Create an Azure metric alert
Provision a Storage Account
This script deploys a simple Azure storage account v2 with LRS.
Provision a Key Vault
This script deploys a simple Key Vault without any Access Policies.