Environment Variables
DataZen allows you to store environment variables and optionally encrypt them using X.509 certificates.
Variables can be accessed using the #getvar()
and #setvar()
DataZen functions. These variables can be used
anywhere DataZen functions can be used.
- You can defined read-only variables; doing so will prevent the use of the
#setvar()
function. - Variables can optionally be created dynamically using the
#setvar()
function
When an environment variable is encrypted using an X.509 certificate, the manager requires the X.509 certificate to be installed on the local machine for security reasons.
Managing Environment Variables
To manage environment variables
go to Configuration -> Security -> Manage Environment Variables... in DataZen Manager.
Example
You can save secrets as environment variables and use these secrets as part of job pipelines. If they are encrypted using an X.509 certificate they will automatically be decrypted at runtime. For example, the following HTTP Payload will get the Sage Intacct secrets that are necessary as part of its API calls.
<?xml version="1.0" encoding="UTF-8" ?> <request> <control> <senderid>#getvar(sagesenderid)</senderid> <password>#getvar(sagesenderpwd)</password> <controlid>test</controlid> <uniqueid>false</uniqueid> <dtdversion>3.0</dtdversion> <includewhitespace>false</includewhitespace> </control> <operation> <authentication> <login> <userid>#getvar(sageuid)</userid> <companyid>#getvar(sagecompany)</companyid> <password>#getvar(sagepwd)</password> </login> </authentication> <content> <function controlid="123456"> #iif( @pagingmarker , "<readMore> <resultId>@pagingmarker</resultId> </readMore>", "<readByQuery> <object>PODOCUMENTENTRY</object> <fields>LINE_NO,RECORDNO,DOCHDRNO,DOCHDRID,DOCPARID, PODOCUMENT.PONUMBER,WHENCREATED,WHENMODIFIED,VENDORID </fields> <query>WHENMODIFIED > #dateadd(#isnullorempty(@highwatermark, '07/05/2025 00:00:00'), -10n, MM/dd/yyyy HH:mm:ss)</query> <pagesize>1</pagesize> <docparid>Receiver</docparid> </readByQuery>") </function> </content> </operation> </request>