Skip to content

Commit 5d39348

Browse files
committed
Merge branch 'main' of https://github.com/MicrosoftDocs/azure-docs-pr into nat-bicep
2 parents 3155b84 + 787a3f9 commit 5d39348

File tree

8 files changed

+357
-26
lines changed

8 files changed

+357
-26
lines changed

articles/azure-functions/functions-bindings-dapr.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,73 @@ Learn how to use the Dapr Extension for Azure Functions via the provided samples
260260

261261
::: zone-end
262262

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):
286+
287+
```bash
288+
dapr run --app-id functionapp --app-port <DAPR_APP_PORT> --components-path <COMPONENTS_PATH> -- func host start
289+
```
290+
291+
### Verify app-port value in Dapr configuration
292+
293+
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:
325+
326+
```
327+
dapr run --app-id functionapp --app-port <DAPR_APP_PORT> --components-path <COMPONENTS_PATH> -- func host start
328+
```
329+
263330
## Next steps
264331

265332
[Learn more about Dapr.](https://docs.dapr.io/)

articles/azure-resource-manager/bicep/bicep-functions-array.md

Lines changed: 60 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
---
22
title: Bicep functions - arrays
33
description: Describes the functions to use in a Bicep file for working with arrays.
4-
author: mumian
54
ms.topic: conceptual
65
ms.custom: devx-track-bicep
7-
ms.author: jgao
8-
ms.date: 12/09/2022
6+
ms.date: 01/11/2024
97
---
108

119
# Array functions for Bicep
@@ -949,6 +947,8 @@ For arrays, the function iterates through each element in the first parameter an
949947

950948
For objects, property names and values from the first parameter are added to the result. For later parameters, any new names are added to the result. If a later parameter has a property with the same name, that value overwrites the existing value. The order of the properties isn't guaranteed.
951949

950+
The union function merges not only the top-level elements but also recursively merges any nested objects within them. Nested array values are not merged. See the second example in the following section.
951+
952952
### Example
953953

954954
The following example shows how to use union with arrays and objects:
@@ -989,6 +989,63 @@ The output from the preceding example with the default values is:
989989
| objectOutput | Object | {"one": "a", "two": "b", "three": "c2", "four": "d", "five": "e"} |
990990
| arrayOutput | Array | ["one", "two", "three", "four"] |
991991

992+
The following example shows the deep merge capability:
993+
994+
```bicep
995+
var firstObject = {
996+
property: {
997+
one: 'a'
998+
two: 'b'
999+
three: 'c1'
1000+
}
1001+
nestedArray: [
1002+
1
1003+
2
1004+
]
1005+
}
1006+
var secondObject = {
1007+
property: {
1008+
three: 'c2'
1009+
four: 'd'
1010+
five: 'e'
1011+
}
1012+
nestedArray: [
1013+
3
1014+
4
1015+
]
1016+
}
1017+
var firstArray = [
1018+
[
1019+
'one'
1020+
'two'
1021+
]
1022+
[
1023+
'three'
1024+
]
1025+
]
1026+
var secondArray = [
1027+
[
1028+
'three'
1029+
]
1030+
[
1031+
'four'
1032+
'two'
1033+
]
1034+
]
1035+
1036+
output objectOutput object = union(firstObject, secondObject)
1037+
output arrayOutput array = union(firstArray, secondArray)
1038+
```
1039+
1040+
The output from the preceding example is:
1041+
1042+
| Name | Type | Value |
1043+
| ---- | ---- | ----- |
1044+
| objectOutput | Object |{"property":{"one":"a","two":"b","three":"c2","four":"d","five":"e"},"nestedArray":[3,4]}|
1045+
| arrayOutput | Array |[["one","two"],["three"],["four","two"]]|
1046+
1047+
If nested arrays were merged, then the value of **objectOutput.nestedArray** would be [1, 2, 3, 4], and the value of **arrayOutput** would be [["one", "two", "three"], ["three", "four", "two"]].
1048+
9921049
## Next steps
9931050

9941051
* To get an array of string values delimited by a value, see [split](./bicep-functions-string.md#split).

articles/azure-resource-manager/bicep/bicep-functions-object.md

Lines changed: 60 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
---
22
title: Bicep functions - objects
33
description: Describes the functions to use in a Bicep file for working with objects.
4-
author: mumian
5-
ms.author: jgao
64
ms.topic: conceptual
75
ms.custom: devx-track-bicep
8-
ms.date: 03/19/2023
6+
ms.date: 01/11/2024
97
---
108

119
# Object functions for Bicep
@@ -415,6 +413,8 @@ For arrays, the function iterates through each element in the first parameter an
415413

416414
For objects, property names and values from the first parameter are added to the result. For later parameters, any new names are added to the result. If a later parameter has a property with the same name, that value overwrites the existing value. The order of the properties isn't guaranteed.
417415

416+
The union function merges not only the top-level elements but also recursively merges any nested objects within them. Nested array values are not merged. See the second example in the following section.
417+
418418
### Example
419419

420420
The following example shows how to use union with arrays and objects:
@@ -455,6 +455,63 @@ The output from the preceding example with the default values is:
455455
| objectOutput | Object | {"one": "a", "two": "b", "three": "c2", "four": "d", "five": "e"} |
456456
| arrayOutput | Array | ["one", "two", "three", "four"] |
457457

458+
The following example shows the deep merge capability:
459+
460+
```bicep
461+
var firstObject = {
462+
property: {
463+
one: 'a'
464+
two: 'b'
465+
three: 'c1'
466+
}
467+
nestedArray: [
468+
1
469+
2
470+
]
471+
}
472+
var secondObject = {
473+
property: {
474+
three: 'c2'
475+
four: 'd'
476+
five: 'e'
477+
}
478+
nestedArray: [
479+
3
480+
4
481+
]
482+
}
483+
var firstArray = [
484+
[
485+
'one'
486+
'two'
487+
]
488+
[
489+
'three'
490+
]
491+
]
492+
var secondArray = [
493+
[
494+
'three'
495+
]
496+
[
497+
'four'
498+
'two'
499+
]
500+
]
501+
502+
output objectOutput object = union(firstObject, secondObject)
503+
output arrayOutput array = union(firstArray, secondArray)
504+
```
505+
506+
The output from the preceding example is:
507+
508+
| Name | Type | Value |
509+
| ---- | ---- | ----- |
510+
| objectOutput | Object |{"property":{"one":"a","two":"b","three":"c2","four":"d","five":"e"},"nestedArray":[3,4]}|
511+
| arrayOutput | Array |[["one","two"],["three"],["four","two"]]|
512+
513+
If nested arrays were merged, then the value of **objectOutput.nestedArray** would be [1, 2, 3, 4], and the value of **arrayOutput** would be [["one", "two", "three"], ["three", "four", "two"]].
514+
458515
## Next steps
459516

460517
* For a description of the sections in a Bicep file, see [Understand the structure and syntax of Bicep files](./file.md).

articles/azure-resource-manager/templates/template-functions-array.md

Lines changed: 74 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Template functions - arrays
33
description: Describes the functions to use in an Azure Resource Manager template (ARM template) for working with arrays.
44
ms.topic: conceptual
55
ms.custom: devx-track-arm-template
6-
ms.date: 05/22/2023
6+
ms.date: 01/11/2024
77
---
88

99
# Array functions for ARM templates
@@ -721,6 +721,8 @@ For arrays, the function iterates through each element in the first parameter an
721721

722722
For objects, property names and values from the first parameter are added to the result. For later parameters, any new names are added to the result. If a later parameter has a property with the same name, that value overwrites the existing value. The order of the properties isn't guaranteed.
723723

724+
The union function merges not only the top-level elements but also recursively merges any nested objects within them. Nested array values are not merged. See the second example in the following section.
725+
724726
### Example
725727

726728
The following example shows how to use union with arrays and objects.
@@ -734,6 +736,77 @@ The output from the preceding example with the default values is:
734736
| objectOutput | Object | {"one": "a", "two": "b", "three": "c2", "four": "d", "five": "e"} |
735737
| arrayOutput | Array | ["one", "two", "three", "four"] |
736738

739+
The following example shows the deep merge capability:
740+
741+
```json
742+
{
743+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
744+
"contentVersion": "1.0.0.0",
745+
"variables": {
746+
"firstObject": {
747+
"property": {
748+
"one": "a",
749+
"two": "b",
750+
"three": "c1"
751+
},
752+
"nestedArray": [
753+
1,
754+
2
755+
]
756+
},
757+
"secondObject": {
758+
"property": {
759+
"three": "c2",
760+
"four": "d",
761+
"five": "e"
762+
},
763+
"nestedArray": [
764+
3,
765+
4
766+
]
767+
},
768+
"firstArray": [
769+
[
770+
"one",
771+
"two"
772+
],
773+
[
774+
"three"
775+
]
776+
],
777+
"secondArray": [
778+
[
779+
"three"
780+
],
781+
[
782+
"four",
783+
"two"
784+
]
785+
]
786+
},
787+
"resources": [],
788+
"outputs": {
789+
"objectOutput": {
790+
"type": "Object",
791+
"value": "[union(variables('firstObject'), variables('secondObject'))]"
792+
},
793+
"arrayOutput": {
794+
"type": "Array",
795+
"value": "[union(variables('firstArray'), variables('secondArray'))]"
796+
}
797+
}
798+
}
799+
```
800+
801+
The output from the preceding example is:
802+
803+
| Name | Type | Value |
804+
| ---- | ---- | ----- |
805+
| objectOutput | Object |{"property":{"one":"a","two":"b","three":"c2","four":"d","five":"e"},"nestedArray":[3,4]}|
806+
| arrayOutput | Array |[["one","two"],["three"],["four","two"]]|
807+
808+
If nested arrays were merged, then the value of **objectOutput.nestedArray** would be [1, 2, 3, 4], and the value of **arrayOutput** would be [["one", "two", "three"], ["three", "four", "two"]].
809+
737810
## Next steps
738811

739812
* For a description of the sections in an ARM template, see [Understand the structure and syntax of ARM templates](./syntax.md).

0 commit comments

Comments
 (0)