Skip to content

Commit a8783ad

Browse files
Merge pull request #291751 from mumian/1210-function-deployer
document deployer()
2 parents 2ea579f + 7e0956f commit a8783ad

File tree

4 files changed

+89
-4
lines changed

4 files changed

+89
-4
lines changed

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

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,49 @@ title: Bicep functions - deployment
33
description: Describes the functions to use in a Bicep file to retrieve deployment information.
44
ms.topic: reference
55
ms.custom: devx-track-bicep
6-
ms.date: 06/26/2024
6+
ms.date: 12/10/2024
77
---
88

99
# Deployment functions for Bicep
1010

1111
This article describes the Bicep functions for getting values related to the current deployment.
1212

13+
## deployer
14+
15+
`deployer()`
16+
17+
Returns the information about the current deployment principal.
18+
19+
Namespace: [az](bicep-functions.md#namespaces-for-functions).
20+
21+
### Return value
22+
23+
This function returns the information about the current deployment principal, including tenant ID and object ID.
24+
25+
```json
26+
{
27+
"objectId": "",
28+
"tenantId": ""
29+
}
30+
```
31+
32+
### Example
33+
34+
The following example Bicep file returns the deployer object.
35+
36+
```bicep
37+
output deployer object = deployer()
38+
```
39+
40+
The preceding example returns the following object:
41+
42+
```json
43+
{
44+
"objectId":"aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb",
45+
"tenantId":"aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e"
46+
}
47+
```
48+
1349
## deployment
1450

1551
`deployment()`

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Bicep functions
33
description: Describes the functions to use in a Bicep file to retrieve values, work with strings and numerics, and retrieve deployment information.
44
ms.topic: reference
55
ms.custom: devx-track-bicep
6-
ms.date: 12/06/2024
6+
ms.date: 12/10/2024
77
---
88

99
# Bicep functions
@@ -74,6 +74,7 @@ The following functions are available for working with dates. All of these funct
7474

7575
The following functions are available for getting values related to the deployment. All of these functions are in the `az` namespace.
7676

77+
* [deployer](./bicep-functions-deployment.md#deployer)
7778
* [deployment](./bicep-functions-deployment.md#deployment)
7879
* [environment](./bicep-functions-deployment.md#environment)
7980

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

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ title: Template functions - deployment
33
description: Describes the functions to use in an Azure Resource Manager template (ARM template) to retrieve deployment information.
44
ms.topic: reference
55
ms.custom: devx-track-arm-template
6-
ms.date: 06/26/2024
6+
ms.date: 12/10/2024
77
---
88

99
# Deployment functions for ARM templates
1010

1111
Resource Manager provides the following functions for getting values related to the current deployment of your Azure Resource Manager template (ARM template):
1212

13+
* [developer](#deployer)
1314
* [deployment](#deployment)
1415
* [environment](#environment)
1516
* [parameters](#parameters)
@@ -20,6 +21,52 @@ To get values from resources, resource groups, or subscriptions, see [Resource f
2021
> [!TIP]
2122
> We recommend [Bicep](../bicep/overview.md) because it offers the same capabilities as ARM templates and the syntax is easier to use. To learn more, see [deployment](../bicep/bicep-functions-deployment.md) functions.
2223
24+
## deployer
25+
26+
`deployer()`
27+
28+
Returns the information about the current deployment principal.
29+
30+
In Bicep, use the [deployer](../bicep/bicep-functions-deployment.md#deployer) function.
31+
32+
### Return value
33+
34+
This function returns the information about the current deployment principal, including tenant ID and object ID.
35+
36+
```json
37+
{
38+
"objectId": "",
39+
"tenantId": ""
40+
}
41+
```
42+
43+
### Example
44+
45+
The following example returns the deployer object.
46+
47+
```json
48+
{
49+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
50+
"contentVersion": "1.0.0.0",
51+
"resources": [],
52+
"outputs": {
53+
"developerOutput": {
54+
"type": "object",
55+
"value": "[developer()]"
56+
}
57+
}
58+
}
59+
```
60+
61+
The preceding example returns the following object:
62+
63+
```json
64+
{
65+
"objectId":"aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb",
66+
"tenantId":"aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e"
67+
}
68+
```
69+
2370
## deployment
2471

2572
`deployment()`

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Template functions
33
description: Describes the functions to use in an Azure Resource Manager template (ARM template) to retrieve values, work with strings and numerics, and retrieve deployment information.
44
ms.topic: reference
55
ms.custom: devx-track-arm-template
6-
ms.date: 05/10/2024
6+
ms.date: 12/10/2024
77
---
88

99
# ARM template functions
@@ -122,6 +122,7 @@ For Bicep files, use the [date](../bicep/bicep-functions-date.md) functions.
122122

123123
Resource Manager provides the following functions for getting values from sections of the template and values related to the deployment:
124124

125+
* [deployer](template-functions-deployment.md#deployer)
125126
* [deployment](template-functions-deployment.md#deployment)
126127
* [environment](template-functions-deployment.md#environment)
127128
* [parameters](template-functions-deployment.md#parameters)

0 commit comments

Comments
 (0)