web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested Answer

Get Azure SQL data in Virtual entity

(0) ShareShare
ReportReport
Posted on by 75

Hello Experts,

I am working on Virtual entity and i am retrieving data from Azure SQL database for that I have written OData which retrieves Sql data from Azure SQL Database. I am trying to mapping data to virtual entity fields but data is not showing.

OutPut of ODataservice:

URL:  http://sqldb.azurewebsites.net/$metadata

"<EntityType Name="Contact">
<Key>
<PropertyRef Name="id"/>
</Key>
<Property Name="id" Type="Edm.String" Nullable="false"/>
<Property Name="Name" Type="Edm.String"/>
<Property Name="Phone" Type="Edm.String"/>
<Property Name="Email" Type="Edm.String"/>
<Property Name="Address" Type="Edm.String"/>
</EntityType>
</Schema>
<Schema xmlns="schemas.microsoft.com/.../edm" Namespace="AzureSqlDatabaseProject">
<EntityContainer Name="DefaultContainer" m:IsDefaultEntityContainer="true">
<EntitySet Name="Contacts" EntityType="AzureSqlDatabaseProject.Models.Contact"/>
</EntityContainer>"
{
  "odata.metadata":"http://sqldb.azurewebsites.net/$metadata#Contacts","value":[
    {
      "id":"1","Name":"abc1","Phone":"1111111111","Email":"abs@gmail.com","Address":"India"
    },{
      "id":"2","Name":"abc2","Phone":"2222222222","Email":"afgs@gmail.com","Address":"India"
    },{
      "id":"3","Name":"abc3","Phone":"3333333333","Email":"adfr@gmail.com","Address":"India"
    },{
      "id":"4","Name":"abc4","Phone":"4444444444","Email":"sdy@gmail.com","Address":"India"
    },{
      "id":"5","Name":"abc5","Phone":"5555555555","Email":"xyz@gmail.com","Address":"India"
    }
  ]
}
I have created record in Virtual Entity Data Sources,
pastedimage1581411818365v3.png
and I mapped the properties on fields for all fields
pastedimage1581411921369v4.png

But I am enable to get data, I am getting below type of error,

pastedimage1581412006018v5.png

How to resolve that issue?

From References:

1. https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/customize/virtual-entity-walkthrough-using-odata-provider

2. https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/customize/create-edit-virtual-entities

I have the same question (0)
  • Suggested answer
    winston he Profile Picture
    220 on at

    The reason is because there is no property of GUID type for your entity. To create a virtual entity and map it to CRM entity, there must be a GUID property. You can try this OData demo service and it will be fine:

    NOTE:contactId will be GUID field which is necessary.

    winstonodata4.azurewebsites.net/$metadata

    ...

    "

    </Key>

    <Property Name="contactId" Type="Edm.Guid" Nullable="false"/>

    <Property Name="name" Type="Edm.String"/>

    <Property Name="address" Type="Edm.String"/>

    <Property Name="email" Type="Edm.String"/>

    "

  • Kiran_girase Profile Picture
    75 on at

    Thanks for reply winston he,

    I have added contactId as a guid and mapped on Primary Key but I am getting same error

    URL: dynamisitysqldb.azurewebsites.net/$metadata

    URL: dynamisitysqldb.azurewebsites.net/Contacts

    for Virtual Entity Data Sources

    URL: dynamisitysqldb.azurewebsites.net/Contacts

    TimeOut: 120

    Pagination Mode: Server-side Paging

    Return Inline Count: False

    I tried all the possibilities into the url and pagination mode but getting same error,

    pastedimage1581574775308v1.png

  • winston he Profile Picture
    220 on at

    There could be something wrong when  the virtual entity is configured, you can raise a support team for Microsoft support team for  further deeper investigation. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 22 Super User 2026 Season 1

#1
Suriyanarayanan V Profile Picture

Suriyanarayanan V 22

#3
Encore Business Solutions Profile Picture

Encore Business Sol... 14

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans