Azure / Azure/azure-functions-nodejs-library

Does sql input binding support parsing of x-www-form-urlencoded form bodies?

Open
#320 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
70
Forks
35
Avg merge
4d 18h
Merged PRs (30d)
6

Description

Hello,

I am trying to do the following
```javascript
const inputSQL = input.sql({
commandText: 'SELECT * FROM schema.user u WHERE u.email = @email',
commandType: 'Text',
parameters: '@email={email}',
connectionStringSetting: 'SqlConnectionString',
})
```

where the request content type is
`application/x-www-form-urlencoded`

and body is
`email=sample%40email.com&password=supersecretpassword`

As a result I get the following error
```
[2024-12-12T16:55:30.691Z] Executed 'Functions.belogin' (Failed, Id=96c0e3e6-4aff-4f26-b43f-22abf9944aa0, Duration=13ms)
[2024-12-12T16:55:30.695Z] System.Private.CoreLib: Exception while executing function: Functions.belogin. Microsoft.Azure.WebJobs.Host: Error while accessing 'email': property doesn't exist.
```

Is there some secret sauce to parameter declaration that I haven't found, or do I have write additional code in frontend to send a JSON instead?

Thanks in advance.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.