Reputation: 59
im very new to Azure so apologise if this is a stupid question.
Can I manually deploy a html and vanilla js project to Azure Web App? (Not Azure Static Web App)?
I have built my files and deployed to a Web App (App Service) that I created via VS Code Azure App Service plugin. On inspection of the directory via the SSH option in my Web App, I can see that all my files have been deployed to /home/site/wwwroot/ which is what I would expect. However when accessing my app URL I get presented with the default "Your web app is running and waiting for your content" page... I also cant access my html files via /index.html as I get "Cannot GET /index.html".
My web app is set up for code deployment with a Node.js runtime, can I not deploy static html files to this app?
Mor info:
I am deploying the following folder:
Folder build:
The build folder contains an "app" folder which has all of the built js and css code. The build folder also has multiple .html files...
I am building the app before deploying it via the VS Code Azure App service extension...
My Azure App service (Web App) Publishing model is set to "Code". When I deploy the build folder to the Web App via VS code I can see that the files have been deployed correctly as they are present in "/home/site/wwwroot" when I SSH into the Web App. However, when I access the web app url the index.html page is not shown
Upvotes: 0
Views: 596
Reputation: 7392
Deploying Node JS App to Azure App Service from VSCode/Visual Studio needs npm packages to be installed.
You need package.json
,server.js
files to run a Node JS App.
I have also tried to deploy using Azure CLI.
Create an Azure App Service with Runtime Stack Node.
Create static files which you want(html/css).
Locally, open Azure CLI. Navigate to the WebApp Root directory and run az login
.
Linux:
az webapp up --resource-group MyRG --name StaticAppMay --plan AppservicePlanName --runtime "node|20-lts"
App is deployed successfully but even I am getting the default content page with Linux.
Only App Service with windows is working here.
Windows:
>az webapp up --resource-group v-harshithav-Mindtree --name StaticAppMay --plan plan-cinsider-test-eastus --html
Output:
One option to server static files is to use Storage Account Static website.
Storage Account
=> Containers
=> $web
.Upvotes: 0