コード例 #1
0
        public async Task <EmbedParams> Get(string id)
        {
            powerBI.Value.ReportId = id;

            // Validate whether all the required configurations are provided in appsettings.json
            string configValidationResult = ConfigValidatorService.ValidateConfig(azureAd, powerBI);

            if (configValidationResult != null)
            {
                throw new ArgumentException();
            }

            EmbedParams embedParams = await pbiEmbedService.GetEmbedParams(new Guid(powerBI.Value.WorkspaceId), new Guid(powerBI.Value.ReportId));

            return(embedParams);
        }
コード例 #2
0
 public string GetEmbedInfo()
 {
     try
     {
         string configValidationResult = ConfigValidatorService.ValidateConfig(appSettings);
         if (configValidationResult != null)
         {
             HttpContext.Response.StatusCode = 400;
             return(configValidationResult);
         }
         string accessToken = AadService.GetAccessToken(appSettings);
         string embedInfo   = PbiEmbedService.GetEmbedParam(accessToken, appSettings);
         return(embedInfo);
     }
     catch (Exception ex)
     {
         HttpContext.Response.StatusCode = 500;
         return(ex.Message + "\n\n" + ex.StackTrace);
     }
 }
コード例 #3
0
        public string GetEmbedInfo()
        {
            try
            {
                // Validate whether all the required configurations are provided in appsettings.json
                string configValidationResult = ConfigValidatorService.ValidateConfig(azureAd, powerBI);
                if (configValidationResult != null)
                {
                    HttpContext.Response.StatusCode = 400;
                    return(configValidationResult);
                }

                EmbedParams embedParams = pbiEmbedService.GetEmbedParams(new Guid(powerBI.Value.WorkspaceId), new Guid(powerBI.Value.ReportId));
                return(JsonSerializer.Serialize <EmbedParams>(embedParams));
            }
            catch (Exception ex)
            {
                HttpContext.Response.StatusCode = 500;
                return(ex.Message + "\n\n" + ex.StackTrace);
            }
        }
コード例 #4
0
 public HomeController()
 {
     m_errorMessage = ConfigValidatorService.GetWebConfigErrors();
 }