BookmarkSubscribeRSS Feed

How to Publish a Decision to Azure with SAS Container Runtime

Started ‎09-22-2021 by
Modified ‎10-31-2021 by
Views 4,915

SAS Container Runtime (SCR) allows you to publish a decision or rule set developed with SAS Intelligent Decisioning as a container image in Azure. The stable SAS Viya version 2021.1.4 adds SCR (SCR, pronounced “soccer”) support for decisions and rule sets, in addition to SAS models. This post details the steps to publish a SAS decision or rule set as an Azure container image and validate the publishing. Scoring the decisions will be covered in separate posts.

The Big Picture

Watch the following short video to understand the end result.



Firstly, the type of decisions you can publish today:

  • Assignment rule sets (can use lookup tables, custom functions, and global variables).
  • Treatment groups.
  • SAS models: analytic store, DATA step, DS2 multi-type or DS2 package.
  • Sub-decisions.
  • DS2 code files that do not contain SQL queries.
  • Filtering rule set nodes

Read more about it in SAS Intelligent Decisioning | 2021.1.4.

The Steps

The steps to publish SAS decisions or rule sets are the following.

  • SAS Viya Deployment
  • Azure Components
  • SAS Viya Components
  • Decision or rule set publishing
  • Publishing validation

The first three steps are exactly the same in How to Publish a SAS Model to Azure with SCR: A Start-to-Finish Guide and won't be repeated here. This post will focus only on decision or rule set publishing and publishing validation .


Decision or rule set publishing

To publish to Azure, you need at least a rule set to begin with:

  1. Define a rule set. This rule helps a fleet manager decide if to bid or not for cars auctioned online. The output is a binary Bid decision (0 or 1), depending on the car characteristics and valuation data.


    Select any image to see a larger version.
    Mobile users: To view the images, select the "Full" version at the bottom of the page.
  2. Test the rule set.
  3. If you decide to use lookup tables in the rule set, they are supported by SCR. Lookup tables are used in the autoAuctionMake rule set (see image below).
  4. Create a decision which refines the logic. It incorporates the rule above on a decision branch and adds several elements. The output is the binary Bid decision (0 or 1), plus a callOffice indicator and a bidCommand.


  5. Test the decision.


Decision or Rule Set Publishing

You only need to configure the Azure publishing destination once. SAS Model Manager and SAS Intelligent Decisioning are sharing the destination.

With the Azure publishing destination now defined:


To publish the decision to Azure is very easy.





What happens during publishing? Switch to the Azure portal, in the SAS Viya Azure Kubernetes Service (AKS) cluster. AKS cluster > Workloads > Pods > sorted by Age descending, you will see several pods spawned:




At some point during publishing you would see a kaniko pod. Kaniko is a tool to build container images from a Dockerfile, inside a container or Kubernetes cluster. Kaniko is used by SCR.




After publishing is successful, you will see your SCR image in the Azure Container Registry, under Repositories.





720 SAS Container Runtime decision image published to Azure Container Registry.png



Decision Publishing Validation

To validate your publishing destination, select the decision, go to Scoring > Publishing Validation, select an input table and run the validation.




During the publishing validation, switch to the Azure Kubernetes Service (AKS) cluster. From AKS cluster > Workloads > Pods > sort by Age descending, and you will see a similar list:





The scoring pod is where the publishing validation happens and where the decision is tested against input data.


When you open the pod events, you can see the scoring pod:

  • Pulling the decision SAS Container Runtime image autoauctiondec1_0:latest, from the Azure Container Registry, where it was published earlier.
  • Starting a container for the decision scoring process.


730 SAS Viya Scoring Pods on Azure Kubernetes Service Cluster.png


The pod will run for a while. This is normal. When the pod is terminated, publishing validation will complete. Back in SAS Intelligent Decisioning, click on Results:





The output shows the Bid values, just like when you test the decision in SAS.





The code section will reveal python code, passing commands to the AKS cluster to create a deployment, a service. It seems to be very helpful if you want to debug and run the code step by step.


740 SAS decision Azure publishing validation code.png



The log provides a few metrics: the process to create the container takes about 5 minutes. While it might seem a bit long, the time is very similar to the creation of an Azure Container instance.





Notice the container endpoint. It runs on a port in the 30000-32767 range. The IP is a private Azure IP, known within the Kubernetes Service resource group virtual network.

Rule Sets

The publishing and validation mechanism for rule sets is exactly the same as for decisions.


In this post, you learnt how to publish SAS Intelligent Decisioning rule sets and decisions to Azure and how to validate their publishing.

Note that once the SCR images are in Azure, there is zero dependency on SAS Viya for decision scoring. Azure takes over. To change the decision and publish a new version, yes, you will still require SAS Viya.

You can deploy your container image in a number of ways and score the decisions or the rule sets. Read more about it in future posts.


Want to Know More?

Thank you for your time reading this post. If you found it useful, like it. Please comment and tell us what you think about the new SCR and Azure publishing destination.

Version history
Last update:
‎10-31-2021 09:23 PM
Updated by:



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

Free course: Data Literacy Essentials

Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning  and boost your career prospects.

Get Started