集装箱应用程序或集装箱应用程序环境臂模板
我正在尝试使用ARM模板创建一个容器应用程序。 容器应用程序在VNET之内,入口连接也仅限于VNET。 我从门户网站下载了自动化的模板,并且在模板中具有此模板
{
"name": "[parameters('environmentName')]",
"location": "[parameters('location')]",
"dependsOn": [
"[concat('Microsoft.OperationalInsights/workspaces/', parameters('workspaceName'))]",
"Microsoft.Resources/deployments/newInfrastructureSubnetTemplate"
],
"properties": {
"internalLoadBalancerEnabled": false,
"appLogsConfiguration": {
"destination": "log-analytics",
"logAnalyticsConfiguration": {
"customerId": "[reference(concat('Microsoft.OperationalInsights/workspaces/', parameters('workspaceName')), '2020-08-01').customerId]",
"sharedKey": "[listKeys(concat('Microsoft.OperationalInsights/workspaces/', parameters('workspaceName')), '2020-08-01').primarySharedKey]"
}
},
"vnetConfiguration": {
"infrastructureSubnetId": "/subscriptions/<subscription-id>/resourceGroups/<resource-group-name>/providers/Microsoft.Network/virtualNetworks/containerapps-vnet/subnets/containerapps-subnet-0",
"internal": true
},
"zoneRedundant": false
},
"apiVersion": "2022-03-01",
"type": "Microsoft.App/managedEnvironments"
}
,但由于托管群集导致故障而失败。
New-AzResourceGroupDeployment : 3:11:14 PM - The deployment 'template' failed with error(s). Showing 1 out of 1 error(s).
Status Message: Managed environment failed to initialize due to managed clusters failed. (Code:OperationFailed)
CorrelationId: <correlation-id>
At line:1 char:1
+ New-AzResourceGroupDeployment -ResourceGroupName dhapi-ml -TemplateFi ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [New-AzResourceGroupDeployment], Exception
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDeploymentCmdlet
VNET,子网和日志分析工作空间也是使用与下面相同的模板创建的。
{
"apiVersion": "2020-08-01",
"name": "[parameters('workspaceName')]",
"type": "Microsoft.OperationalInsights/workspaces",
"location": "[parameters('workspaceLocation')]",
"dependsOn": [],
"properties": {
"sku": {
"name": "PerGB2018"
},
"retentionInDays": 30,
"workspaceCapping": {}
}
},
{
"type": "Microsoft.Resources/deployments",
"apiVersion": "2020-06-01",
"name": "newInfrastructureSubnetTemplate",
"resourceGroup": "<resource-group-name>",
"subscriptionId": "<subscription-id>",
"properties": {
"mode": "Incremental",
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"variables": {},
"resources": [
{
"type": "Microsoft.Network/virtualNetworks/subnets",
"apiVersion": "2020-07-01",
"name": "containerapps-vnet/containerapps-subnet-0",
"properties": {
"delegations": [],
"serviceEndpoints": [],
"addressPrefix": "10.0.0.0/23"
}
}
]
}
},
"dependsOn": [
"[resourceId('Microsoft.Network/virtualNetworks', 'containerapps-vnet')]"
]
},
{
"type": "Microsoft.Network/virtualNetworks",
"apiVersion": "2020-07-01",
"location": "eastus",
"name": "containerapps-vnet",
"properties": {
"addressSpace": {
"addressPrefixes": [
"10.0.0.0/16"
]
},
"subnets": []
}
}
I am trying to create a container app using ARM template.
The container app is within a VNet and ingress connection is also limited to VNet.
I downloaded the template for automation from portal and it has this in template
{
"name": "[parameters('environmentName')]",
"location": "[parameters('location')]",
"dependsOn": [
"[concat('Microsoft.OperationalInsights/workspaces/', parameters('workspaceName'))]",
"Microsoft.Resources/deployments/newInfrastructureSubnetTemplate"
],
"properties": {
"internalLoadBalancerEnabled": false,
"appLogsConfiguration": {
"destination": "log-analytics",
"logAnalyticsConfiguration": {
"customerId": "[reference(concat('Microsoft.OperationalInsights/workspaces/', parameters('workspaceName')), '2020-08-01').customerId]",
"sharedKey": "[listKeys(concat('Microsoft.OperationalInsights/workspaces/', parameters('workspaceName')), '2020-08-01').primarySharedKey]"
}
},
"vnetConfiguration": {
"infrastructureSubnetId": "/subscriptions/<subscription-id>/resourceGroups/<resource-group-name>/providers/Microsoft.Network/virtualNetworks/containerapps-vnet/subnets/containerapps-subnet-0",
"internal": true
},
"zoneRedundant": false
},
"apiVersion": "2022-03-01",
"type": "Microsoft.App/managedEnvironments"
}
But this fails with an error because of failure due to managed cluster.
New-AzResourceGroupDeployment : 3:11:14 PM - The deployment 'template' failed with error(s). Showing 1 out of 1 error(s).
Status Message: Managed environment failed to initialize due to managed clusters failed. (Code:OperationFailed)
CorrelationId: <correlation-id>
At line:1 char:1
+ New-AzResourceGroupDeployment -ResourceGroupName dhapi-ml -TemplateFi ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [New-AzResourceGroupDeployment], Exception
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDeploymentCmdlet
VNet, subnet and log-analytics workspace are also created using the same template as below for your reference.
{
"apiVersion": "2020-08-01",
"name": "[parameters('workspaceName')]",
"type": "Microsoft.OperationalInsights/workspaces",
"location": "[parameters('workspaceLocation')]",
"dependsOn": [],
"properties": {
"sku": {
"name": "PerGB2018"
},
"retentionInDays": 30,
"workspaceCapping": {}
}
},
{
"type": "Microsoft.Resources/deployments",
"apiVersion": "2020-06-01",
"name": "newInfrastructureSubnetTemplate",
"resourceGroup": "<resource-group-name>",
"subscriptionId": "<subscription-id>",
"properties": {
"mode": "Incremental",
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"variables": {},
"resources": [
{
"type": "Microsoft.Network/virtualNetworks/subnets",
"apiVersion": "2020-07-01",
"name": "containerapps-vnet/containerapps-subnet-0",
"properties": {
"delegations": [],
"serviceEndpoints": [],
"addressPrefix": "10.0.0.0/23"
}
}
]
}
},
"dependsOn": [
"[resourceId('Microsoft.Network/virtualNetworks', 'containerapps-vnet')]"
]
},
{
"type": "Microsoft.Network/virtualNetworks",
"apiVersion": "2020-07-01",
"location": "eastus",
"name": "containerapps-vnet",
"properties": {
"addressSpace": {
"addressPrefixes": [
"10.0.0.0/16"
]
},
"subnets": []
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
谢谢 @ shui shengbao ,如上所述 这里答案,以便对其他成员在类似问题上是有益的。
另外,我们可以使用PowerShell使用以下命令(例如)(例如)注册资源提供商: -
如我们的订阅中已注册的,它可能向您显示 注册 ,但是您可以进行部署资源的操作。
有关更多信息,请参阅此 Microsoft文档 | 注册资源提供商 。
Thank you @Shui shengbao As mentioned here, and after my research posting the same as an answer so that it will be beneficial for other members for similar issue.
Alternatively, we can use the PowerShell to register resource provider by using below command (e.g):-
As its already registered in our subscription ,it might be showing you registering but you can do operations to deploy resources.
For more information please refer this MICROSOFT DOCUMENTATION| Register resource provider .
订阅未注册以使用
Microsoft.ContainerService
我只是从门户网站注册了它,或者您可以使用PowerShell/AZCLI进行此操作。
然后它可以创建容器应用程序。
The subscription was not registered to use
Microsoft.ContainerService
I just registered it from portal or you can use powershell/azcli to do it.
And then it worked to create the container app.