azure - 删除 Azure 文件共享中的文件失败,错误:指定的资源是只读的,此时无法修改
问题描述
尝试删除 Azure 存储文件共享中的文件时。我不断收到以下错误:
无法删除文件“cs-firstName-lastname-domain-com-10033fff99999999/mslearn-my-app-folder-word-and-word-wd/.git/objects/pack/pack-someguid.idx”。错误:指定的资源是只读的,此时不能修改
试图检查是否有任何当前打开的句柄,但我没有看到。 https://docs.microsoft.com/en-us/rest/api/storageservices/list-handles
<?xml version="1.0" encoding="utf-8"?>
<EnumerationResults>
<Entries />
<NextMarker />
</EnumerationResults>
此外,我尝试通过运行 powershell cmdlet New-PSDrive从 Windows 连接到此 Azure 文件共享,但也在那里使用Remove-Item,得到以下错误
Remove-Item : Cannot remove item
Z:\mslearn-my-app-folder-word-and-word-wd/.git/objects/pack/pack-someguid.idx: **You
do not have sufficient access rights to perform this operation**.
任何帮助,关于如何从只读更改属性/如何删除/或我缺少的任何内容。
谢谢,
解决方案
正如@BhargaviAnnadevara-MSFT 共享的链接中所述,https: //social.msdn.microsoft.com/Forums/en-US/6fde433a-aef0-49e9-8568-2aaf5a9b673a/unable-to-delete-a-file- from-azure-file-storage?forum=windowsazuredata只读属性只能在安装后删除,我做了以下操作。
- 使用 Azure 门户中提供的脚本装载文件共享
- 挂载后,执行ls命令将显示文件属性
- 在 powershell 或 CMD 中更改文件属性。我发现通过 powershell 很难做到这一点,所以改用 ATTRIB cmd。属性包-someguid.idx -R
更新:更简单的解决方案
推荐阅读
- ios - 在 Xcode 11 中,Live Preview 按钮下方的按钮是什么?
- python - 在没有主目录名称的情况下启动 os.walk
- progress-bar - Inno Setup:如何处理 [UninstallDelete] 部分的进度条?
- sql - 选择包含其他列的列,SQL
- mongodb - 如何在 MongoDB 4.0 上创建副本集
- javascript - 根据选定的单选按钮将两个字段显示为必填字段
- jquery - event.preventDefault(); 无法在 ajax post laravel Framework 5.8.17 中工作
- c# - .NET Core 但不是 .NET Framework 的 400 BadRequest 响应
- javascript - 在下面的所有 div 上使用 css 模糊效果
- beagleboneblack - 在 BeagleBone Black 上读取、加载和卸载驱动程序的命令?