Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TableClient::SubmitTransaction() doesn't work for TransactionActionType InsertReplace #5618

Closed
krzwaraksa opened this issue May 13, 2024 · 2 comments · Fixed by #5642
Closed
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Tables

Comments

@krzwaraksa
Copy link

Describe the bug
TableClient::SubmitTransaction() with TransactionStep.Action set to InsertReplace doesn't insert entities. It works fine with action Add, or when using Upsert method without transaction.

To Reproduce
Steps to reproduce the behavior:

  • run the code snippet

Code Snippet

#include <iostream>
#include <azure/data/tables.hpp>
#include <azure/identity/default_azure_credential.hpp>

int main() {
  auto cred = std::make_shared<Azure::Identity::DefaultAzureCredential>();
  std::string tableName = "<your table name>";
  std::string storageUrl= "<your storage account url>";
  auto tableClient = Azure::Data::Tables::TableClient(storageUrl, tableName, cred);
  auto serviceClient = Azure::Data::Tables::TableServiceClient(storageUrl, cred);
  serviceClient.CreateTable(tableName);

  auto transaction = std::vector<Azure::Data::Tables::Models::TransactionStep>(1);
  auto entity = Azure::Data::Tables::Models::TableEntity();
  entity.SetPartitionKey("partition");
  entity.SetRowKey("rowKey");
  transaction[0].Entity = entity;
  transaction[0].Action = Azure::Data::Tables::Models::TransactionActionType::InsertReplace;
  tableClient.SubmitTransaction(transaction);

  auto response = tableClient.QueryEntities();
  std::cout << "returned " << response.TableEntities.size() << " entities"; // got 0, expected 1
}

Expected behavior
Expected to insert 1 entity, as per code snippet

Setup
OS: WSL, Ubuntu 22.04
IDE : VS Code
Version of the Library used: azure-data-tables-cpp, 1.0.0-beta.2 (pulled from VCPKG)

@github-actions github-actions bot added Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Tables labels May 13, 2024
Copy link

Thank you for your feedback. Tagging and routing to the team member best able to assist.

@gearama
Copy link
Member

gearama commented May 14, 2024

Thank you for the report, looking into it .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Tables
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants