Hi All,
I’m looking to embed amazonbi dashboards in my web application. I want to achieve this by fetching the embed url of the dashboards since there are more than 100 dashboards to be displayed on the UI.
I checked the documentation but I could find 1-click embedding options for this. Can anyone help me with the steps on how can i get the embed dashboard url for for amazonbi account? Also are there any prerequisites for this?
Thanks in advance!
Hi @shreyavj
To embed QuickSight dashboards in your web application using embed URLs, ensure that you have a QuickSight Enterprise Edition
subscription.
To fetch an embed URL, you must have QuickSight API access. Since you have 100+ dashboards, automate fetching embed URLs using Boto3 (Python).
Example: (Syntax may vary—modify it as per your requirements)
Note: Use the following API call to fetch all dashboard IDs. Remove any dashboard IDs that you do not want to embed.
import boto3
quicksight = boto3.client('quicksight', region_name="your-region")
response = quicksight.list_dashboards(AwsAccountId="your-aws-account-id")
dashboard_ids = [dashboard['DashboardId'] for dashboard in response['DashboardSummaryList']]
print(dashboard_ids)
# For each dashboard, fetch the embed URL
embed_urls = []
for dashboard_id in dashboard_ids:
response = quicksight.get_dashboard_embed_url(
AwsAccountId="your-aws-account-id",
DashboardId=dashboard_id,
IdentityType="QUICKSIGHT", # 'IAM'|'QUICKSIGHT'|'ANONYMOUS'
SessionLifetimeInMinutes=600
)
embed_urls.append(response['EmbedUrl'])
print(embed_urls)
Note:
SessionLifetimeInMinutes
- User session is valid for 15 minutes (default) up to 10 hours (maximum). You can use the optionalSessionLifetimeInMinutes
parameter to customize session duration.IdentityType="QUICKSIGHT"
is for QuickSight users. For external users, useANONYMOUS
Please refer the below QuickSight documentation and community post this might be helpful for you.
Hi @Xclipse , thanks for your response. Can you pls help me understand if apart from whitelisting my application’s domain in amazonbi aws account and adding a role in their account for my application’s lambda to assume (also adding the required resource & trust policies in both accounts) , are there any other prerequisites for the above approach?
Hi @shreyavj
Yes, apart from whitelisting your application’s domain in the QuickSight account and adding a role in their AWS account for your application’s Lambda to assume, there are additional considerations.
VPC Endpoints: If the Lambda function runs inside a VPC, configure VPC endpoints for QuickSight.
Try the QuickSight Workshop Studio, it provides a step-by-step guide to embedding dashboards.
Thanks @Xclipse for the support here!