-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(azure-functions): support Azure Functions programming model v4
See https://learn.microsoft.com/en-ca/azure/azure-functions/functions-node-upgrade-v4 This builds on the work in #4178 by @qzxlkj (type that 5 times fast), which provide most of the runtime code fix. The rest of this is adding testing and updated examples and docs. Refs: #4178 Closes: #3185
- Loading branch information
Showing
43 changed files
with
613 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 0 additions & 12 deletions
12
test/instrumentation/azure-functions/fixtures/AJsAzureFnApp/README.md
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
test/instrumentation/azure-functions/fixtures/azfunc3/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
A Node.js Azure Functions app, using **version 3** of the Node.js | ||
programming model. See: | ||
https://learn.microsoft.com/en-ca/azure/azure-functions/functions-node-upgrade-v4 |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../fixtures/AJsAzureFnApp/package-lock.json → ...ctions/fixtures/azfunc3/package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
10 changes: 10 additions & 0 deletions
10
test/instrumentation/azure-functions/fixtures/azfunc4/.funcignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
*.js.map | ||
*.ts | ||
.git* | ||
.vscode | ||
local.settings.json | ||
test | ||
getting_started.md | ||
node_modules/@types/ | ||
node_modules/azure-functions-core-tools/ | ||
node_modules/typescript/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
lockfile-version=3 |
3 changes: 3 additions & 0 deletions
3
test/instrumentation/azure-functions/fixtures/azfunc4/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
A Node.js Azure Functions app, using **version 4** of the Node.js | ||
programming model. See: | ||
https://learn.microsoft.com/en-ca/azure/azure-functions/functions-node-upgrade-v4 |
15 changes: 15 additions & 0 deletions
15
test/instrumentation/azure-functions/fixtures/azfunc4/host.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"version": "2.0", | ||
"logging": { | ||
"applicationInsights": { | ||
"samplingSettings": { | ||
"isEnabled": true, | ||
"excludedTypes": "Request" | ||
} | ||
} | ||
}, | ||
"extensionBundle": { | ||
"id": "Microsoft.Azure.Functions.ExtensionBundle", | ||
"version": "[4.*, 5.0.0)" | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
test/instrumentation/azure-functions/fixtures/azfunc4/initapm.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and other contributors where applicable. | ||
* Licensed under the BSD 2-Clause License; you may not use this file except in | ||
* compliance with the BSD 2-Clause License. | ||
*/ | ||
|
||
// For the normal use case an "initapm.js" would look like: | ||
// module.exports = require('elastic-apm-node').start(/* { ... } */) | ||
|
||
console.log('initapm: XXX start'); | ||
module.exports = require('../../../../../').start({ | ||
// XXX remove all this config before merging | ||
// XXX | ||
logLevel: 'trace', | ||
apiRequestTime: '5s', | ||
// XXX traceContext Qs | ||
traceContinuationStrategy: 'restart_external', | ||
// XXX not fancy yet | ||
cloudProvider: 'none', | ||
centralConfig: false, | ||
metricsInterval: '0s', | ||
}); | ||
console.log('initapm: XXX done'); |
14 changes: 14 additions & 0 deletions
14
test/instrumentation/azure-functions/fixtures/azfunc4/local.settings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"IsEncrypted": false, | ||
"Values": { | ||
"FUNCTIONS_WORKER_RUNTIME": "node", | ||
"AzureWebJobsStorage": "", | ||
|
||
"FUNCTIONS_EXTENSION_VERSION": "~4", | ||
"WEBSITE_SITE_NAME": "azfunc4", | ||
"WEBSITE_OWNER_NAME": "2491fc8e-f7c1-4020-b9c6-78509919fd16+my-resource-group-ARegionShortNamewebspace", | ||
"WEBSITE_RESOURCE_GROUP": "my-resource-group", | ||
"WEBSITE_INSTANCE_ID": "test-website-instance-id", | ||
"REGION_NAME": "test-region-name" | ||
} | ||
} |
Oops, something went wrong.