azure - 如何在不明确指定版本的情况下将 Azure 角色切换到 Windows Server 2008 R2?

标签 azure windows-server-2008 windows-server-2008-r2 azure-web-roles

Azure service configuration有两个参数 - osFamily 和 osVersion。 osFamily 可以是 1 表示 Windows Server 2008(默认),也可以是 2 表示 Windows Server 2008 R2。默认情况下,osVersion*,意思是“无论如何,这取决于 Azure 基础设施”。

现在我想从默认值切换到 R2。我打开配置文件并添加了 osFamily="2",现在当我尝试部署服务时,出现以下错误消息:

Invalid .cscfg file. If the osFamily attribute is set in the .cscfg file, you also need to set the osVersion attribute. The osVersion attribute can either be '*' for automatic operating system upgrades, or the name of a specific operating system version.

这在某种程度上意味着我现在必须指定确切的操作系统版本。

我不想指定确切的版本,我宁愿“无论如何,这取决于 Azure,就让它成为某个 Windows Server 2008 R2”。

如何在不明确指定确切操作系统版本的情况下切换到 Windows 2008 R2?

最佳答案

如果我正确地阅读了您的问题,您的 .cscfg 文件中有一行看起来像这样

<ServiceConfiguration serviceName="MyService" osFamily="2" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration">

根据错误消息告诉您的内容,虽然 osVersion 可能默认为 *,但如果您指定 osFamily,则还必须指定osVersion。在您的情况下,您想要添加该属性并将其设置为 * ,如下所示。

<ServiceConfiguration serviceName="MyService" osFamily="2" osVersion="*" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration">

关于azure - 如何在不明确指定版本的情况下将 Azure 角色切换到 Windows Server 2008 R2?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11775587/

相关文章:

powershell - 从任何地方运行 powershell 脚本

asp.net - Web 事件提供程序 'EventLogProvider' 引发了以下异常

c++ - 如何在 Windows 2008 R2 中使用 CreateVirtualDisk 创建差异 VHD

c++ - 应用程序崩溃后套接字仍在监听

azure - az devops login 无法使用 key 环存储 PAT;回退到文件存储

azure - 在 Visual Studio 中调试 Azure Function 时创建的日志文件在哪里

php - 为 Apache 设置 Windows 身份验证

DocumentDb/CosmoDb 的 Azure 函数绑定(bind)参数

azure - 提供的文件不是有效的服务包。详细错误代码: InvalidOperationException in azure

ios - 移动到 Amazon ec2 服务器后推送通知停止工作