Setting environment variables for coded agents
I have been trying to deploy some very basic coded agents in Automation Cloud (just following this quickstart guide), but I am facing some issues related to environment details for them (see this forum post for more details on that).
I'm able to publish them to Orchestrator, using the uipath studio package publish command, but it seems that whatever I put in the projects .env files are not reflecting correctly in Orchestrator (once again, I refer to the forum topic above for more details), so now I'm considering how to set this through the uipathcli directly instead.
When looking at the Orchestrator swagger, the uipathcli command that would come closest to an the endpoint needed for setting agent environment variables would be the one I have in the code block below, but I'm not sure where Environment variables would go.
$ uipath orchestrator releases put-by-id --help
NAME:
uipath orchestrator releases put-by-id - Edits a release.
USAGE:
uipath orchestrator releases put-by-id [command options] [arguments...]
DESCRIPTION:
OAuth required scopes: OR.Execution or OR.Execution.Write.
Required permissions: (Processes.Edit) and (RemoteControl.Create - Required when changing the live streaming configuration.).
OPTIONS:
--folder-id integer (required)
Folder/OrganizationUnit Id
--key integer (required)
--name string (required)
A custom name of the release. The default name format is ProcessName_EnvironmentName.
--process-key string (required)
The unique identifier of the process associated with the release.
--process-version string (required)
The version of the process associated with the release.
--arguments object
Example:
Input=string; Output=string
--auto-update boolean
--automation-hub-idea-url string
--creation-time string
--creator-user-id integer
--current-version object
Stores data about a version of the various versions of the process associated with a certain release.
<para />If a certain version is associated on and off with a release a new ReleaseVersion object is created for each association.
Example:
CreationTime=string; Id=integer; ReleaseId=integer; ReleaseName=string; VersionNumber=string
--description string
Used to add additional information about a release in order to better identify it.
--entry-point object
Example:
DataVariation.Content=string; DataVariation.ContentType=string; DataVariation.Id=integer; Id=integer; InputArguments=string; OutputArguments=string; Path=string; UniqueId=string
--entry-point-id integer
--entry-point-path string
--environment object
A grouping of Robots.
Example:
Robots[0].CreationTime=string; Robots[0].CreatorUserId=integer; Robots[0].CredentialStoreId=integer; Robots[0].CredentialType=string; Robots[0].Description=string; Robots[0].Enabled=boolean; Robots[0].Environments[0].Description=string; Robots[0].Environments[0].Id=integer; Robots[0].Environments[0].Name=string; Robots[0].Environments[0].Type=string; Robots[0].ExternalName=string; Robots[0].HostingType=string; Robots[0].Id=integer; Robots[0].IsExternalLicensed=boolean; Robots[0].LastModificationTime=string; Robots[0].LastModifierUserId=integer; Robots[0].LicenseKey=string; Robots[0].LimitConcurrentExecution=boolean; Robots[0].MachineId=integer; Robots[0].MachineName=string; Robots[0].Name=string; Robots[0].Password=string; Robots[0].ProvisionType=string; Robots[0].RobotEnvironments=string; Robots[0].Type=string; Robots[0].UserId=integer; Robots[0].Username=string
--environment-id integer
The Id of the environment associated with the release.
--environment-name string
The name of the environment associated with the release.
--feed-id string
--hidden-for-attended-user boolean
--id integer
--input-arguments string
Input parameters in JSON format to be passed as default values to job execution.
--is-attended boolean
--is-compiled boolean
--is-latest-version boolean
States whether the version of process associated with the release is latest or not.
--is-process-deleted boolean
States whether the process associated with the release is deleted or not.
--job-priority string
The execution priority. If null, it defaults to Normal.
Allowed values:
- Low
- Normal
- High
--last-modification-time string
--last-modifier-user-id integer
--organization-unit-fully-qualified-name string
Fully qualified name of the folder this release is part of.
--organization-unit-id integer
Id of the folder this release is part of.
--process-settings object
Example:
AlwaysRunning=boolean; AutoStartProcess=boolean; AutopilotForRobots.Enabled=boolean; AutopilotForRobots.HealingEnabled=boolean; Duration=integer; ErrorRecordingEnabled=boolean; Frequency=integer; Quality=integer
--process-type string
Allowed values:
- Undefined
- Process
- ProcessOrchestration
- WebApp
- Agent
- TestAutomationProcess
--release-versions object (multiple)
The collection of release versions that current release had over time.
--remote-control-access string
Allowed values:
- None
- ReadOnly
- Full
--requires-user-interaction boolean
--robot-size string
Allowed values:
- Small
- Standard
- Medium
- Large
--specific-priority-value integer
Value for more granular control over execution priority.
--supports-multiple-entry-points boolean
--tags object (multiple)
Example:
DisplayName=string; DisplayValue=string; Name=string; Value=string
--target-framework string
Allowed values:
- Legacy
- Windows
- Portable
--video-recording-settings object
Example:
MaxDurationSeconds=integer; QueueItemVideoRecordingType=string; VideoRecordingType=string
A quick look at the endpoint /Releases/Releases_PutById in Swagger shows me that EnvironmentVariables is part of the payload there. Not sure how to work with it though.
The uipathcli does not currently support .env files or any other environment variables than documented here. Could you explain what you mean by EnvironmentVariables are part of the payload in the /Releases/Releases_PutById endpoint?
When deploying agents, one can manually set values for Environment variables in the "Process" here:
If I'm not entirely mistaken, the end point for /Releases/Releases_PutById provides the option to do the same by setting values on the EnvironmentVariables property of the body:
So in my use case, I have a workflow that packs the agent. Then after publishing, I want to run the uipathcli to do my environment variable configuration of the agent through this endpoint, instead of going in manually and set the variables through this one with a put request.