Azure Role Assignments Audit Report
Overview:
Azure Administrators often come across challenges while tracking multiple Azure role assignments and removals. At present Azure provides Activity Logs but they make less sense to non-techsavy stakeholders. For example it includes Role Id, Principal Id but doesn't indicate Role names and Principal names which can make the report more readable. To ensure proper tracking and accountability, we need a comprehensive report that includes the following details:
- Initiator and Timestamp
- User/Group/Principal assigned/removed
- Role assigned/removed
- Scope of the Attempt
Pre-Requisites:
- Export subscription level Activity Logs to a Log Analytics Workspace. For this navigate to Subscription > Activity log > Export Activity Log > Add Diagnostic Setting
- Add Diagnostic Setting to export Administrative logs to a Log Analytic Workspace of your choice and hit the save button:
- Navigate to the Workspace and Retrieve the Workspace ID from the overview section, we'll require this in our script.
Solution:
We have created a solution that retrieves and refines information from the Log Analytic Workspace stored Activity Logs and creates a readable CSV report.
Sample Output:
PowerShell Script:
Please replace with appropriate workspace ID(line 32,33) and output CSV file path(line 57, 78). You can provide same values for both at multiple places. Based on the requirement and Log Analytics Retention the no. of days can also be edited(line 6,20)
Hope this helps!
Published on:
Learn moreRelated posts
Enable IP restriction for a public facing App service
In this blog article, we will cover how to control the app service deployment to support only public facing app service with IP restriction en...
Selecting the Optimal Container for Azure AI: Docker, ACI, or AKS?
Deploying Azure AI services in containers like Docker, Azure Container Instances (ACI), or Azure Kubernetes Service (...
Securing Hardware and Firmware Supply Chains
In the modern cloud data center, ensuring the authenticity, integrity, and security of hardware and firmware is paramount. Firmware is the low...
Liquid Cooling in Air Cooled Data Centers on Microsoft Azure
With the advent of artificial intelligence and machine learning (AI/ML), hyperscale datacenters are increasingly accommodating AI accelerators...
Mt Diablo - Disaggregated Power Fueling the Next Wave of AI Platforms
Authors: Jason Adrian – General Manager, Azure Platform Architecture Laurentiu Olariu – Power Architect, Azure Platform Architecture Banha Sok...
Deny inbound NSG Rule creation via Azure Policy
In this blog article, we will cover how to deny the creation of inbound Network Security Group Rules if the inbound NSG Rule contains&n...
Azure Extended Zones: Optimizing Performance, Compliance, and Accessibility
Azure Extended Zones are designed to bring the power of Azure closer to end users in specific metropolitan areas or jurisdictions, cate...
Inside Maia 100: Revolutionizing AI Workloads with Microsoft's Custom AI Accelerator
Authored by: Sherry Xu, Partner Lead SoC Architect, Azure Maia Chandru Ramakrishnan, Partner Software Engineering Manager As the advanc...
Accelerate Cloud Potential for Your SAP Workloads on Azure with these Learning Paths
Accelerate Cloud Potential for Your SAP Workloads on Azure with these Learning Paths In today's rapidly evolving digital landsc...
Leveraging Azure Copilot for Azure Kubernetes Services (AKS)
Azure Copilot is a powerful AI-driven tool that helps manage and optimize your Azure resources, including Azure Kubernetes Services (AKS). By ...