简体   繁体   中英

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

I'm doing all the work based on the code. I want to work on a simple task of edit and save hostingstart.html in kudu ui, but I don't know how to do it.

Currently, we have checked the connection through Azure app service distribution and dns authentication with terraform, and even checked whether the change is good through hostingstart.html in kuduui.

If possible, I wanted to work with the terraform code, so I wrote it as below and put the html file inside, but it didn't work. (If it's not terraform, yaml or sh direction is also good.)

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"
  }
}

Or can we specify the default path in the internal folder in this way?

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

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

For the moment. It seems best to deploy and apply through blob storage. ( https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_blob )

You can view and edit your files in Portal.

  1. In the Azure Portal, navigate to your web app.
  2. In the App Service blade, Select Advanced Tools > Go .
  3. Select Debug console > CMD .
  4. Navigate to site/wwwroot
  5. Select the pencil icon to edit the hostingstart.html file.

在此处输入图像描述

You can specify the Default Documents in the Portal itself.

  • In the App Service blade, Select Configuration > Default Documents .
  • Place the file which you want to make as a default document on the top of the root.

在此处输入图像描述

for Terraform you can't easily edit that file from management plane APIs, which Terraform would use. Instead, you can deploy a minimal application with whatever you want to show. Here's an example of deploying code with an ARM template: https://github.com/JasonFreeberg/zip-deploy-arm-template .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM