Search code examples
c#azure-active-directorydynamics-crm

Client added new sandbox for Dynamics 365, and when trying to insert data I'm getting a 401 error


We had our client create a new sandbox for us to test imports without workflows (imports work on the original sandbox.) I'm authenticated into D365 using an Active Directory app with a certificate sent from the C# code and my thought process was to just replace all instances of the old base url of {sandbox-name}.api.crm.dynamics or {sandbox-name}.crm.dynamics with {new-sandbox-name}.api.crm.dynamics and {new-sandbox-name}.crm.dynamics. I'm getting a 401 error now when trying to import data.

I can't find in the Active Directory app where the certificate that we created is tied only to that original sandbox url, so is there something obvious I'm missing?


Solution

  • In your new Sandbox D365 CRM, go and create the Application user in system user table with the right security role/privilege. Then it should work.

    enter image description here

    Read more