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: articles/azure-functions/functions-bindings-dapr.md
+67Lines changed: 67 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -260,6 +260,73 @@ Learn how to use the Dapr Extension for Azure Functions via the provided samples
260
260
261
261
::: zone-end
262
262
263
+
## Troubleshooting
264
+
265
+
This section describes how to troubleshoot issues that can occur when using the Dapr extension for Azure Functions.
266
+
267
+
### Ensure Dapr is enabled in your environment
268
+
269
+
If you're using Dapr bindings and triggers in Azure Functions, and Dapr isn't enabled in your environment, you might receive the error message: `Dapr sidecar isn't present. Please see (https://aka.ms/azure-functions-dapr-sidecar-missing) for more information.` To enable Dapr in your environment:
270
+
271
+
- If your Azure Function is deployed in Azure Container Apps, refer to [Dapr enablement instructions for the Dapr extension for Azure Functions](../azure-functions/functions-bindings-dapr.md#dapr-enablement).
272
+
273
+
- If your Azure Function is deployed in Kubernetes, verify that your [deployment's YAML configuration](https://github.com/azure/azure-functions-dapr-extension/blob/master/deploy/kubernetes/kubernetes-deployment.md#sample-kubernetes-deployment) has the following annotations:
274
+
275
+
```YAML
276
+
annotations:
277
+
...
278
+
dapr.io/enabled: "true"
279
+
dapr.io/app-id: "functionapp"
280
+
# You should only set app-port if you are using a Dapr trigger in your code.
281
+
dapr.io/app-port: "<DAPR_APP_PORT>"
282
+
...
283
+
```
284
+
285
+
- If you're running your Azure Function locally, run the following command to ensure you're [running the function app with Dapr](https://github.com/azure/azure-functions-dapr-extension/tree/master/samples/python-v2-azurefunction#step-2---run-function-app-with-dapr):
The Dapr extension for Azure Functions starts an HTTP server on port `3001` by default. You can configure this port using the [`DAPR_APP_PORT` environment variable](https://docs.dapr.io/reference/environment/).
294
+
295
+
If you provide an incorrect app port value when running an Azure Functions app, you might receive the error message: `The Dapr sidecar is configured to listen on port {portInt}, but the app server is running on port {appPort}. This may cause unexpected behavior. For more information, visit [this link](https://aka.ms/azfunc-dapr-app-config-error).`To resolve this error message:
296
+
297
+
1. In your container app's Dapr settings:
298
+
299
+
- If you're using a Dapr trigger in your code, verify that the app port is set to `3001` or to the value of the `DAPR_APP_PORT` environment variable.
300
+
301
+
- If you're _not_ using a Dapr trigger in your code, verify that the app port is _not_ set. It should be empty.
302
+
303
+
1. Verify that you provide the correct app port value in the Dapr configuration.
304
+
305
+
- If you're using Azure Container Apps, specify the app port in Bicep:
306
+
307
+
```bash
308
+
DaprConfig: {
309
+
...
310
+
appPort: <DAPR_APP_PORT>
311
+
...
312
+
}
313
+
```
314
+
315
+
- If you're using a Kubernetes environment, set the `dapr.io/app-port` annotation:
316
+
317
+
```
318
+
annotations:
319
+
...
320
+
dapr.io/app-port: "<DAPR_APP_PORT>"
321
+
...
322
+
```
323
+
324
+
- If you're developing locally, verify you set `--app-port` when running the function app with Dapr:
0 commit comments