Enabling OMS Agent monitoring on aks machines - azure

we are looking for a solution to setup the alert when OMS agent stopped on AKS
machines, through azure monitor, however we could not find any query or solution which
can monitor the oms agent process on VMs and generate the alert when it is stopped.
Thanks in advance for any leads.

I Tried to reproduce the same in my environment to redirect the IIS app to Offline Page during application Maintenance :
I have created IIS Web Application in Windows Server with HTTP Redirection as below.
Once the IIS Setup has been completed, deploy the application code to IIS Server.
The application is running successfully.
Now add an HTTP redirect rule to IIS Server which will redirect user requests to the maintenance page as shown below.
Open HTTP Redirect option and add your maintenance page address.
Make sure to enable "Redirect all requests to exact destination".
After adding the HTTP redirect rule in IIS Web Server, whenever users hit the application. it will redirect the requests to the maintenance page automatically.
Refer to this Stack link created by : Paul Grimshaw

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.

IIS Basics: How to change default site to remove welcome screen

We are currently using an internal farm of two web servers running IIS on MS2019. In IIS, we have a site called ABC under the Default Web Site.
This farm is load balanced. When you go to the VIP (mysite.com), which sends the traffic to the appropriate web server, it goes directly to the IIS landing/welcome page. How can I configure IIS to redirect to s specific site versus the welcome page?
mysite.com --> mysite.com/ABC

Azure Front Door to Website on IIS VM Host

I've got an Azure Front Door that has been set up to link to 2 Windows VM's running IIS, I'm trying to add a Frontend Domain that I can then use to access websites on the VM's.
Azure Frontend Domain
Then I have the backend pool which links to the 2 servers.
Back End Pool
I then have a route to the web servers, which should (as far as I can tell) just forward the request onwards.
Routing Rule
Then I have my web servers which I have set up the bindings on for the website
Website Bindings
However whenever I try to browse to the website I just see the IIS landing page rather than the website I have setup. How do I get to my actual website?
The problem in the end was that the Certificate subject name validation had been enabled. To change you need to go to Front Door Designer then Settings.
if you get the IIS landing page it means the traffic is forwarded correctly from the AFD, your problem is likely with the local IIS setup like the default page or something like that.

Why does ASP.NET Core redirection not work even if I call UseHttpsRedirection?

I have a web application which uses ASP.NET Core 3.1 on an Azure AppService, combined with Azure AD B2C authentication.
In my Startup.cs code, I call UseHttpsRedirection, but when I visit the site with an empty browser cache / or a new incognito session, using the HTTP protocol, I don't get redirected to HTTPS. Because of this, the B2C authentication doesn't work, so my app is not working.
This (HTTP) link is not working.
This link (HTTPS) does work.
What is strange though, once you visited the HTTPS site, and then the HTTP one, you will see the redirection is working.
What are getting served here are static HTML and JS files, served by the ASP.NET Core self-hosted server (running on a Linux AppService).
What do I miss here? Do I need to make an additional setting in Azure or in my code? Or do I need another record in the DNS?
It turned out that you have to go to the Protocol settings of the App Service and set "HTTPS only" to "on".

ERROR_USER_UNAUTHORIZED when deploy to IIS 7.5 when using IIS manager user

I'm trying to deploy from a teamcity server to my iis server but I get unauthorized when I use an IIS Manager user set up in IIS. If I use a Windows account it works just fine. Am I missing something?
I thought it was enough to create an IIS Manager User in ISS, or do I have to add that user to the domain or server I'm trying to deploy to?
In the Management Service Delegation I have added two rules, it could probably be combined into one. The first rule is for contentPath and iisApp and the second is for createApp. Both rules are run as an administrator user. I have added that all users (*) are allowed to execute the rule.
Is it something else I need to enable on the target server for it to work with IIS Manager Users?
I get the following message in my event viewer:
IISWMSVC_AUTHORIZATION_SERVER_NOT_ALLOWED
Only Windows Administrators are allowed to connect using a server connection.
Other users should use the 'Connect To Site or Application' task to be able to connect.
Process:WMSvc
Ok, I've been looking for an answer for some time and couldn't find it... but of course I figure it out myself as soon as I post the question here. The answer to my problem was that I have to add the IIS Manager User to the site which I want to deploy to. So if I selected the sites and then opened up the "IIS Manager Permissions" and added my user it all started working just as expected.

Resources