Azure云服务中的服务定义与服务配置 [英] service definition vs service configuration in Azure cloud services

查看:43
本文介绍了Azure云服务中的服务定义与服务配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道这两者之间有什么区别吗?我已经看过,但似乎找不到一个页面,其中清楚地说明了它们的不同之处.微软解释这两个方法的方式非常模糊.

Does anyone know what the difference is between these two? I've looked and can't seem to find a page that has a clear description of how they are different. The way Microsoft explains the two of them is very vague.

定义文档

该文件包含可用于以下角色的定义云服务,指定服务端点并建立服务的配置设置.

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.

指定要为以下角色中的每个角色部署的角色实例数服务,任何配置设置的值以及指纹与角色相关的任何证书

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

推荐答案

链接非常重要- 服务定义文件为应用程序定义了服务模型.

The very first line in the link you included for service definition file (*.csdef) is very important - The service definition file defines the service model for an application.

您知道 Cloud Services Stateless PaaS Services ,只需将服务定义文件告诉Azure Fabric Controller应该如何为您创建和配置VM.例如, InputEndpoints 定义必须在防火墙中打开以允许传入流量的端口.另一个示例是 vmsize 元素,该元素告诉Fabric控制器创建特定大小(小型,中型等)的VM,以承载您的角色.

As you know Cloud Services are Stateless PaaS Services, and simply put the service definition file tells Azure Fabric Controller how your VM should be created and configured for you. For instance, InputEndpoints defines the ports that must be opened in the firewall to allow incoming traffic. Another example is vmsize element which tells the Fabric controller to create a VM of particular size (Small, Medium etc.) for hosting your role.

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

Service Configuration file (*.cscfg) can be thought of as web.config or app.config equivalent for your roles (Web and Worker). This is where you define the application settings.

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

One key difference between the two files is that csdef file is included in the package that gets deployed so if you have to make any changes to csdef file (e.g. VM size) you would need to redeploy your code. cscfg file is deployed along the package and you can make changes to the settings on the fly without having to redeploy your code. So if you have a setting and you want to change the value of that setting, you can simply do so on the portal (or some other means) without having to redeploy your code. Please note that the configuration setting elements name is also stored in csdef file so you can't add or remove a setting from the cscfg file. You have to add/remove it from both cscfg and csdef file.

这篇关于Azure云服务中的服务定义与服务配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