-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Code Samples for Netherite #72
New Code Samples for Netherite #72
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! Thanks a lot for creating these samples, I think they will be very helpful.
I had some minor comments and questions, see review. Also, I would suggest that you include the README.md in the typescript sample, since I found it very helpful.
@@ -25,7 +25,7 @@ public static class HelloCities | |||
{ | |||
[FunctionName(nameof(HelloCities))] | |||
public async static Task<IActionResult> Run( | |||
[HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = "hellocities")] HttpRequest req, | |||
[HttpTrigger(AuthorizationLevel.Function, "post", Route = "hellocities")] HttpRequest req, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using non-anonymous access makes it slightly more difficult to run this sample. I suppose there is a risk is that users will forget to secure this later (after copying the sample).
Still, simplicity of the sample is important so I would probably leave this anonymous. I had a quick look at DF samples and they use anonymous also (e.g. https://github.com/Azure/azure-functions-durable-extension/blob/dev/samples/javascript/HttpStart/function.json).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had the risk in mind, but you are right, the samples in the documentation are anonymous. I changed that for all implementations. I will make a remark in the documentation
"scriptFile": "__init__.py", | ||
"bindings": [ | ||
{ | ||
"authLevel": "function", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again, maybe use "anonymous"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
$Plan = "EP1", | ||
$MinNodes = "1", | ||
$MaxNodes = "20", | ||
$Runtime = "python", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this script specific to python now? Or are you setting this parameter when calling this script?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we could have runtime specific scripts that call this one, e.g. create-dotnet-function-app.ps1
, create-python-function-app.ps1
, create-typescript-function-app.ps1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I created three scripts now referencing the generic one.
$storageName = $name | ||
$planName = $name | ||
|
||
if (($name -eq "globally-unique-lowercase-alphanumeric-name-with-no-dashes")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this test condition should be updated to ($name -eq "testnetheritescripts")
... unless I am missing something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other way round - did not change that back to your setup after my last test
samples/scripts/request.http
Outdated
### Start Orchestrator Function via HTTP for Python and NodeJS | ||
POST http://localhost:7071/api/orchestrators/DurableFunctionsNetheriteOrchestrator | ||
|
||
### Start Orchestrator Function via HTPP for .NET Core |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HTPP -> HTTP
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Concerning the README-file. I will rework the documentation on the samples in the gh-pages branch and will take that into account |
The documentation is now also updated see pull request #73 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Thanks again.
I haven't tried running the samples on Linux yet, but at least on Windows it all works.
@lechnerc77, I am ready to merge this and #73, unless you have some additional changes you want to add first. |
@sebastianburckhardt : Nothing to add from my side - let the merging begin ;-) |
This pull request comprises additional code samples (TypeScript and Python) using Netherite in order to make the first steps easy for non-.NET users
It also contains some changes to the existing setup namely:
settings.ps1
now throws an exception in case that the name is not adopted, stopping the executionThere will be an additional pull-request to adopt the GitHub pages to the new structure