web
You’re offline. This is a read only version of the page.
close
Skip to main content
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)
  • winston he Profile Picture
    220 on at
    RE: Get Azure SQL data in Virtual entity

    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. 

  • Kiran_girase Profile Picture
    75 on at
    RE: Get Azure SQL data in Virtual entity

    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

  • Suggested answer
    winston he Profile Picture
    220 on at
    RE: Get Azure SQL data in Virtual entity

    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"/>

    "

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

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

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 100 Super User 2025 Season 2

#2
Suresh Kulla Profile Picture

Suresh Kulla 72 Super User 2025 Season 2

#3
DAnny3211 Profile Picture

DAnny3211 54

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans