簡體   English   中英

怎么修改azure應用服務中kudu的hostingstart.html呢?

[英]How can we modify the hostingstart.html of kudu in the azure app service?

我正在根據代碼完成所有工作。 我想在 kudu ui 中完成一個簡單的編輯和保存 hostingstart.html 的任務,但我不知道該怎么做。

目前我們已經通過Azure應用服務分發和dns認證與terraform進行了連接檢查,甚至通過kuduui中的hostingstart.html檢查是否變化良好。

如果可能的話,我想使用 terraform 的代碼,所以我寫成如下,並把 html 文件放在里面,但是沒有用。 (如果不是terraform,yaml或者sh方向也可以。)

resource "azurerm_app_service" "service" {
  provider = azurerm.generic

  name = "${local.service_name}-service"
  app_service_plan_id = azurerm_app_service_plan.service_plan.id
  location = azurerm_resource_group.rg.location
  resource_group_name = azurerm_resource_group.rg.name
  https_only = true

  source_control {
    repo_url = "https://git.a.git"
    branch = "master"
  }
}

或者我們可以通過這種方式在內部文件夾中指定默認路徑嗎?

tree : web
        +page
         - hostingstart.html
        +terraform
         - main.tf
         - app_service.tf

site_config {
  always_on = true
  default_documents = "../page/hostingstart.html"
}

目前。 似乎最好通過 blob 存儲來部署和應用。 https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_blob

您可以在 Portal 中查看和編輯您的文件。

  1. 在 Azure 門戶中,導航到您的 web 應用程序。
  2. 應用服務邊欄選項卡中,Select高級工具> Go
  3. Select調試控制台 > CMD
  4. 導航到站點/wwwroot
  5. Select 用鉛筆圖標編輯hostingstart.html文件。

在此處輸入圖像描述

您可以在門戶本身中指定默認文檔

  • 應用服務邊欄選項卡中, Select Configuration > Default Documents
  • 將要制作的文件作為默認文檔放在根目錄的頂部。

在此處輸入圖像描述

對於 Terraform,您無法從 Terraform 將使用的管理平面 API 輕松編輯該文件。 相反,您可以使用您想要顯示的任何內容部署一個最小的應用程序。 下面是使用 ARM 模板部署代碼的示例: https://github.com/JasonFreeberg/zip-deploy-arm-template

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM