使用资源管理器模板创建多个容器实例 [英] Creating multiple container instances with a resource manager template

查看:90
本文介绍了使用资源管理器模板创建多个容器实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我教授安全编码研讨会,并将OWASP Juice Shop应用程序作为教学工具使用。对于Juice Shop应用程序的每个学生部署,我想使用Jason Haley在他的系列博客文章中概述的Azure容器实例。 


最终,我会像这个应用程序的多个实例,每个实例都有自己的IP和域名(这样每个学生都可以通过一个独特的域访问自己的版本)。而且,我想自动创建这些实例,这样我每次教这个研讨会时都可以简单地调整
,比如25左右。


I假设这可以使用资源管理器模板完成,利用复制密钥,但我不清楚如何使用此功能创建具有唯一IP和域名的多个实例。当我在同一个容器组中手动创建两个容器实例
然后导出相应的模板时,模板的JSON结构将ipAddress键放在与"containers"相同的级别上。密钥,让我不清楚如何迭代容器本身每个
迭代接收自己的IP。


我是否应该在"变量"中使用复制密钥。对象和"资源"阵列?还有什么?


谢谢。




解决方案

这是你在找什么? 


https://docs.microsoft.com/en-us/azure/container-instances/container-instances-multi-container-group


I teach a workshop on secure coding, and use the OWASP Juice Shop application throughout as a teaching tool. For each student deployment of the Juice Shop app, I'd like to use an Azure Container Instance as outlined by Jason Haley in his series of blog posts. 

Ultimately, I'd like multiple instances of this app, each with its own IP and domain name (so that each student would access their own version through a unique domain). And, I'd like to automate the creation of these instances, such that I can simply spin up, say, 25 or so every time I teach this workshop.

I assume this can be done with a resource manager template, making use of the copy key, but it's not clear to me how I can use this functionality to create multiple instances with unique IPs and domain names. When I manually create two container instances within the same container group and then export the respective template, the template's JSON structure places the ipAddress key at the same level as the "containers" key, making it unclear how I can iterate on the containers themselves with each iteration receiving its own IP.

Should I be using the copy key in both the "variables" object and the "resources" array? Something else?

Thanks.


解决方案

Is this what you are looking for? 

https://docs.microsoft.com/en-us/azure/container-instances/container-instances-multi-container-group


这篇关于使用资源管理器模板创建多个容器实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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