Hello @S B R Vamsi Manda and welcome to Microsoft Q&A.
From the second error message it sounds like you might not have given the proper authorization header.
It is expecting like
Header name: "Authorization"
Heaver value: "Bearer XXXXXXXXXXXXXXXXXXXXXX"
This bearer token is acquired in a separate step, using https://login.microsoftonline.com/common/oauth2/authorize
However this is only one of the ways to authorize. Another easier way is to use the System Assigned Managed Identity. For this you need to go to the Azure Portal, and on the resource group of the Data Factory, assign either "Reader" or "Data Factory Contributor" role to the Factory.