-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding SignalR template as an item template for VS (#967)
Added signalR to itemTemplates for VS
- Loading branch information
Showing
13 changed files
with
132 additions
and
17 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
86 changes: 86 additions & 0 deletions
86
...emplates/Templates/SignalRConnectionInfoHttpTrigger-CSharp/.template.config/template.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,86 @@ | ||
{ | ||
"author": "Microsoft", | ||
"classifications": [ | ||
"Azure Function", | ||
"Trigger", | ||
"Http", | ||
"SignalR" | ||
], | ||
"name": "SignalRTrigger", | ||
"identity": "Azure.Function.CSharp.SignalR.2.x", | ||
"groupIdentity": "Azure.Function.SignalR", | ||
"shortName": "signalr", | ||
"tags": { | ||
"language": "C#", | ||
"type": "item" | ||
}, | ||
"sourceName": "SignalRConnectionInfoHttpTriggerCSharp", | ||
"symbols": { | ||
"namespace": { | ||
"description": "namespace for the generated code", | ||
"replaces": "Company.Function", | ||
"type": "parameter" | ||
}, | ||
"AccessRights": { | ||
"type": "parameter", | ||
"description": "Authorization level controls whether the function requires an API key and which key to use; Function uses a function key; Admin uses your master key. The function and master keys are found in the 'keys' management panel on the portal, when your function is selected.", | ||
"datatype": "choice", | ||
"choices": [ | ||
{ | ||
"choice": "Function", | ||
"description": "Function" | ||
}, | ||
{ | ||
"choice": "Anonymous", | ||
"description": "Anonymous" | ||
}, | ||
{ | ||
"choice": "Admin", | ||
"description": "Admin" | ||
} | ||
], | ||
"replaces": "AuthLevelValue", | ||
"defaultValue": "Function" | ||
}, | ||
"HubName": { | ||
"description": "SignalR Hub Name", | ||
"replaces": "HubValue", | ||
"type": "parameter" | ||
} | ||
}, | ||
"primaryOutputs": [ | ||
{ | ||
"path": "SignalRConnectionInfoHttpTriggerCSharp.cs" | ||
} | ||
], | ||
"defaultName": "SignalRConnectionInfoHttpTriggerCSharp", | ||
"postActions": [ | ||
{ | ||
"Description": "Adding Reference to Microsoft.Azure.WebJobs.Extensions.SignalRService Nuget package", | ||
"ActionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", | ||
"ContinueOnError": "true", | ||
"ManualInstructions": [], | ||
"args": { | ||
"referenceType": "package", | ||
"reference": "Microsoft.Azure.WebJobs.Extensions.SignalRService", "version": "1.2.0", | ||
"projectFileExtensions": ".csproj" | ||
} | ||
}, | ||
{ | ||
"description": "Restore NuGet packages required by this project.", | ||
"manualInstructions": [], | ||
"actionId": "210D431B-A78B-4D2F-B762-4ED3E3EA9025", | ||
"continueOnError": true | ||
}, | ||
{ | ||
"condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")", | ||
"description": "Opens the function class file in the editor", | ||
"manualInstructions": [], | ||
"actionId": "84C0DA21-51C8-4541-9940-6CA19AF04EE6", | ||
"args": { | ||
"files": "0" | ||
}, | ||
"continueOnError": true | ||
} | ||
] | ||
} |
38 changes: 38 additions & 0 deletions
38
...es/Templates/SignalRConnectionInfoHttpTrigger-CSharp/.template.config/vs-2017.3.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,38 @@ | ||
{ | ||
"name": { | ||
"text": "SignalR", | ||
"package": "{E9BCFE2B-304A-4D7F-836F-F3A4FB1A1451}", | ||
"id": "2180" | ||
}, | ||
"description": { | ||
"text": "The following example shows a C# function that acquires SignalR connection information using the input binding and returns it over HTTP.", | ||
"package": "{E9BCFE2B-304A-4D7F-836F-F3A4FB1A1451}", | ||
"id": "2181" | ||
}, | ||
"order": 900, | ||
"icon": "vs-2017.3/functionF.png", | ||
"learnMoreLink": "https://go.microsoft.com/fwlink/?linkid=848145", | ||
"uiFilters": [ | ||
"functions" | ||
], | ||
"symbolInfo": [ | ||
{ | ||
"id": "AccessRights", | ||
"name": { | ||
"id": "2182", | ||
"text": "Authorization level controls whether the function requires an API key and which key to use; Function uses a function key; Admin uses your master key. The function and master keys are found in the 'keys' management panel on the portal, when your function is selected.", | ||
"package": "{E9BCFE2B-304A-4D7F-836F-F3A4FB1A1451}" | ||
}, | ||
"isVisible": true | ||
}, | ||
{ | ||
"id": "HubName", | ||
"name": { | ||
"id": "2183", | ||
"text": "Hub name", | ||
"package": "{E9BCFE2B-304A-4D7F-836F-F3A4FB1A1451}" | ||
}, | ||
"isVisible": true | ||
} | ||
] | ||
} |
Binary file added
BIN
+554 Bytes
...onnectionInfoHttpTrigger-CSharp/.template.config/vs-2017.3/functionF-mac-32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1003 Bytes
...ectionInfoHttpTrigger-CSharp/.template.config/vs-2017.3/functionF-mac-32@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+527 Bytes
...tionInfoHttpTrigger-CSharp/.template.config/vs-2017.3/functionF-mac-32~dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+930 Bytes
...nInfoHttpTrigger-CSharp/.template.config/vs-2017.3/functionF-mac-32~dark@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+385 Bytes
...InfoHttpTrigger-CSharp/.template.config/vs-2017.3/functionF-mac-32~dark~sel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+635 Bytes
...oHttpTrigger-CSharp/.template.config/vs-2017.3/functionF-mac-32~dark~sel@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+385 Bytes
...ctionInfoHttpTrigger-CSharp/.template.config/vs-2017.3/functionF-mac-32~sel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+635 Bytes
...onInfoHttpTrigger-CSharp/.template.config/vs-2017.3/functionF-mac-32~sel@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+735 Bytes
...ignalRConnectionInfoHttpTrigger-CSharp/.template.config/vs-2017.3/functionF.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 4 additions & 17 deletions
21
...mplates/SignalRConnectionInfoHttpTrigger-CSharp/SignalRConnectionInfoHttpTriggerCSharp.cs
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 |
---|---|---|
@@ -1,31 +1,18 @@ | ||
#if (portalTemplates) | ||
#r "Microsoft.Azure.WebJobs.Extensions.SignalRService" | ||
#endif | ||
#if (vsTemplates) | ||
using Microsoft.AspNetCore.Http; | ||
using Microsoft.AspNetCore.Http; | ||
using Microsoft.Azure.WebJobs; | ||
using Microsoft.Azure.WebJobs.Extensions.Http; | ||
#endif | ||
using Microsoft.Azure.WebJobs.Extensions.SignalRService; | ||
|
||
#if (portalTemplates) | ||
public static SignalRConnectionInfo Run(HttpRequest req, SignalRConnectionInfo connectionInfo) | ||
{ | ||
return connectionInfo; | ||
} | ||
#endif | ||
#if (vsTemplates) | ||
namespace Company.Function | ||
{ | ||
public static class SignalRConnectionInfoHttpTriggerCSharp | ||
{ | ||
[FunctionName("negotiate")] | ||
public static SignalRConnectionInfo Negotiate( | ||
[HttpTrigger(AuthorizationLevel.Anonymous, "post")] HttpRequest req, | ||
[SignalRConnectionInfo(HubName = "chat")] SignalRConnectionInfo connectionInfo) | ||
[HttpTrigger(AuthorizationLevel.AuthLevelValue, "post")] HttpRequest req, | ||
[SignalRConnectionInfo(HubName = "HubValue")] SignalRConnectionInfo connectionInfo) | ||
{ | ||
return connectionInfo; | ||
} | ||
} | ||
} | ||
#endif | ||
} |