microsoft / microsoft/powerbi-powershell
Restore-PowerBIWorkspace throws Not Found (404)
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 413
- Forks
- 134
- Avg merge
- 33m
- Merged PRs (30d)
- 1
Description
Hi Team,
I tried below to restore the deleted workspace. whereas when I tried get-workspaces I do see those workspaces still in delete state. Below is what I used.
Get-PowerBIWorkspace -scope Organization -Deleted
OutPut
Id : 88888888-8888-8888-8888-888888888888
Name : testingPowerBIRestore
Type : Group
State : Deleted
IsReadOnly : False
IsOrphaned : False
IsOnDedicatedCapacity : False
CapacityId :
Restore-PowerBIWorkspace -Id "88888888-8888-8888-8888-888888888888" -RestoredName "testingPowerBIRestore" -AdminEmailAddress "********@********.onmicrosoft.com"
OutPut
WARNING: Only preview workspaces are supported when -Scope Organization is specified
Restore-PowerBIWorkspace : Operation returned an invalid status code 'NotFound'
At line:1 char:1
+ Restore-PowerBIWorkspace -Id "88888888-8888-8888-8888-888888888888" - ...
+
+ CategoryInfo : WriteError: (Microsoft.Power...owerBIWorkspace:RestorePowerBIWorkspace) [Restore-PowerBI
Workspace], HttpOperationException
+ FullyQualifiedErrorId : Operation returned an invalid status code 'NotFound',Microsoft.PowerBI.Commands.Workspac
es.RestorePowerBIWorkspace
Resolve-PowerBIError -Last
OutPut
RequestId : ac0a32c8-46a9-4419-8694-922f5ff0f359
Response : Not Found (404): {"error":{"code":"PowerBIEntityNotFound","pbi.error":{"code":"PowerBIEntityNotFound
","parameters":{},"details":[],"exceptionCulprit":1}}}
PowerBIErrorInfo :
ResponseDate : Wed, 03 Jun 2020 12:54:09 GMT
RequestMethod : POST
RequestUri : https://api.powerbi.com/v1.0/myorg/admin/groups/88888888-8888-8888-8888-888888888888/restore
InvocationInfo : {Restore-PowerBIWorkspace}
Line : Restore-PowerBIWorkspace -Id "88888888-8888-8888-8888-888888888888" -RestoredName "testingPowerBIRestore"
-AdminEmailAddress "********@********.onmicrosoft.com"
Position : At line:1 char:1
+ Restore-PowerBIWorkspace -Id "88888888-8888-8888-8888-888888888888" - ...
+
StackTrace : at
Microsoft.PowerBI.Api.V2.Groups.<RestoreDeletedGroupAsAdminWithHttpMessagesAsync>d__21.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PowerBI.Api.V2.GroupsExtensions.<RestoreDeletedGroupAsAdminAsync>d__33.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PowerBI.Api.V2.GroupsExtensions.RestoreDeletedGroupAsAdmin(IGroups operations,
String groupId, GroupRestoreRequest groupRestoreRequest)
at Microsoft.PowerBI.Common.Api.Workspaces.WorkspacesClient.RestoreDeletedWorkspaceAsAdmin(Guid
workspaceId, WorkspaceRestoreRequest restoreRequest)
at Microsoft.PowerBI.Commands.Workspaces.RestorePowerBIWorkspace.ExecuteCmdlet()
at Microsoft.PowerBI.Commands.Common.PowerBICmdlet.ProcessRecord()
HistoryId : 5
MicrosoftPowerBIMgmt version 1.0.840
Is here someone faced with the same issue? Please help me
Contributor guide
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
Start by reproducing Restore-PowerBIWorkspace after listing the deleted workspace with Get-PowerBIWorkspace -Scope Organization -Deleted. Review the Organization-scope warning, the POST request shown by Resolve-PowerBIError, and the RestorePowerBIWorkspace stack-trace entry point. Done means the reported restore request succeeds or the unsupported condition is clearly documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, powershell
- Domain
- api, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100