-
-
Save MoimHossain/04f19a083a8eecdca7b5b559eba34d16 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tokenProvider = new OAuthTokenProvider(tenantId, clientId, secret, scope); | |
var hdfs = new FileSystemApi(storageAccountName, tokenProvider); | |
var response = hdfs.CreateFileSystemAsync(fileSystemName).Result; | |
hdfs.CreateDirectoryAsync(fileSystemName, "/demo").Wait(); | |
hdfs.CreateEmptyFileAsync(fileSystemName, "/demo/", "example.txt").Wait(); | |
var stream = new FileStream(@"C:\temp.txt", FileMode.Open, FileAccess.Read); | |
hdfs.CreateFileAsync(fileSystemName, "/demo/", "mytest.txt", stream).Wait(); | |
var acls = new AclEntry[] | |
{ | |
new AclEntry( | |
AclScope.Access, | |
AclType.Group, | |
"2dec2374-3c51-4743-b247-ad6f80ce4f0b", | |
(GrantType.Read | GrantType.Execute)), | |
new AclEntry( | |
AclScope.Access, | |
AclType.Group, | |
"62049695-0418-428e-a5e4-64600d6d68d8", | |
(GrantType.Read | GrantType.Write | GrantType.Execute)), | |
new AclEntry( | |
AclScope.Default, | |
AclType.Group, | |
"62049695-0418-428e-a5e4-64600d6d68d8", | |
(GrantType.Read | GrantType.Write | GrantType.Execute)) | |
}; | |
hdfs.SetAccessControlAsync(fileSystemName, "/", acls).Wait(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment