cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dippa
Frequent Visitor

Error message in PowerApps Data Integration - Bad request

Hi,

I'm attempting to make use of the SQL to CDS tremplate to move data from a SQL table into the Common data store. I can create the DI (Data Integration) app but get the error message below when it runs. To further clarify, the DI is able to retrieve the data from SQL, create the post request and sends it to CDS, CDS seems to reject the request.

 

For the Post request:

POST https://orge1e47dcf.crm6.dynamics.com/api/data/v9.0/cdm_workers {"cdm_middlename":"xxx","cdm_lastname":"xxxxxxxxx","cdm_emailaddress1":"test1","cdm_workernumber":"42825","ownerid@odata.bind":"/teams(0c3347fc-f4dd-e511-a967-006d3ae75f5a)"}

 

This is the error

Bad Request {"error":{"code":"0x80042f0a","message":"Principal team (Id=c3347fc-f4dd-e511-a967-006d3ae75f5a, type=9, teamType=0, privilegeCount=0, is missing prvReadcdm_worker privilege (Id=2b5c359a-6bf3-426f-9558-f7326760de18","innererror":{"message":"Principal team (Id=0c3747fc-f0dd-e813-a977-000d3ae03f5a, type=9, teamType=0, privilegeCount=0, is missing prvReadcdm_worker privilege (Id=2b53259a-63f3-4f3f-9558-f7326760de18","type":"System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=9999999999999]]","stacktrace":" at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.CreateInternal(Entity entity, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, Boolean checkAdminMode, Dictionary`2 optionalParameters)\r\n at Microsoft.Crm.Extensibility.OData.CrmODataExecutionContext.CreateOrganizationResponse(Entity entity)\r\n at Microsoft.Crm.Extensibility.OData.CrmODataServiceDataProvider.CreateEdmEntity(CrmODataExecutionContext context, String edmEntityName, EdmEntityObject entityObject, Boolean isUpsert)\r\n at Microsoft.Crm.Extensibility.OData.EntityController.PostEntitySetImplementation(String& entitySetName, EdmEntityObject entityObject)\r\n at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute[TResult](ILogger logger, EventId eventId, ActivityType activityType, Func`1 func, IEnumerable`1 additionalCustomProperties)\r\n at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute[TResult](ILogger logger, XrmTelemetryActivityType activityType, Func`1 func)\r\n at lambda_method(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()"}}}

 

 

Thanks

 

J

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi,

I managed to fix this last night., and thank you for your reply!

Even though I had PowerApps and Flow licenses asssinged they were not listed under 'customer engagement'.

So make sure in office 365 under licenses you have the correct PowerApp and Flow lic.

Thanks

J

View solution in original post

5 REPLIES 5
v-xida-msft
Community Support
Community Support

Hi @Dippa,

Could you please share a bit more about the error message within your app?
Based on the error message that you mentioned, it seems to tell that your current sign in account does not have prvReadcdm_worker permission to CDS in your PowerApps.

Please check if you have assigned proper permission (e.g. System Administrator) to your current sign in account to access your CDS. Please take a try to assign a System Administrator Role to your current sign in user, then check if the issue is solved.

More details about configuring environment security, please check the following article:

https://docs.microsoft.com/en-us/powerapps/administrator/database-security

More details about Privileges required for customization in PowerApps environment, please check the following article:

https://docs.microsoft.com/en-us/dynamics365/customer-engagement/customize/privileges-required-custo...

 

In addition, if the issue still exists, please consider take a try to re-create a new Data Integration project within your PowerApps, check if the issue still exists.

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi,

I managed to fix this last night., and thank you for your reply!

Even though I had PowerApps and Flow licenses asssinged they were not listed under 'customer engagement'.

So make sure in office 365 under licenses you have the correct PowerApp and Flow lic.

Thanks

J

View solution in original post

v-xida-msft
Community Support
Community Support

Hi @Dippa,

Have you solved your problem?

If you have solved your problem, please go head to click "Accept as Solution" to identify this thread has been solved for other users.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I had the same problem, and licenses were correct.

 

The solution for me was to assign permissions to the team. By default PowerApp Integration Task uses root team to assign the ownership if you don't define mapping fields for that.

 

Other solution could be to create a mapping fields for ownership between source and destination and assign an owner.

 

Anonymous
Not applicable

Hi @josemg0g0 

 

Could you provide detail step by step? im new in CDS and CRM, the problem is same, error privileges in entities with ownership type user and team

 

Thanks

Hamzah

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,003)