microsoft / microsoft/Analysis-Services
fabricps-pbip Import-FabricItem updateDefinition : 401 (Unauthorized).; API error code: 'Unauthorized'
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 732
- Forks
- 433
- PR merge metrics
- No merged PRs in 30d
Description
I am using following script to create 2 workspaces and publish the semantic model and report to the 2 different workspaces.
$mdlworkspaceId = New-FabricWorkspace -name "TestPBIPModelWorkSpace" -skipErrorIfExists
$rptworkspaceId = New-FabricWorkspace -name "TestPBIPReportWorkSpace" -skipErrorIfExists
$currentPath = (Split-Path $MyInvocation.MyCommand.Definition -Parent)
$pbipSemanticModelPath = "$currentPath\TestPBIP.SemanticModel"
$pbipReportPath = "$currentPath\TestPBIP.Report"
Set-FabricAuthToken -reset
$semanticModelImport = Import-FabricItem -workspaceId $mdlworkspaceId -path $pbipSemanticModelPath
$reportImport = Import-FabricItem -workspaceId $rptworkspaceId -path $pbipReportPath -itemProperties @{"semanticModelId" = $semanticModelImport.Id }
After succesfully running above script.. i granted myself read,build,share for the semantic model and changed role to "Viewer" on workspace "TestPBIPModelWorkSpace".
If i now try to publish the report it errors out... (update of report)
If i delete the report and deploy report.. it works fine again. (creation of report)
Import-FabricItem -workspaceId $rptworkspaceId -path $pbipReportPath -itemProperties @{"semanticModelId" = $semanticModelImport.Id }
For updating a report looks like fabric APIs warrant write privileges on the semantic model/workspace.
Pls advise if any workaround for same.
Thanks,
Naren
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the two-workspace script using New-FabricWorkspace, Set-FabricAuthToken, and Import-FabricItem, then compare report creation with report update after changing the semantic model permissions and workspace role. Determine whether the update path requires write access and document a confirmed workaround or the permissions expected for completion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- api, authorization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100