Exemplo n.º 1
0
        private static DataLakeFileSystemClient GetDataLakeClient(DataLakeConfig settings, ILogger log)
        {
            // This works as long as the account accessing (managed identity or visual studio user) has both of the following IAM permissions on the storage account:
            // - Reader
            // - Storage Blob Data Reader
            var credential = new DefaultAzureCredential();

            log.LogInformation($"Using credential Type: {credential.GetType().Name}");

            var client = new DataLakeFileSystemClient(new Uri(settings.BaseUrl), credential);

            if (!client.Exists())
            {
                return(null);
            }

            return(client);
        }