You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: samples/correlation-csharp/getting-started.md
+30-46Lines changed: 30 additions & 46 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,38 +8,38 @@ In this article, you use command-line tools to create a function app, then publi
8
8
9
9
# Create a function app
10
10
11
-
Go to Azure Portal, Click the cloud shell on the right top of the Azure Portal. Open Bash.
11
+
Go to the [Azure Portal](https://ms.portal.azure.com/), click the cloud shell icon on the right top of the Azure Portal, and select Bash from the dropdown if it's not already selected.
12
12
13
13

14
14
15
15
## Create a Resource Group
16
16
17
-
Create a resource group.
17
+
Run the following commands to create a resource group.
18
18
19
19
```bash
20
-
ResourceGroup=DurableFunctionsQucikstart-rg
20
+
ResourceGroup=DurableFunctionsQuickstart-rg
21
21
Location=westus
22
22
az group create --name $ResourceGroup --location $Location
23
23
```
24
24
## Create a Storage Account
25
25
26
-
Create a storage account. The storage account name should be globally unique.
26
+
Run the following commands to create a storage account. The storage account name should be globally unique.
**NOTE:** The samples targeting functions version 3. Distributed Tracing works for version 2 but not for version 1.
55
+
**NOTE:** The samples target Functions version 3. Distributed Tracing doesn't work for Functions version 1.
56
56
57
57
# Publish samples
58
58
59
+
Run the following commands on your local machine in a terminal of your choice.
60
+
These commands will clone the `azure-functions-durable-extension` repository and create a local branch where you can make modifications to local.settings.json and host.json before publishing.
Go to `samples/correlation-csharp/` then open FunctionAppCorrelation.sln with Visual Studio 2019.
70
+
Navigate to `samples/correlation-csharp/` then open FunctionAppCorrelation.sln with Visual Studio 2019.
68
71
69
-
## Create a local.settings.json
72
+
## Modify local.settings.json
70
73
71
-
Create your `local.settings.json` for local execution.
72
-
You can copy and modify `local.settings.json.example.` Set the Application Insights Key. If you are not familiar with the Application Insights key, refer to [Create an Application Insights resource](https://docs.microsoft.com/en-us/azure/azure-monitor/app/create-new-resource).
74
+
Update the `APPINSIGHTS_INSTRUMENTATIONKEY` value in `local.settings.json` with the `InstrumentationKey` created earlier.
Configure host.json. This JSON is the sample of the Distributed Tracing with the W3C trace context. Distributed Tracing is enabled by default. You need to configure the telemetry protocol. For more details, refer [reference](reference.md).
89
+
Configure host.json. The host.json sample below enables Distributed Tracing and sets [W3C Trace Context](https://github.com/Azure/azure-functions-durable-extension/blob/dev/samples/correlation-csharp/reference.md#w3ctracecontext) as the tracing protocol. The default value for `distributedTracingProtocol` is [HttpCorrelationTraceContext](https://github.com/Azure/azure-functions-durable-extension/blob/dev/samples/correlation-csharp/reference.md#httpcorrelationtracecontext).
88
90
89
91
```json
90
92
{
93
+
"version": "2.0",
91
94
"extensions": {
92
95
"durableTask": {
93
96
"tracing": {
94
-
"DistributedTracingProtocol": "W3CTraceContext"
97
+
"distributedTracingEnabled": true,
98
+
"distributedTracingProtocol": "W3CTraceContext"
95
99
}
96
100
}
97
101
},
98
102
"logging": {
99
103
"applicationInsights": {
100
104
"httpAutoCollectionOptions": {
101
105
"enableW3CDistributedTracing": true
102
-
}
106
+
}
103
107
}
104
-
},
105
-
"version": "2.0"
108
+
}
106
109
}
107
110
```
108
111
109
112
## Storage Emulator
110
113
For the local execution, you need the [Strorage Emulator](https://docs.microsoft.com/en-us/azure/storage/common/storage-use-emulator). Download it from the link and execute it before you run the functions.
111
114
112
-
## Configure NuGet
113
-
114
-
Goto the Package source on Visual Studio. Right-click FunctionAppCorrelation project, select `Manage NuGet packages...`, then click the icon.
115
-
116
-

117
-
118
-
Add Available package sources.
119
-
NOTE: Distributed Tracing is pre-release. We currently use myget.org until it is going to GA.
During pre-release, we use `Microsoft.Azure.WebJobs.Extensions.DurableTask.Telemetry` NuGet package start with Version `2.2.0-alpha`.
125
-
126
-
## Push the samples to the Function App
115
+
## Publish the samples to the Function App
127
116
128
117
Right-click the `FunctionAppCorrelation` project, then select `Publish.`
129
118
@@ -137,28 +126,23 @@ Then select the target function app. Then click `OK.`
137
126
138
127
## Run the samples
139
128
140
-
Refer to [the scenario](Readme.md#sample-scenario) that includes the samples. Some scenarios do not support distributed tracing. We'll support it in the future. For executing samples, call `HttpStart_*` functions as the endpoints.
141
-
142
-
If you can't pick one, you can try `/api/HttpStart_sampleOrchestration` on your FunctionApp. For the complex orchestration, try `/api/HttpStart_MultiLayerOrchestrationWithRetry`
143
-
144
-
Refer the [Sample scenario](Readme.md#sample-scenario).
129
+
Refer to the [sample scenarios section](Readme.md#sample-scenario) to find a list of available scenarios and descriptions. Please note that all scenarios are not supported yet.
130
+
To execute samples, call the `HttpStart_*` functions as the endpoints. For example, you can try sending a request to the `/api/HttpStart_SimpleOrchestration` endpoint of your Function App. To run a complex orchestration, try `/api/HttpStart_MultiLayerOrchestrationWithRetry`.
145
131
146
132
## Diagnose the Telemetry
147
133
148
-
Go to your Azure Portal, then go to your Application Insights resource.
149
-
Click `Search`on your left list. Filter it with `Last 30 minutes` and `Event types: Request.`You can see the `Start Orchestration` request. Click it.
134
+
To see the emitted telemetry, go to the Application Insights resource in the Azure Portal. You can easily find this by going to the `DurableFunctionsQuickstart-rg` resource group.
135
+
Once you have navigated to the Application Insights resource, click `Transaction Search`in the menu. Filter it with `Last 30 minutes` and `Event types: Request.`Click on the `Start Orchestration` request or any request that starts with 'Dt'.
150
136
151
137

152
138
153
-
Then You can see end-to-end tracing. Click and see how it correlates with each other.
139
+
You can see the end-to-end tracing here. Click and see how it correlates with each other.
154
140
155
141

156
142
157
-
**NOTE:**When you see the correlation breaks, you might wait for a while. The request telemetry of the first orchestrator comes last.
143
+
**NOTE:**If you see correlation breaks, you might have to wait for the telemetry to propagate to the Application Insights Resource. The request telemetry of the first orchestrator comes last.
0 commit comments