Пример #1
0
 internal static AdlsClient GetAdlsClient(string accntNm, IAzureContext context)
 {
     accntNm = HandleAccntName(accntNm, context);
     lock (ClientFactory)
     {
         if (ClientFactory.ContainsKey(accntNm))
         {
             return(ClientFactory[accntNm]);
         }
         ServiceClientCredentials creds;
         if (IsTest)
         {
             if (MockCredentials != null)
             {
                 creds = MockCredentials;
             }
             else
             {
                 ClientFactory.Add(accntNm, MockAdlsClient.GetMockClient());
                 return(ClientFactory[accntNm]);
             }
         }
         else
         {
             creds = AzureSession.Instance.AuthenticationFactory.GetServiceClientCredentials(context,
                                                                                             AzureEnvironment.Endpoint.AzureDataLakeStoreFileSystemEndpointSuffix);
         }
         var client = AdlsClient.CreateClient(accntNm, creds);
         client.AddUserAgentSuffix(AzurePowerShell.UserAgentValue.ToString());
         ClientFactory.Add(accntNm, client);
         return(client);
     }
 }
Пример #2
0
 public void TestMockClientAccountValidation()
 {
     MockAdlsClient.GetMockClient("rdutta.azuredatalakestore.net/");
 }