Output declarations will be compiled into template outputs and are used to return information back out from the template deployment. See Template Parameter Syntax Reference for more information. The value of an output is any value literal or any expression.
There are no constraints on placement of output declarations. They can be mixed with any other valid declarations in any order.
output myEndpoint string = myResource.properties.endpoint
The following declares a hard-coded integer output and sets the value to 42
.
output myHardcodedOutput int = 42
The following declares an object output that returns information about the resourceGroup:
output myResourceGroup object = resourceGroup()
The following declares a boolean output value and sets the value using an expression.
output isInputParamEmpty bool = length(myParam) == 0
The following declares an array output and computes the value using a loop.
output myLoopyOutput array = [for myItem in myArray: {
myProperty: myItem.myOtherProperty
}]