当前上下文中不存在名称 "Randomize"

The name "Randomize" doesnt exist in the current context

我正在关注 Azure 文档 here,它对代码示例造成混淆,目前我看到这个错误与“随机化”功能有关,他们没有记录...

The name “Randomize” doesnt exist in the current context

我只是想 upload/download(获取文件位置)在一个用例的数据湖上。

string connectionString = Environment.GetEnvironmentVariable("AZURE_STORAGE_CONNECTION_STRING");
// Create DataLakeServiceClient
DataLakeServiceClient serviceClient = new DataLakeServiceClient(connectionString);

// Get a reference to a filesystem named "sample-filesystem-append" and then create it
DataLakeFileSystemClient filesystem = serviceClient.GetFileSystemClient(Randomize("sample-filesystem-append"));
filesystem.Create();

另外,我使用连接字符串连接是否正确? 我假设它是一个合法参数,因为我没有收到任何投诉,或者我必须使用 StorageSharedKeyCredential 代替吗?

RandomizeSampleTest class, which is available on GitHub。不过方法很简单:

public string Randomize(string prefix = "sample") => $"{prefix}-{Guid.NewGuid()}";

...所以它实际上只是创建一个具有给定前缀的随机字符串。