Skip to content

Commit f4bf4ba

Browse files
committed
updates azure powershell command
1 parent 7f8e6b0 commit f4bf4ba

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

articles/governance/policy/how-to/export-resources.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
title: Export Azure Policy resources
33
description: Learn to export Azure Policy resources to GitHub, such as policy definitions and policy assignments.
4-
ms.date: 09/30/2024
4+
ms.date: 10/03/2024
55
ms.topic: how-to
6-
ms.custom: devx-track-azurepowershell, devx-track-azurecli
6+
ms.custom: devx-track-azurepowershell, devx-track-azurecli
77
ms.devlang: azurecli
88
---
99

@@ -12,7 +12,7 @@ ms.devlang: azurecli
1212
This article provides information on how to export your existing Azure Policy resources. Exporting your resources is useful and recommended for backup, but is also an important step in your journey with Cloud Governance and treating your [policy-as-code](../concepts/policy-as-code.md). Azure Policy resources can be exported through [REST API](/rest/api/policy), [Azure CLI](#export-with-azure-cli), and [Azure PowerShell](#export-with-azure-powershell).
1313

1414
> [!NOTE]
15-
> The portal experience for exporting definitions to GitHub was deprecated in April 2023.
15+
> The portal experience for exporting definitions to GitHub was deprecated in April 2023.
1616
1717
## Export with Azure CLI
1818

@@ -37,13 +37,12 @@ Azure Policy definitions, initiatives, and assignments can each be exported as J
3737
- Assignment - [Get-AzPolicyAssignment](/powershell/module/az.resources/get-azpolicyassignment).
3838

3939
```azurepowershell-interactive
40-
Get-AzPolicyDefinition -Name 'b2982f36-99f2-4db5-8eff-283140c09693' | ConvertTo-Json -Depth 10
40+
Get-AzPolicyDefinition -Name 'b2982f36-99f2-4db5-8eff-283140c09693' | Select-Object -Property * | ConvertTo-Json -Depth 10
4141
```
4242

4343
## Export to CSV with Resource Graph in Azure portal
4444

45-
Azure Resource Graph gives the ability to query at scale with complex filtering, grouping and sorting. Azure Resource Graph supports the policy resources table, which contains policy resources such as definitions, assignments and exemptions. Review our [sample queries.](../samples/resource-graph-samples.md#azure-policy). The Resource Graph explorer portal experience allows downloads of query results to CSV using the ["Download to CSV"](../../resource-graph/first-query-portal.md#download-query-results-as-a-csv-file) toolbar option.
46-
45+
Azure Resource Graph gives the ability to query at scale with complex filtering, grouping and sorting. Azure Resource Graph supports the policy resources table, which contains policy resources such as definitions, assignments and exemptions. Review our [sample queries.](../samples/resource-graph-samples.md#azure-policy). The Resource Graph explorer portal experience allows downloads of query results to CSV using the ["Download to CSV"](../../resource-graph/first-query-portal.md#download-query-results-as-a-csv-file) toolbar option.
4746

4847
## Next steps
4948

0 commit comments

Comments
 (0)