Hello @evisha - Thank you for providing additional info in the comment. You likely have a minor misconfiguration relating to v3 to v4 programming models somewhere in your local project stack. I was able to test your use case (HTTP trigger with Blob output) for v4 programming model without any issues and thought this might help:
- Here's my
src/functions/httpTrigger.js
file:
const { app, output } = require('@azure/functions');
const blobOutput = output.storageBlob({
connection: "AzureWebJobsStorage",
path: "subfolder/{DateTime:MM-dd-yyyy H:mm:ss}.json",
});
async function httpTrigger1(request, context){
context.log(`Http function processed request for url "${request.url}"`);
const name = request.query.get('name') || await request.text() || 'world';
context.extraOutputs.set(blobOutput, 'here goes blob content');
return { body: `Hello, ${name}!` };
};
app.http('httpTrigger1', {
methods: ['GET', 'POST'],
extraOutputs: [blobOutput],
authLevel: 'anonymous',
handler: httpTrigger1
});
- Here's the
package.json
file (unchanged):
{
"name": "nodejs-functionapp-v4",
"version": "1.0.0",
"description": "",
"scripts": {
"start": "func start",
"test": "echo \"No tests yet...\""
},
"dependencies": {
"@azure/functions": "^4.0.0"
},
"devDependencies": {},
"main": "src/functions/*.js"
}
- Resulting files created in Blob container:
I hope the above helps & gets you unblocked. If you still hit the same issue, or have any follow-up questions, let me know in the comments below.
Please "Accept Answer" if the answer is helpful so that others in the community may benefit from your experience.