I'm looking for a way to export Conditional Access (CA) Policies from Azure to create backups and possibly restore them later. Ideally, I'd also like to import these policies into different tenants. I'm currently using a script from an external website that exports these policies as .json files, but none of the files can be imported back into Azure as CA Policies through the portal. I suspect the formatting of these .json files might not be correct, because I've checked some other working policies coming from a GitHub repo and they seem fine. The script I found is over a year old, and I know there have been changes since then.
2 Answers
You might want to check out EntraExporter; it's designed for exporting these kinds of policies and could save you some hassle. It could give you a cleaner export that imports better into Azure.
Have you tried using PowerShell for the import? I just did it with the .json files and it worked fine for me. You might need to tweak the script a bit if you face any issues. Here's a link to a guide I used: www.alitajran.com/import-conditional-access-policies/
Not yet, I’ve been using the Azure website to import the files. It seems like the exported jsons have nested objects, and the website requires a simpler format. I’ll give PowerShell a shot next.
Wow, I didn't know about EntraExporter! I'll definitely give it a try.