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