Ejemplo n.º 1
0
        /// <summary>
        /// Retrieves a list of reports from Power BI api
        /// </summary>
        /// <returns></returns>
        public async Task <IList <Report> > GetAvailableReportsAsync()
        {
            // Create a user password cradentials.
            var credential = await _authenticationHandler.GetAzureTokenDataAsync();

            using (var client = new PowerBIClient(new Uri(_powerBiSettings.MainAddress), credential.tokenCredentials))
            {
                var reports = await client.Reports.GetReportsInGroupAsync(_powerBiSettings.GroupId);

                return(reports.Value);
            }
        }