This repository has been archived by the owner on Sep 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Updating to preview 5 #55
Open
fabiocav
wants to merge
1
commit into
main
Choose a base branch
from
fabiocav/preview4update
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+75
−64
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,32 @@ | ||
using System.Collections.Generic; | ||
using System.Net; | ||
using System.Reflection.PortableExecutable; | ||
using System.Text.Json; | ||
using Microsoft.Azure.Functions.Worker; | ||
using Microsoft.Azure.WebJobs; | ||
using Microsoft.Azure.WebJobs.Extensions.Http; | ||
using Microsoft.Azure.Functions.Worker.Extensions.Abstractions; | ||
using Microsoft.Azure.Functions.Worker.Extensions.Http; | ||
using Microsoft.Azure.Functions.Worker.Extensions.Storage; | ||
using Microsoft.Azure.Functions.Worker.Http; | ||
Comment on lines
+6
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this just be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment for all below! |
||
|
||
namespace FunctionApp | ||
{ | ||
public static class Function1 | ||
{ | ||
|
||
[FunctionName("Function1")] | ||
public static HttpResponseData Run( | ||
[HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequestData req, [Blob("test-samples/sample1.txt", Connection = "AzureWebJobsStorage")] string myBlob, | ||
[Queue("functionstesting2", Connection = "AzureWebJobsStorage")] OutputBinding<Book> book) | ||
[Function("Function1")] | ||
public static Result Run( | ||
[HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequestData req, | ||
[BlobInput("test-samples/sample1.txt", Connection = "AzureWebJobsStorage")] string myBlob) | ||
{ | ||
var bookVal = (Book)JsonSerializer.Deserialize(myBlob, typeof(Book)); | ||
book.SetValue(bookVal); | ||
var response = new HttpResponseData(HttpStatusCode.OK); | ||
var headers = new Dictionary<string, string>(); | ||
headers.Add("Date", "Mon, 18 Jul 2016 16:06:00 GMT"); | ||
headers.Add("Content", "Content - Type: text / html; charset = utf - 8"); | ||
|
||
var response = req.CreateResponse(HttpStatusCode.OK); | ||
response.Headers.Add("Date", "Mon, 18 Jul 2016 16:06:00 GMT"); | ||
response.Headers.Add("Content", "Content - Type: text / html; charset = utf - 8"); | ||
|
||
response.Headers = headers; | ||
response.Body = "Book Sent to Queue!"; | ||
response.WriteString("Book Sent to Queue!"); | ||
|
||
return response; | ||
return new Result { Response = response, Book = bookVal }; | ||
} | ||
|
||
public class Book | ||
|
@@ -34,5 +35,13 @@ public class Book | |
public string id { get; set; } | ||
} | ||
|
||
public class Result | ||
{ | ||
[QueueOutput("books", Connection = "AzureWebJobsStorage")] | ||
public Book Book { get; set; } | ||
|
||
public HttpResponseData Response { get; set; } | ||
} | ||
|
||
} | ||
} |
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
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
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
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
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 |
---|---|---|
|
@@ -12,13 +12,12 @@ | |
</Target> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<DocumentationFile></DocumentationFile> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Http" Version="3.0.12" /> | ||
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="4.0.3" /> | ||
<PackageReference Include="Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator" Version="1.2.0" /> | ||
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.0.0-preview4" OutputItemType="Analyzer" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.0.0-preview4" /> | ||
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.0.0-preview5" /> | ||
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.0.12-preview1" /> | ||
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Storage" Version="4.0.4-preview1" /> | ||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" /> | ||
<PackageReference Include="System.Net.NameResolution" Version="4.3.0" /> | ||
</ItemGroup> | ||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 required for something?