Unable to reach web site locally on Azure web role - azure

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.

Related

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

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.

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

Site not loading on WFE2 in SharePoint 2019

I have setup a SharePoint 2019 high-availability farm with 2 WFE's, 2 APP and 2 SQL Servers. All servers state is good and patched the farm with May 2022 Cumulative Update. We are running F5 load balancer and public IP of the load balancer (LB) is also added in the host file of both WFE servers.
We created a web application (its public facing site, so also added anonymous authentication) and added DNS to it. We have setup the AAM in central Admin and also added IIS binding for web application port and 443 (wildcard certificate is installed on both WFE servers).
When Load Balancer is pointed to WFE1, the application is loading perfectly fine, however when LB is pointed to WFE2, its showing a blank white page (with no JS or CSS loaded on the page, no errors). However, when we do IISRESET on WFE2, first time site loads on WFE2 and then goes blank if we refresh the browser or click on any link on the website. The application is working fine with server name on both the servers
We have tested on different browsers. Also added Disableloopbackcheck in Registry. All required firewall rules (ports) are open. Each server is getting pinged from one another, so there is no server communication issue. Even the required SharePoint files/folders are excluded from antivirus (Bitdefender). Also, there is no other web application on this farm which is using SSL/https.
I have also checked SharePoint ULS logs, Event Viewer logs and IIS logs, but it seems there are no errors.
Any help would be highly appreciated!

IIS returns a 503 error for one specific binding

I have a windows server 2019 VM in Azure.
On this server I have multiple web sites running.
One web site has two URL's
For example https://api.oldcompanyname.com (192.1.1.5) and https://api.newcompanyname.com (192.1.1.6)
I have certificates for both, each has its own binding, and each has its own IP address.
Locally on the machine I can access both sites with no issue.
However remotely the old site URL pulls up just fine, but the new site URL gives me a 503 error.
I have checked the IIS logs and I don't see any of the 503 errors listed in there.
I checked the windows logs and there are no crashes with the AppPool and again running locally (with FQDN) works just fine so the site is loading.
Windows firewall is turned off.
In Azure we do have this server behind a Traffic Manager, PF Sense, and App Gateway.
I want to rule out any issues on this server before I go searching in one of these areas
Funny thing is that even from another machine inside the network I get the 503 on this one binding and I don't think that that connection would go through any of above items as it is an internal address it is using.
Any ideas?

How to solve Web Deploy - IISWMSVC_AUTHORIZATION_FAILED

Using Web Deploy, I encountered this problem as recorded in the server event log:
IISWMSVC_AUTHORIZATION_FAILED
The user '[my user]' is not authorized for the path '/[my site]'.
Process:WMSvc User=NT AUTHORITY\LOCAL SERVICE
When setting up the site, I had misspelled the site name in IIS.
Confusingly, the error reported contained the correct spelling! (must be obtained from the url passed to web deploy)
Hence the web deploy command didn't match the site name in IIS.

Resources