azure / azure-functions-templates Goto Github PK
View Code? Open in Web Editor NEWAzure functions templates for the azure portal, CLI, and VS
License: MIT License
Azure functions templates for the azure portal, CLI, and VS
License: MIT License
Most current templates only have an input binding, making it hard for users to get up to speed. They can use UI to create output bindings, but then they're on their own with the code.
Some related discussions on Azure/azure-functions-host#93.
The template has this code:
module.exports = function (context, myQueueItem) {
context.log('Node.js queue trigger function processed work item', myQueueItem.id);
context.done();
};
The confusing thing is that this .id reference is not referring to the actual azure queue id of the message.. its based on the sample data having an ID property.
To make this sample less confusing, lets change the sample data to something else.
readme.md is specific to C#
When using the ServiceBusQueueTrigger template, I have a function with a trigger only
The current template has an trigger and an output binding
App: functions1f748f5a
I used http://www.cronmaker.com/ (from google search) to generate a few expressions
e.g
hourly
0 0 0/1 1/1 * ? *
every minute
0 0/1 * 1/1 * ? *
but we dont seem to support them.
2016-03-29T17:49:28.083 Microsoft.Azure.WebJobs.Host: Error indexing method 'Functions.TimerTriggerCSharp1'. mscorlib: String was not recognized as a valid TimeSpan.
We should validate the expressions upfront, a UI to generate working expressions would also be handy .
We need a template for Event Hub Trigger C#
Right now only app setting is allowed for specifying MobileApp Uri:
What is the app setting that specifies the URL of your Mobile App?
We should accept url directly as it is not a secret.
Service Bus Trigger template for C# doesn't exist and the Node version is in experimental
These aren't in a good enough state yet. We can bring them back after beta, but we need to remove them now.
Currently, WebHooks use code=...
(coming from WebHook SDK), while plain http use key=...
(coming from our own logic).
One way or another, let's find a way to make them be the same.
Add output to Blob. If impossible let's remove the template. Make sure we have parameter name.
rename trigger queue to "samples-workitems"
We need an easy way to validate that the templates are in good shape.
The help text for the "connection" value mentions support for %%. We should remove this - these values need to be unadorned app setting names.
Related issue:
https://github.com/projectkudu/WebJobsPortal/issues/149
There is no such thing as webhookType: "generic". The drop down should instead have an option that says "Generic JSON" and this should correspond to webhookType: "genericJson".
The current templates only supports using service bus queues. There is no option to use a topic and the user must go into the advanced editor and have knowledge of the property name.
We're likely dealing with a UI limitation here as well, but we could address this by having one template for Service Bus Queues and another for Service Bus Topics in the meantime.
The input object for "partition key" is invalid. Currently {project-id}
. Receive this error when used: Invalid template '{project-id}'. The parameter name 'project-id' is invalid.
Portal will use the "defaultFunctionName" parameter to drive a "default" name for new template creation
Some bindings won't behave the same when used in node vs when used in C#. It'd be nice if we could restrict a binding to supported languages until they're updated, tested, and verified.
As far as I can tell, it works. Any reason not to move it now? This is a core scenario and we need to have it in good shape.
I do not think the current code looks approachable. This template probably needs to be rewritten from scratch.
Add output or consider deleting the template
rename trigger queue to "samples-workitems"
In Functions, the "Easy Tables" binding uses the URL of a mobile app, which it looks like can be any table exposed by a App Service mobile app. In Mobile Apps, an "Easy Table" is usually a Node.js backend service, since Easy Tables in the portal doesn't support .NET backend.
This makes "Easy Tables" confusingly overloaded. Instead of Easy Tables we should call it Mobile Tables.
Lets start with C# and Node.js. The template would include an empty function signature but no bindings.
We have a generic webhook template in the core category, but once you select it, you are asked to specify the type of webhook.
E.g., queues can't have upper case, and tables can't have dashes.
The service bus trigger incorrectly calls the input/trigger source output .
The current verbiage is:
Which queue would you like to output to?
When it should be (for consistency with storage queues):
Which queue should the trigger monitor?
Add output or consider deleting the template
rename trigger queue to "samples-workitems"
rename template to include the output to
We should let users know what values will work for their object names, etc.
To read a single entity and bind to a POCO type you need to specify rowKey but when you add a table input binding in the portal, rowKey is not offered as a field to enter.
not a huge priority but couple of issues with current name:
Consider removing this one if we don't have a good powershell story. If not, this one seems to have table output so we either change to blob to be consistent with the other ones or at least rename the template to Queue Trigger to Table Storage Powershell Function
Created a blob template in node.js and it consistently throws the below errors (taken from the Webjob SDK dashboard)
Microsoft.Azure.WebJobs.Host.FunctionInvocationException: Microsoft.Azure.WebJobs.Host.FunctionInvocationException: Exception while executing function: Functions.BlobTriggerNodeJS1 ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Timeouts are not supported on this stream.
at System.IO.Stream.get_ReadTimeout()
at Microsoft.Azure.WebJobs.Host.Blobs.DelegatingStream.get_ReadTimeout()
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at ClrFunc.MarshalCLRObjectToV8(Localv8::Object* , Object netdata)
at ClrFunc.MarshalCLRToV8(Localv8::Value* , Object netdata)
at ClrFunc.MarshalCLRToV8(Localv8::Value* , Object netdata)
at ClrFunc.MarshalCLRToV8(Localv8::Value* , Object netdata)
at NodejsFuncInvokeContext.CallFuncOnV8Thread()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.WebJobs.Script.Description.NodeFunctionInvoker.d__16.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.WebJobs.Host.Executors.FunctionInvoker`1.d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.d__33.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.d__2e.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.d__15.MoveNext()
--- End of inner exception stack trace ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.d__2.MoveNext()
After creating an HttpTrigger when we called from within the portal returns 400 (Expected as per template). However when hitting the trigger from a browser returns 500.
Discussed this with Chris, he suggested that the code template should have a comment that includes instructions for setting up the webhook (or a link to some online instructions).
Not sure if this was a deliberate change, but raising it in case. Previously, HttpTriggerCSharp was returning text. Now, when I run it from portal, the response has JSON, e.g.
"Hello Azure"
What I don't like is that if you run copy the function your and run it from new tab, you get XML, e.g.
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">
Please pass a name on the query string or in the request body
</string>
That feels pretty heavy for what's supposed to be the simplest template. That may be a runtime issue rather than template.
Change name to Queue Trigger to Blob Batch Function
rename trigger queue to "samples-workitems"
Change name of output parameter to Out-Blob
Creating a function using the ServiceBusQueue trigger currently triggers the following error on function creation:
Microsoft.Azure.WebJobs.Host: Error indexing method 'Functions.servicebusssignoffnode'. Microsoft.Azure.WebJobs.ServiceBus: Microsoft Azure WebJobs SDK ServiceBus connection string 'AzureWebJobs' is missing or empty.
2016-03-29T20:55:45 Welcome, you are now connected to log-streaming service.
An upcoming update in the scripts repo will help with the "broken"-ness of the non-CS/JS languages. We should rename that category to experimental.
Input binding queries the given table name. Following text needs to be updated:
To which table should the data be sent?
The Name= output is wrong. It outputs the full url, not a name. Should be RequestUri= like the C# sample.
context.log('Node.js HTTP trigger function processed a request. Name=' + req.originalUrl);
RunOnStartup has a problem where it will run every time that the function app gets loaded up due to other bindings (such as another function reading queue messages). This means that the function wont actually run according to the schedule. We need to remove it from the templates and the binding.json so that this option is disabled.
I would expect a JS suffix.
Change name to: Queue Trigger to Blob Node.js Function
Add a parameter name for the trigger, if we can't, we should block the UX for the parameter name in the trigger
Rename the output blob from "receipt" to Out-Blob
Have an option for default storage account connection (filed separately in the UX repo)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.