<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Microsoft.Rest.HttpOperationException: 'Operation returned an invalid status code 'Not Found'' in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Microsoft-Rest-HttpOperationException-Operation-returned-an/m-p/4397316#M59352</link>
    <description>&lt;P&gt;Hi&amp;nbsp; &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/890716"&gt;@zamsam6931&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can check the following:&lt;/P&gt;
&lt;P&gt;It seems to be caused by insufficient permissions or incorrect authentication, check if you have all the required permissions, you can check the details in the link below :&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-sample-for-customers?tabs=net-core#set-up-your-power-bi-environment" target="_blank"&gt;Embed content in your Power BI embedded analytics application - Power BI | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Check that the values entered are correct for tenantId, reportId, groupId and datasetId.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is the related document, you can view this content:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Developer/Generate-Embed-Token-For-Create-Issue/m-p/219683" target="_blank"&gt;Solved: Generate Embed Token For Create Issue - Microsoft Fabric Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Developer/Creating-datasource-using-Power-BI-RestAPI/m-p/2168408" target="_blank"&gt;Solved: Creating datasource using Power BI RestAPI - Microsoft Fabric Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/49037233/operation-returned-an-invalid-status-code-unauthorized" target="_blank"&gt;c# - Operation returned an invalid status code 'Unauthorized'' - Stack Overflow&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
    <pubDate>Thu, 06 Feb 2025 02:14:51 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2025-02-06T02:14:51Z</dc:date>
    <item>
      <title>Microsoft.Rest.HttpOperationException: 'Operation returned an invalid status code 'Not Found''</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Microsoft-Rest-HttpOperationException-Operation-returned-an/m-p/4391742#M59304</link>
      <description>&lt;P&gt;i am facing error in this line : var profile = pbiClient.Profiles.CreateProfile(createRequest);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;public PowerBiTenant OnboardNewTenant(PowerBiTenant tenant)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;this.SetCallingContext();&lt;/P&gt;&lt;P&gt;var createRequest = new CreateOrUpdateProfileRequest(tenant.Name + " Profile");&lt;BR /&gt;var profile = pbiClient.Profiles.CreateProfile(createRequest);&lt;/P&gt;&lt;P&gt;string profileId = profile.Id.ToString();&lt;BR /&gt;tenant.ProfileId = profileId;&lt;/P&gt;&lt;P&gt;SetCallingContext(profileId);&lt;/P&gt;&lt;P&gt;// create new app workspace&lt;BR /&gt;GroupCreationRequest request = new GroupCreationRequest("AODSK: " + tenant.Name);&lt;BR /&gt;Group workspace = pbiClient.Groups.CreateGroup(request);&lt;/P&gt;&lt;P&gt;// assign new workspace to dedicated capacity&lt;BR /&gt;if (targetCapacityId != "")&lt;BR /&gt;{&lt;BR /&gt;pbiClient.Groups.AssignToCapacity(workspace.Id, new AssignToCapacityRequest&lt;BR /&gt;{&lt;BR /&gt;CapacityId = new Guid(targetCapacityId),&lt;BR /&gt;});&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;tenant.WorkspaceId = workspace.Id.ToString();&lt;BR /&gt;tenant.WorkspaceUrl = "&lt;A href="https://app.powerbi.com/groups/" target="_blank" rel="noopener"&gt;https://app.powerbi.com/groups/&lt;/A&gt;" + workspace.Id.ToString() + "/";&lt;/P&gt;&lt;P&gt;// This code adds service principal as workspace Contributor member&lt;BR /&gt;// -- Adding service principal as member is required due to security bug when&lt;BR /&gt;// -- creating embed token for paginated report using service princpal profiles&lt;BR /&gt;var userServicePrincipal = pbiClient.Groups.GetGroupUsers(workspace.Id).Value[0];&lt;BR /&gt;string servicePrincipalObjectId = userServicePrincipal.Identifier;&lt;BR /&gt;pbiClient.Groups.AddGroupUser(workspace.Id, new GroupUser&lt;BR /&gt;{&lt;BR /&gt;Identifier = servicePrincipalObjectId,&lt;BR /&gt;PrincipalType = PrincipalType.App,&lt;BR /&gt;GroupUserAccessRight = "Contributor"&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// add user as new workspace admin to make demoing easier&lt;BR /&gt;string adminUser = Configuration["DemoSettings:AdminUser"];&lt;BR /&gt;if (!string.IsNullOrEmpty(adminUser))&lt;BR /&gt;{&lt;BR /&gt;pbiClient.Groups.AddGroupUser(workspace.Id, new GroupUser&lt;BR /&gt;{&lt;BR /&gt;Identifier = adminUser,&lt;BR /&gt;PrincipalType = PrincipalType.User,&lt;BR /&gt;EmailAddress = adminUser,&lt;BR /&gt;GroupUserAccessRight = "Admin"&lt;BR /&gt;});&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// upload sample PBIX file #1&lt;BR /&gt;string importName = "Sales";&lt;BR /&gt;PublishPBIX(workspace.Id, importName);&lt;/P&gt;&lt;P&gt;Dataset dataset = GetDataset(workspace.Id, importName);&lt;/P&gt;&lt;P&gt;UpdateMashupParametersRequest req =&lt;BR /&gt;new UpdateMashupParametersRequest(new List&amp;lt;UpdateMashupParameterDetails&amp;gt;() {&lt;BR /&gt;new UpdateMashupParameterDetails { Name = "DatabaseServer", NewValue = tenant.DatabaseServer },&lt;BR /&gt;new UpdateMashupParameterDetails { Name = "DatabaseName", NewValue = tenant.DatabaseName }&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;pbiClient.Datasets.UpdateParametersInGroup(workspace.Id, dataset.Id, req);&lt;/P&gt;&lt;P&gt;PatchSqlDatasourceCredentials(workspace.Id, dataset.Id, tenant.DatabaseUserName, tenant.DatabaseUserPassword);&lt;/P&gt;&lt;P&gt;pbiClient.Datasets.RefreshDatasetInGroup(workspace.Id, dataset.Id);&lt;/P&gt;&lt;P&gt;if (targetCapacityId != "")&lt;BR /&gt;{&lt;BR /&gt;// only import paginated report if workspace has been associated with dedicated capacity&lt;BR /&gt;string PaginatedReportName = "Sales Summary";&lt;BR /&gt;PublishRDL(workspace, PaginatedReportName, dataset);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;return tenant;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2025 05:40:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Microsoft-Rest-HttpOperationException-Operation-returned-an/m-p/4391742#M59304</guid>
      <dc:creator>zamsam6931</dc:creator>
      <dc:date>2025-02-03T05:40:26Z</dc:date>
    </item>
    <item>
      <title>Re: Microsoft.Rest.HttpOperationException: 'Operation returned an invalid status code 'Not Found''</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Microsoft-Rest-HttpOperationException-Operation-returned-an/m-p/4397316#M59352</link>
      <description>&lt;P&gt;Hi&amp;nbsp; &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/890716"&gt;@zamsam6931&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can check the following:&lt;/P&gt;
&lt;P&gt;It seems to be caused by insufficient permissions or incorrect authentication, check if you have all the required permissions, you can check the details in the link below :&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-sample-for-customers?tabs=net-core#set-up-your-power-bi-environment" target="_blank"&gt;Embed content in your Power BI embedded analytics application - Power BI | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Check that the values entered are correct for tenantId, reportId, groupId and datasetId.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is the related document, you can view this content:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Developer/Generate-Embed-Token-For-Create-Issue/m-p/219683" target="_blank"&gt;Solved: Generate Embed Token For Create Issue - Microsoft Fabric Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Developer/Creating-datasource-using-Power-BI-RestAPI/m-p/2168408" target="_blank"&gt;Solved: Creating datasource using Power BI RestAPI - Microsoft Fabric Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/49037233/operation-returned-an-invalid-status-code-unauthorized" target="_blank"&gt;c# - Operation returned an invalid status code 'Unauthorized'' - Stack Overflow&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2025 02:14:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Microsoft-Rest-HttpOperationException-Operation-returned-an/m-p/4397316#M59352</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-02-06T02:14:51Z</dc:date>
    </item>
  </channel>
</rss>

