Cannot connect to '\\Laptop123\C\'. : The system could not find the environment option that was entered

Amira Bedhiafi 34,101 Reputation points Volunteer Moderator
2023-03-16T19:51:55.5866667+00:00

I am trying to create a linked service with self-hosted integration server like below ;

The CSV file is under C:/

I am accessing my local machine with my email address and a password.

In this case for the user name should I use my email or the username?

The error I get :

Cannot connect to '\Laptop123\C'. Detail Message: The system could not find the environment option that was entered The system could not find the environment option that was entered

I tried to put C:\ in the host but it gives the same error

User's image

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,651 questions
{count} votes

Accepted answer
  1. PRADEEPCHEEKATLA 90,651 Reputation points Moderator
    2023-05-17T09:26:47.6266667+00:00

    @Amira Bedhiafi - - Thanks for the question and using MS Q&A platform.

    According to the offical documentation, the latest SHIR has a security fix that has been changed and does not allow access to local files by default.

    User's image

    You must run .\dmgcmd.exe -DisableLocalFolderPathValidation to disable the setting for more details, refer to Set up an existing self-hosted IR via local PowerShell

    User's image

    User's image

    Default: Enable security validation to disable access to file system of the local machine.

    Errorcode22853

    After Disabling access to file system of the local machine using: .\dmgcmd.exe -DisableLocalFolderPathValidation able to access the data from linked service.

    Resolve

    Hope this helps. Do let us know if you 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.

    2 people found this answer helpful.
    0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Khushal Makhija 5 Reputation points
    2024-12-16T09:19:34.86+00:00

    Try using below command to find your username

    whoami
    
    1 person found this answer helpful.

  2. Subashri Vasudevan 11,231 Reputation points
    2023-03-18T02:40:50.25+00:00

    Hi,

    Please check the below video, it touches upon same use case as yours.

    https://youtu.be/cEfDGwHvzJE you should be using the same credentials that you use to login to your laptop. if you use mail id for username, use the same. kindly let us know if that resolves your issue.

    Thanks


  3. PRADEEPCHEEKATLA 90,651 Reputation points Moderator
    2023-03-20T06:03:51.3133333+00:00

    @Amira Bedhiafi - The error message "Cannot connect to '\Laptop123\C'. Detail Message: The system could not find the environment option that was entered" in Azure Data Factory's File system could occur due to various reasons. However, one possible reason could be that the Data Factory is unable to find the network location specified in the file system connector.

    Here are some troubleshooting steps that you can follow to resolve this issue:

    1. Check if the network location '\Laptop123\C' exists and is accessible from the machine where Azure Data Factory is running.
    2. Make sure that the correct network path is specified in the file system connector. Double-check the path to ensure that it is correct and that there are no typos or mistakes.
    3. Check if the machine where the network location is hosted is running and accessible from the machine where Azure Data Factory is running. You can try to ping the machine to check if it is reachable.
    4. Verify that the correct credentials are specified to access the network location. Ensure that the user account has the necessary permissions to access the location.
    5. Check if any firewall or security software is blocking the connection. Temporarily disable the firewall or security software and try to connect to the network location again.
    6. Ensure that the machine where the network location is hosted is running the necessary services to allow remote connections. For example, if the network location is a shared folder, ensure that the "Server" service is running on the machine.

    As per the repro, you will experience this issue - when your username or password is incorrect:

    I got the same error when I gave the password as incorrect.
    User's image

    When I gave correct username and password works as excepted.

    User's image

    To find the currently logged-in user name in the Windows operating system, use the %username% environment variable.
    User's image

    Note: If your on a system/laptop - you can use same username and password which is used for system login. And if you are on domain you should use username as ******@organization.com and password should works.

    For more details, refer to MS Q&A thread: https://learn.microsoft.com/en-us/answers/questions/1188162/im-attempting-to-use-data-factory-to-transfer-a-cs

    Hope this helps. Do let us know if you 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.


  4. yeluru poojitha 0 Reputation points
    2023-09-25T19:12:49.6666667+00:00

    @PRADEEPCHEEKATLA
    Even though I had provided correct user name and password it is giving me the error as
    Cannot connect to 'C:\raw'. Detail Message: The system could not find the environment option that was entered

    The system could not find the environment option that was entered

    username --> i got when i run @echo %username%
    password---> system login password


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.