ugreg / virtual-entities

👤 Dynamics 365 Virtual Entity OData REST API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Virtual Entities

Dynamics 365 Virtual Entity demo.

Virtual Entity

A virtual entity is a definition of an entity in the Common Data Service platform metadata without the associated physical tables for entity instances created in the Common Data Service database. Instead during runtime, when an entity instance is required, its state is dynamically retrieved from the associated external system.

Run

C Sharp

in porgress. . . Download the project and click run. Even works on Mac!

Python

in porgress. . .

set FLASK_APP=server.py
flask run

INFO

If you run into any issues running the code, debug the script using python -m pdb .\server.py

Deploy to Azure

Create resource group

export rg="rg-virtual-entities"
az group create -n $rg -l 'West US'

Create resources

export server="server-dynamics-unit-test"
export db="db--dynamics-unit-test"
az sql server create --admin-password 'Password!' --admin-user admin --location 'West US' -n $server -g $rg

# A server-level firewall rule allows an external application, such as SQL Server Management Studio or the SQLCMD utility to connect to a SQL database through the SQL Database service firewall.
# To enable external connectivity, change the IP address to an appropriate address for your environment. To open all IP addresses, use 0.0.0.0 as the startip and 255.255.255.255 as andip.
export startip="0.0.0.0"
export endip="255.255.255.255"
az sql server firewall-rule create -g $rg --server $server -n AllowAnyIp --start-ip-address $startip --end-ip-address $endip

az sql db create -g $rg --server $server -n $db

Deploy REST API with OData.

Get your own test Dataset

Used Mockaroo to generate test data. You can use curl to test and get a response.

curl "https://api.mockaroo.com/api/0ad55780?count=100&key=d9e7f2e0" > "WebOrder-Virtual-Entity.csv"

References

C Sharp

Python

About

👤 Dynamics 365 Virtual Entity OData REST API

License:MIT License


Languages

Language:C# 89.4%Language:Python 10.3%Language:TSQL 0.3%