簡體   English   中英

Azure Data Lake Gen2 - 如何使用 C# 將文件從文件夾移動到另一個文件夾

[英]Azure Data Lake Gen2 - How do I move files from folder to another folder using C#

我已經配置了 Datalake gen2,並且在 C# 中我正在尋找有關如何將文件從一個文件夾移動到另一個文件夾的選項? 使用 blob 存儲很簡單,但使用 Datalake,我對使用哪個 SDK 以及如何在 C# 中完成感到困惑

另外,我可以使用在容器級別生成的 SAS 令牌進行身份驗證嗎?

如果要將文件從一個文件夾移動到 Azure Data Lake Gen2 中的另一個文件夾,請參考以下代碼

public async Task<DataLakeFileClient> MoveDirectory
    (DataLakeFileSystemClient fileSystemClient)
{
    DataLakeFileClient fileClient=
         fileSystemClient.GetFileClient("<file path>");

    return await fileClient.RenameAsync("<new file path>");
}

有關更多詳細信息,請參閱此處此處

此外,我們可以使用 sas 令牌來管理 azure 數據湖 gen2 資源。 關於如何生成 sas 令牌,請參考這里

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM