Coder Social home page Coder Social logo

azure / azure-functions-templates Goto Github PK

View Code? Open in Web Editor NEW
340.0 73.0 193.0 9.16 MB

Azure functions templates for the azure portal, CLI, and VS

License: MIT License

C# 46.64% JavaScript 13.49% PowerShell 5.67% Python 20.94% TypeScript 6.71% F# 6.56%
azure-functions

azure-functions-templates's People

Contributors

ahmelsayed avatar aishwaryabh avatar alrod avatar anthonychu avatar bachuv avatar brettsam avatar cgillum avatar charles-gagnon avatar csigs avatar davidmrdavid avatar dependabot[bot] avatar fabiocav avatar francisco-gamino avatar hossam-nasr avatar jviau avatar kashimiz avatar kshyju avatar liliankasem avatar lucyzhang929 avatar maddydev avatar maiqbal11 avatar mathewc avatar mattchenderson avatar mhoeger avatar paulbatum avatar pragnagopa avatar soninaren avatar surgupta-msft avatar sylvanc avatar tsuyoshiushio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

azure-functions-templates's Issues

JS queue trigger template has confusing .id reference

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.

Cron Trigger expressions not supported

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 .

Queue Trigger Bash Function

Add output to Blob. If impossible let's remove the template. Make sure we have parameter name.
rename trigger queue to "samples-workitems"

Issue with webhook binding type "generic"

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".

ServiceBus template only supports queues

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.

Service Bus bindings need work

  1. There is a binding labelled "Service Bus" which is quite ambiguous (if its for service bus queues it should be labelled as such).
  2. The picker for a service bus queue should not be asking you to select a notification hub. These need to be different pickers!
  3. The label for the queue name box is "Which queue would you like to trigger off of" -- but you're not triggering, you're creating messages in this queue.

Easy Tables binding is confusing to Mobile Apps developers

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.

ServiceBus trigger parameter description and default values

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?

Queue Trigger PHP Function

Add output or consider deleting the template
rename trigger queue to "samples-workitems"
rename template to include the output to

Blob trigger node.js - change path name from sample-workitems to myblob

not a huge priority but couple of issues with current name:

  1. sample-workitems sounds more like a queue not a file folder
  2. having a dash is illegal for table storage (even though it is ok for blob storage might as well make it consistent)
    1. new name will be similar to the name of the object in code

Queue Trigger Powershell Function

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

Blob trigger node.js template throws errors

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()

GitHub webhook template needs instructions

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).

C# http template returns JSON / XML instead of plain text

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.

Queue Trigger Batch Function

Change name to Queue Trigger to Blob Batch Function
rename trigger queue to "samples-workitems"
Change name of output parameter to Out-Blob

ServiceBusQueue binding connection string error

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.

Fix Node.js HTTP template log output

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);

Remove runOnStartup from timer binding and template

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.

Queue Trigger Nodejs

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.