BookmarkSubscribeRSS Feed

Use a Power App app with Power Platform connector having an SAS Viya REST API endpoint (part 1)

Started ‎05-16-2023 by
Modified ‎05-15-2023 by
Views 454



On 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)



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 and sign in to your Microsoft account. Click on New custom connector and select Create from blank.


custom connector.png


Give the connector a name.


custom connector name.png


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.






Fill in your Viya hostname in the Base URL field.






Now click on Security. Choose API key as authentication and fill the fields like you see below.






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.


import frm sample.png


Enter the following URL. We are going to modify the values between the brackets.




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.






Before you are able to test the newly created customer connector you need to first save it by clicking on Create connector.


test create.png


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.


Bearer eyJhbGciOiJSUzI1NiIsImprdSI6Imh0dHBzOi8vbG9jYWxob3N0L1NBU0xvZ29uL3Rva2VuX2tleXMiLCJraWQiOiJsZWdhY3k




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!

Version history
Last update:
‎05-15-2023 03:24 AM
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

Article Labels
Article Tags