The goal is to execute python file stored in blob storage using azure batch job.
-- created azure account -- created pool -- created job -- created task
Batchpool:
windowsserver
Target Dedicated Nodes: 2
VM Size: Standard A1_V2 1vCPU 2Gb Memory
StartTask: installs python by taking .exe files from storage account
Task: using python file stored in blob storage, just simply printing "Hello World".
Output: Gives an error Message: The system cannot find the file specified.
By logging remotely to a batch node I was able to confirm that the python was installed.
What am I doing wrong?
Maybe the syntax in "Command Line" to execute python script is incorrect?
I am not sure how to supply Environment Variables.
In order to run Python script inside a Azure Batch Pool Windows Node as a Start Task, Refer the steps in this Microsoft Blog.
I downloaded Python 3.12
from this website and uploaded the downloaded exe package in my Storage account container like below:-
Created a batch pool with Windows Server 2019 datacenter
image with 3 Nodes and 1 Spot node[ You can create it with 1 Node too].
In the start task selected the exe package from storage account:-
Make sure you check-mark Include SAS
while uploading exe package from storage account to batch task:-
My Task:-
Command line script to install Python 3.12:-
cmd /c "python-3.12.0-amd64.exe /quiet InstallAllUsers=1 PrependPath=1 Include_test=0"
Select Pool autouser, Admin in the Elevation level.
Save the Task, And the Task ran successfully on the Node:-
I Rdp'd into the Node and Python 3.12 was installed successfully:-
Now, I added another hello_world.py in my Storage account with Include SAS checkmark and ran it inside the Node:-
Added hello_world.py
in the Batch Start task > Resource files:-
My Start Task:-
Command line:-
cmd /c "python-3.12.0-amd64.exe /quiet InstallAllUsers=1 PrependPath=1 Include_test=0"
cmd /c "python hello_world.py"
Start Task Ran successfully, Make sure you Reboot the Node everytime, Before you run the Start task.
I RDP'd into the Node and the files were successfully present:-