Outputs can be created in Farmer for any ARM Expression, Resource Name or any optional string. ARM Expressions are most useful in this case for referring to values that only exist at deployment time, such as connection strings.
Farmer ARM expressions are in reality just wrapped strings, and are easy to create. For example, the code to create a Storage Key property is similar to this:
let buildKey accountName : ArmExpression =
// Create the raw string of the expression
let rawValue =
$"concat('DefaultEndpointsProtocol=https;AccountName={accountName};AccountKey=', listKeys('{accountName}', '2017-10-01').keys[0].value)"
// Wrap the raw value in an ARM Expression and return it
ArmExpression.create rawValue
Notice that you do not wrap the expression in square brackets [ ]; Farmer will do this when writing out the ARM template.
ARM expressions also have the following members on them:
Map
- standard mapBind
- standard bindValue
- Returns the raw string valueEval
- Returns the string as a formatted ARM expression i.e. surround in []