Microsoft Power Automate Integration

Last modified on 2022/11/08 13:22

IntegrationIntroduction

You can integrate third-party systems with Service Manager in many ways. The method you select will depend on business requirements, architectural and security constraints as well as the characteristics specific to each third-party application or service.

This document describes an integration process that has already been implemented in a customer context. 

To find out more about this integration (e.g. scripts to be used), please do not hesitate to contact your EasyVista contact, or your service provider and integrator.

Overview of the integration

Microsoft Power Automate (formerly known as Microsoft Flow) enables you to automate recurrent tasks by building workflows using Web applications.

  • The tool relies on a large ever growing ecosystem of standard connectors based on Microsoft Azure Logic Apps for interfacing with any endpoint via HTTP/HTTPS.

    example  Azure Active Directory, Office 365, Skype For Business, Teams, Jira Software, SAP, etc.

  • It can also use the Microsoft Graph gateway via the MS Graph API when no connector is available.
     

This integration enables you to use the Microsoft Power Automate sentiment analysis prebuilt model using the Text Analytics API: 

  • Users create a ticket in Service Apps.
  • Its description is immediately analyzed by the API. Sentiment scores and sentiment labels are returned for each sentence.  This is useful for detecting positive and negative sentiments in user input.
     
Integration Data Feed (direction) Authentication Type Integration Connector Options

Logo - EV Service Manager.png

Up and Down arrow.png

Logo Icon - Microsoft Flow.png

  • Depending on the third-party service used (authentication managed by Microsoft Power Automate)
  • Basic Authentication for the Service Manager REST API
Available versions
SaaS-based On-premises
Service Manager Check icon.png Check icon.png
Third-Party Product Check icon.png N/A

Data feed

This integration is based on a simple use case. It analyzes the text entered by users when creating an incident via the portal and notifies a manager when it detects that the user is dissatisfied.

The exchange flow is represented below.
         Exchange flow diagram - EN.png

Step-by-Step Integration Process

Sentiment analysis of the Service Manager ticket is performed in several steps:

Prerequisites

Microsoft Azure: Create a subscription for sentiment analysis

Step 1: Access the Azure portal.

1. Log in to the Azure portal using your Azure account login.

Step 2: Create an Azure resource for sentiment analysis.

1. Click + Create a resource on the portal Home page.

          Azure portal - Create new resource.png

2. Select AI + Machine Learning in the left pane and click Text Analytics.

          Azure portal - Create new resource - Text analytics resource.png

3. Enter the information on the new resource.

          Azure portal - Create new resource - Text analytics resource - Information.png

4. Click Create.
The new resource for using the sentiment analysis API is deployed.
 

Step 3: Obtain an access key for the subscription.

1. Select the sentiment analysis resource.

          Azure portal - Access Text analytics resource.png

2. Select Keys and Endpoint in the left pane.
The access keys for the Sentiment analysis subscription will appear.

          Azure portal - Keys Text analytics resource.png

3. Click Copy icon.png to copy the key displayed in the KEY 1 or KEY 2 field and paste it in your text editor in order to store it temporarily. It will be required when configuring the MS Power Automate workflow (step 2.5).

Microsoft Azure: Configure an MS Power Automate workflow

Step 1: Import a sentiment analysis flow to Microsoft Power Automate.

1. Download the file below to your workstation.

        Download icon.png  Sentiment analysis package

2. Import the file to Microsoft Power Automate.

  • Click My flows in the left pane.
    A list of your MS Power Automate flows will appear.
             Microsoft Flow - Flow list.png
  • Click Import in the menu bar and select the file you downloaded.
    Once imported, the package contents will appear.
     

Step 2: Create a Text Analytics connection.

1. Click the Select during import link in the Import Setup column.
         Microsoft Flow - Package information.png

The window for configuring the import will appear.
         Microsoft Flow - Package - Create connection 1.png

2. Create a new connection for sentiment analysis.

  • Click + Create.
  • An MS Power Automate instance will appear in a new Web browser tab.
  • The list of existing connections will appear.
  • Click + New connection.
             Microsoft Flow - Package - Create connection 2.png
  • Search for the Text Analytics connector using the search field. Select it from the list of results.
             Microsoft Flow - Package - Select connection.png

3. Enter the information on the new connection.

          Microsoft Flow - Package - Information connection.png

  • Account Key: Copy and paste the access key to the sentiment analysis API you stored in your text editor when creating your subscription in step 3.3. The access key was provided by Azure.
  • Site URL: Copy and paste the URL to the Text Analytics API below.

    https://westeurope.api.cognitive.microsoft.com/text/analytics/v2.0

4. Click Create.
The new connection for sentiment analysis is created.

5. Close your Web browser tab.

  • You will return to the tab displaying the list of MS Power Automate flows.
  • The new connection for sentiment analysis will appear in the list of resources.
    Microsoft Flow - Package - New connection added.png

6. Select the connection.
The window for configuring the import will appear.
         Microsoft Flow - Package - Save connection.png

7. Click Save.
 

Step 3: Configure the imported flow.

1. Click Edit icon.png next to the flow.
         Microsoft Flow - Edit flow.png

The workflow will appear.
         Microsoft Flow - Detail flow.png

2. Retrieve the URL of the first step, When a HTTP request is received.

  • Select the name of the step.
    The Properties window for the step will appear.
  • Click Copy icon.png to copy the URL displayed in the HTTP POST URL field and paste it in your text editor in order to store it temporarily. It will be required when defining the configuration in Service Manager.
             Microsoft Flow - Detail flow - When HTTP request step.png

