.NET Framework/Embed for your organization/UserOwnsData/Services/PowerBIService.cs
/// <summary>
/// Returns Embed URL for a report
/// </summary>
/// <param name="workspaceId">Workspace where the report resides</param>
/// <param name="reportId">Report to be embedded</param>
/// <returns>Object of EmbedConfigModel containing embed url and access token</returns>
Returns Embed URL for a report
Returns Embed URL for a report
public static async Task<EmbedConfigModel> GetReportEmbedConfigAsync(string workspaceId, string reportId)
		{
			using (var client = GetPowerBiClient())
			{
				Report report = await client.Reports.GetReportInGroupAsync(new Guid(workspaceId), new Guid(reportId));
				return new EmbedConfigModel
				{
					EmbedUrl = report.EmbedUrl,
					AccessToken = TokenManager.GetAccessToken()
				};
			}
		}
public static async Task < EmbedConfigModel > GetReportEmbedConfigAsync ( string workspaceId , string reportId ) { using ( var client = GetPowerBiClient ( ) ) { Report report = await client . Reports . GetReportInGroupAsync ( new Guid ( workspaceId ) , new Guid ( reportId ) ) ; return new EmbedConfigModel { EmbedUrl = report . EmbedUrl , AccessToken = TokenManager . GetAccessToken ( ) } ; } }
Returns Embed URL for a report
Returns Embed URL for a report
Object of EmbedConfigModel containing embed url and access token
Object of EmbedConfigModel containing embed url and access token
workspaceId
string
Workspace where the report resides
Workspace where the report resides
reportId
string
Report to be embedded
Report to be embedded