OData WebServices returns Host Validation error through Self-Hosted IR test connection

Fabien GRANGE 25 Reputation points
2023-04-11T08:01:23.9533333+00:00
DEBUG:
Microsoft.DataTransfer.Common.Shared.HybridDeliveryException: Failed to create odata connection to RequestUrl. ---> Microsoft.DataTransfer.SecurityValidation.Exceptions.**HostValidationException**: **Value does not fall within the expected range.**
   at Microsoft.DataTransfer.SecurityValidation.**HostValidator**.HandleDisallowedHostWithLogging(Action`1 writeLog, Boolean throwException, Tuple`3 args)
   at Microsoft.DataTransfer.SecurityValidation.**HostValidator**.IsAllowedHost(String host, NetworkType networkType, Boolean enableLocalMachineAccessFromOnPremise, Action`1 writeAccessDeniedLog, Action`1 writeDnsFailureLog, Boolean throwExceptionUponValidationFailure)
   at Microsoft.DataTransfer.SecurityValidation.HostValidator.IsAllowed(String hostOrUri, NetworkType networkType, Boolean enableLocalMachineAccessFromOnPremise, Action`1 writeAccessDeniedLog, Action`1 writeDnsFailureLog, Boolean throwExceptionUponValidationFailure)
   at Microsoft.DataTransfer.Common.HostValidationRuntimeCommonHelper.ValidateHostWithLogging(Uri host, Guid jobId, Guid activityId, ComputeType computeType, Boolean enableLocalMachineAccessFromOnPremise, Boolean disableLocalFolderPathValidation, Boolean throwExceptionUponValidationFailure, Boolean supportLocalFolderPathValidation)
   at Microsoft.DataTransfer.Runtime.GenericHttpClient.PrivateHttpRequestHandler.<SendAsync>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.DataTransfer.Runtime.Connector.OData.ODataClientFactory.<GetHandlerFromSvcMetadata>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.DataTransfer.Runtime.Connector.OData.ODataClientFactory.<CreateODataClient>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.DataTransfer.Runtime.Connector.OData.ODataConnection.CreateClient()
   --- End of inner exception stack trace ---
   at Microsoft.DataTransfer.Runtime.Connector.OData.ODataConnection.CreateClient()
   at Microsoft.DataTransfer.Runtime.Connector.OData.ODataConnection.TestConnection()
   at Microsoft.DataTransfer.Runtime.ConnectorHelper.ValidateConnectionAdfV2LinkedService(String linkedServicePayload, PluginRegistration plugins)
   at Microsoft.DataTransfer.DIAgentHost.BusinessLogic.ValidateConnectivityAdfV2Logic.TestConnectionWithIntegrationRuntimeOnline(String payload)
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,196 questions
{count} votes

Accepted answer
  1. KranthiPakala-MSFT 46,442 Reputation points Microsoft Employee
    2023-04-11T23:48:48.9733333+00:00

    Hi @Fabien GRANGE , Welcome to Microsoft Q&A forum and thanks for reaching out here. As per your confirmation, my understanding is that your ODATA service and the SHIR are on the same server and resulting in above error message. But when you install the SHIR in you local machine it is working fine.

    Looking at this statement from error log: Microsoft.DataTransfer.SecurityValidation.**HostValidator**.IsAllowedHost(String host, NetworkType networkType, Boolean enableLocalMachineAccessFromOnPremise, Action`1 writeAccessDeniedLog, Action`1 writeDnsFailureLog, Boolean throwExceptionUponValidationFailure

    The host validation is causing the problem here. By default, the local machine access is disabled for security reason. Which is why it is failing with above error message.
    Ref document: Set up an existing self-hosted IR via local PowerShell

    User's image

    User's image

    If needed, you can opt out this security feature by leveraging SHIR command line (-EnableLocalMachineAccess) as shown in above image. (Note: Making a request from SHIR to local IP is not a secure behavior, so that product team blocked any localhost access from SHIR). But if your requirement needs SHIR to access the local host then you can enable local machine access using above powershell command on the server where SHIR is hosted.

    Workaround 2: Ideal way is to have your SHIR installed on different server than that of your ODATA host server. Hope this info helps.

    Please don’t forget to Accept Answer and Yes for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful