Skip to content

Instantly share code, notes, and snippets.

@shibayan
Last active January 23, 2026 01:44
Show Gist options
  • Select an option

  • Save shibayan/e37307ba05a91cac884872505a4625f6 to your computer and use it in GitHub Desktop.

Select an option

Save shibayan/e37307ba05a91cac884872505a4625f6 to your computer and use it in GitHub Desktop.
Script to bulk register frequently used Resource Providers with an Azure subscription
#!/bin/bash
set -euo pipefail
# Azure Resource Providers Registration Script
# Registers common PaaS / Serverless resource providers
readonly RESOURCE_PROVIDERS=(
# Core Infrastructure
"Microsoft.Compute"
"Microsoft.Network"
"Microsoft.Storage"
"Microsoft.Resources"
"Microsoft.Authorization"
"Microsoft.CloudShell"
# Containers
"Microsoft.ContainerInstance"
"Microsoft.ContainerRegistry"
"Microsoft.ContainerService"
# PaaS / Serverless
"Microsoft.Web"
"Microsoft.Logic"
"Microsoft.ApiManagement"
"Microsoft.SignalRService"
# Databases
"Microsoft.Sql"
"Microsoft.DBforMySQL"
"Microsoft.DBforPostgreSQL"
"Microsoft.DocumentDB"
"Microsoft.Cache"
# AI / Search
"Microsoft.CognitiveServices"
"Microsoft.Search"
# Messaging
"Microsoft.EventGrid"
"Microsoft.EventHub"
"Microsoft.ServiceBus"
# Security / Identity
"Microsoft.KeyVault"
"Microsoft.ManagedIdentity"
"Microsoft.Security"
# Monitoring / Management
"microsoft.insights"
"Microsoft.OperationalInsights"
"Microsoft.CostManagement"
# Other
"Microsoft.AppConfiguration"
"Microsoft.Cdn"
"Microsoft.RecoveryServices"
)
echo "Registering ${#RESOURCE_PROVIDERS[@]} resource providers..."
failed=()
for provider in "${RESOURCE_PROVIDERS[@]}"; do
if az provider register --namespace "$provider" > /dev/null 2>&1; then
echo "✓ $provider"
else
echo "✗ $provider (failed)"
failed+=("$provider")
fi
done
echo ""
echo "Registration initiated for $((${#RESOURCE_PROVIDERS[@]} - ${#failed[@]}))/${#RESOURCE_PROVIDERS[@]} providers."
if [[ ${#failed[@]} -gt 0 ]]; then
echo "Failed: ${failed[*]}"
exit 1
fi
echo "Note: Registration may take a few minutes to complete."
@shibayan
Copy link
Author

curl https://gist.githubusercontent.com/shibayan/e37307ba05a91cac884872505a4625f6/raw/resource-providers.sh | bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment