Advertisement
Guest User

Untitled

a guest
Jul 12th, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. string _username = <your azure username>
  2. string _pass = <your azure password>
  3. string _adlsAccountName = <name of your data lake store>
  4. string _subId = <your subscription id>
  5. string localFolderPath = @"<yourfolderpath>"
  6. string localFilePath = Path.Combine(localFolderPath, "<yourFile>");
  7. string remoteFolderPath = "/path on data lake/";
  8. string remoteFilePath = Path.Combine(remoteFolderPath, "yourFileonDataLake");
  9.  
  10. var tenantId = "<your tenant id>"; //you can find this in right top corner on azure portal
  11. var nativeClientApp_clientId = "1950a258-227b-4e31-a9cf-717495945fc2"; // you can use this one
  12. var activeDirectoryClientSettings = ActiveDirectoryClientSettings.UsePromptOnly(nativeClientApp_clientId, new Uri("urn:ietf:wg:oauth:2.0:oob"));
  13. var creds = UserTokenProvider.LoginSilentAsync(nativeClientApp_clientId, tenantId, _username, _password).Result;
  14. _adlsClient = new DataLakeStoreAccountManagementClient(creds) { SubscriptionId = _subId };
  15. _adlsFileSystemClient = new DataLakeStoreFileSystemManagementClient(creds);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement