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 :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Getting 401 Unauthorized error in web api on Azure VM

(0) ShareShare
ReportReport
Posted on by 5

Hi
I am trying to test my custom web service in postman, before using it in the Power Apps but unfortunatelly I get 401 Unauthorized error when trying to do the call the POST request.

pastedimage1662546494589v2.png

I did everything as shown in this tutorial: https://dynamics365musings.com/create-a-custom-service-in-d365/ including the token part.

My d365 enviroment is set on Azure Virtual Machine and this is the respond of the invoke in Event Viewer on the VM:

 pastedimage1662546398382v1.png

I also added Api permisions in Azure App: 

pastedimage1662632830401v1.png

PS:It is my first post, so please excuse me for any inconveniences :)

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Getting 401 Unauthorized error in web api on Azure VM

    Hi Michal,

    You can refer the following link to try to fix the error:

    https://nishantrana.me/2020/12/16/fixed-401-unauthorized-error-while-calling-dynamics-365-web-api/

    And you can refer the following link--Setup Postman to connect to Dynamics 365 CRM using OAuth 2.0 | Azure App Registration:

    d365demystified.com/.../

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
DAnny3211 Profile Picture

DAnny3211 239

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 139 Super User 2025 Season 2

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 91 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans