.NET Website hosted on Azure Windows VM - IIS Web Server fails to work after Server (VM) restart - azure

Hosted a .NET 6 basic Web App in IIS Web Server inside the Azure Virtual Machine (Windows 2016 Data Center)
Commands:
dotnet new webapp
dotnet run
dotnet publish -c Release
3rd command is used for placing release folder files in the Site Physical Path created in IIS Web Server:
It shown the result as welcome page. After VM Stop and Start action, it is showing the localhost as "The Site can't be reached"
If I create new site on Connections of the IIS Manager, then it is working.
Every time after restarting the VM, Creating New Site is not the solution.
Why previously created Site is showing me "The Site can't be reached" error.
What I have tried:
Tested by creating new Site in Connections of the IIS Manager, it worked for the new site but after restarting the VM, it also stopped working and showing above mentioned error.
Checked VM Status, it is Healthy
All required tools are installed in the VM (VS Code, .NET 6 SDK, Runtime, and Hosting Bundle)
Note: It is working successfully after I clear the cache in the browser after server restart (stop and start) but why I have to clear the browser cache every time after VM stop and start?
Update:
Forgot to mention this:
I have given HTTPS binding to the IIS Manager Website Hosted so if do localhost with port 80, it will shows IIS Web Served Home Page and localhost with Https (443), it will show the hosted website content.
After Server Stop and Start, localhost with port 80 gives the IIS Web Served Home Page and localhost with Https is not giving the website content, here it is giving error "The site is not reached".
Fix:
I have found the fix to this issue which is:
Hosting works with particular time period.
Every time when you launch the Website hosted in VM through IIS Web Server after Server restart (several hours), you need to re-host or create new site in IIS Manager Pool.

I tried to reproduce the same in my environment and I got the results like below:
I have created sample website and when I tried Stop and Start action, localhost reached successfully:
As suggested by samwu you can check event viewer like below:
In start -> select event viewer -> click Windows Logs node
Select application Event Log and Search for errors associated with the failing app like below
You can make use of Debug Diagnostics tool.

Related

Share point site configurations issue while using port other than 80

I am using SharePoint 2019 on premise and hosting our .net application into it.
I created a site in share point using port 80 and i can deploy my application into it with no problem.
while creating multiple site to host the same application system is not allowing to host application other than 80
Error:-
error occurred in deployment step recycle IIS application pool the local sharepoint server is not available.Check the server is running and connected to the sahre point farm
Please try to do some troubleshooting:
Clear the visual studio's cache.
Open VS as Administrator.
IIS reset executed before every deploy.
Use the account has full control and is the primary site collection administrator.
Restart the server.
Similar issue for reference: Getting Error occurred in deployment step 'Recycle IIS Application Pool': A task was canceled when deploying custom action to Sharepoint

IIS 10 Manager Showing only start page, Not showing site

I have add feature for IIS web server in windows server 2019. and installation successfully completed. but it show only start page and local connection. Default site is missing. How I recover it.
I have run IIS with both "Run As Administrator" and normally.
For reference I have attach the screen shot of my IIS.
Windows Server Role Configuration

Running Node.JS with IIS. Can’t connect to site from other computers, but site runs on local server

I am trying to host a Node.JS app on a server that also has IIS running on it. I can open the site in the server browser. As you can see i have the website iisnode running in the browser and it is added in the IIS manager
However, i can not access this site from a different computer using ServerURL/siteName. I just get this error:
What could i be doing wrong? It works locally so i must be close to having it working. I can access other sites hosted on this server so i know the issue is with this app specifically.

Unable to reach web site locally on Azure web role

I am deploying multiple web sites on Windows Azure cloud service on Single web role. I have added required binding and host file entries. when I run ping command I am getting the response as well.
However when RDP to VM and browse the site locally on VM as localhost
it is not reachable and showing 404 not found.
Error from IIS events
The application '/' belonging to site '1' has an invalid AppPoolId 'DefaultAppPool' set. Therefore, the application will be ignored.
when RDP to VM and browse the site locally on VM as localhost it is not reachable and showing 404 not found.
I access the desktop of your web role running in Azure and add a new Web site to your Web server, I can browse the site locally. If possible, you can try to create a new web site to server static html files and check if it works fine, or you can share us the detailed information of bindings and your application.
Add a website:
Settings:
Application pool:
Browse site locally:
The application '/' belonging to site '1' has an invalid AppPoolId 'DefaultAppPool' set. Therefore, the application will be ignored.
Some community members encounter and post similar issue in this so thread, you can check if any .dll files are missing or 32-bit libraries are used.

Web Deploy unable to validate connection

I am trying to learn how to setup Web Deploy functionality on both sides Server and host/client computer. Created a Windows Server 2012 Web Server in Hyper-V and able to access default web page in host/client computer. On server installed Web Maintenance Service, Web Deploy 3.5 and performed all the required steps e.g. "Configure Web Deploy Publishing" and added Administrator to IIS Manager Permission for the website in IIS. I disabled Firewall totally to make it work for the first time.
On client computer I created a dummy MVC Application in Visual Studio and trying to create publish profile for this app. As soon as I hit the Validate Connection I got the option to receive and save the security certificate from server but after that in gives me following warning (snapshot):
Tried doing all the steps all over but no luck.
I am open to all feedback. Thanks in advance.
Found the solution. Instead of adding publish information manually, I am suppose to use publishsetting file generated in server through "Configure Web Deploy Publishing" feature of IIS. Server address ends with file name which ends with .axd

Resources