gpt4 book ai didi

azure - 如何使用 Azure ARM 模板自动安装 New Relic 扩展?

转载 作者:行者123 更新时间:2023-12-01 10:32:52 25 4
gpt4 key购买 nike

我正在使用 azure arm 模板在 azure 中创建一个 Web 应用程序。现在我需要在将使用此模板创建的 Web 应用程序中安装 New Relic Extension。所以我无法找到具体的json格式。请帮帮我!

最佳答案

请尝试添加ARM模板中截取的json代码。

 "resources": [
{
"apiVersion": "2015-08-01",
"name": "NewRelic.Azure.WebSites",
"type": "siteextensions",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', variables('webSiteName'))]"
],
"properties": {
}
}
],

我为它创建了一个演示。下面是我的详细步骤。关于扩展名请引用NewRelic.Azure.WebSites .

<强>1。创建 Azure 资源组项目。 enter image description here

<强>2。选择Web应用程序项目模板 enter image description here

<强>3。只是网站扩展的演示,所以我删除了不必要的资源

enter image description here

<强>4。在ARM模板中添加截取的代码

enter image description here

<强>5。通过 Visual Studio 部署网站

enter image description here enter image description here

<强>6。检查 Azure 门户中的网站

enter image description here

演示 ARM 模板:

{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"hostingPlanName": {
"type": "string",
"minLength": 1
},
"skuName": {
"type": "string",
"defaultValue": "F1",
"allowedValues": [
"F1",
"D1",
"B1",
"B2",
"B3",
"S1",
"S2",
"S3",
"P1",
"P2",
"P3",
"P4"
],
"metadata": {
"description": "Describes plan's pricing tier and instance size. Check details at https://azure.microsoft.com/en-us/pricing/details/app-service/"
}
},
"skuCapacity": {
"type": "int",
"defaultValue": 1,
"minValue": 1,
"metadata": {
"description": "Describes plan's instance count"
}
}
},
"variables": {
"webSiteName": "[concat('webSite', uniqueString(resourceGroup().id))]"
},
"resources": [
{
"apiVersion": "2015-08-01",
"name": "[parameters('hostingPlanName')]",
"type": "Microsoft.Web/serverfarms",
"location": "[resourceGroup().location]",
"tags": {
"displayName": "HostingPlan"
},
"sku": {
"name": "[parameters('skuName')]",
"capacity": "[parameters('skuCapacity')]"
},
"properties": {
"name": "[parameters('hostingPlanName')]"
}
},
{
"apiVersion": "2015-08-01",
"name": "[variables('webSiteName')]",
"type": "Microsoft.Web/sites",
"location": "[resourceGroup().location]",
"tags": {
"[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]": "Resource",
"displayName": "Website"
},
"dependsOn": [
"[concat('Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]"
],
"resources": [
{
"apiVersion": "2015-08-01",
"name": "NewRelic.Azure.WebSites",
"type": "siteextensions",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', variables('webSiteName'))]"
],
"properties": {
}
}
],
"properties": {
"name": "[variables('webSiteName')]",
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('hostingPlanName'))]"
}
}
]
}

关于azure - 如何使用 Azure ARM 模板自动安装 New Relic 扩展?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40507711/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com