Skip to content
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

Merge Correlation Branch into Dev #1571

Merged
merged 24 commits into from
Nov 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
49aac11
Distributed Tracing (#1270)
TsuyoshiUshio May 14, 2020
feafb36
Distributed Tracing Samples, Documentation, and Video (#1298)
TsuyoshiUshio May 14, 2020
8455ac0
Merge branch 'dev' of https://github.com/Azure/azure-functions-durabl…
davidmrdavid Nov 18, 2020
5ff4af2
partial PR feedback
davidmrdavid Nov 20, 2020
477d5dd
deleted .gitignore in samples
davidmrdavid Nov 20, 2020
9900862
renamed sample
davidmrdavid Nov 20, 2020
2de2933
PR feedback
davidmrdavid Nov 23, 2020
4e925cb
added comments for tracktrace, removed duplicates
davidmrdavid Nov 23, 2020
80b3e7f
simplified csproj
davidmrdavid Nov 23, 2020
fd113b8
removed newline in csproj
davidmrdavid Nov 23, 2020
08a0eff
linter fix
davidmrdavid Nov 23, 2020
c8eb2f8
changed end2end test since now arg to setStatus cannot be null
davidmrdavid Nov 23, 2020
3c35bcd
updated yml to include application insights key
davidmrdavid Nov 23, 2020
3d0c03b
adding instrumentation key to missing locations in yml
davidmrdavid Nov 23, 2020
49b3322
Merge branch 'dev' of https://github.com/Azure/azure-functions-durabl…
davidmrdavid Nov 24, 2020
d6adc73
Merge branch 'dev' of https://github.com/Azure/azure-functions-durabl…
davidmrdavid Nov 24, 2020
e8d1b70
increased timeout
davidmrdavid Nov 24, 2020
795decd
minor test infrastructure changes
davidmrdavid Nov 24, 2020
c3bf64e
uncomment flaky test for WIP feature
davidmrdavid Nov 24, 2020
2f2e1aa
fully commented out test for WIP feature
davidmrdavid Nov 24, 2020
eba4edb
PR feedback
davidmrdavid Nov 25, 2020
45bde36
revert timeout expansion, removed whitespace
davidmrdavid Nov 25, 2020
c7ed37d
removed the unused AppAuthentication dependency
davidmrdavid Nov 25, 2020
2860f16
no null-coalescing in demo
davidmrdavid Nov 25, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
rerunMaxAttempts: 2
env:
AzureWebJobsStorage: $(AzureWebJobsStorage)
APPINSIGHTS_INSTRUMENTATIONKEY: $(APPINSIGHTS_INSTRUMENTATIONKEY)

- job: FunctionsV2Tests
pool:
Expand Down Expand Up @@ -78,6 +79,7 @@ jobs:
rerunMaxAttempts: 2
env:
AzureWebJobsStorage: $(AzureWebJobsStorage)
APPINSIGHTS_INSTRUMENTATIONKEY: $(APPINSIGHTS_INSTRUMENTATIONKEY)

- job: DurableAnalyzerTests
pool:
Expand Down Expand Up @@ -116,6 +118,7 @@ jobs:
rerunMaxAttempts: 2
env:
AzureWebJobsStorage: $(AzureWebJobsStorage)
APPINSIGHTS_INSTRUMENTATIONKEY: $(APPINSIGHTS_INSTRUMENTATIONKEY)

- job: PublishPipelineArtifact
dependsOn:
Expand Down
25 changes: 25 additions & 0 deletions samples/correlation-csharp/FunctionAppCorrelation.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29509.3
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunctionAppCorrelation", "FunctionAppCorrelation\FunctionAppCorrelation.csproj", "{F9428663-9742-4746-A434-D073CCD5395C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F9428663-9742-4746-A434-D073CCD5395C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F9428663-9742-4746-A434-D073CCD5395C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F9428663-9742-4746-A434-D073CCD5395C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F9428663-9742-4746-A434-D073CCD5395C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6D2AE1B1-FA1A-4E46-B75D-B9B01E570B50}
EndGlobalSection
EndGlobal
264 changes: 264 additions & 0 deletions samples/correlation-csharp/FunctionAppCorrelation/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,264 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# Azure Functions localsettings file
local.settings.json

# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/

# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

# NUNIT
*.VisualState.xml
TestResult.xml

# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c

# DNX
project.lock.json
project.fragment.lock.json
artifacts/

*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc

# Chutzpah Test files
_Chutzpah*

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb

# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap

# TFS 2012 Local Workspace
$tf/

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user

# JustCode is a .NET coding add-in
.JustCode

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*

# MightyMoose
*.mm.*
AutoTest.Net/

# Web workbench (sass)
.sass-cache/

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
#*.pubxml
*.publishproj

# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/

# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets

# Microsoft Azure Build Output
csx/
*.build.csdef

# Microsoft Azure Emulator
ecf/
rcf/

# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt

# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/

# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
node_modules/
orleans.codegen.cs

# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# SQL Server files
*.mdf
*.ldf

# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings

# Microsoft Fakes
FakesAssemblies/

# GhostDoc plugin setting file
*.GhostDoc.xml

# Node.js Tools for Visual Studio
.ntvs_analysis.dat

# Visual Studio 6 build log
*.plg

# Visual Studio 6 workspace options file
*.opt

# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions

# Paket dependency manager
.paket/paket.exe
paket-files/

# FAKE - F# Make
.fake/

# JetBrains Rider
.idea/
*.sln.iml

# CodeRush
.cr/

# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
27 changes: 27 additions & 0 deletions samples/correlation-csharp/FunctionAppCorrelation/Counter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using System.Threading.Tasks;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.DurableTask;
using Newtonsoft.Json;

namespace FunctionAppCorrelation
{
[JsonObject(MemberSerialization.OptIn)]
public class Counter
{
[JsonProperty("value")]
public int CurrentValue { get; set; }

public void Add(int amount) => this.CurrentValue += amount;

public void Reset() => this.CurrentValue = 0;

public int Get() => this.CurrentValue;

[FunctionName(nameof(Counter))]
public static Task Run([EntityTrigger] IDurableEntityContext ctx)
=> ctx.DispatchAsync<Counter>();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.DurableTask;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Newtonsoft.Json.Linq;

namespace FunctionAppCorrelation
{
/// <summary>
/// This example is for testing that Durable Entities work with the new correlation implementation.
/// </summary>
public class EntityOrchestration
{
private const string CounterName = "myCounter";

[FunctionName(nameof(IncrementOrchestration))]
public async Task<int> IncrementOrchestration(
[OrchestrationTrigger] IDurableOrchestrationContext context)
{
var entityId = new EntityId(nameof(Counter), CounterName);
await context.CallEntityAsync(entityId, "Add", 1);
var counter = await context.CallEntityAsync<int>(entityId, "Get");
counter++;
return counter;
}

[FunctionName(nameof(HttpStart_EntityCounter))]
public async Task<IActionResult> HttpStart_EntityCounter(
[HttpTrigger(AuthorizationLevel.Function, "get")] HttpRequest req,
[DurableClient] IDurableEntityClient entityClient,
[DurableClient] IDurableOrchestrationClient orchestrationClient)
{
var entityId = new EntityId(nameof(Counter), CounterName);
EntityStateResponse<JObject> stateResponse = await entityClient.ReadEntityStateAsync<JObject>(entityId);

await entityClient.SignalEntityAsync(entityId, "Add", 1);
var instanceId = await orchestrationClient.StartNewAsync(nameof(this.IncrementOrchestration), null);

return orchestrationClient.CreateCheckStatusResponse(req, instanceId);
}
}
}
Loading