Azure / Azure/azure-functions-sql-extension

Can't update a row in table with IDENTITY as primary key

Open
#891 8 comments 0 reactions 0 assignees View on GitHub
bug Needs Logs output-binding P0 Triage: Done
Dominant language
C#
Stars
130
Forks
71
Avg merge
4d 8h
Merged PRs (30d)
4

Description

When trying to update an existing row of data, get a 500 Internal Server Error. Works fine for creating a new row.

Looking at the function logs -

![image](https://github.com/Azure/azure-functions-sql-extension/assets/3673816/c56f7fc3-d9b1-4fcc-986d-b93bd92fe685)

Output binding -

![image](https://github.com/Azure/azure-functions-sql-extension/assets/3673816/c08549ed-372c-4586-8ed5-5ca0731f3fd6)

Table structure -

```
CREATE TABLE [dbo].[config_rs](
[ID] [int] IDENTITY(1,1) NOT NULL,
[SQL_COLUMN] [varchar](50) NOT NULL,
[DIVISION] [varchar](100) NOT NULL,
[WARD] [varchar](6) NULL,
[EXCLUDE_PARENT_DIV] [bit] NULL,
[COMPARISON] [int] NULL,
[OPERATOR] [varchar](20) NULL,
[SCORE] [int] NOT NULL,
CONSTRAINT [PK_config_rs] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
```

Request Payload -

![image](https://github.com/Azure/azure-functions-sql-extension/assets/3673816/8f1445ff-a8e7-4138-aca3-3a99fc0e2975)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the update against the provided IDENTITY-keyed table schema, then inspect the function logs and request payload shown in the issue. Done means an existing row updates successfully without returning a 500 error.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp, sql
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.