Skip to content

Commit

Permalink
docs for ETag validation
Browse files Browse the repository at this point in the history
  • Loading branch information
PalmEmanuel committed Mar 21, 2024
1 parent 898e1e9 commit bf10475
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ The format is based on and uses the types of changes according to [Keep a Change

## [Unreleased]

### Added

- ETag validation for Update- & Remove-AzDataTableEntity ([#58](https://github.com/PalmEmanuel/AzBobbyTables/issues/58))

### Fixed

- Missing examples of Remove-AzDataTableEntity

## [3.1.3] - 2024-01-20

### Added
Expand Down
14 changes: 14 additions & 0 deletions docs/help/Remove-AzDataTableEntity.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,20 @@ PS C:\> Remove-AzDataTableEntity -Entity $Users -Context $Context

Gets all users with the last name "Tables" from the table using a system-assigned managed identity, then removes the users.

### Example 4

```powershell
PS C:\> $Context = New-AzDataTableContext -TableName $TableName -ConnectionString $ConnectionString
PS C:\> $Users = Get-AzDataTableEntity -Filter "LastName eq 'Tables'" -Context $Context
PS C:\> # Imagine that the users are updated somewhere else
PS C:\> Remove-AzDataTableEntity -Entity $Users -Context $Context
PS C:\> # ERROR - The ETag of Users do not match
PS C:\> Remove-AzDataTableEntity -Entity $Users -Context $Context -Force
PS C:\> # OK - The -Force switch overrides ETag validation
```

Force remove all users with the last name Tables, overriding ETag validation.

## PARAMETERS

### -Context
Expand Down
19 changes: 17 additions & 2 deletions docs/help/Update-AzDataTableEntity.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,28 @@ The PartitionKey and RowKey cannot be updated.
### Example 1

```powershell
PS C:\> $UserEntity = Get-AzDataTableEntity -Filter "FirstName eq 'Bobby'" -TableName $TableName -ConnectionString $ConnectionString
PS C:\> $Context = New-AzDataTableContext -TableName $TableName -ConnectionString $ConnectionString
PS C:\> $UserEntity = Get-AzDataTableEntity -Filter "FirstName eq 'Bobby'" -Context $Context
PS C:\> $UserEntity['LastName'] = 'Tables'
PS C:\> Update-AzDataTableEntity -Entity $UserEntity -TableName $TableName -ConnectionString $ConnectionString
PS C:\> Update-AzDataTableEntity -Entity $UserEntity -Context $Context
```

Update the last name of the user "Bobby" to "Tables" using a connection string.

### Example 2

```powershell
PS C:\> $Context = New-AzDataTableContext -TableName $TableName -ConnectionString $ConnectionString
PS C:\> $UserEntity = Get-AzDataTableEntity -Filter "FirstName eq 'Bobby'" -Context $Context
PS C:\> $UserEntity['LastName'] = 'Tables'
PS C:\> # Imagine that the user is updated somewhere else
PS C:\> Update-AzDataTableEntity -Entity $UserEntity -Context $Context
PS C:\> # ERROR - The ETag of UserEntity does not match
PS C:\> Update-AzDataTableEntity -Entity $UserEntity -Context $Context -Force
```

Force update the last name of the user "Bobby" to "Tables" using a connection string, overriding ETag validation.

## PARAMETERS

### -Context
Expand Down

0 comments on commit bf10475

Please sign in to comment.