public async Task <int> GetAasUserSessionCount() { try { AzureADClient adClient = new AzureADClient(); var authToken = await adClient.GetToken(AadAppKey, "https://management.azure.com/"); var client = new AasClient(); return(await client.GetActiveUserSessionCount(authToken)); } catch (Exception e) { Trace.TraceError("HomeController.GetAasUserSessionCount failed with the following exception: " + e.ToString()); throw new HttpResponseException(HttpStatusCode.InternalServerError); } }
public async Task <long> GetAdlsStorage() { try { AzureADClient adClient = new AzureADClient(); var token = await adClient.GetToken(AadAppKey, "https://management.azure.com/"); AdlsInsightClient client = new AdlsInsightClient(); return(await client.GetDataAtRestInBytes(adlsAccountName, token)); } catch (Exception e) { Trace.TraceError("HomeController.GetAdlsStorage failed with the following exception: " + e.ToString()); throw new HttpResponseException(HttpStatusCode.InternalServerError); } }