[英]Unable to get environment variable in azure batch VM
這是我的 Azure 批處理配置,我試圖從 此處和此處的microsoft 教程中創建
我試圖在這里定義環境變量
CloudPool pool = batchClient.PoolOperations.CreatePool(
poolId: PoolId,
targetDedicatedComputeNodes: PoolNodeCount,
virtualMachineSize: PoolVMSize,
virtualMachineConfiguration: vmConfiguration);
// Specify the application and version to install on the compute nodes
pool.ApplicationPackageReferences = new List<ApplicationPackageReference>
{
new ApplicationPackageReference {
ApplicationId = "7Zip",
Version = "19.00" }
};
// Commit the pool so that it's created in the Batch service. As the nodes join
// the pool, the specified application package is installed on each.
await pool.CommitAsync();
CloudJob job = batchClient.JobOperations.CreateJob();
job.Id = JobId;
job.PoolInformation = new PoolInformation { PoolId = PoolId };
await job.CommitAsync();
string taskId = "blendertask01";
string commandLine =
@"cmd /c echo %AZ_BATCH_APP_PACKAGE_7Zip%";
CloudTask blenderTask = new CloudTask(taskId, commandLine);
batchClient.JobOperations.AddTask(JobId, blenderTask);
我期待cmd /c echo %AZ_BATCH_APP_PACKAGE_7Zip%
的輸出為我提供可以找到我的應用程序 7zip 的路徑,以便我可以安裝它,但我不明白。 相反,我得到%AZ_BATCH_APP_PACKAGE_7Zip%
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.