简体   繁体   English

如何连接到 C# 上的 AWS Quicksight 服务

[英]How to connect to AWS Quicksight service on C#

I'm trying to embed a dashboard I created using Quicksight I have the code they publish on the site, but where do I get the data that passes to the AmazonQuickSightClient object.我正在尝试嵌入我使用 Quicksight 创建的仪表板我有他们在网站上发布的代码,但是我从哪里获取传递给 AmazonQuickSightClient object 的数据。

Do I need to authenticate before this code?我需要在此代码之前进行身份验证吗?

//example from AWS site
var client = new AmazonQuickSightClient(
    AccessKey,
    SecretAccessKey,
    sessionToken,
    Amazon.RegionEndpoint.USEast1);
try
{
    Console.WriteLine(
        client.GetDashboardEmbedUrlAsync(new GetDashboardEmbedUrlRequest
        {
            AwsAccountId = 111122223333,
            DashboardId = "1c1fe111-e2d2-3b30-44ef-a0e111111cde",
            IdentityType = IdentityType.IAM,
            ResetDisabled = true,
            SessionLifetimeInMinutes = 100,
            UndoRedoDisabled = false
        }).Result.EmbedUrl
    );
} catch (Exception ex) {
    Console.WriteLine(ex.Message);
}

You need to AssumeRole in order to get the credentials that will contain the AccessKey, SecretAccessKey, and SessionToken.您需要 AssumeRole 以获取将包含 AccessKey、SecretAccessKey 和 SessionToken 的凭证。

See https://aws.amazon.com/blogs/big-data/embed-interactive-dashboards-in-your-application-with-amazon-quicksight/请参阅https://aws.amazon.com/blogs/big-data/embed-interactive-dashboards-in-your-application-with-amazon-quicksight/

Look into Step 3 which executes this command查看执行此命令的步骤 3

aws sts assume-role --role-arn "arn:aws:iam::293424211206:role/QuickSightEmbed" --role-session-nametom.smith@example.com aws sts 假设角色 --role-arn "arn:aws:iam::293424211206:role/QuickSightEmbed" --role-session-nametom.smith@example.com

For .NET you can look at this API to AssumeRole https://docs.aws.amazon.com/sdkfornet/v3/apidocs/items/SecurityToken/MSecurityTokenServiceAssumeRoleAssumeRoleRequest.html For .NET you can look at this API to AssumeRole https://docs.aws.amazon.com/sdkfornet/v3/apidocs/items/SecurityToken/MSecurityTokenServiceAssumeRoleAssumeRoleRequest.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM