Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Add-FinOpsServicePrincipal command
description: Grants the specified service principal or managed identity access to an Enterprise Agreement billing account or department.
author: flanakin
ms.author: micflan
ms.date: 04/01/2026
ms.date: 08/27/2026
ms.topic: reference
ms.service: finops
ms.subservice: finops-toolkit
Expand All @@ -13,7 +13,7 @@ ms.reviewer: brettwil

# Add-FinOpsServicePrincipal command

The **Add-FinOpsServicePrincipal** command grants the specified service principal or managed identity access to an Enterprise Agreement billing account or department.
The **Add-FinOpsServicePrincipal** command grants the specified service principal or managed identity access to an Enterprise Agreement billing account or department.

For more information about granting roles to service principals, see [Assign Enterprise Agreement roles to service principals](/azure/cost-management-billing/manage/assign-roles-azure-service-principals). For more information about the permissions associated with each role, see [Usage and costs access by role](/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role).

Expand All @@ -23,22 +23,22 @@ For more information about granting roles to service principals, see [Assign Ent

```powershell
Add-FinOpsServicePrincipal `
-ObjectId 00000000-0000-0000-0000-000000000000 `
-TenantId 00000000-0000-0000-0000-000000000000 `
-BillingAccountId 12345 `
-DepartmentId 67890
[‑ObjectId] <string> `
[‑TenantId] <string> `
[‑BillingAccountId] <string> `
[[‑DepartmentId] <string>]
```

<br>

## Parameters

| Name | Description |
| ------------------ | ---------------------------------------------------------------------------------- |
| `ObjectId` | Required. The object ID of the service principal or managed identity. |
| `TenantId` | Required. The Azure Active Directory tenant which contains the identity. |
| `BillingAccountId` | Required. The billing account ID (enrollment number) to grant permissions against. |
| `DepartmentId` | Optional. The department ID to grant permissions against. |
| Name | Description |
| ------------------- | ---------------------------------------------------------------------------------- |
| `‑ObjectId` | Required. The object ID of the service principal or managed identity. |
| `‑TenantId` | Required. The Azure Active Directory tenant which contains the identity. |
| `‑BillingAccountId` | Required. The billing account ID (enrollment number) to grant permissions against. |
| `‑DepartmentId` | Optional. The department ID to grant permissions against. |

<br>

Expand All @@ -49,22 +49,15 @@ The following examples demonstrate how to use the Add-FinOpsServicePrincipal com
### Enterprise Administrator (read only)

```powershell
Add-FinOpsServicePrincipal `
-ObjectId 00000000-0000-0000-0000-000000000000 `
-TenantId 00000000-0000-0000-0000-000000000000 `
-BillingAccountId 12345
Add-FinOpsServicePrincipal -ObjectId 00000000-0000-0000-0000-000000000000 -TenantId 00000000-0000-0000-0000-000000000000 -BillingAccountId 12345
```

Grants Enterprise Administrator (read only) permissions to the specified service principal or managed identity.

### Department Administrator (read only)

```powershell
Add-FinOpsServicePrincipal `
-ObjectId 00000000-0000-0000-0000-000000000000 `
-TenantId 00000000-0000-0000-0000-000000000000 `
-BillingAccountId 12345 `
-DepartmentId 67890
Add-FinOpsServicePrincipal -ObjectId 00000000-0000-0000-0000-000000000000 -TenantId 00000000-0000-0000-0000-000000000000 -BillingAccountId 12345 -DepartmentId 67890
```

Grants Department Administrator (read only) permissions to the specified service principal or managed identity.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Cost Management commands
description: Learn about PowerShell commands in the FinOpsToolkit module to support Cost Management capabilities.
author: flanakin
ms.author: micflan
ms.date: 04/01/2026
ms.date: 08/27/2026
ms.topic: reference
ms.service: finops
ms.subservice: finops-toolkit
Expand All @@ -19,6 +19,7 @@ The Cost Management PowerShell commands help you manage Cost Management features

## Commands

- [Add-FinOpsServicePrincipal](add-finopsserviceprincipal.md) – Grants a service principal or managed identity access to an Enterprise Agreement billing account or department.
- [Get-FinOpsCostExport](Get-FinOpsCostExport.md) – Get details about Cost Management exports.
- [New-FinOpsCostExport](New-FinOpsCostExport.md) – Create a new Cost Management export.
- [Remove-FinOpsCostExport](Remove-FinOpsCostExport.md) – Delete a Cost Management export and optionally data associated with the export.
Expand Down
93 changes: 43 additions & 50 deletions docs-mslearn/toolkit/powershell/cost/get-finopscostexport.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ title: Get-FinOpsCostExport command
description: Get a list of Cost Management exports for a given scope using the Get-FinOpsCostExport command in the FinOpsToolkit module.
author: flanakin
ms.author: micflan
ms.date: 04/01/2026
ms.date: 08/27/2026
ms.topic: reference
ms.service: finops
ms.subservice: finops-toolkit
ms.reviewer: micflan
#customer intent: As a FinOps user, I want to understand how to use the what Get-FinOpsCostExport command in the FinOpsToolkit module.
#customer intent: As a FinOps user, I want to understand how to use the Get-FinOpsCostExport command in the FinOpsToolkit module.
---

# Get-FinOpsCostExport command
Expand All @@ -28,30 +28,30 @@ This command was tested with the following API versions:

```powershell
Get-FinOpsCostExport `
[-Name <string>] `
[-Scope <string>] `
[-DataSet <string>] `
[-DataSetVersion <string>] `
[-StorageAccountId <string>] `
[-StorageContainer <string>] `
[-RunHistory] `
[-ApiVersion <string>]
[[‑Name] <string>] `
[[‑Scope] <string>] `
[[‑Dataset] <string>] `
[[‑DatasetVersion] <string>] `
[[‑StorageAccountId] <string>] `
[[‑StorageContainer] <string>] `
[‑RunHistory] `
[[‑ApiVersion] <string>]
```

<br>

## Parameters

| Name | Description |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `‑Name` | Optional. Name of the export. Supports wildcards. |
| `‑Scope` | Optional. Resource ID of the scope the export was created for. If empty, defaults to current subscription context. |
| `‑DataSet` | Optional. Dataset to get exports for. Allowed values = "ActualCost", "AmortizedCost", "FocusCost", "PriceSheet", "ReservationDetails", "ReservationTransactions", "ReservationRecommendations". Default = null (all exports). |
| `‑DataSetVersion` | Optional. Schema version of the dataset to export. Default = null (all exports). |
| `‑StorageAccountId` | Optional. Resource ID of the storage account to get exports for. Default = null (all exports). |
| `‑StorageContainer` | Optional. Name of the container to get exports for. Supports wildcards. Default = null (all exports). |
| `‑RunHistory` | Optional. Indicates whether the run history should be expanded. Default = false. |
| `‑ApiVersion` | Optional. API version to use when calling the Cost Management exports API. Default = 2025-03-01. |
| Name | Description |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `‑Name` | Optional. Name of the export. Supports wildcards. |
| `‑Scope` | Optional. Resource ID of the scope the export was created for. If empty, defaults to current subscription context. |
| `‑Dataset` | Optional. Dataset to export. Allowed values = "ActualCost", "AmortizedCost", "FocusCost", "PriceSheet", "ReservationDetails", "ReservationTransactions", "ReservationRecommendations". Default = null (all exports). |
| `‑DatasetVersion` | Optional. Schema version of the dataset to export. Default = null (all exports). |
| `‑StorageAccountId` | Optional. Resource ID of the storage account to get exports for. Default = null (all exports). |
| `‑StorageContainer` | Optional. Name of the container to get exports for. Supports wildcards. Default = null (all exports). |
| `‑RunHistory` | Optional. Indicates whether the run history should be expanded. Default = false. |
| `‑ApiVersion` | Optional. API version to use when calling the Cost Management exports API. Default = 2025-03-01. |

<br>

Expand Down Expand Up @@ -89,16 +89,21 @@ Get-FinOpsCostExport `

### FinOpsCostExportRunHistory object

| Property | Type | JSON path |
| --------------- | -------- | -------------------------------------------------------- |
| `Id` | String | `properties.runHistory.value[].id` |
| `ExecutionType` | String | `properties.runHistory.value[].properties.executionType` |
| `FileName` | String | `properties.runHistory.value[].fileName` |
| `StartTime` | DateTime | `properties.runHistory.value[].processingStartTime` |
| `EndTime` | DateTime | `properties.runHistory.value[].processingEndTime` |
| `Status` | String | `properties.runHistory.value[].status` |
| `SubmittedBy` | String | `properties.runHistory.value[].submittedBy` |
| `SubmittedTime` | DateTime | `properties.runHistory.value[].submittedTime` |
| Property | Type | JSON path |
| ---------------- | -------- | ----------------------------------------------------------- |
| `ResourceId` | String | `properties.runHistory.value[].id` |
| `RunId` | String | `properties.runHistory.value[].name` |
| `ExecutionType` | String | `properties.runHistory.value[].properties.executionType` |
| `Status` | String | `properties.runHistory.value[].properties.status` |
| `SubmittedBy` | String | `properties.runHistory.value[].properties.submittedBy` |
| `SubmittedTime` | DateTime | `properties.runHistory.value[].properties.submittedTime` |
| `RunStartTime` | DateTime | `properties.runHistory.value[].properties.processingStartTime` |
| `RunEndTime` | DateTime | `properties.runHistory.value[].properties.processingEndTime` |
| `FileName` | String | `properties.runHistory.value[].properties.fileName` |
| `QueryStartDate` | DateTime | `properties.runHistory.value[].properties.startDate` |
| `QueryEndDate` | DateTime | `properties.runHistory.value[].properties.endDate` |
| `ErrorCode` | String | `properties.runHistory.value[].properties.error.code` |
| `ErrorMessage` | String | `properties.runHistory.value[].properties.error.message` |

<br>

Expand All @@ -107,59 +112,47 @@ Get-FinOpsCostExport `
### Get all cost exports for a subscription

```powershell
Get-FinOpsCostExport `
-Scope "/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e"
Get-FinOpsCostExport -Scope "/subscriptions/00000000-0000-0000-0000-000000000000"
```

Gets all exports for a subscription. Doesn't include exports in nested resource groups.
Gets all exports for a subscription. Does not include exports in nested resource groups.

### Get exports matching a wildcard name

```powershell
Get-FinOpsCostExport `
-Name mtd* `
-Scope "providers/Microsoft.Billing/billingAccounts/00000000"
Get-FinOpsCostExport -Name mtd* -Scope "providers/Microsoft.Billing/billingAccounts/00000000"
```

Gets export with name matching wildcard mtd\* within the specified billing account scope. Doesn't include exports in nested resource groups.
Gets export with name matching wildcard mtd* within the specified billing account scope. Does not include exports in nested resource groups.

### Get all amortized cost exports

```powershell
Get-FinOpsCostExport `
-DataSet "AmortizedCost"
Get-FinOpsCostExport -Dataset "AmortizedCost"
```

Gets all exports within the current context subscription scope and filtered by dataset AmortizedCost.

### Get exports using a specific storage account

```powershell
Get-FinOpsCostExport `
-Scope "/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e"`
-StorageAccountId "/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/MyStorageAccount"
Get-FinOpsCostExport -Scope "/subscriptions/00000000-0000-0000-0000-000000000000" -StorageAccountId "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/MyStorageAccount"
```

Gets all exports within the subscription scope filtered by a specific storage account.

### Get exports using a specific container

```powershell
Get-FinOpsCostExport `
-Scope "/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e" `
-StorageContainer "MyContainer*"
Get-FinOpsCostExport -Scope "/subscriptions/00000000-0000-0000-0000-000000000000" -StorageContainer "MyContainer*"
```

Gets all exports within the subscription scope for a specific container. Supports wildcard.

### Get exports using a specific API version

```powershell
Get-FinOpsCostExport `
-Scope "/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e"
-StorageContainer "mtd*"
-ApiVersion "2023-08-01"
-StorageContainer "MyContainer*"
Get-FinOpsCostExport -Scope "/subscriptions/00000000-0000-0000-0000-000000000000" -StorageContainer "mtd*" -ApiVersion "2025-03-01"
```

Gets all exports within the subscription scope for a container matching wildcard pattern and using a specific API version.
Expand Down
Loading