我正在使用手臂模板和terraform在VNet中的特定子网中设置AppService集成。它会引发错误,有人可以帮助我指出模板的问题吗?
我已经创建了具有动态IP地址的网关,VNet和3个子网,并通过terraform脚本为Microsoft.Web启用了服务端点。我无法进行App Service-VNet集成,因此我正在使用“ azurerm_template_deployment”为此执行特定的手臂模板。
我正在执行的手臂模板
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"sites_uos_aue_web_web_name": {
"defaultValue": "some-name-develop-web",
"type": "string"
},
"serverfarms_externalid": {
"defaultValue": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/SOME-Develop-ARG-App-WEB/providers/Microsoft.Web/serverfarms/some-name-develop-asp-web",
"type": "string"
},
"virtual_network_name": {
"type": "string",
"defaultValue": "some-aue-develop-vnet-agw"
},
"subnet_resource_id": {
"type": "string",
"defaultValue": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/SOME-Develop-ARG-App-WEB/providers/Microsoft.Network/virtualNetworks/some-aue-develop-vnet-agw"
}
},
"variables": {},
"resources": [
{
"name": "[parameters('sites_uos_aue_web_web_name')]",
"type": "Microsoft.Web/sites",
"apiVersion": "2018-11-01",
"kind": "app",
"location": "Asia East",
"properties": {
"enabled": true,
"hostNameSslStates": [
{
"name": "[concat(parameters('sites_uos_aue_web_web_name'), '.azurewebsites.net')]",
"sslState": "Disabled",
"hostType": "Standard"
},
{
"name": "[concat(parameters('sites_uos_aue_web_web_name'), '.scm.azurewebsites.net')]",
"sslState": "Disabled",
"hostType": "Repository"
}
],
"serverFarmId": "[parameters('serverfarms_externalid')]",
"reserved": false,
"requestTracingEnabled": true,
"httpLoggingEnabled": true,
"detailedErrorLoggingEnabled": true,
"vnetName": "[parameters('virtual_network_name')]"
},
"resources": []
},
{
"type": "Microsoft.Web/sites/config",
"apiVersion": "2018-11-01",
"name": "[concat(parameters('sites_uos_aue_web_stepupweb_name'), '/web')]",
"location": "Australia East",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('sites_uos_aue_web_web_name'))]"
],
"properties": {
"requestTracingEnabled": true,
"requestTracingExpirationTime": "9999-12-31T23:59:00Z",
"httpLoggingEnabled": true,
"logsDirectorySizeLimit": 35,
"detailedErrorLoggingEnabled": true,
"scmType": "LocalGit",
"vnetName": "[parameters('virtual_network_name')]",
"ipSecurityRestrictions": [
{
"vnetSubnetResourceId": "[concat(parameters('subnet_resource_id'), '/subnets/frontend')]",
"action": "Allow",
"name": "FrontendSubnetAccess"
}
]
}
}
]
}
执行时出现以下错误
错误:等待部署时出错:Code =“ DeploymentFailed”消息=“至少一项资源部署操作失败。请列出部署操作以获取详细信息。请参阅https://aka.ms/arm-debug以获取使用详细信息。” Details = [{“ code”:“ NotFound”,“ message”:“ {\ r \ n \” error \“:{\ r \ n \” code \“:\” BadRequest \“,\ r \ n \ “ message \”:\“ \” \ r \ n} \ r \ n}“}]
任何指针??????
答案 0 :(得分:0)
如果要将Azure Vnet与Azure应用服务集成,可以参考以下ARM模板:
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://cdn.datatables.net/v/bs4/dt-1.10.18/r-2.2.2/datatables.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" />
<link href="https://cdn.datatables.net/v/bs4/dt-1.10.18/r-2.2.2/datatables.min.css" rel="stylesheet" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.10.2/css/all.min.css" rel="stylesheet" />
<div class="card card-body card-panel mb-3">
<h4 class="card-title">Datatable Paging</h4>
<table class="table" id="dataTable">
<thead>
<tr>
<th class="all">Name</th>
<th>Type</th>
<th>Method</th>
<th class="all">Date</th>
</tr>
</thead>
<tbody>
<tr>
<td>First Name</td>
<td>Type 1</td>
<td>M123456</td>
<td>10/10/2019</td>
</tr>
<tr>
<td>First Name</td>
<td>Type 1</td>
<td>M123456</td>
<td>10/10/2019</td>
</tr>
<tr>
<td>First Name</td>
<td>Type 1</td>
<td>M123456</td>
<td>10/10/2019</td>
</tr>
<tr>
<td>First Name</td>
<td>Type 1</td>
<td>M123456</td>
<td>10/10/2019</td>
</tr>
<tr>
<td>First Name</td>
<td>Type 1</td>
<td>M123456</td>
<td>10/10/2019</td>
</tr>
<tr>
<td>First Name</td>
<td>Type 1</td>
<td>M123456</td>
<td>10/10/2019</td>
</tr>
<tr>
<td>First Name</td>
<td>Type 1</td>
<td>M123456</td>
<td>10/10/2019</td>
</tr>
<tr>
<td>First Name</td>
<td>Type 1</td>
<td>M123456</td>
<td>10/10/2019</td>
</tr>
<tr>
<td>First Name</td>
<td>Type 1</td>
<td>M123456</td>
<td>10/10/2019</td>
</tr>
<tr>
<td>First Name</td>
<td>Type 1</td>
<td>M123456</td>
<td>10/10/2019</td>
</tr>
<tr>
<td>First Name</td>
<td>Type 1</td>
<td>M123456</td>
<td>10/10/2019</td>
</tr>
<tr>
<td>First Name</td>
<td>Type 1</td>
<td>M123456</td>
<td>10/10/2019</td>
</tr>
<tr>
<td>First Name</td>
<td>Type 1</td>
<td>M123456</td>
<td>10/10/2019</td>
</tr>
<tr>
<td>First Name</td>
<td>Type 1</td>
<td>M123456</td>
<td>10/10/2019</td>
</tr>
<tr>
<td>First Name</td>
<td>Type 1</td>
<td>M123456</td>
<td>10/10/2019</td>
</tr>
<tr>
<td>First Name</td>
<td>Type 1</td>
<td>M123456</td>
<td>10/10/2019</td>
</tr>
<tr>
<td>First Name</td>
<td>Type 1</td>
<td>M123456</td>
<td>10/10/2019</td>
</tr>
<tr>
<td>First Name</td>
<td>Type 1</td>
<td>M123456</td>
<td>10/10/2019</td>
</tr>
<tr>
<td>First Name</td>
<td>Type 1</td>
<td>M123456</td>
<td>10/10/2019</td>
</tr>
<tr>
<td>First Name</td>
<td>Type 1</td>
<td>M123456</td>
<td>10/10/2019</td>
</tr>
<tr>
<td>First Name</td>
<td>Type 1</td>
<td>M123456</td>
<td>10/10/2019</td>
</tr>
<tr>
<td>First Name</td>
<td>Type 1</td>
<td>M123456</td>
<td>10/10/2019</td>
</tr>
<tr>
<td>First Name</td>
<td>Type 1</td>
<td>M123456</td>
<td>10/10/2019</td>
</tr>
<tr>
<td>First Name</td>
<td>Type 1</td>
<td>M123456</td>
<td>10/10/2019</td>
</tr>
<tr>
<td>First Name</td>
<td>Type 1</td>
<td>M123456</td>
<td>10/10/2019</td>
</tr>
<tr>
<td>First Name</td>
<td>Type 1</td>
<td>M123456</td>
<td>10/10/2019</td>
</tr>
<tr>
<td>First Name</td>
<td>Type 1</td>
<td>M123456</td>
<td>10/10/2019</td>
</tr>
<tr>
<td>First Name</td>
<td>Type 1</td>
<td>M123456</td>
<td>10/10/2019</td>
</tr>
<tr>
<td>First Name</td>
<td>Type 1</td>
<td>M123456</td>
<td>10/10/2019</td>
</tr>
<tr>
<td>First Name</td>
<td>Type 1</td>
<td>M123456</td>
<td>10/10/2019</td>
</tr>
<tr>
<td>First Name</td>
<td>Type 1</td>
<td>M123456</td>
<td>10/10/2019</td>
</tr>
<tr>
<td>First Name</td>
<td>Type 1</td>
<td>M123456</td>
<td>10/10/2019</td>
</tr>
<tr>
<td>First Name</td>
<td>Type 1</td>
<td>M123456</td>
<td>10/10/2019</td>
</tr>
<tr>
<td>First Name</td>
<td>Type 1</td>
<td>M123456</td>
<td>10/10/2019</td>
</tr>
<tr>
<td>First Name</td>
<td>Type 1</td>
<td>M123456</td>
<td>10/10/2019</td>
</tr>
</tbody>
</table>
</div>
有关更多详细信息,请参阅github上的issue
答案 1 :(得分:0)
Azure具有VNet Integration功能的两个版本。一个版本可以与同一地区的VNet集成,另一个版本可以与其他地区的VNet或经典VNet集成,但需要虚拟网络网关。看来您使用网关所需的VNet集成。您需要将Microsoft.Web/sites/virtualNetworkConnections资源包括在JSON模板中。
如我所见,您在本段中有一个错误
"type": "Microsoft.Web/sites/config",
"apiVersion": "2018-11-01",
"name": "[concat(parameters('sites_uos_aue_web_stepupweb_name'), '/web')]",
应为"name": "[concat(parameters('sites_uos_aue_web_web_name'), '/web')
。
在您的情况下,您可以添加虚拟网络(具有启用VNet网关的参数)并从中引用:
"virtualNetworks_test_externalid": {
"defaultValue": "/subscriptions/xxx/resourceGroups/xx/providers/Microsoft.Network/virtualNetworks/test",
"type": "string"
}
并添加资源Microsoft.Web/sites/virtualNetworkConnections
{
"type": "Microsoft.Web/sites/virtualNetworkConnections",
"apiVersion": "2016-08-01",
"name": "[concat(parameters('sites_uos_aue_web_web_name'), '/test')]",
"location": "Central US",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('sites_uos_aue_web_web_name'))]"
],
"properties": {
"vnetResourceId": "[parameters('virtualNetworks_test_externalid')]",
"resyncRequired": false,
"isSwift": true
}
}