简体   繁体   English

Azure 资源管理器模板部署 - 使用 _artifactsLocation 和 _artifactsLocationSasToken

[英]Azure resource manager template deployments - Using _artifactsLocation and _artifactsLocationSasToken

Where and how to use artifactsLocation and _artifactsLocationSasToken in Arm template deployments.在 Arm 模板部署中,在何处以及如何使用 artifactsLocation 和 _artifactsLocationSasToken。 Are these used only for nested deployments.这些是否仅用于嵌套部署。

Can we use these for custom VM extension of the Virtual machine as part of post provisioning activity, after VM is built or should the extension be added as part of the VM build deployment template only.我们可以将这些用于虚拟机的自定义 VM 扩展,作为后置备活动的一部分,在构建 VM 之后,还是应该仅将扩展作为 VM 构建部署模板的一部分添加。

VM Custom script extension - (Initialize and format data drives, Mount file shares for instance) VM 自定义脚本扩展 - (初始化和格式化数据驱动器,例如挂载文件共享)

Azure quick start templates, have the parameter values for these as default for artifactsLocation and type securestring for _artifactsLocationSasToken. Azure 快速入门模板,将这些参数值作为 artifactsLocation 的默认值,并为 _artifactsLocationSasToken 键入安全字符串。 How these values are populated in the ARM deployment runtime.如何在 ARM 部署运行时填充这些值。

It would be great if someone can provide documentation around the same / step by step process or share an existing working custom script extension template.如果有人可以提供有关相同/逐步过程的文档或共享现有的工作自定义脚本扩展模板,那就太好了。

There's nothing inherent in the platform that makes _artifactsLocation and _artifactsLocationSasToken special... it's just a pattern (well used) that has developed for staging artifacts needed for a deployment.平台中没有什么固有的东西使 _artifactsLocation 和 _artifactsLocationSasToken 变得特别......它只是一种为部署所需的暂存工件而开发的模式(很好地使用)。 The pattern is to stage all artifacts together and then use the uri of the main template as a relative location.该模式是将所有工件放在一起,然后使用主模板的 uri 作为相对位置。 The defaultValue generally used for _artifactsLocation is: _artifactsLocation 通常使用的默认值是:

"defaultValue": "[deployment().properties.templateLink.uri]"

The deployment() function is inherent and contains the uri passed in for the main template. deployment() function 是固有的,包含为主模板传入的 uri。

That said, you can use those values anyway you see fit and the primary use case is for retrieving any artifact needed by any resource.也就是说,您可以以任何您认为合适的方式使用这些值,主要用例是检索任何资源所需的任何工件。 For example:例如:

Custom Script Extension https://github.com/Azure/azure-quickstart-templates/blob/master/demos/vm-winrm-windows/azuredeploy.json#L256-L259自定义脚本扩展https://github.com/Azure/azure-quickstart-templates/blob/master/demos/vm-winrm-windows/azuredeploy.json#L256-L259

MSDeploy Packages for WebApps https://github.com/Azure/azure-quickstart-templates/blob/master/demos/private-endpoint-sql-from-appservice/azuredeploy.json#L277用于 Web 应用程序的 MSDeploy 包https://github.com/Azure/azure-quickstart-templates/blob/master/demos/private-endpoint-sql-from-appservice/azuredeploy.json#L277

DSC Configuration Modules https://github.com/Azure/azure-quickstart-templates/blob/master/demos/iis-2vm-sql-1vm/azuredeploy.json#L585 DSC 配置模块https://github.com/Azure/azure-quickstart-templates/blob/master/demos/iis-2vm-sql-1vm/azuredeploy.json#L585

etc, etc...等等等等……

That help?这种帮助?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM