错误消息是 BadRequest:不满足ETag指定的条件。
这是我正在使用的代码
_cloudServiceName = ConfigurationManager.AppSettings["CloudServiceName"];
_maxJobCount = Int32.Parse(ConfigurationManager.AppSettings["MaxJobCount"]);
string certpath = HttpContext.Current.Server.MapPath("/App_Data/DanAzureCertificate.pfx");
X509Certificate2 cert = new X509Certificate2(certpath, "SOLID");
CertificateCloudCredentials creds = new CertificateCloudCredentials(_subScriptionID, cert);
smClient = new SchedulerManagementClient(creds);
smClient.LongRunningOperationInitialTimeout = int.MaxValue;
schedulerClient = new SchedulerClient(_cloudServiceName, "", creds);
schedulerClient.LongRunningOperationInitialTimeout = int.MaxValue;
JobCollectionCreateParameters pc = new JobCollectionCreateParameters();
pc.IntrinsicSettings = new JobCollectionIntrinsicSettings();
pc.IntrinsicSettings.Quota = new JobCollectionQuota();
pc.IntrinsicSettings.Quota.MaxJobCount = _maxJobCount;
pc.IntrinsicSettings.Plan = JobCollectionPlan.Standard;
pc.Label = jobCollectionName;
// smClient = new SchedulerManagementClient();
smClient.LongRunningOperationInitialTimeout = 3600;
var createreposnse = smClient.JobCollections.Create(_cloudServiceName, jobCollectionName, pc);
这是我在输出窗口中得到的
线程0x2524已退出,代码为0(0x0)。 应用见解遥测:{" name":" Microsoft.ApplicationInsights.Dev.ac922776334349f8bcc2e2ed951af0a9.RemoteDependency"," time":" 2017-01-14T12: 13:41.2610531Z""的iKey":" ac922776-3343-49f8-BCC2-e2ed951af0a9""标记" {" AI。 device.roleInstance":" HP"," ai.internal.sdkVersion":" rddf:2.1.0.363"},"数据&# 34;:{"碱基类型":" RemoteDependencyData"" baseData" {"版本":2"名称&#34 ;:" https://management.core.windows.net/c44db09b-bb78-417c-a130-934ce4edb2f5/cloudservices/newCloudService/resources/scheduler/~/JobCollections/JC1"" ID":" e9odaNEE8sI =""值":1888.9979,&#34 ;发送resultCode":" 404"" dependencyKind":1,"成功":假,"属性" {&#34 ; DeveloperMode":"真"}}}} 抛出异常:' Hyak.Common.CloudException'在Microsoft.Threading.Tasks.dll中 应用见解遥测:{" name":" Microsoft.ApplicationInsights.Dev.ac922776334349f8bcc2e2ed951af0a9.RemoteDependency"," time":" 2017-01-14T12: 13:48.7034807Z""的iKey":" ac922776-3343-49f8-BCC2-e2ed951af0a9""标记" {" AI。 device.roleInstance":" HP"," ai.internal.sdkVersion":" rddf:2.1.0.363"},"数据&# 34;:{"碱基类型":" RemoteDependencyData"" baseData" {"版本":2"名称&#34 ;:" https://management.core.windows.net/c44db09b-bb78-417c-a130-934ce4edb2f5/cloudservices/newCloudService/resources/scheduler/JobCollections/JC1"" ID":" 2Y8TsJ / DV / Y =""值":1418.5722 "发送resultCode":" 400"" dependencyKind":1,"成功":假,"属性&#34 ;: {" DeveloperMode":"真"}}}} 抛出异常:' Hyak.Common.CloudException'在Microsoft.Threading.Tasks.dll中 ' iisexpress.exe' (CLR v4.0.30319:/ LM / W3SVC / 2 / ROOT-1-131288695585980488):已加载' C:\ Windows \ assembly \ GAC_MSIL \ Microsoft.VisualStudio.Debugger.Runtime \ 14.0.0.0__b03f5f7f11d50a3a \ Microsoft.VisualStudio .Debugger.Runtime.dll&#39 ;.跳过加载符号。模块已经过优化,调试器选项“Just My Code'已启用。 程序' [11560] iisexpress.exe:程序跟踪'已退出代码0(0x0)。 该程序' [11560] iisexpress.exe'已退出代码-1(0xffffffff)。 程序' [9564] iexplore.exe'退出时使用代码-1(0xffffffff)。
任何想法如何解决这个问题?