How to pass application path to task in Azure batch

血红的双手。 提交于 2019-12-11 08:45:35

问题


I am using Azure batch. I have an exe which I need to execute on compute nodes.

I am using this path in the azure portal in my task window "cmd /c %AZ_BATCH_APP_PACKAGE_MyAppCreateRG%\CreateRG.exe -args HelloRG eastUs"

But I am getting an error: The system cannot find the path specified.


回答1:


For your issue, the error you got is the core point of your problem. You can create a task with the command cmd /c "echo %AZ_BATCH_APP_PACKAGE_MyAppCreateRG%" to show the exact path if it exists or not.

Just like if you want to get the environment variable PATH in windows, you should use the command echo %PATH%. And the result will like below:

So, if it could not show the path you want, it means the environment variable doesn't exist and you should set it up first and check then.

I suggest if you want to execute an exe, you should check if the path of it is right and if the exe already exist for you.




回答2:


It appears that you have mis-quoted your command to execute. Try:

cmd.exe /c "%AZ_BATCH_APP_PACKAGE_MyAppCreateRG%\CreateRG.exe -args HelloRG eastUs"



回答3:


As an alternative i am able to execute powershell script instead of exe

powershell C:\Scripts\CreateRG.ps1 -resourceGroup "MyRG" -location "eastUs"



来源:https://stackoverflow.com/questions/52138427/how-to-pass-application-path-to-task-in-azure-batch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!