A small toolbox of PowerShell scripts to simplify Azure cleanup and maintenance.
Each script comes with a one-liner you can copy, paste, and run instantly.
-
PowerShell 7+ (
pwsh) -
Azure CLI (
az) installed and logged in:az login
-
Permissions to manage the target resources
-
Azure CLI extensions configured to allow preview versions and install without prompts:
az config set extension.dynamic_install_allow_preview=true az config set extension.use_dynamic_install=yes_without_prompt
Tip
Copy the command below each script and run it in PowerShell 7.
- π§ GPT-RAG
- π AI Search
- π³ Container Apps
- π Networking
- π· Resource Group
- π GitHub Projects
Sends queries to the orchestrator running locally or in Azure Container Apps with conversation tracking and token caching.
pwsh -NoProfile -ExecutionPolicy Bypass -Command "iex (iwr 'https://raw.githubusercontent.com/placerda/azure-utils/main/ps/invoke-orchestrator.ps1').Content"Local usage examples:
# Interactive mode
.\ps\invoke-orchestrator.ps1
# Clear cache and start fresh
Remove-Item "$env:TEMP\invoke-orchestrator-last.ps1" -ErrorAction SilentlyContinue
.\ps\invoke-orchestrator.ps1Retrieves a Container App Dapr API token for connecting local or dev services.
pwsh -NoProfile -ExecutionPolicy Bypass -Command "iex (iwr 'https://raw.githubusercontent.com/placerda/azure-utils/main/ps/get-dapr-token.ps1').Content"Verifies Azure AI Search Agentic Retrieval configuration, knowledge sources, vectorizers, and semantic search settings.
pwsh -NoProfile -ExecutionPolicy Bypass -Command "iex (iwr 'https://raw.githubusercontent.com/placerda/azure-utils/main/ps/check-agentic-setup.ps1').Content"Performs agentic retrieval queries using Azure AI Search Knowledge Agents with formatted results and activity tracking.
pwsh -NoProfile -ExecutionPolicy Bypass -Command "iex (iwr 'https://raw.githubusercontent.com/placerda/azure-utils/main/ps/invoke-agentic-retrieval.ps1').Content"Deletes documents from a Search index (by key or filter) to keep it tidy.
pwsh -NoProfile -ExecutionPolicy Bypass -Command "iex (iwr 'https://raw.githubusercontent.com/placerda/azure-utils/main/ps/rm-index-documents.ps1').Content"Removes blockers (NSGs, Private Endpoints, subnet settings, PDNS links, locks, etc.) and forcefully deletes the Resource Group.
pwsh -NoProfile -ExecutionPolicy Bypass -Command "iex (iwr 'https://raw.githubusercontent.com/placerda/azure-utils/main/ps/rm-rg.ps1').Content"Turns on public network access for Storage Accounts, Key Vaults, and Cosmos DB (does not remove private endpoints).
pwsh -NoProfile -ExecutionPolicy Bypass -Command "iex (iwr 'https://raw.githubusercontent.com/placerda/azure-utils/main/ps/set-public.ps1').Content"Creates a new Azure VNet with interactive prompts. Remembers your last settings and creates the resource group if it doesnβt exist.
pwsh -NoProfile -ExecutionPolicy Bypass -Command "iex (iwr 'https://raw.githubusercontent.com/placerda/azure-utils/main/ps/create-vnet.ps1').Content"Creates an Azure VNet with multiple pre-configured subnets for enterprise workloads.
Features:
- 9 base subnets (agent, ACA, PE, Bastion, Firewall, Gateway, App Gateway, Jumpbox, DevOps)
- 2 optional subnets for API Management and PostgreSQL (
-SkipApim,-SkipPostgres) - Address space:
192.168.0.0/21 - Delegations:
Microsoft.App/environments,Microsoft.DBforPostgreSQL/flexibleServers - Service endpoints:
CognitiveServices,AzureCosmosDB - PE subnet
/26to prevent race conditions - Remembers previous settings like
create-vnet.ps1
pwsh -NoProfile -ExecutionPolicy Bypass -Command "iex (iwr 'https://raw.githubusercontent.com/placerda/azure-utils/main/ps/create-vnet-with-subnets.ps1').Content"Local usage examples:
# Interactive mode
.\ps\create-vnet-with-subnets.ps1
# With parameters
.\ps\create-vnet-with-subnets.ps1 -ResourceGroup "my-rg" -VNetName "my-vnet"
# Skip optional subnets
.\ps\create-vnet-with-subnets.ps1 -SkipApim -SkipPostgresSynchronizes Start Date, End Date, and Status fields from issues in their original GitHub projects to a consolidated project.
Features:
- Automatic GitHub CLI authentication with project scope
- Interactive prompts with default values (project 885, org Azure)
- Syncs date fields from source projects (Start Date, End Date, Target Date)
- Falls back to Iteration dates when direct dates are unavailable
- Case-insensitive field name matching
- Excludes consolidated project from source data search
- Prioritizes projects with complete date information
- Syncs status field with emoji cleanup
- Shows all available fields and their types
- Detailed progress reporting with debug information
Prerequisites:
- GitHub CLI (
gh) installed - Authenticated with GitHub (
gh auth login) - Project scope enabled (script handles this automatically)
pwsh -NoProfile -ExecutionPolicy Bypass -Command "iex (iwr 'https://raw.githubusercontent.com/placerda/azure-utils/main/ps/gh-projects.ps1').Content"Local usage:
# Interactive mode (with defaults)
.\ps\gh-projects.ps1Example:
Project number [default: 885]: <Enter>
Organization/owner [default: Azure]: <Enter>
β
Found project: Prometheus Program
β
Found 25 items to process
Processing: Azure/doc-proc-solution-accelerator#39
π Found in 2 project(s):
- Prometheus Program
- Doc-Proc-Solution-Accelerator
π Checking project: Doc-Proc-Solution-Accelerator
β Found Iteration: Iteration 3
- Start: 2025-11-29, Duration: 14 days
β Using Iteration Start Date: 2025-11-29
β Using Iteration End Date: 2025-12-12
β Start: 2025-11-29 (from Iteration (Iteration 3))
β End: 2025-12-12 (from Iteration (Iteration 3))
β Status: Backlog
β
Updated Start Date to 2025-11-29
β
Updated End Date to 2025-12-12
β
Updated Status to Backlog
Migrates all issues from one GitHub repository to another, preserving titles, descriptions, labels, and state.
Features:
- Automatic GitHub CLI authentication
- Interactive prompts for source and destination repository URLs
- Migrates all issue data (title, body, labels, state)
- Creates labels in destination if they don't exist
- Adds reference to original issue in migrated body
- Preserves issue state (open/closed)
- Confirmation prompt before migration
- Progress reporting with success/failure counts
- Rate limiting protection
Prerequisites:
- GitHub CLI (
gh) installed - Authenticated with GitHub (
gh auth login) - Write access to destination repository
pwsh -NoProfile -ExecutionPolicy Bypass -Command "iex (iwr 'https://raw.githubusercontent.com/placerda/azure-utils/main/ps/gh-migrate-items.ps1').Content"Local usage:
# Interactive mode
.\ps\gh-migrate-items.ps1Example:
Source repository URL: https://github.com/Azure/source-repo
Destination repository URL: https://github.com/Azure/dest-repo
β
Found 15 issue(s) to migrate
β οΈ WARNING: This will create 15 new issue(s) in Azure/dest-repo
Do you want to continue? (yes/no): yes
Migrating issue #1: First issue title
β
Created: https://github.com/Azure/dest-repo/issues/1
Migrating issue #2: Second issue title
β
Created: https://github.com/Azure/dest-repo/issues/2
β
Closed issue (matching source state)
β
Migration completed!
Success: 15
Failed: 0
MIT β see LICENSING.md