Introduction
On developer.sas.com it says that the SAS Viya REST APIs are designed for enterprise application developers, who intend to build on the work of model builders and data scientists, to deliver apps based on SAS Viya technology. With the SAS Viya REST APIs, you can create and access SAS resources using any third party application that supports http(s) calls.
Microsoft Power Platform connectors are wrappers or proxies around an API that allow the underlying service to talk to Microsoft Power Automate, Microsoft Power Apps, and Azure Logic Apps. SAS offers a SAS Decisioning Connector to run SAS Intelligent decisions that are deployed on your SAS Viya platform.
However Microsoft also gives you the option to build your own custom connectors which allows you to communicate with services that aren't available as prebuilt connectors. That way you could for instance connect from within PowerApps to a SAS model published in a SAS Scoring Container.
In this blog series that is split up in to three different parts, we will explain how you can create a Power App application that displays data retrieved from your SAS Viya environment. In the first part of the blog we will start with creating custom connector that list data loaded into the SAS Cloud Analytic Services (CAS)
Prerequisites
The SAS Viya environment use TLS to secure data in motion. You need a certificate from a commercial vendor like Digicert or Verisign. Self signed certificates are not be trusted by the Power Automate of Power App platforms of Microsoft. And you are not able to import a self signed certificate.
In case the SAS Viya environment is protected by a firewall, you will need to whitelist the IP from which Power Automate requests are sent. More info about these IP addresses can be found here.
Create a Power Platform custom connector
Go to make.powerautomate.com and sign in to your Microsoft account. Click on New custom connector and select Create from blank.
Give the connector a name.
Now you can use a wizard that will guide you through the steps necessary to create your customer connector in Microsoft Power Automate. We will guide you through each of these steps and call out what needs to be setup for your custom connector.
General
Fill in your Viya hostname in the Base URL field.
Security
Now click on Security. Choose API key as authentication and fill the fields like you see below.
Definition
Click Definition and in the next screen you can determine actions that users will be able to perform. In our example we will only add 1 action: the retrieval of a number of rows from a CAS table. We start by clicking on New action and then we will define some general properties of the actions.
After that it's time to specify the details of the Request, for that you can click Import from sample.
Enter the following URL. We are going to modify the values between the brackets.
https://{viya-fqdn}/casRowSets/servers/cas-shared-default/caslibs/{cas-lib}/tables/{cas-table}/rows?limit=a&start=b |
Parameter | Description |
viya-fqdn | The fully qualified domain name of the SAS Viya server. |
cas-lib | The CAS library where the table is located. |
cas-table | The CAS table name. |
*) Leave the limit and start parameter to the respective values as shown above
Click Import.
Test
Before you are able to test the newly created customer connector you need to first save it by clicking on Create connector.
Once the custom connector has been saved we can start our test. But first we have to create a new connection. If no connection is listed click on "New connection"
To establish the connection to the SAS Viya environment you need to provide an API key. This API key is something that needs to be generated within the SAS Viya environment. How to generate this API key can be found here.
The API key needs to be in this format: Bearer <access_token>. An example of what the API key could look like is shown here.
|
You can validate if the connection was created successful by selecting connections:
You can go back to customer Custom connectors to test the connection. Click Test operation.
If the Access Token was generated correctly you will be able to run a successful test.
That concludes the creation for the custom connector. Now you're all set to create a Power Automate Flow which can be used in a later step in a Power App. We will explain how to do that in the second part of our blog series.
Let us know if you have any questions in the comments!
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.