3. Configure the HTTP2 action in the step called Apply to each.

  • Click the name of the step, Apply to each.
    The step contents will appear.
             Microsoft Flow - Detail flow - Apply for each step.png
  • Click the name of the HTTP2 action.
    The Properties window for the action will appear.
             Microsoft Flow - Detail flow - HTTP 2 action.png
  • Specify the server name and account.
    • Click the concat(…) variable in the URI field.
      The content of the variable will appear in the Properties window.
    • Check that the server name is {your_server} and that the account is {your_account}.
    • If required, make corrections as shown in yellow below and click Update.

      concat('https://{your_server}/api/v1/{your_account}/requests/',triggerBody()?['id'])

      Microsoft Flow - Detail flow - HTTP 2 action - Account information.png
  • Specify the information on the account with the relevant rights for the REST API in Service Manager. Open url.png See Profile management.
    • Click the Show advanced options link at the bottom of the Properties window.
    • Enter the username and password.
               Microsoft Flow - Detail flow - HTTP 2 action - Advanced settings.png
  • Click Save at the bottom of the list of steps.
    The workflow is now configured for sentiment analysis.

Service Manager: Create a resource called Sentiment analysis used in a REST step of a process

Notes:

  • The Sentiment analysis resource will enable an analyze of the description of a ticket created in Service Apps.
  • It is associated with a Microsoft Power Automate service.
  • It is used in a Service Manager process using a REST action type.
CreateInServiceManagerRestResource_Procedure

Step 1: Manage rights for using the Service Manager REST API

1. Select Administration > Access Management > User Profiles in the menu.

2. Select a user profile authorized to use the REST API.

3. Tick the REST API box.
Your changes will automatically be saved.

4. Repeat the procedure for all authorized profiles.

Step 2: Create a resource called Sentiment analysis associated with a Microsoft Power Automate service

        Open url.png See the detailed procedure.

Step 2.a: Create a service called Microsoft Power Automate

1. Select Administration > REST > Services in the menu.

2. Create a new service.

          New REST service - None authentication.png

3. Specify the information below.

  • Service Name: Enter the label Microsoft Power Automate.
  • Authentication Method: None.
  • Service URL: URL for accessing the new Microsoft Power Automate service.
    • Copy and paste the URL you stored in your text editor when creating the MS Power Automate flow (step that will trigger the flow).
    • You should keep only the text displayed in yellow below.

      https://prod-35.westeurope.logic.azure.com:443/workflows/?????/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=??????

    • Replace prod-35.westeurope with {subdomain}.
       

Step 2.b: Create a connection to the Microsoft Power Automate service.

1. Create a new connection.

          New REST connection - None authentication.png

2. Specify the information below.

  • Connection Name: Enter the label Sentiment analysis.
  • Authentication Method: None.
  • Service Name: Select the Microsoft Power Automate service you created at step 2.a.
    The URL of the service will automatically appear.
  • subdomain: Copy and paste the prod-35.westeurope value of the URL you stored in your text editor.
     

Step 2.c: Create a resource associated with the Microsoft Power Automate service

1. Create a new resource.

          New REST resource - None authentication.png

2. Specify the information below.

  • Label: Enter the label Sentiment analysis.
  • Resource URI: ID of the new resource.
    • Copy and paste the URL you stored in your text editor when creating the MS Power Automate flow (step that will trigger the flow).
    • You should keep only the text displayed in yellow below.

      https://prod-35.westeurope.logic.azure.com:443/workflows/?????/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=??????

  • Contents: Body of the query containing the data to be updated. Copy and paste the text below without inserting any spaces or line breaks.

Caution: If you paste a JSON schema copied from a third-party editor such as Microsoft Word or Notepad++, invisible characters may be inserted. This will create an error in the processing of the REST step using the resource.

{"Description": "{Description}","id":"{id}"}

Step 3: Use the new Sentiment analysis resource in a REST step of a Service Manager process

1. Open the workflow or the business rule-related process you want.

  • Workflow: References > Other References > Workflows (Operation/Transition)
  • Business rule: Administration > Business Rules > Related Processes

2. Click and drag the new Sentiment analysis resource from the REST Actions category of the palette of action types to the graphic editor of the process.

A new step will be added to the process.

3. Double-click to define the properties of the new step.

4. Click Confirm Changes.

Check and test

Step 1: Create a new incident using Service Apps.

1. Log in to Service Apps.

2. Create an incident.

Step 2: Run the MS Power Automate flow.

1. Log in to the Microsoft Power Automate website using your account login.

2. Select the sentiment analysis flow.

  • The flow will appear in the run history.
             Microsoft Flow - Integration test.png
  • A notification may appear depending on the score obtained.

Step 3 (optional): View the score for the incident.

1. Open the Incident form in Service Apps.

2. Add Available Field 6.

AccountFreeCreation

How to create a free Azure account

1. Go to the Microsoft Azure website.

2. Click Start free.

          Microsoft Flow - Free account.png

3. Log in to your professional Microsoft account.
         Microsoft Flow - Login account.png

4. Enter the login information.
         Microsoft Flow - Account creation - Identification 1.png

5. Click Next.

6. Tick the I agree box.
         Microsoft Flow - Account creation - Identification 2.png

7. Click Sign up.

EndAccountFreeCreation

Links to other integrations

Tags:
Powered by XWiki © EasyVista 2022