如何为 Azure 部署修复 "OS version specified in the .cscfg file is inactive"?

How to fix "OS version specified in the .cscfg file is inactive" for Azure deployment?

我们的一个 msbuild 几天前开始失败并出现此错误:

The polling operation Create Deployment failed with the error: (400) BadRequest. Error Code: BadRequest Message: The OS version specified in the .cscfg file is inactive. This means that it cannot currently be used to create, update or upgrade a deployment.
The deployment failed. Check the logs for exceptions that may have caused this failure.

Exception Message: An attempted http request against URI returned an error: (400) BadRequest. Additional Exception Information: Error Code: BadRequest Message: The OS version specified in the .cscfg file is inactive. This means that it cannot currently be used to create, update or upgrade a deployment. (type AzureHttpRequestException) Exception Stack Trace: at Microsoft.TeamFoundation.Deployment.Workflow.AzureManagement.v1_7.OperationStatusInfo.EnsureSuccessStatus(Uri requestUri) at Microsoft.TeamFoundation.Deployment.Workflow.Activities.ReportFailedPollResultAndThrow.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

根据此页面,我们的访客 OS 版本似乎被 Microsoft 视为 "disabled":https://azure.microsoft.com/en-us/documentation/articles/cloud-services-guestos-update-matrix/

因此,我将 .cscfg XML 文件中 'ServiceConfiguration' 行的 .cscfg 文件从 'osVersion="WA-GUEST-OS-4.26_201511-02"' 更新为 'osVersion="WA-GUEST-OS-4.29_201602-01"'。但是没有用。

有人知道我可以尝试的其他方法吗?谢谢

使用星号符号 (osVersion="*") 似乎解决了这个问题。我的构建又开始工作了。

根据我的一位同事的说法,我们之前对来宾 OS 版本进行硬编码的原因是,要让 .NET 4.6 正常工作,这是必要的。可能不再需要了。

.cscfg 的完整行是:

<ServiceConfiguration serviceName="OurCompany.Azure" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="4" osVersion="*" schemaVersion="2015-04.2.6">