Getting started
From an empty WordPress site to a live collection: register an app in Entra ID, give it a least-privilege application user in Dataverse, store the credentials in wp-config.php, run the connection test, and publish your first table with a shortcode or a block. About thirty minutes if you have admin rights in both places.
1. Entra ID app registration
- In the Microsoft Entra admin center open App registrations and create a new registration. Single tenant, no redirect URI.
- Note the Application (client) ID and the Directory (tenant) ID.
- Under Certificates & secrets create a client secret. Copy the value now; it is shown once. Put the expiry date in your calendar: an expired secret is the most common reason a Dataverse site stops working, and the plugin's health probe will tell you when it happens.
No API permissions are needed for the client-credentials flow: access is granted inside Dataverse through the application user in the next step.
2. Application user and security role
- In the Power Platform admin center open your environment, then Settings, Users + permissions, Application users, and add the app registration as an application user.
- Create a custom security role and assign it. Do not use System Administrator.
The role needs only what the features you use require:
| Feature | Privileges on the table |
|---|---|
| Collections, detail pages, images and files | Read (organization scope for a public site) |
| Forms in create mode | Create; Append when the form binds a lookup or relates to a record |
| Forms in update mode | Write, plus Read through the bound collection |
| Lookup fields and "relate to" | Read and Append To on the target table, so the plugin can list names and bind the record |
| Field-secured columns | A field security profile that grants the application user access to the column |
Column labels, choice options and required levels come from the table metadata, which every application user can read.
3. Credentials in wp-config.php
Constants are the recommended home: they lock the matching fields on the settings page and keep the secret out of the database.
define('WBS_DATAVERSE_CONNECT_TENANT_ID', '00000000-0000-0000-0000-000000000000');
define('WBS_DATAVERSE_CONNECT_CLIENT_ID', '00000000-0000-0000-0000-000000000000');
define('WBS_DATAVERSE_CONNECT_CLIENT_SECRET', 'your-client-secret');
define('WBS_DATAVERSE_CONNECT_ENV_URL', 'https://yourorg.crm4.dynamics.com');
Without the constants, enter the four values under Dataverse Connect, Connection in wp-admin. The secret is stored in the options table and never displayed again. Changing any connection value drops the cached token and flushes the read cache.
The same tab holds the site-wide Cache TTL (default 300 seconds, 0 disables caching) and the health alert settings.
4. Test connection
Click Test connection on the Connection tab. The plugin requests a fresh token and calls WhoAmI; a success shows the application user id. A failure shows the reason: invalid_client means a wrong or expired secret, an HTTP 403 means the application user is missing or has no role.
5. First collection
On the Collections tab add a collection. The four required values:
| Field | Example | Where to find it |
|---|---|---|
| Key | listings | Your choice; used in the shortcode and the block dropdown |
| Table (logical name) | wbs_listing | Power Apps maker portal, table properties |
| Entity set (plural) | wbs_listings | Same place, "Set name"; usually the logical name with an s |
| Name column | wbs_name | The table's primary name column |
Add the columns to display, one per line, and a status filter such as statecode eq 0 so only active records are public. Every other field is explained on the Collections page. Saving flushes the cache.
Put the shortcode on a page:
[wbsdvc_collection name="listings" per_page="12" columns="3"]
The same page renders a record's detail view when ?dvc=<slug-or-id> is appended to its URL, so one page is enough.
6. First block
In the block editor add the Dataverse Collection block (Widgets category), pick listings from the dropdown in the sidebar and adjust records per page, columns and the search, filter and sort switches. The editor shows a server-rendered preview; the published page renders exactly the shortcode above. Details on the Blocks page.
Next steps
- Switch on search, filters and sort for the collection and set a slug column for readable URLs.
- Add a form on the Forms tab and attach it to the collection with the
formattribute, so every detail page carries an enquiry form related to its record. - Set the alert email on the Connection tab, and add a webhook if a flow should react to submissions.