azure - 如何使用 powershell 从 Azure 表存储中删除属性?

标签 azure powershell azure-table-storage azure-powershell

我尝试使用此代码从表中删除属性:

$propertiesToRemove = @("Prop1", "Prop2")
$row = Get-AzTableRow -Table $cloudTable -PartitionKey "PK" -RowKey $id
$propertiesToRemove | %{ $row.PSObject.Properties.Remove($_) }
Update-AzTableRow -Table $cloudTable -entity $row

但这并没有影响到它们。如何使用 powershell 执行此操作?

最佳答案

假设您正在使用AzureRmStorageTable ,我认为不可能从表中删除属性,因为 Update-AzTableRow 执行 InsertOrMerge操作而不是 ReplaceInsertOrReplace操作。

来自source code :

return ($Table.Execute([Microsoft.Azure.Cosmos.Table.TableOperation]::InsertOrMerge($updatedEntity)))

关于azure - 如何使用 powershell 从 Azure 表存储中删除属性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61139762/

相关文章:

python - 有没有办法找到给定VM的资源组,然后使用Python sdk找到Azure中VM的详细信息

node.js - 将客户端和服务器 Nodejs 应用程序部署到 Azure

azure - 在 Azure 表存储中使用时间戳作为修改日期

c# - 实现 Azure Table 的 ITableEntity 接口(interface)以支持嵌套对象和自定义属性类型

powershell - 如何使用 PowerShell 在 Azure 存储表中获取行?

c# - cmd批处理监听控制台应用程序的输出

Azure 存储帐户防火墙规则阻止使用 azure devops 进行 terraform 部署

html - Powershell 表中的额外列

powershell - 扩展通过 Powershell 中的单引号存储的字符串变量

windows - WUSA 2359302 安装 WMF 静默时的错误代码