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); }
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); } }
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); } }
public HomeController() { m_errorMessage = ConfigValidatorService.GetWebConfigErrors(); }