PPIAD - Part 2 (1)

Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

You will build THIS data-driven website in 1 day:

Power Pages in a Day


https://aka.ms/PowerPagesInADay

https://aka.ms/Pages_Prereqs
https://aka.ms/PowerPagesInADayStudent
Microsoft Power Platform
Rapid app dev platform that spans Office 365, Azure, Dynamics 365, and standalone applications

Power Apps Power Automate Power BI Power Virtual Agents Power Pages
Application development Process automation Business analytics Intelligent bots External websites

Data AI Builder Microsoft Power Fx Managed


connectors Dataverse Environments
Security Structure

Table Dataverse
Basic Form
Permissions Form
Dataverse
Table
Page Dataverse
Web Role Web Page List
Permission View

Contacts

Access

Website Setup (Custom Domain, SSL Certificate, Power BI, SP, .. )

Configuration stored in Dataverse Data

Dataverse Metadata

Content & Code

Manual Configuration
Security Structure

Dataverse Contact

Web Role

Page Table
Permissions Permissions
Power Pages users

• Users can be anonymous or authenticated.


• Authenticated users are associated with a Contact record in Dataverse.
• This means that the website has its own security model separate from
Dataverse Security Roles.
• To secure the website, permissions are grouped into Web Roles and then
assigned to the Contact.

• Users must have a unique


email address.
Web Roles
• Allow named roles to be assigned to Contacts.
• Determines which records and permissions on those records a user has
access to
• A given contact can be in any number of roles.
• A given role has any number of related permissions.

• Out of the box web roles:


 Administrators
 Anonymous Users
 Authenticated Users
Authenticated vs. Anonymous Users
• Authenticated Users Role:
 Boolean
 If set to true, this will be the default web role for authenticated users.
 There can only be one web role set to be the Authenticated Users Role.
• Anonymous Users Role:
 Boolean
 If set to true, this will be the default web role for unauthenticated users.
 There can only be one web role set to be the Anonymous Users Role.

• One role can be defined as the default anonymous role, and one can be defined
as the default authenticated role.
• Automatically assigned to a Power Pages user when they are accessing the site
anonymously or as an authenticated users
Table Permissions
• Defines permissions at the table level.
• Determine the actions (Read, Write, Create, etc.) that can be taken on a record
by the user.
• Are associated with Web Roles, determining the Web Role’s level of access.
• Table Permissions will not apply until the box Enable Table Permissions has
been checked on the Lists, Forms, and Web Form Steps.

Contact Web Role Table


Permission
Access Types
Scope Description

Global Permissions are applied regardless of the user’s relationship to the record.

Contact User’s contact record must have a relationship with the record.

Account User’s contact record must be related to the account related to the record.

Parent Grant privileges to the table record through the chain of its parent table permissions’
relationships.

Self Allows you to define rights a user has to their own Contact record
Page + Table Permissions
Page Permission

Web Page

Table
Dataverse Data Permission
Private and Public site
Private Public
• Only the site makers and organization users • the site is available on the internet
whom the maker granted access can view it.
Think of this as a “privacy wrapper” for sites for everyone (anonymously or
that are not ready for more users. authenticated) to access and interact
with it
• Website visitors need to authenticate using
the organization's Azure Active Directory
identity provider to access the website. • Your controls for Home page like
Restrict Access still apply.
• Site is still Unauthenticated when users
authenticates past the Private wrapper. So
you can fully test what browsing the site • This can feel confusing as you can
feels like before users actually login. have a completely private or internal
site but it’s state will say Public in
• This is not the feature for authentication admin tools.
control for internal sites
Identity providers
 Power Pages users can sign in with their choice of an external account based on
ASP.NET Identity. External identity providers which are configured will be up to
the business.

• Azure AD
• Azure AD B2C – Microsoft
recommended approach
• Microsoft
• LinkedIn
• Facebook
• Google
What is Liquid?

Liquid is an open-source templating language for website design and is


supported by Power Pages and many other industries web apps.

Liquid was originally written in Ruby, but has since been ported to the .NET
ported to the .NET framework

framework, which in turn has made it easily adaptable for use with Power Pages.
ported to the .NET framework

There is no .NET or other server-side language options now/planned.

Liquid gives Pages developers the ability to have server-side access to read and
search the table records in Dataverse pre-render/load of a Web Page
Liquid Event
Execution
Pipeline
Customization Options

Client-Side Language Server-Side Language

• JavaScript executes on the client-side. • Liquid executes on the server-side.


• Logic written is sent to the browser • Browser only can access the result
and anyone can see what’s going on in of execution
the DOM • End user’s/ developers don’t have
access to this in the DOM through
Dev tools
JavaScript vs. Liquid

Client-Side Language Server-Side Language

• Manipulate DOM • Server-side logic


• Validation • Work With Sensitive Data
• Business Logic • Interact with Dataverse
• Calculations • Access data from Power Pages
Components
• Runs on page-load, grid-load,
change of controls • Get user details, roles, permissions
• Performance
Liquid Operations

• Create, Read, Update, Delete (CRUD) Operations in Dataverse


• Use Web API
• Write Fetch XML
• Design Custom Pages
• Dynamics DOM Manipulation
• Grab Contextual Data
• Access to Power Pages tables and Dataverse table contexts
Better
Together
Liquid – Read Power Pages components data and logged in user details
without performing query to Dataverse

JavaScript – Can perform complex calculations and business logic on


events like OnChange, OnMouseHover, OnClick, etc.

Portal Web API – Can perform CRUD operations in Microsoft Dataverse


