BookmarkSubscribeRSS Feed

Automating SAS Viya Copilot Setup

Started Wednesday by
Modified Wednesday by
Views 173

SAS Viya Copilot brings generative AI directly into the SAS Viya platform, allowing users to explore data and generate insights using natural language. A recent SAS Communities Library article, How to Activate SAS Viya Copilot: An Administrator’s Guide, provides an excellent walkthrough of the prerequisites and the browser‑based activation steps using SAS Environment Manager. This post explores some additional required steps for administrators to consider and demonstrates a practical automation approach to address one of the most common pain points.

 

 

A Key Prerequisite: Access to the SAS Viya Order

 

One key requirement that is easy to miss is that the user who creates the Orders API keys for activating SAS Viya Copilot must have access to the specific SAS Viya order used for the deployment.

 

In practice, this means that Orders API keys for SAS Viya Copilot must be generated by a user who can see the relevant SAS Viya order in the MySAS Customer Portal. Using a different account produces keys that cannot be used for activation of Copilot. This might require coordination between platform teams and procurement teams. Without access to the order, the activation step fails. Addressing this early can save troubleshooting time during Copilot setup.

 

 

Application-Level Enablement

 

Another common point of confusion is the assumption that activating SAS Viya Copilot automatically enables it everywhere.

 

In reality, Copilot activation in SAS Environment Manager is a general, platform-level action, but individual SAS Viya applications, such as SAS Visual Analytics (depending on your deployed version), may still require feature flags or configuration settings to be enabled for the Copilot icon to appear.

 

01_AF_featureflag.png

Select the image to see a larger version.
Mobile users: To view the image, select the "Full" version at the bottom of the page.

 

This behaviour allows administrators to control rollout and adoption by product, but it also means that a successful Copilot activation in SAS Environment Manager does not guarantee immediate end‑user visibility. This is important to remember as Copilot is gradually made available in more SAS Viya applications and interfaces.

 

 

Automation

 

The SAS Viya Copilot setup steps described in the official documentation rely heavily on manual UI interactions; administrators must log in to SAS Environment Manager and add required the secret & key before clicking the activation button to enable Copilot.

 

There are several scenarios that can benefit from automating some of this workflow, such as:

 

  • Multiple SAS Viya environments (dev, test, prod)
  • Environment rebuilds or upgrades
  • DevOps workflows
  • Restricted or tightly controlled enterprise systems

 

While not all of the activation setup tasks can be automated just yet, a repeatable and auditable approach that reduces manual intervention and human error can benefit administrators.

 

A new pyviyatool has been created to help automate some of the setup of the Orders API credentials required by SAS Viya Copilot.

 

The setupcopilotcredentials.py script checks to see whether the copilot credentials have already been defined in SAS Environment Manager. If not, it allows for them to be created via a REST API call to the credentials endpoint. The tool accepts credentials (created manually in the SAS Developer Portal) via an external input file or inline command parameters. This makes the tool suitable for CI/CD pipelines.

 

Let's take a look at an example.

 

If using an input file, the format is a simple key–value file:

 

SAS_ORDERS_API_CLIENT_ID=your_client_id_here
SAS_ORDERS_API_CLIENT_SECRET=your_client_secret_here

 

A tip: the SAS Developer Portal creates two keys when you register an app. Be sure to use the base64-encoded one (with no special characters).

 

To configure the Copilot credential, run:

 

./setupcopilotcredentials.py --input-file ordersapicreds.txt

 

Alternatively, use the --client-id and --client-secret command-line flags instead of an input file.

 

If the credential already exists in the OrdersAPIAuth domain, the script exits without making changes, unless the --force flag is used:

 

Client credential already exists in domain 'OrdersAPIAuth'.
No changes made. Use --force to attempt overwrite.

 

Successful execution displays a message showing the new credential was added:

 

SAS Viya Copilot Orders API credential 'sas.genAiGateway' configured in domain 'OrdersAPIAuth'.

 

 

Putting It All Together

 

The complete process looks something like this:

 

  1. Ensure the Orders API keys are created by a user with access to the correct SAS Viya order
  2. Configure the Orders API credential in SAS Viya using an automated, repeatable approach
  3. Activate Copilot in SAS Environment Manager
  4. Enable Copilot feature flags for the relevant SAS Viya products
  5. Validate Copilot visibility and behaviour for end users

 

If you manage SAS Viya platforms in an enterprise environment, I hope this new tool and the insights shared here help simplify your Copilot rollout.

 

 

Find more articles from SAS Global Enablement and Learning here.

Contributors
Version history
Last update:
Wednesday
Updated by:

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore Now →

SAS AI and Machine Learning Courses

The rapid growth of AI technologies is driving an AI skills gap and demand for AI talent. Ready to grow your AI literacy? SAS offers free ways to get started for beginners, business leaders, and analytics professionals of all skill levels. Your future self will thank you.

Get started

Article Tags