Our Requirement:
We have Azure Linux server resource group. So we need to create azure function in .net core 3.1.
So, we got the following package which provide supports in .net core azure function
Microsoft.Powerplatform.Cds.Client -Version 0.2.14-Alpha
Let me include few details about our implementation:
1. We have used Dynamics connection string - ClientSecret Authentication types
2. Following things working fine with the above connection string.
- Retrieve records from Entities - Working fine
- Insert/Update operation in Entity which doesn't contain EntityReference type (Lookup) - Working fine.
3. When we perform Insert/update operation in Entity which contains EntityReference type (Lookup), it gives error
Operation return invalid status code 'Bad Request'
Let me attach some code which we implemented in console application:
var service = new CdsServiceClient(connectionString);
if (service.IsReady)
{
Entity account = GetAccountEntity(service);
Entity coupon = GetCouponEntity(service);
Entity couponPerCustomer = new Entity("couponpercustomer");
couponPerCustomer["couponid"] = coupon.ToEntityReference();
couponPerCustomer["customerid"] = account.ToEntityReference();
service.Create(couponPerCustomer);
}
When we run above code it gives error in "service.Create(couponPerCustomer)"
Error: Operation return invalid status code 'Bad Request'
