service definition vs service configuration in Azure cloud services

旧街凉风 提交于 2021-02-08 04:51:25

问题


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.

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


回答1:


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.

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.

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.

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.



来源:https://stackoverflow.com/questions/29591367/service-definition-vs-service-configuration-in-azure-cloud-services

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!