private void SetupManagementClients(MockContext context)
 {
     ResourceManagementClient = GetResourceManagementClient(context);
     KustoManagementClient    = GetKustoManagementClient(context);
     _helper.SetupManagementClients(ResourceManagementClient,
                                    KustoManagementClient);
 }
Exemple #2
0
        internal async Task <KustoManagementClient> GetManagementClient()
        {
            var token = await GetAadToken(_options);

            var client = new KustoManagementClient(credentials: new TokenCredentials(token))
            {
                SubscriptionId = _options.SubscriptionId
            };

            return(client);
        }
        public KustoClient(IAzureContext context)
        {
            if (context == null)
            {
                throw new ApplicationException(Resources.InvalidDefaultSubscription);
            }

            _subscriptionId = context.Subscription.GetId();
            _client         = AzureSession.Instance.ClientFactory.CreateArmClient <KustoManagementClient>(
                context,
                AzureEnvironment.Endpoint.ResourceManager);
            _currentUser = context.Account.Id;
        }
 public KustoClusterManagementClient(KustoManagementClient client, AppConfig config)
 {
     this.client = client;
     this.config = config;
     this.client.SubscriptionId = this.config.Global.SubscriptionId;
 }