microsoft / microsoft/powerbi-powershell

Get-PowerBIActivityEvent fails to Collect Data using PowerShell Extension in VSCode

Open
#393 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
413
Forks
134
Avg merge
33m
Merged PRs (30d)
1

Description

I am having an issue while calling Get-PowerBIActivityEvent cmdlet on PowerShell Extension in Visual Studio Code which returns empty arrays. I ran it on Windows PowerShell terminal, and it works perfectly fine. Other MicrosoftPowerBIMgmt cmdlets seem to work fine on PowerShell Extension, thus, I am suspecting that it might just be Get-PowerBIActivityEvent cmdlet issue. I might be wrong though 😶 and isn't sure if this is a bug issue 🐛.

Windows PowerShell Terminal version: 5.1.19041.3031
PowerShell Extension Terminal version: 2023.6.0

MicrosoftPowerBIMgmt info
Item Value
version 1.2.1111
Installed Module Path $HOME\Documents\WindowsPowerShell\Modules
Visual Studio Code info
Item Value
Version 1.80.1 (user setup)
Electron 22.3.14
Chromium 108.0.5359.215
Node.js 16.17.1
V8 10.8.168.25-electron.0
OS Windows_NT x64 10.0.19044

Actual

The cmdlet returns empty arrays.

[
  {
    "Id": [],
    "RecordType": [],
    "CreationTime": [],
    "Operation": [],
    "OrganizationId": [],
    "UserType": [],
    "UserKey": [],
    "Workload": [],
    "UserId": [],
    "ClientIP": [],
    "UserAgent": [],
    "Activity": [],
    "ItemName": [],
    "WorkSpaceName": [],
    "DatasetName": [],
    "ReportName": [],
    "CapacityId": [],
    "CapacityName": [],
    "WorkspaceId": [],
    "ObjectId": [],
    "DatasetId": [],
    "ReportId": [],
    "ArtifactId": [],
    "ArtifactName": [],
    "IsSuccess": [],
    "ReportType": [],
    "RequestId": [],
    "ActivityId": [],
    "DistributionMethod": [],
    "ConsumptionMethod": [],
    "ArtifactKind": []
  }
]

Expected

I am expecting the cmdlet to collect the Activity Event data that looks like below which happens to work when running on Windows PowerShell terminal.

[
  {
    "Id": "xxxxxxxxx",
    "RecordType": 20,
    "CreationTime": "2023-07-19T00:04:42Z",
    "Operation": "ViewReport",
    "OrganizationId": "xxxxxxxxx",
    "UserType": 0,
    "UserKey": "xxxxxxxxx",
    "Workload": "PowerBI",
    "UserId": "xxxxxxxxx",
    "ClientIP": "xxxxxxxxx",
    "UserAgent": "xxxxxxxxx",
    "Activity": "ViewReport",
    "ItemName": "xxxxxxxxx",
    "WorkSpaceName": "xxxxxxxxx",
    "DatasetName": "xxxxxxxxx",
    "ReportName": "xxxxxxxxx",
    "CapacityId": "xxxxxxxxx",
    "CapacityName": "Default Capacity",
    "WorkspaceId": "xxxxxxxxx",
    "ObjectId": "xxxxxxxxx",
    "DatasetId": "xxxxxxxxx",
    "ReportId": "xxxxxxxxx",
    "ArtifactId": "xxxxxxxxx",
    "ArtifactName": "xxxxxxxxx",
    "IsSuccess": true,
    "ReportType": "PowerBIReport",
    "RequestId": "xxxxxxxxx",
    "ActivityId": "xxxxxxxxx",
    "DistributionMethod": "Shared",
    "ConsumptionMethod": "Power BI Web",
    "ArtifactKind": "Report"
  }
]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing Get-PowerBIActivityEvent with MicrosoftPowerBIMgmt 1.2.1111 in the VS Code PowerShell Extension and Windows PowerShell 5.1 environments described. Compare the returned activity data and inspect the cmdlet or module entry point to identify why VS Code produces empty arrays. Done means the command returns activity records consistently in both environments, with a regression test or confirmed reproduction path.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, vscode
Domain
cli, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.