Push-OutputBinding for table storage does not overwrite existing entities
See original GitHub issueIf the rowKey already exists in the table the entity is not overwritten, but an error is raised. This makes Push-OutputBinding
a one-trick-pony wrt. table storage and any workaround defeats the purpose of making integration with Azure Table Storage easy and straightforward.
$Entity = @{
partitionKey = "SOME_PARTITION_KEY"
rowKey = "key_that_already_exists_in_the_table"
}
Push-OutputBinding -Name outputTable -Value $Entity
# results in an error "The specified entity already exists"
I would suggest adding a -Force
parameter that means overwrite existing entries. This should be trivial as instead of using the insert
operation you could use the upsert
operation.
Not sure if this should then be an insert or replace
or a insert or merge
. Perhaps something that can be defined in the integration itself, but either will do as a temporary measure.
Or am I missing something since I could find no mention of this issue anywhere?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Powershell and Azure storage table (INSERT OR REPLACE)
The operation will update an existing entity or inserts a new entity if it does not exist in the table. Regarding how to...
Read more >Azure Tables output bindings for Azure Functions
Use an Azure Tables output binding to write entities to a table in Azure Cosmos DB for Table or Azure Table Storage.
Read more >Insert Or Replace Entity (REST API) - Azure Storage
The Insert Or Replace Entity operation replaces an existing entity or inserts a new entity if it does not exist in the table....
Read more >Updating and Deleting Table Storage Entities with Azure ...
However, the bindings don't directly support updating and deleting entities (yet). But it's actually pretty easy to support updates and deletes.
Read more >Update Your Azure Functions Table Storage Bindings
This will completely change how you bind to Table storage. You can already build isolated process C# functions today with .NET 6. However,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Perhaps make it work like
Out-File
where-NoClobber
:In the case of table storage the default behavior could be to overwrite an existing row, but one could work around this using the
-NoClobber
switch.But it would probably be best to adopt the two upsert operations already established in table storage
You could implement this by adding an
-Upsert
parameter (only works with table storage)Is there already an update on this topic?