> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flexagon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# exportContents

> Extracts Azure Power BI contents from a Power BI server to the file system. This operation supports both standard and package based projects. Objects

Extracts Azure Power BI contents from a Power BI server to the file system.  This operation supports both **standard** and **package-based** projects.

> [!NOTE]
>
> ***Objects can be exported in .pbix or PBIP structures, based on*** [***project properties***](https://flexagon.atlassian.net/wiki/spaces/FD11/pages/12395013775/exportContents#Project-Properties) ***.***

# Target Properties

<table><colgroup><col /><col /><col /><col /></colgroup><tbody><tr><th>**Property Name**</th><th>**Property Code**</th><th>**Required**</th><th>**Description**</th></tr><tr><td>Azure Power BI Account</td><td>`FDPBI_ACCOUNT_CODE`</td><td>No</td><td>The account from where we will export the files\
</td></tr><tr><td>Azure Power BI Workspace ID</td><td>`FDPBI_TGT_WORKSPACE_ID`</td><td>No\
</td><td>Workspace Id of the Power BI content</td></tr><tr><td>Azure Power BI Workspace Name</td><td>`FDPBI_TGT_WORKSPACE_NAME`</td><td>No</td><td>Workspace Name of the Power BI content. (Workspace Name is case-sensitive)</td></tr><tr><td>Read Timeout</td><td>`FDPBI_TGT_READ_TIMEOUT`</td><td>No</td><td>Timeout to get response during large file export. Default: 500 seconds. Only applicable for .pbix.</td></tr><tr><td>Use Default Script</td><td>`FDPBI_TGT_USE_DEFAULT_SCRIPT`</td><td>No</td><td>Check if you want to use the Default Script to export PBIP Files. (Keep it checked for Linux Endpoint).Unchecking will download the latest Script from Microsoft. **Recommended unchecking for Windows.**(For Windows, you can keep it unchecked, if it stops working, you can check it)**@Since 9.0.0.3**</td></tr><tr><td>PowerShell Path</td><td>`FDPBI_TGT_PWSH_PATH`</td><td>No</td><td>PowerShell Path on the endpoint. (Only works with PowerShell 7 and above) Applicable for PBIP files.**@Since 9.0.0.3**</td></tr></tbody></table>

> [!NOTE]
>
> For installing Powershell on linux - [Install PowerShell on Linux - PowerShell | Microsoft Learn](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-linux?view=powershell-7.5)

# Project Properties

<table><colgroup><col /><col /><col /><col /></colgroup><tbody><tr><th>**Property Name**</th><th>**Property Code**</th><th>**Required**</th><th>**Description**</th></tr><tr><td>Power BI File Format</td><td>`FDPBI_FILE_FORMAT`</td><td>No</td><td>The File Format specifying the type of file to save. Drop down will show PBIX and PBIP. Default is PBIX. If the project is dealing with export of PBIP type files, please select accordingly.**NOTE: When you are discovering from backend as Power BI, this property also controls how the files will be discovered to be enlisted in File Catalog.**</td></tr></tbody></table>

# Inputs

<table><colgroup><col /><col /><col /><col /></colgroup><tbody><tr><th>**Input Name**</th><th>**Input Code**</th><th>**Required**</th><th>**Description**</th></tr><tr><td>Power BI Account</td><td>`FDPBI_INP_ACCOUNT_CODE`</td><td>No\
</td><td>The account from where we will export the files\
</td></tr><tr><td>Reports Names</td><td>`FDPBI_INP_REPORTS_NAMES`\
</td><td>No\
</td><td>Comma separated list of the Report names to be exported. If nothing is provided, all reports present in the workspace will be exported as per the selected format in `FDPBI_FILE_FORMAT`.\
</td></tr><tr><td>Path To Export</td><td>`FDPBI_INP_EXPORT_PATH`</td><td>No</td><td>The directory where the exported **.pbix/PBIP** files will be kept. By default, it could be a folder with FD\_PROJECT\_NAME inside FD\_TEMP\_DIR.</td></tr><tr><td>Semantic Model Save Option</td><td>`FDPBI_INP_MODEL_SAVE_OPTION`</td><td>No</td><td>Format in which you want to save the Semantic Model. By default, it will be TMDL. Only applicable for PBIP.<ul><li>TMDL</li><li>TMSL</li></ul>**@Since 9.0.0.3**</td></tr></tbody></table>

# Artifacts

This operation produces artifacts that will be stored in the artifacts repository.

# Endpoint Selection

This operation delegates the selection to the workflow developer to determine.

# Endpoint Execution

This operations delegates the execution to the workflow developer to decide.

## Troubleshooting

While exporting a LIVE report, that points to another workspace’s shared semantic model, you can come across the error -

```
Calling https://api.fabric.microsoft.com/v1/workspaces/<id>/items/<itemid>/getDefinition
[31;1mException: [31;1mResponse status code does not indicate success: 401 (Unauthorized).; API error code: 'Unauthorized'[0m
```

This usually means the service principal is not assigned with Contributor access to the shared semantic model’s workspace as well. **Both the report and model’s workspaces need the Contributor access.**

> [!NOTE]
>
> In case of .pbix, Power BI REST API doesn't support exporting a Shared Dataset directly using the dataset id, however it can still be exported by using it’s tagged Report’s id in the workspace.
>
> To achieve this, prepare an empty report with the same name as the Dataset, and it will get exported as .pbix
