u/AdeelAutomates

Orphaned Resources
▲ 0 r/AZURE

Orphaned Resources

Azure environments as they grow large (especially in many brownfields where proper lifecycle/IaC of resources are not in place) can accumulate abandoned resources.

Many resources in the process can become orphaned which are assets that are no longer tied to active workloads or services, often resulting from past deployments or incomplete resource cleanup processes. Some exist without no effect while others can cost your organization.

So in this episode we will explore Orphaned Resources and how to action them:

  • How to query and discover such resources in our Azure tenant using KQL.
  • Build an automation around these queries using PowerShell.
  • The script will inform the owners of the resources to take action.
  • While we will inform via email in the video, you can choose to send the alerts out as tickets, tasks or stories.
  • Upload to Automation Account to run on a schedule

Link: Orphaned Resources - Discover Abandoned Azure Services - YouTube

Giving credit where credit is due. A special thanks to Dolev Shor for the excellent workbook in github which is the basis of this episode.

youtube.com
u/AdeelAutomates — 2 days ago
▲ 12 r/entra+1 crossposts

Runbook to Auto-Rotate App Registration Secrets

Hey Everyone, as managing App Registration secrets can be annoying... either you stay on top of them or they expire.

Initially, I had built scripts to alert app owners when secrets were expiring through email/tickets. But then I started thinking: why not just automate the whole rotation process?

Especially since these secrets are created & stored in a secret manager like a Key Vault for scripts, runbooks, or apps to consume.

So I built a process in PowerShell that does the following:

  • With a list of app registrations (to control which ones we autorotate)
  • Rotate their secrets automatically (when a date hits since creation that you set)
  • Update Key Vault with its new secret
  • Keep the old secret on the app for a grace period (to avoid breaking a service that happens to be consuming it at the time of this script run)

Throw it in an Automation Account, run it daily, and secret rotation becomes a managed process instead of a manual task.

I did a full walkthrough for this here: https://www.youtube.com/watch?v=smKhyZ1xL6I

In case all you want is alerting. Where it sends HTML emails to the owners of the app registrations when their secrets are about to expire, I made a walk through on that as well: https://www.youtube.com/watch?v=E3wnj0bVRWg

u/AdeelAutomates — 8 days ago
▲ 52 r/entra+3 crossposts

Learning Microsoft Graph

Hey everyone,

I built a series of content on Microsoft Graph. I thought I share it here.

Microsoft Graph, if you don’t know, is Microsoft’s unified platform to interact with Entra ID, Microsoft 365, Teams, SharePoint, Intune, and more through APIs.

This is what allows you to truly automate against the Microsoft cloud platform. It has replaced many of the PowerShell modules for everything but Microsoft Exchange.

If you wish to understand it so you can start automating on these platforms (both Graph Module & API), I got you! Here are some of the episodes for you may be interested in checking:

Putting it all together, here is the kind of things you can do with Graph: Build a Report on Azure, Entra & M365 Permissions! This builds a identity permissions report of your tenant & stores it in SharePoint in a new excel doc. If nothing else check out @ 40:04 , one of my favorite things about Graph is seeing excel docs come alive in real time with the data!

u/AdeelAutomates — 11 days ago

Learn PowerShell in Azure, EntraID & M365

Explore cloud services through automation and scripting across Azure, EntraID and Microsoft 365. With the intent to build the skills needed to become an effective modern cloud engineer using practical automation concepts, scripting, and real-world examples you can apply anywhere.

I teach not just theory, but demonstrate hands-on techniques throughout each lesson.

Link: https://youtube.com/@adeelautomates

youtube.com
u/AdeelAutomates — 15 days ago
▲ 3 r/AZURE

I put together an episode focused on ownership governance using Azure Policy and Automation (PowerShell).

The focus is on using Azure Policy to set the laws of the tenant and then using scripts to police it over time.

We apply this approach to ownership across resources using owner tags.

We will explore:

  • How Azure Policy works:
    • Definition vs Assignment
    • How to read and edit the Definition JSON and all the parts that go into it
  • Build our own custom policies to:
    • Enforce owner tags on resource groups
    • Append owner tags to resources
  • Build a PowerShell script to validate owner values against EntraID:
    • Detect drift (invalid values, disabled/ex-employee accounts, duplicates)
    • Rout actions to the right people to take actions (email, task, ticket)

The goal is to move from “we have tags labeling owners” to “we have accurate ownership across time”.

Link: https://www.youtube.com/watch?v=pP43VQ7577s

u/AdeelAutomates — 18 days ago