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-resource-manager/bicep/bicep-functions-string.md
+39-47Lines changed: 39 additions & 47 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Bicep functions - string
3
3
description: Describes the functions to use in a Bicep file to work with strings.
4
4
ms.topic: reference
5
5
ms.custom: devx-track-bicep
6
-
ms.date: 05/09/2025
6
+
ms.date: 06/19/2025
7
7
---
8
8
9
9
# String functions for Bicep
@@ -141,26 +141,21 @@ The output from the preceding example with the default values is:
141
141
142
142
## buildUri
143
143
144
-
`buildUri(scheme, host, path, query, fragment)`
144
+
`buildUri(uriComponent)`
145
145
146
-
Constructs a URI by combining the provided scheme, host, path, query, and fragment components into a single URI string. To parse a URI, see [parseUri](#parseuri).
146
+
Constructs a URI by combining the provided scheme, host, port, path, and query component object into a single URI string. To parse a URI, see [parseUri](#parseuri).
| query | No | string | The query string, including the leading `?` if present (e.g., `?key=value`). Defaults to an empty string if not provided. |
158
-
| fragment | No | string | The fragment identifier, including the leading `#` if present (e.g., `#section`). Defaults to an empty string if not provided. |
159
-
160
-
* The `scheme`, `host`, and `path` parameters are required to ensure a valid URI structure.
161
-
* The `query` and `fragment` parameters are optional and can be omitted or set to an empty string (`''`) if not needed.
162
-
* The function handles proper formatting, ensuring correct separators (e.g., `://` between scheme and host, `/` for paths, `?` for queries, `#` for fragments) and avoids issues like double slashes.
163
-
* For complete details, the URI is constructed as specified in [RFC 3986, section 3](https://tools.ietf.org/html/rfc3986#section-3).
154
+
| scheme | Yes | String | The protocol of the URI (e.g., `http`, `https`, `ftp`). |
155
+
| host | Yes | String | The domain or hostname (e.g., `example.com`). |
156
+
| port | No | Int or Null | The port number (e.g., `443`). If not specified, defaults to `null`, which means the default port for the scheme is used. |
The following example shows how to use `parseUri` to extract components from an existing URI, modify them, and then use `buildUri` to reconstruct a new URI:
@@ -969,7 +966,7 @@ The output from the preceding example with the default values is:
969
966
970
967
`parseUri(uriString)`
971
968
972
-
Parses a URI string into its constituent components, such as scheme, host, path, query, and fragment. To build a URI string, see [buildUri](#builduri).
969
+
Parses a URI string into its constituent components, such as scheme, host, port, path, and query. To build a URI string, see [buildUri](#builduri).
The following example shows how to use `parseUri` to extract the host and scheme, then reconstruct a new URI with a different path using the `uri` function:
0 commit comments