Enabling low code developers to

Create custom client reports with a helping hand from Azure

Introduction

  • Share an Architecture pattern today
  • In this example:
  • Use Power Automate to generate a custom report
  • Based on Dataverse data
  • Share it with our client securely via a link

Ian Tweedie

Image
  • Senior Technical Consultant, Capgemini
  • Trustee for Digital Transformation for a £22 million non for profit
  • Chair of an £750k non for profit

Ian Tweedie

Certification Wall

height:100pxheight:100pxheight:100pxheight:100pxheight:100pxheight:100pxheight:100pxheight:100pxheight:100pxheight:100pxheight:100pxheight:100pxheight:100pxheight:100pxheight:100pxheight:100pxheight:100pxheight:100pxheight:100pxheight:100pxheight:100pxheight:100pxheight:100pxheight:100pxheight:100pxheight:100pxheight:100pxheight:100pxheight:100pxheight:100pxheight:100pxheight:100pxheight:100pxheight:100px

Community Tools

Image
Image
  • Calculate working day
  • Email domain checker
  • SharePoint Connector using SPN
  • Email Connector using SPN
  • Dataverse 4 Teams Local ALM Tool
  • DevOps Extension: Power Apps Solution Documentation Tool
  • Around 500k hits a month

Power Platform Clinic

cap

Problem

  • WE ARE handling high value claims

  • WE NEED TO share settlement documents with our clients

  • WE MUST share these documents securely

Current solution

Live Demo 1

  1. Settlement App
  2. Check email
  3. Power automate flow
  4. Power Pages Portal
  5. SharePoint Site
  6. Document

Problems

Slow

Inaccessible

Clunky

Click and wait...

Proposed solution

  • Present it as a web link

Can we

  • Get power automate to make a web page for us

  • Can that web page present a PDF document

Lets give it a go

Live Demo 2

alt text

View the flow runs

View

Key component

Web Page

  • Flow with HTTP Request trigger
  • Response Headers

content-type : text/html

content-type : text/html

Lets give it a go

Live Demo 3

alt text
  1. PDF Flow
  2. Try it out

View the flow run

View

Key component

PDF

Response Headers

Content-Type: application/pdf

Content-Type: application/pdf

Common MIME types - HTTP | MDN (mozilla.org)

Content-Disposition: inline

Content-Disposition: attachment; filename=“filename.pdf”

Content-Disposition: inline
Content-Disposition: attachment; filename="filename.pdf"

Content-Disposition - HTTP | MDN (mozilla.org)

alt text

Lets see that working

Live Demo 4

alt text

View the Flow

View the flow

Key component

@{triggerOutputs()[‘queries’]}

@{triggerOutputs()['queries']}

Overview

graph LR A(User) --> B(Flow) --> C(Dataverse)

Sequence

sequenceDiagram autonumber actor User User->>Flow: Clicks link HTTP Flow->>Dataverse: Requests data Dataverse-->>Flow: Data returned Flow->>SharePoint: Requests template SharePoint-->>Flow: Template returned Flow-->Flow: Merge data in to template Flow-->>User: Returns PDF

We still have a problem

What do we need?

sequenceDiagram autonumber actor User User->>Flow: Clicks link Flow-->>User: Returns PDF

Reverse Proxy

sequenceDiagram autonumber actor User User->>Reverse-Proxy: Clicks link Reverse-Proxy-->>Reverse-Proxy: Authentication Reverse-Proxy->Flow: Forwards Request Flow-->>Reverse-Proxy: Returns PDF Reverse-Proxy-->>User: Returns PDF

Solution requirements

  • Authenticate by Azure B2C

  • Reverse Proxy function

Where can I find this

Image
Out of the box Authentication

Azure function

  • Forwards all headers received from the incoming request.
  • Adds custom header Flow-Key (from environment variables).
  • Handles GET, POST, OPTIONS method.
  • Appends query parameters from the incoming request to the external URL.

FLOW_URL=https://prod-21.uksouth.logic.azure.com/workflows/your-logic-app-url
FLOW_KEY=your-flow-key-value

Lets deploy it

  1. Access the Repo
  2. Press Deploy
  3. Follow the on screen instructions
Image

Lets deploy it

  1. Access the Repo
  2. Press Deploy
  3. Follow the on screen instructions
  4. Add Environment variables

FLOW_URL=https://prod-15.uksouth.logic.azure.com/workflows/7a854d30969e4158bac2b17ac15d1ad7/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=FrLhWsuldO9AiPgF4ztcjuvjsSrBrJtlD5Mf17jjU_I 

FLOW_KEY=ABC123

Lets deploy it

  1. Access the Repo
  2. Press Deploy
  3. Follow the on screen instructions
  4. Add Environment variables
  5. Setup Azure B2C

Lets see that working

Demo 5

Live Demo 5

View the form Power Pages Portal

Try it out

alt text

Username:

demo@tweed.technology

Password:

TechTweedie1!

View the flow

View the flow

Key component

Inbound Header

X-MS-CLIENT-PRINCIPAL-ID

  "X-MS-CLIENT-PRINCIPAL-ID": "1ebcd192-5366-48eb-9028-04610ae1704d"

Key component

Fetch XML

<fetch>
  <entity name="techtwed_settlement">
    <attribute name="techtwed_name" />
    <attribute name="techtwed_settlementid" />
    <filter>
      <condition attribute="techtwed_name" operator="eq" value="SET-1001-T8B5" />
    </filter>
    <link-entity name="contact" from="contactid" to="techtwed_customer" alias="contact">
      <link-entity name="adx_externalidentity" from="adx_contactid" to="contactid" alias="externalid">
        <filter>
          <condition attribute="adx_username" operator="eq" value="1ebcd192-5366-48eb-9028-04610ae1704d" />
        </filter>
      </link-entity>
    </link-entity>
  </entity>
</fetch>

High Level Solution

Image

Sequence Diagram

sequenceDiagram autonumber actor User User->>Reverse-Proxy: Click Link Reverse-Proxy->>Reverse-Proxy: Authentication Reverse-Proxy->>Flow: Forwards request Flow->>Dataverse: Requests data Dataverse-->>Flow: Data returned Flow->>SharePoint: Requests template SharePoint-->>Flow: Template returned Flow-->Flow: Merge data in to template Flow->>Reverse-Proxy: Returns PDF Reverse-Proxy->>User: Returns PDF

Where have I used this Pattern

  • Document Generation
  • WiFi Network Login
  • Register Interest
  • Login to a legacy systems
  • Door code generation

Questions

Keep in touch
Image
Feedback
Image
Presentation
Image
Github Repo
Image