unlike Liquid, which can only retrieve data using FetchXML
Visual Studio Code + Power Platform Tools
Power Pages Web API
Use Portal Web API for interaction with data via Pages data-tier from the front end
of the website / perform CRUD across Dataverse tables
Portal Web API does not avoid Pages read-caching

Available Operations
Read records from a table
•Create a record in a table
•Update and delete records in a table
•Associate and disassociate tables Calling actions and functions using the portals Web
API is not supported.
Web API security

Follows Table Permissions and it’s not


possible to reach more data then exposed.
Field-level granular and has ability to set
Column Permissions
PAC CLI For Power Pages/Portals (Standard)

Main Dev UAT Prod


#Get Latest PAC CLI Update #Get Latest PAC CLI Update #Get Latest PAC CLI Update
pac install latest pac install latest pac install latest

#Connect to Dataverse Env Instance #Connect to Dataverse Env Instance #Connect to Dataverse Env Instance
pac auth create -u https://dataverseenvironmenturl.crm.dynamics.com/ pac auth create -u https://dataverseenvironmenturl.crm.dynamics.com/ pac auth create -u
https://dataverseenvironmenturl.crm.dynamics.com/
#/List all the portals in Dataverse Environment and get Ids #Download Portal By ID
pac paportal list pac paportal download --path C:\Power-Platform-CLI\Portals\<specific- #Download Portal By ID
folder-path> -id <portal id> pac paportal download --path C:\Power-Platform-
#Download Portal By ID CLI\Portals\<specific-folder-path> -id <portal id>
pac paportal download --path C:\Power-Platform-CLI\Portals\<specific- #Upload Dataverse Solution
folder-path> -id <portal id> pac solution import --path C:\Power-Platform-CLI\Portals\<specific- #Upload Dataverse Solution
folder-path>\Solution.zip pac solution import --path C:\Power-Platform-
#Download Portal By ID and Overwite currently local downloaded files CLI\Portals\<specific-folder-path>\Solution.zip
pac paportal download --path C:\Power-Platform-CLI\Portals\<specific- #Upload to Environment and Portal Record
folder-path> --webSiteId <portal id> --overwrite true pac paportal upload --C:\Power-Platform-CLI\Portals\<specific-folder- #Upload to Environment and Portal Record
path> pac paportal upload --C:\Power-Platform-CLI\Portals\<specific-
#Download Dataverse Solutions as managed folder-path>
pac solution export --path C:\Power-Platform-CLI\Portals\<specific-
folder-path>\Solution.zip --name SolutionName --managed true --include
general

#Download Dataverse Solutions as unmanaged


pac solution export --path C:\Power-Platform-CLI\Portals\<specific-
folder-path>\Solution.zip --name SolutionName --managed false--include
general
PAC CLI For Power Pages/Portals (Enhanced)

Main Dev UAT Prod


#Get Latest PAC CLI Update #Get Latest PAC CLI Update #Get Latest PAC CLI Update
pac install latest pac install latest pac install latest

#Connect to Dataverse Env Instance #Connect to Dataverse Env Instance #Connect to Dataverse Env Instance
pac auth create -u https://dataverseenvironmenturl.crm.dynamics.com/ pac auth create -u https://dataverseenvironmenturl.crm.dynamics.com/ pac auth create -u
https://dataverseenvironmenturl.crm.dynamics.com/
#/List all the portals in Dataverse Environment and get Ids #Upload Dataverse Solution
pac paportal list -v pac solution import --path C:\Power-Platform-CLI\Portals\<specific- #Upload Dataverse Solution
folder-path>\Solution.zip pac solution import --path C:\Power-Platform-
#Download Portal By ID CLI\Portals\<specific-folder-path>\Solution.zip
pac paportal download --path C:\Power-Platform-CLI\Portals --webSiteId #Upload to Environment and Portal Record
xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx --modelVersion 2 pac paportal upload --C:\Power-Platform-CLI\Portals\<specific-folder- #Upload to Environment and Portal Record
<path> --modelVersion 2 pac paportal upload --C:\Power-Platform-CLI\Portals\<specific-
#Download Portal By ID and Overwite currently local downloaded files folder-<path> --modelVersion 2
pac paportal download --path C:\Power-Platform-CLI\Portals --webSiteId #Download Portal By ID
xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx --modelVersion 2 --overwrite true pac paportal download --path C:\Power-Platform-CLI\Portals --
webSiteId xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx --modelVersion 2
#Download Dataverse Solutions as managed
pac solution export --path C:\Power-Platform-CLI\Portals\<specific- #Download Portal By ID and Overwite currently local downloaded files
folder-path>\Solution.zip --name SolutionName --managed true --include pac paportal download --path C:\Power-Platform-CLI\Portals --
general webSiteId xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx --modelVersion 2 --
overwrite true
#Download Dataverse Solutions as unmanaged
pac solution export --path C:\Power-Platform-CLI\Portals\<specific-
folder-path>\Solution.zip --name SolutionName --managed false--include
general
Technical Capabilities : Example Custom UI Frameworks

Microsoft Power Pages


Authentication, Content Management System, Language, etc

Standard features React.JS


Web Pages,
Web Templates, Custom Front-End JavaScript, HTML, CSS, etc
Content Snippets,
Site Settings, Customer
Custom Custom React.JS
And more Code
Header/Footer Pages Components (PCF)

Liquid Code
(Data Query, Power Pages Web API
Personalization,
(Full CRUD)
Pre-Render Logic Server-
side)

Power Pages Data Layer


Read Cache, External User Context, Security (Web Roles, Table Permissions)

Dataverse (Dynamics 365)


Tables, Columns, Relationships , Data Schema and Data Storage

Dataverse Plugins For Visual


Example Only

You might also like