Hi @Jayakumar R,
How can I remove the default homepage from my Azure Web App hosting as a PaaS service?
When you create a new Azure App Service (Web App), Azure automatically places a default file called hostingstart.html
in the /site/wwwroot
folder. This acts as a placeholder page until you deploy your own content. To remove this file, you can simply delete or overwrite it with your actual application files.
If I find the default file (e.g.,
hostingstart.html
) in thesite/wwwroot
folder via Kudu, how can I delete or replace it through Azure DevOps?
If you're using Azure DevOps pipelines (CI/CD), your deployment process automatically overwrites everything in the site/wwwroot
folder, including the hostingstart.html
file. To ensure the file is deleted during deployment:
- Just exclude
hostingstart.html
from your code repository. - During deployment via your pipeline, the App Service deploy task (such as using Azure App Service Deploy or Web Deploy) will remove it if it's not part of your deployment package.
- You probably don’t want to delete the whole app. Instead, to delete a file like
hostingstart.html
, you can use an Azure DevOps pipeline task that runs Azure CLI or Kudu API commands to delete the file directly fromsite/wwwroot
.
Is it possible to perform this removal on an already deployed Azure PaaS Web App without redeploying the web app?
Yes, you can delete it without a full redeployment using any of these methods:
- Go to
https://<your-app-name>.scm.azurewebsites.net
, navigate tosite/wwwroot
, and delete the file manually. - Use the Kudu API from a pipeline to remove the file during your release process.
- Add a script step before or after your deployment to delete the file using REST API calls.
Deploy to Azure Web App using Azure DevOps
Kudu – Access your app’s files via the SCM site
Azure App Service Deployment Center
Kudu REST API for File Management
I hope you find this information useful.
If the answer is helpful, please click Accept Answer and kindly upvote it so that other people who faces similar issue may get benefitted from it.
Let me know if you have any further Queries.