Azure Active Directory (Azure AD) is an identity and access management platform (IAM) that’s responsible for controlling your employees’ ability to log into your organization’s resources and applications.
Anything that compromises your Azure AD tenant configurations can lead to a sudden loss of access to important data and apps, making it especially important to have a backup plan for it in case something goes wrong.
Unfortunately, Microsoft’s built-in retention mechanisms are not enough to serve most enterprise organizations’ needs, forcing engineering teams to look elsewhere for third-party solutions and workarounds to back up their configurations.
Here’s an overview of every tool, framework, and workaround that you can use to backup Active Directory tenants in Microsoft Azure, including our very own no-code web portal for managing and maintaining tenant configurations.
This article covers:
The short answer? Yes. Microsoft Azure Active Directory is the primary identity provider for organizations running on Microsoft 365, meaning that it controls access to all your apps, resources, and integrations within the platform.
If something were to happen to your Azure AD tenant, it’s not excessive to assume that your employees would lose access to all your data and applications for an extended period of time.
As for the long answer, Microsoft Azure AD stores a collection of configuration files, settings, and policies that are highly critical for business continuity — including custom domains, conditional access policies, app registrations, role-based access control settings, privileged identity management settings, and much more. It also contains a directory of all users and groups within the company, which enables employees to log in and access business data.
All of this needs to be backed up securely in a third-party storage location so that it can be recovered in the event of a cyber attack or human error. For example, even something as simple as an employee making unintended changes to your tenant configurations could have your team locked out of access to crucial resources.
Microsoft offers some native backup and retention mechanisms for Azure AD; however, these features are insufficient for most business users due to their limitations. Here's an overview of these mechanisms and their potential shortcomings:
Azure AD provides a Recycle Bin that temporarily holds deleted objects, such as users and groups, for thirty days. This is known as soft-delete, allowing you to restore these objects within this timeframe. However, this feature has limitations:
Azure AD Connect synchronizes your on-premises Active Directory database with Azure AD. Although not a backup solution, it allows you to recover your Azure AD configuration by resynchronizing with your on-premises AD. However, this approach has limitations:
Azure AD maintains activity and audit logs that track changes made to various objects and configurations. While these logs can help investigate incidents, they are not a backup solution and cannot restore the previous state of your tenant.
Using PowerShell scripts to securely back up your Azure AD tenant configurations involves exporting the data to a file format like CSV or JSON and storing the files in a secure location.
Prerequisites for running the PS script:
The following is a step-by-step process for achieving this.
Step 1: Connect to Azure AD
Connect to Azure AD using your admin credentials:
Step 2: Export users to a CSV file:
Step 3: Export groups to a CSV file:
Step 4: Export group memberships to a CSV file:
Step 5: Export applications to a CSV file:
Step 6: Export service principals to a CSV file:
Step 7: Export directory roles and their memberships to CSV files:
Step 8: Save Backup Files.
Save the generated CSV files to a secure location, such as an encrypted folder, a secure file server, or a cloud storage service that supports encryption and access controls.
Step 9: Export conditional access policies to a JSON file
(This requires the Microsoft Graph Module)
Step 10: Automate and schedule ongoing backups (instructions below).
To automate the backup process, create a PowerShell script file that contains the steps described above. Save the script with a ".ps1" extension, for example, "AzureADBackup.ps1".
To schedule regular backups, use Windows Task Scheduler or an alternative scheduling tool. Here’s a step-by-step guide to for scheduling these backups:
Step 1: Open Windows Task Scheduler and create a new task.
Step 2: Set a name and description for the task.
Step 3: In the "Triggers" tab, create a new trigger and define the schedule (e.g., daily, weekly, or monthly).
Step 4: In the "Actions" tab, create a new action with the following settings:
Step 5: Configure any additional settings, such as security options or conditions, as needed.
Step 6: Save the task and ensure it runs as expected.
Microsoft 365 Desired State Configuration (DSC) is a powerful solution that uses PowerShell DSC to manage the configuration of Microsoft 365 services, including Azure AD. Using Microsoft 365 DSC, you can extract your Azure AD tenant configurations and save them in a configuration file.
Prerequisites for using DSC:
Here's a step-by-step process for using Microsoft 365 DSC to back up your Azure AD tenant configurations:
Step 1: Connect to Azure AD
Connect to Azure AD using your admin credentials: Connect-M365DSCConfiguration
Step 2: Extract Azure AD configurations
Run the following command to extract the Azure AD tenant configurations:
This command exports the specified components, such as users, groups, applications, service principals, and tenant details, to a DSC configuration script. You can tailor the components list to your organization's requirements.
Step 3: Save the Configuration Script
After running the Export-M365DSCConfiguration command, it will generate a DSC configuration script that contains your Azure AD tenant configurations. Save this script to a secure location, such as an encrypted folder, a secure file server, or a cloud storage service that supports encryption and access controls.
Step 4: Automate and schedule backups with DSC (instructions below)
Step 5: Monitor and Maintain Backups
Regularly monitor the backup process to ensure it is running as expected and that the backup files are securely stored. Periodically test the restoration process to ensure the data can be successfully imported back into Azure AD when needed.
To automate the backup process, create a PowerShell script file that contains the steps described above. Save the script with a ".ps1" extension, for example, "AzureADBackupM365DSC.ps1".
To schedule regular backups, use Windows Task Scheduler or an alternative scheduling tool:
Step 1: Open Windows Task Scheduler and create a new task.
Step 2: Set a name and description for the task.
Step 3: In the "Triggers" tab, create a new trigger and define the schedule (e.g., daily, weekly, or monthly).
Step 4: In the "Actions" tab, create a new action with the following settings:
Step 5: Configure any additional settings, such as security options or conditions, as needed.
Step 6: Save the task and ensure it runs as expected.
Third-party platforms for backing up Azure AD tenant configurations offer several advantages over native methods like Azure AD Connect and code-intensive workarounds like PowerShell. These advantages include:
CoreView is a dedicated end-to-end automation platform that helps you back up your Microsoft 365 tenant configurations, including Azure AD.
How does it work? It’s simple: CoreView Configuration Manager stores a backup of all your Azure AD settings and policies each time someone from your team makes a change to your tenant via Admin Center. These backups are stored securely for you to retrieve on-demand should you need them.
But it doesn’t stop there. CoreView Configuration Manager also provides ongoing drift detection and compliance monitoring features for Azure AD. With us, you can rest assured knowing that your organization is compliant with security standards and industry regulations at all times.
Moreover, CoreView does this while allowing you to manage multiple tenants through a single interface, a feature that’s especially useful for managed service providers and enterprises with more than one tenant. You can even copy-paste your configurations from one tenant to another!
Learn how CoreView can help you streamline your backup strategy for Microsoft 365 today.