azure - Azure 云服务中的服务定义与服务配置

标签 azure azure-worker-roles azure-cloud-services

有谁知道这两者有什么区别吗?我查看过,似乎找不到一个页面可以清楚地描述它们的不同之处。微软对两者的解释非常模糊。

Definition documentation

The file contains the definitions for the roles that are available to a cloud service, specifies the service endpoints, and establishes configuration settings for the service.

Configuration documentation

specifies the number of role instances to deploy for each role in the service, the values of any configuration settings, and the thumbprints for any certificates associated with a role

最佳答案

link 中的第一行您包含的服务定义文件 (*.csdef) 非常重要 - 服务定义文件定义应用程序的服务模型。

如您所知,云服务无状态PaaS服务,只需将服务定义文件告诉Azure Fabric Controller应如何为您创建和配置VM。例如,InputEndpoints 定义必须在防火墙中打开以允许传入流量的端口。另一个示例是 vmsize 元素,它告诉 Fabric Controller 创建特定大小(小型、中型等)的 VM 来托管您的角色。

服务配置文件 (*.cscfg) 可以被视为与您的角色(Web 和 Worker)等效的 web.configapp.config。您可以在此处定义应用程序设置。

这两个文件之间的一个主要区别是 csdef 文件包含在部署的包中,因此如果您必须对 csdef 文件进行任何更改(例如 VM 大小),则需要重新部署代码。 cscfg 文件随包一起部署,您可以即时更改设置,而无需重新部署代码。因此,如果您有一个设置并且想要更改该设置的值,您可以简单地在门户(或其他方式)上执行此操作,而无需重新部署代码。请注意,配置设置元素名称也存储在 csdef 文件中,因此您无法在 cscfg 文件中添加或删除设置。您必须从 cscfg 和 csdef 文件中添加/删除它。

关于azure - Azure 云服务中的服务定义与服务配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29591367/

相关文章:

azure - 部署的 REST API 总是给出 500 错误

azure - 当我想要购买 SSL 证书时,SSL 和 TLS 服务器证书之间有什么区别吗?

javascript - Azure cosmos DB 仅在查询中允许最多 5 个联接

azure - 使用 .net 在 Azure 容器实例中创建新容器组

azure - Azure 搜索中的个性化搜索

azure - 辅助角色的本地存储位于文件系统的哪个位置?

azure - 在 Windows Azure 中实现辅助角色

c# - CloudConfigurationManager.GetSetting() 使用 Azure Configuration Manager 3.0 返回 null

azure - 在云服务上设置运行时 Application Insights

c# - Azure 云服务 - 部署错误