protected virtual void Dispose(bool disposing)
        {
            if (this.Client != null)
            {
                if (disposing)
                {
                    this.Client.Dispose();
                }

                this.Client = null;
            }
        }
        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);
            }
        }
 protected override void BeginProcessing()
 {
     this.Client = new AzureADClient(this.AccessToken, this.TenantId);
 }
Ejemplo n.º 5
0
 protected override void BeginProcessing()
 {
     Client = new AzureADClient(AccessToken, TenantId);
 }