Azure Batch Pool Windows Start Up Script Paths not found

George Li 0 Reputation points
2023-07-05T01:06:10.3166667+00:00

I have a Batch Pool of windows virtual machines. I would like the pool to automatically load a folder with program installers, let's say install.exe files, and copy it to the /root/shared/ directory or other accessible directory for a subsequent task or command to install. Currently, I can successfully get it to load the directory into the startup/wd directory simply by selecting the container via the Azure web portal.

I would then like to use in the startup script command line, something like:

xcopy %AZ_BATCH_NODE_STARTUP_DIR%\wd\install.txt %AZ_BATCH_NODE_SHARED_DIR%\install.txt

However, I get the error Invalid Path in the stderr.txt log and the startup script fails.

I have been following this https://learn.microsoft.com/en-us/azure/batch/files-and-directories for the environment variables and am now at a loss.

Does anyone know what I'm missing, or if there is an easier way to automatically deploy this to a directory where a startup or future task can then access and install the program?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,994 questions
Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,224 questions
Azure Batch
Azure Batch
An Azure service that provides cloud-scale job scheduling and compute management.
339 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Prrudram-MSFT 25,321 Reputation points
    2023-07-11T06:42:13.1933333+00:00

    @George Li

    Thank you for reaching out to the Microsoft Q&A platform.

    It sounds like you are trying to copy a file from the startup directory to the shared directory on a Batch pool of Windows virtual machines, but you are encountering an "Invalid Path" error.

    One thing to check is that the shared directory exists on the virtual machines in the Batch pool. By default, the shared directory is located at C:\BatchNode\Shared on Windows virtual machines in a Batch pool. You can check if this directory exists by logging into one of the virtual machines in the pool and navigating to the directory.

    If the shared directory does not exist, you can create it by adding a command to your startup script that creates the directory. For example, you can add the following command to your startup script:

    mkdir C:\BatchNode\Shared Once the shared directory exists, you can modify your startup script to copy the file from the startup directory to the shared directory. Here is an example command that copies a file named install.txt from the startup directory to the shared directory

    xcopy %AZ_BATCH_NODE_STARTUP_DIR%\install.txt C:\BatchNode\Shared\install.txt

    Note that in this example, I am assuming that the file you want to copy is named install.txt, not install.exe as mentioned in your question. You will need to modify the command to match the name of the file you want to copy.

    If you continue to encounter issues, you can check the stderr.txt log for more information about the error. This log file should contain more detailed information about the error that occurred.

    If this does answer your question, please accept it as the answer as a token of appreciation.

    0 comments No comments

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.