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