Я использую .net4.8.
Мне нужно подключиться к хранилищу озера данных Azure Gen1.
Я нашел ниже образец на github:
https://github.com/Azure-Samples/data-lake-store-adls-dot-net-get-started/
Теперь в учетной записи Azure:
![enter image description here](https://i.stack.imgur.com/QonXr.png)
Зарегистрировано новое приложение, получен идентификатор приложения, tenantId, секрет клиента
![enter image description here](https://i.stack.imgur.com/fn0RY.png)
// Obtain AAD token
var creds = new ClientCredential(applicationId, clientSecret);
var clientCreds = ApplicationTokenProvider.LoginSilentAsync(tenantId, creds).GetAwaiter().GetResult();
// Create ADLS client object
AdlsClient client = AdlsClient.CreateClient(adlsAccountFQDN, clientCreds);
try
{
string fileName = "/test/xyz.txt";
//Read file contents
using (var readStream = new StreamReader(client.GetReadStream(fileName)))
{
string line;
while ((line = readStream.ReadLine()) != null)
{
Console.WriteLine(line);
}
}
}
Использование строки (var readStream = new StreamReader (client.GetReadStream (fileName)))
{выдает исключение:
![enter image description here](https://i.stack.imgur.com/11EhW.png)
![enter image description here](https://i.stack.imgur.com/yVlJx.png)
xyz.txt доступен как в корневом каталоге, так и в /test/xyz.txt.
Как исправить это исключение?