Beispiel #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MonitoringClient"/>.
 /// </summary>
 public MonitoringClient(Uri endpoint, TokenCredential credential, MonitoringClientOptions options)
     : this(new ClientDiagnostics(options),
            SynapseClientPipeline.Build(options, credential),
            endpoint.ToString(),
            options.VersionString)
 {
 }
Beispiel #2
0
        public MonitoringClient(string endpoint, TokenCredential credential, MonitoringClientOptions options = null)
        {
            if (endpoint == null)
            {
                throw new ArgumentNullException(nameof(endpoint));
            }
            if (credential == null)
            {
                throw new ArgumentNullException(nameof(credential));
            }

            options ??= new MonitoringClientOptions();
            _clientDiagnostics = new ClientDiagnostics(options);
            string[] scopes = { "https://dev.azuresynapse.net/.default" };
            _pipeline  = HttpPipelineBuilder.Build(options, new BearerTokenAuthenticationPolicy(credential, scopes));
            RestClient = new MonitoringRestClient(_clientDiagnostics, _pipeline, endpoint, options.Version);
        }