Azure / Azure/azure-functions-nodejs-library
Reduce confusion for "magic" binding expressions
- Dominant language
- TypeScript
- Stars
- 70
- Forks
- 35
- Avg merge
- 4d 18h
- Merged PRs (30d)
- 6
Description
We've had several people get confused by these (example [1](https://github.com/Azure/azure-functions-nodejs-library/issues/103), [2](https://github.com/Azure/azure-functions-nodejs-library/issues/84), [3](https://github.com/Azure/azure-functions-nodejs-library/discussions/152#discussioncomment-7209198)). I think the main problem is that these are hard-coded string values that basically perform magic under the covers and the documentation is hard-to-find. Would be nice if we could add some Intellisense or helper methods to make it easier to understand.
Example [binding expression](https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-expressions-patterns):
```typescript
const blobOutput = output.storageBlob({
connection: "AzureWebJobsStorage",
path: "helloworld/{DateTime:MM-dd-yyyy H:mm:ss}.json",
});
```
Example [route parameter](https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-http-webhook-trigger?pivots=programming-language-javascript#using-route-parameters):
```typescript
app.http('httpTrigger1', {
methods: ['GET', 'POST'],
authLevel: 'anonymous',
route: 'httpTrigger1/{id}',
handler: httpTrigger1
});
```
Contributor guide
Assessment
This issue has not been assessed yet.