Greetings & Welcome to Microsoft Q&A forum! Thanks for posting your query!
This error indicates that the Azure Data Factory (ADF) pipeline is failing to post a JSON message to the Service Bus due to a 401 Unauthorized error. Even though the ADF has the required roles (Service Bus Owner and Sender), the issue likely stems from network restrictions or authentication configuration.
Understanding the Error
The error message indicates that the Azure Data Factory is attempting to connect to a Service Bus queue but is being prevented.
-
ErrorCode=RestCallFailedWithClientError
- This means the ADF was unable to complete the REST API call to Service Bus. -
Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException
- This indicates a general exception related to the ADF's data transfer capabilities. -
Message=Rest call failed with client error, status code 401 Unauthorized
- This points to a 401 Unauthorized error, which means the ADF is attempting to access the Service Bus queue without the necessary permissions. -
Response: <Error> <Code>401</Code> <Detail>Ip has been prevented to connect to the endpoint
- This confirms that the ADF's IP address is being blocked from accessing the Service Bus endpoint.
Here are some potential causes and resolutions that might help you in resolving the issue:
Authentication Issues - Ensure that the ADF has the correct permissions to access the Service Bus. Even though you mentioned that ADF has the service bus owner and sender roles, double-check that the roles are correctly assigned and that there are no issues with the authentication token being used.
Network Configuration - Since ADF and the Service Bus are in different virtual networks, ensure that the private endpoints are correctly configured and that the necessary network rules are in place. Verify that the virtual network IP CIDR is indeed whitelisted in the Service Bus.
Service Bus Configuration - Check the Service Bus settings to ensure that it is configured to accept connections from the ADF's virtual network. Sometimes, additional settings might be required to allow cross-network communication.
Token Expiration - If you are using a token for authentication, ensure that it has not expired. You may need to refresh the token before making the API call.
Service Bus Namespace - Ensure that the correct Service Bus namespace is being targeted in your API call. A mismatch in the namespace can lead to authentication failures.
Please refer to the links provided below, as they might offer some insights that could help you address your question.
- Troubleshoot the REST connector in Azure Data Factory and Azure Synapse
- Allow access to Azure Event Hubs namespaces via private endpoints
- known limitations when using the Private Link service
Please refer to this similar thread:
- Unable Auhorize Access to REST API end service with Azure Data Factory with Token Error status code 401 Unauthorized
- Azure Private Endpoints with Service Bus and Function receiver fails with "Ip has been prevented to connect to the endpoint"
I hope this information helps. Please do let us know if you have any further queries.
If this answers your query, do click Accept Answer
and Yes
for was this answer helpful. And, if you have any further query do let us know.