Exemplo n.º 1
0
        private void create_adls_client()
        {
            var authenticationContext = new AuthenticationContext($"https://login.windows.net/{tenant_id}");
            var credential            = new ClientCredential(clientId: client_id, clientSecret: client_key);
            var result = authenticationContext.AcquireToken(resource: "https://management.core.windows.net/", clientCredential: credential);

            if (result == null)
            {
                throw new InvalidOperationException("Failed to obtain the JWT token");
            }

            string token        = result.AccessToken;
            var    _credentials = new TokenCredentials(token);

            inner_client = new DataLakeStoreFileSystemManagementClient(_credentials);
            inner_client.SubscriptionId = subscription_id;
        }
Exemplo n.º 2
0
        private void create_adls_client()
        {

            var authenticationContext = new AuthenticationContext($"https://login.windows.net/{tenant_id}");
            var credential = new ClientCredential(clientId: client_id, clientSecret: client_key);
            var result = authenticationContext.AcquireToken(resource: "https://management.core.windows.net/", clientCredential: credential);

            if (result == null)
            {
                throw new InvalidOperationException("Failed to obtain the JWT token");
            }

            string token = result.AccessToken;

            var _credentials = new TokenCloudCredentials(subscription_id, token);
            inner_client = new DataLakeStoreFileSystemManagementClient(_credentials);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="DataLakeStoreFrontEndAdapter"/> class.
 /// </summary>
 /// <param name="accountName">Name of the account.</param>
 /// <param name="client">The client.</param>
 /// <param name="token">The token.</param>
 public DataLakeStoreFrontEndAdapter(string accountName, IDataLakeStoreFileSystemManagementClient client, CancellationToken token)
 {
     _accountName = accountName;
     _client      = client;
     _token       = token;
 }
        private const int PerRequestTimeoutMs = 30000; // 30 seconds and we timeout the request

        #endregion

        #region Constructor

        /// <summary>
        /// Initializes a new instance of the <see cref="DataLakeStoreFrontEndAdapter"/> class.
        /// </summary>
        /// <param name="accountName">Name of the account.</param>
        /// <param name="client">The client.</param>
        public DataLakeStoreFrontEndAdapter(string accountName, IDataLakeStoreFileSystemManagementClient client) :
            this(accountName, client, CancellationToken.None)
        {
        }
 public DataLakeFileRepository(DataLakeConfiguration configuration, IDataLakeStoreFileSystemManagementClient dataLakeStoreClient)
 {
     _dataLakeStoreClient   = dataLakeStoreClient;
     _datalakeConfiguration = configuration;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="DataLakeStoreFrontEndAdapter"/> class.
 /// </summary>
 /// <param name="accountName">Name of the account.</param>
 /// <param name="client">The client.</param>
 /// <param name="token">The token.</param>
 public DataLakeStoreFrontEndAdapter(string accountName, IDataLakeStoreFileSystemManagementClient client, CancellationToken token)
 {
     _accountName = accountName;
     _client = client;
     _token = token;
 }
        private const int PerRequestTimeoutMs = 30000; // 30 seconds and we timeout the request

        #endregion

        #region Constructor

        /// <summary>
        /// Initializes a new instance of the <see cref="DataLakeStoreFrontEndAdapter"/> class.
        /// </summary>
        /// <param name="accountName">Name of the account.</param>
        /// <param name="client">The client.</param>
        public DataLakeStoreFrontEndAdapter(string accountName, IDataLakeStoreFileSystemManagementClient client) :
            this(accountName, client, CancellationToken.None)
        {
            
        }