我想自动部署虚拟网络(与另一个网络对等)和连接到该网络的容器实例。 我只想确认我会执行正确的步骤。我将使用Azure REST API。
步骤3对我来说有点奇怪,因为它与我在Azure门户中所做的不同。在门户中,我只需选择要与容器连接的虚拟网络。在查看MSDN文档时,在我看来REST API要求我首先创建该网络配置文件。我说的对吗?
答案 0 :(得分:1)
使用az container create
部署容器时,az cli将在后台为您创建网络配置文件。
这也许就是为什么您以前可能没有看到显式创建网络配置文件的原因。
A network profile is a network configuration template for Azure resources. It specifies certain network properties for the resource, for example, the subnet into which it should be deployed. When you first use the az container create command to deploy a container group to a subnet (and thus a virtual network), Azure creates a network profile for you. You can then use that network profile for future deployments to the subnet.
https://docs.microsoft.com/en-us/azure/container-instances/container-instances-vnet#network-profile
您的步骤看起来不错。