How to Download Defender for Cloud Compliance Reports Using CLI or API
Question details
The user is looking for methods to download Microsoft Defender for Cloud compliance reports using command-line tools like Azure CLI, PowerShell, or the REST API rather than the Azure portal.

- Product
- Microsoft Defender for Cloud
- Device & OS
- not provided
- Scenario
- Automating the retrieval of security compliance data and reports from Azure for external analysis or auditing.
- Observed behavior
- The user needs clarification on whether API or CLI capabilities exist for downloading compliance reports, as the standard documentation points primarily to the Azure portal.
Ensure you have an active Azure subscription with the appropriate Security Reader or Security Admin role permissions before attempting to query compliance data.
Use the Standard Azure Portal Method
The Azure portal provides the most reliable and fully documented method for generating and downloading comprehensive compliance reports.
Currently, downloading fully formatted PDF compliance reports is natively optimized through the graphical user interface. If you require standard compliance audits, this method guarantees the correct formatting and standard mappings.
Log in to the Azure portal and search for 'Microsoft Defender for Cloud' in the top search bar.
On the left-hand menu under 'Cloud Security', select 'Regulatory compliance'.
Click on the 'Download report' button at the top of the page, select the specific compliance standard (e.g., ISO 27001, SOC TSP), choose the format (PDF or CSV), and click 'Download'.
Explore Azure REST API for Compliance Data
While direct PDF downloads via API are limited, you can use Azure REST API endpoints to extract the underlying raw compliance data for your own reports.
Analyze Your Azure Exported Reports with WPS Office
When you export raw compliance data from Microsoft Defender for Cloud as CSV files or download PDF audit reports, you need a fast and reliable office suite to view and analyze them. WPS Office is a completely free, lightweight alternative to Microsoft Office that perfectly handles all your data analysis and document needs.

Frequently Asked Questions
Can I completely automate PDF compliance report downloads using Azure CLI?
Native Azure CLI commands currently do not fully support downloading formatted PDF compliance reports directly. You can use the REST API to pull raw assessment data, but for polished PDFs, the Azure Portal remains the officially supported method.
Where can I find community scripts for Azure Defender API tasks?
You can find custom PowerShell and Python scripts built by cloud experts on the official Microsoft Tech Community forums, GitHub repositories under the 'Azure' organization, and Stack Overflow.
Why is the download button disabled in my Azure Regulatory Compliance dashboard?
The download button may be disabled if you lack sufficient role-based access control (RBAC) permissions. You typically need at least a Security Reader role at the subscription level to generate and download compliance reports.




