Я установил утилиту sqlcmd в Azure Batch Node (это обычная windows VM). Итак, у меня есть утилита bcp на этой виртуальной машине. Как я могу указать путь к bcp.exe в Azure Пакетное задание?
using (BatchClient batchClient = BatchClient.Open(cred))
{
string jobId = "1";
CloudJob job = batchClient.JobOperations.GetJob(jobId);
job.Commit();
string taskCommandLine = String.Format("cmd c/ 'D:\\Program Files\\Microsoft SQL Server\\Client SDK\\ODBC\\130\\Tools\\Binn\\bcp.exe'");
string uniqueIdentifier = Regex.Replace(Convert.ToBase64String(Guid.NewGuid().ToByteArray()), "[/+=]", "");
string taskId = String.Format(name.Replace(".", string.Empty) + "-" + uniqueIdentifier);
CloudTask task = new CloudTask(taskId, taskCommandLine);
task.UserIdentity = new UserIdentity(new AutoUserSpecification(elevationLevel: ElevationLevel.Admin, scope: AutoUserScope.Task));
batchClient.JobOperations.AddTask(jobId, task);
}
Это правильный способ указать полный путь, например
string taskCommandLine = String.Format("cmd c/ 'D:\\Program Files\\Microsoft SQL Server\\Client SDK\\ODBC\\130\\Tools\\Binn\\bcp.exe'");