Skip to content

Commit 11a28a9

Browse files
authored
Add node v4 programming model sample (#830)
* add node v4 model sample * add local settings json and set trace logging * add samples-js-v4 to docs
1 parent a3c928d commit 11a28a9

File tree

13 files changed

+321
-0
lines changed

13 files changed

+321
-0
lines changed

docs/SetupGuide_Javascript.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
- [Samples for Output Bindings](#samples-for-output-bindings)
2020
- [Array](#array)
2121
- [Single Row](#single-row)
22+
- [Node V4 Model](#node-v4-model)
2223

2324
## Setup Function Project
2425

@@ -201,3 +202,7 @@ See the [AddProductsArray](https://github.com/Azure/azure-functions-sql-extensio
201202
#### Single Row
202203

203204
See the [AddProduct](https://github.com/Azure/azure-functions-sql-extension/tree/main/samples/samples-js/AddProduct) sample
205+
206+
## Node V4 Model
207+
208+
See the Node V4 Model samples [here](https://github.com/Azure/azure-functions-sql-extension/tree/main/samples/samples-js-v4/). More information about the Node V4 Model can be found [here](https://learn.microsoft.com/azure/azure-functions/functions-node-upgrade-v4?tabs=azure-cli-set-indexing-flag%2Cv4).

samples/samples-js-v4/.funcignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
*.js.map
2+
*.ts
3+
.git*
4+
.vscode
5+
__azurite_db*__.json
6+
__blobstorage__
7+
__queuestorage__
8+
local.settings.json
9+
test
10+
tsconfig.json

samples/samples-js-v4/.gitignore

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
9+
# Diagnostic reports (https://nodejs.org/api/report.html)
10+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11+
12+
# Runtime data
13+
pids
14+
*.pid
15+
*.seed
16+
*.pid.lock
17+
18+
# Directory for instrumented libs generated by jscoverage/JSCover
19+
lib-cov
20+
21+
# Coverage directory used by tools like istanbul
22+
coverage
23+
24+
# nyc test coverage
25+
.nyc_output
26+
27+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
28+
.grunt
29+
30+
# Bower dependency directory (https://bower.io/)
31+
bower_components
32+
33+
# node-waf configuration
34+
.lock-wscript
35+
36+
# Compiled binary addons (https://nodejs.org/api/addons.html)
37+
build/Release
38+
39+
# Dependency directories
40+
node_modules/
41+
jspm_packages/
42+
43+
# TypeScript v1 declaration files
44+
typings/
45+
46+
# Optional npm cache directory
47+
.npm
48+
49+
# Optional eslint cache
50+
.eslintcache
51+
52+
# Optional REPL history
53+
.node_repl_history
54+
55+
# Output of 'npm pack'
56+
*.tgz
57+
58+
# Yarn Integrity file
59+
.yarn-integrity
60+
61+
# dotenv environment variables file
62+
.env
63+
.env.test
64+
65+
# parcel-bundler cache (https://parceljs.org/)
66+
.cache
67+
68+
# next.js build output
69+
.next
70+
71+
# nuxt.js build output
72+
.nuxt
73+
74+
# vuepress build output
75+
.vuepress/dist
76+
77+
# Serverless directories
78+
.serverless/
79+
80+
# FuseBox cache
81+
.fusebox/
82+
83+
# DynamoDB Local files
84+
.dynamodb/
85+
86+
# TypeScript output
87+
dist
88+
out
89+
90+
# Azure Functions artifacts
91+
bin
92+
obj
93+
appsettings.json
94+
local.settings.json
95+
96+
# Azurite artifacts
97+
__blobstorage__
98+
__queuestorage__
99+
__azurite_db*__.json
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"recommendations": [
3+
"ms-azuretools.vscode-azurefunctions"
4+
]
5+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Attach to Node Functions",
6+
"type": "node",
7+
"request": "attach",
8+
"port": 9229,
9+
"preLaunchTask": "func: host start"
10+
}
11+
]
12+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"azureFunctions.deploySubpath": ".",
3+
"azureFunctions.postDeployTask": "npm install (functions)",
4+
"azureFunctions.projectLanguage": "JavaScript",
5+
"azureFunctions.projectRuntime": "~4",
6+
"debug.internalConsoleOptions": "neverOpen",
7+
"azureFunctions.projectLanguageModel": 4,
8+
"azureFunctions.preDeployTask": "npm prune (functions)"
9+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"type": "func",
6+
"label": "func: host start",
7+
"command": "host start",
8+
"problemMatcher": "$func-node-watch",
9+
"isBackground": true,
10+
"dependsOn": "npm install (functions)"
11+
},
12+
{
13+
"type": "shell",
14+
"label": "npm install (functions)",
15+
"command": "npm install"
16+
},
17+
{
18+
"type": "shell",
19+
"label": "npm prune (functions)",
20+
"command": "npm prune --production",
21+
"problemMatcher": []
22+
}
23+
]
24+
}

samples/samples-js-v4/host.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"version": "2.0",
3+
"logging": {
4+
"applicationInsights": {
5+
"samplingSettings": {
6+
"isEnabled": true,
7+
"excludedTypes": "Request"
8+
}
9+
},
10+
"logLevel": {
11+
"default": "Trace"
12+
}
13+
},
14+
"extensionBundle": {
15+
"id": "Microsoft.Azure.Functions.ExtensionBundle.Preview",
16+
"version": "[4.*, 5.0.0)"
17+
}
18+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"IsEncrypted": false,
3+
"Values": {
4+
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
5+
"FUNCTIONS_WORKER_RUNTIME": "node",
6+
"AzureWebJobsFeatureFlags": "EnableWorkerIndexing",
7+
"SqlConnectionString": ""
8+
}
9+
}

samples/samples-js-v4/package-lock.json

Lines changed: 63 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)