Web API Data operations Samples (PowerShell)
This article provides common understanding about Web API samples using PowerShell. Currently, there's only one sample, but we plan to add more. While each sample focuses on a different aspect of Microsoft Dataverse Web API, they all follow similar process and structure described in this article.
Web API Samples using PowerShell
The following samples use the patterns described here:
Sample | Sample Group | Description |
---|---|---|
Web API Basic Operations Sample (PowerShell) | Web API Basic Operations Sample | Demonstrates how to create, retrieve, update, delete, associate and disassociate Dataverse table rows (entity records). |
Not available yet | Web API Query Data Sample | Demonstrates how to use OData v4 query syntax and functions and Dataverse query functions. Includes examples of working with predefined queries and using FetchXML to perform queries. |
Not available yet | Web API Conditional Operations Sample | Demonstrates how to perform conditional operations you specify with ETag criteria. |
Not available yet | Web API Functions and Actions Sample | Demonstrates how to use bound and unbound functions and actions, including custom actions. |
Web API table schema operations sample (PowerShell) | Web API table schema operations sample | Demonstrates how to perform selected operations that modify the Dataverse schema, or metadata. |
Prerequisites
Before running these samples, you should read these articles that explain concepts and patterns used by these samples:
- Quick Start Web API with PowerShell and Visual Studio Code
- Use PowerShell and Visual Studio Code with the Dataverse Web API
These samples have the same prerequisites.
Install or verify that the following are installed
Install Visual Studio Code. See Download Visual Studio Code
Install the PowerShell extension for Visual Studio Code. See PowerShell for Visual Studio Code
Install PowerShell 7.4 or higher. See Install PowerShell on Windows, Linux, and macOS
Install the Az PowerShell module version 11.1.0 or higher. See How to install Azure PowerShell
To update an existing installation to the latest version, use
Update-Module -Name Az -Force
Verify installation
Open Visual Studio Code.
In the Terminal menu, select New Terminal.
In Visual Studio Code navigation pane, select the icon for the PowerShell extension.
Copy and paste the following script in the Visual Studio Code terminal window:
Write-Host 'PowerShell Version:'$PSVersionTable.PSVersion.ToString() Write-Host 'PowerShell Az version:'(Get-InstalledModule Az).Version
Press Enter. The output should resemble the following:
PowerShell Version: 7.4.0 PowerShell Az version: 11.1.0
If you don't see results like this, install or update the prerequisites.
You'll also need
- A valid user account for a Dataverse environment
- The Url to the Dataverse environment you want to connect to. See View developer resources to learn how to find it. It looks something like this:
https://yourorg.crm.dynamics.com/
, whereyourorg.crm
is different. - Basic understanding of the PowerShell scripting language
See also
Use the Dataverse Web API
Quick Start Web API with PowerShell and Visual Studio Code
Use PowerShell and Visual Studio Code with the Dataverse Web API
Web API Samples