Azure Administration - Cookbook - PowerShell
What's Included:
At a Glance
Azure Administration - Cookbook - PowerShell is a professional Azure (Microsoft Azure) eBook by Dargslan, 95 pages, available as an instant PDF and EPUB download for €12.90 with lifetime access and free updates. A practical cookbook of complete, runnable PowerShell scripts for real Azure admin tasks—resources and tagging, identity and RBAC, VMs, networking, storage, cos...
- Length: 95 pages
- Format: PDF and EPUB (instant download)
- Language: English
- Topic: Azure (Microsoft Azure)
- Price: €12.90
Key Highlights
- A cookbook of complete, runnable Azure PowerShell scripts—no fragments
- Every recipe: goal, requirements, script, real output, how it works, and variations
- Built-in safety: make a subscription-context check a reflex before every script
- Full migration path off the deprecated AzureRM module, including the non-rename traps
- Resources and tagging, including Resource Graph queries across thousands of resources
- Identity and RBAC: role assignments, service principals, and custom roles
- Virtual machines: sensible defaults, stopping idle spend, and right-sizing
- Networking: VNets, subnets, NSGs, blocked-traffic diagnosis, and peering
- Storage: secure defaults, SAS tokens, and lifecycle cost rules
- Cost management: spend breakdowns and budgets with alerts—find real money fast
- Governance and policy: tag enforcement, region and SKU restriction, resource protection
- Monitoring and backup, including proving the restore actually works
- Works with PowerShell or CLI (Azure CLI equivalents appendix included)
- Reference appendices: cmdlet reference, CLI equivalents, troubleshooting, naming/tagging card, and glossary
Overview
A practical cookbook of complete, runnable PowerShell scripts for real Azure admin tasks—resources and tagging, identity and RBAC, VMs, networking, storage, cost management, governance, and monitoring. Includes a full migration path off the deprecated AzureRM module and Azure CLI equivalents.
The Problem
Administering Azure at any real scale means automating it—but the path from "I know what I want to do" to "I have a script that safely does it" is full of pitfalls. Azure's surface area is enormous, its permission and RBAC model takes real understanding, and the difference between a script that works on your laptop and one you can trust against production is exactly where things go wrong. The most expensive mistake in Azure scripting is a single destructive command run against the wrong subscription.
On top of that, the ground has shifted. The AzureRM module was deprecated in February 2024 and is no longer maintained—no new service has appeared in it since—so scripts built on it are living on borrowed time. Meanwhile, most learning material is either certification-focused theory that never gives you a runnable script, or scattered snippets that stop halfway and leave you to finish them. When you have an estate to manage and costs to control, you need working automation, not exam objectives or fragments.
The Solution
Azure Administration Cookbook is a cookbook, not a certification guide. Every recipe is a complete, runnable script for something admins actually do—with the roles it needs, the real output it produces, and the reasoning to adapt it to your own estate. Substitute your values and it runs as written, no fragments to finish yourself.
It builds in production-minded safety (making a context check a reflex before every script) and gives you a clear migration path off the deprecated AzureRM module—how to find, convert, and test old scripts, including the traps that aren't just a rename. Recipes span resources and tagging, identity and RBAC, VMs, networking, storage, cost management, governance, and monitoring and backup, with cost recipes designed to find real money in an afternoon. An Azure CLI equivalents appendix lets you work in either tool. Practical, safe, and grounded in real tasks—this is automation you can actually run.
About This Book
Azure Administration Cookbook is a cookbook, not a certification guide. Every recipe is a complete, runnable script for something Azure administrators actually do—delivered with the permissions it needs, the output it produces, and an explanation of why it works so you can adapt it to your own estate. If you manage Azure and want to automate real tasks rather than wade through exam objectives, this book is built for you.
Every Recipe Is Complete and Runnable
There are no fragments here and no "…and adapt as needed." Every recipe follows the same practical shape: the goal in one sentence; what you'll need (roles, values, and prerequisites); the script, complete and runnable, never a fragment; what you get, showing real output so you know it worked; how it works, explaining the reasoning behind the code; and variations, pointing to the next thing you'll want to do. Substitute your own values and each recipe runs as written.
Built-In Protection Against Costly Mistakes
The most expensive mistake in Azure scripting is running a destructive command against the wrong subscription. This book builds good habits from the start—making a context check a reflex before every script—and threads that same production-minded caution through its automation recipes, so what you build is safe to run for real, not just in a demo.
If Your Scripts Use AzureRM
The AzureRM module was deprecated on 29 February 2024 and is no longer maintained or supported, with no new Azure service appearing in it since. The good news is the migration is largely mechanical—Verb-AzureRmNoun became Verb-AzNoun—but the traps are the differences that aren't just a rename. This book gives you a dedicated migration section covering how to find, convert, and test old scripts, how to use Microsoft's own migration tooling to do most of the work, and exactly which differences go beyond a simple rename.
What You'll Automate
The recipes span the full range of everyday and advanced Azure administration:
- Resources and tagging — a tag strategy worth having, creating resource groups with full tag sets, finding untagged and orphaned resources, and querying thousands of resources instantly with Resource Graph
- Identity and RBAC — assigning and auditing role assignments, creating service principals for automation, and building custom roles
- Virtual machines — creating VMs with sensible defaults, stopping payment for idle VMs, and resizing with right-sizing reports
- Networking — building VNets with segmented subnets and NSGs, diagnosing blocked traffic, and peering virtual networks
- Storage — creating storage accounts with secure defaults, sharing files with SAS tokens, and cutting cost with lifecycle rules
- Cost management — breaking down where the money actually goes and setting budgets with alerts
- Governance and policy — requiring tags at deployment time and restricting regions, SKUs, and protecting resources
- Monitoring and backup — querying logs, creating useful alerts, and backing up VMs while proving the restore works
Find Real Money in an Afternoon
Azure cost sprawl is real, and this book treats it practically. Dedicated cost recipes—breaking down spend, setting budgets, stopping idle VMs, and applying storage lifecycle rules—are designed to find real money in an afternoon. Combined with the governance recipes for tag enforcement and region and SKU restriction, they help you keep your estate both controlled and cost-effective.
PowerShell or CLI—Your Choice
The recipes are built around Azure PowerShell, but the book recognizes that many admins live in the Azure CLI too. An Azure CLI equivalents appendix helps you translate between the two, so the skills transfer regardless of which you reach for.
Suggested Paths for Your Situation
The book adapts to where you are. New to Azure automation? Read the setup and identity sections in order, then jump to whichever service you work with most. Under cost pressure? Head straight to the VM and storage cost recipes and the cost management section. Running a governance project? The resources, identity, and governance sections form a baseline. Migrating old scripts? Start with the migration section, then the recipes matching what your scripts did.
Reference Material You'll Keep Open
The appendices are built for daily use: a cmdlet reference, Azure CLI equivalents, a troubleshooting reference, a naming and tagging card, and a glossary.
Why This Book
Certification guides teach you to pass an exam; this cookbook teaches you to get real work done. With complete, runnable scripts grounded in actual admin tasks, built-in safeguards, and a clear path off the deprecated AzureRM module, it's the practical companion for anyone who administers Azure day to day. Check your context, run the recipe, and get back to work.
Who Is This Book For?
- Azure administrators automating day-to-day tasks with PowerShell
- Admins whose AzureRM scripts need migrating to the Az module
- IT professionals managing resources, identity, and cost across an Azure estate
- Cloud engineers building safe, repeatable Azure automation
- DevOps and platform engineers standardizing governance and tagging
- Teams under cost pressure who need to find and cut Azure waste
- Anyone who wants complete, runnable Azure scripts rather than exam theory or fragments
Who Is This Book NOT For?
- Complete beginners with no PowerShell or Azure experience at all
- Readers preparing purely for a certification exam who want objectives, not runnable scripts
- Those seeking coverage of AWS or Google Cloud rather than Azure
- Developers wanting application code rather than infrastructure administration
- Admins committed to the portal who won't script
Table of Contents
- Section 0 — Setup: the module situation, installing and connecting, Cloud Shell, scopes, PowerShell or CLI, how the book is organised
- Section 1 — Resources & Tagging: a tag strategy worth having, create a resource group with a full tag set, find untagged and orphaned resources, query thousands of resources with Resource Graph
- Section 2 — Identity & RBAC: the RBAC model, assign and audit role assignments, create a service principal for automation, build a custom role
- Section 3 — Virtual Machines: what a VM consists of, create a VM with sensible defaults, stop paying for idle VMs, resize and report on right-sizing candidates
- Section 4 — Networking: how NSG rules are evaluated, build a VNet with segmented subnets and NSGs, diagnose blocked traffic, peer two virtual networks
- Section 5 — Storage: redundancy and access tiers, create a storage account with secure defaults, share files with a SAS token, cut cost with lifecycle rules
- Section 6 — Cost Management: where the money goes, break down spending, set a budget with alerts
- Section 7 — Governance & Policy: require tags at deployment time, restrict regions and SKUs and protect resources
- Section 8 — Monitoring & Backup: query logs and create a useful alert, back up VMs and prove the restore works
- Section 9 — Migrating from AzureRM: what changed and what didn't, find and convert AzureRM scripts, the differences that aren't just a rename
- Appendix A — Cmdlet Reference
- Appendix B — Azure CLI Equivalents
- Appendix C — Troubleshooting Reference
- Appendix D — Naming & Tagging Card
- Appendix E — Glossary
Requirements
- Working knowledge of PowerShell fundamentals (cmdlets, variables, the pipeline)
- An Azure subscription with administrative access to run the recipes
- The Az PowerShell module installed, or access to Azure Cloud Shell (setup is covered)
- Appropriate Azure roles to create and manage the resources in each recipe
- Familiarity with core Azure concepts (subscriptions, resource groups) is helpful
- The Azure CLI is optional—an equivalents appendix is included if you prefer it