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 EmbedReportController(PbiEmbedService pbiEmbedService, IOptions <AzureAd> azureAd, IOptions <PowerBI> powerBI) { this.pbiEmbedService = pbiEmbedService; this.azureAd = azureAd; this.powerBI = powerBI; }