Azure Web aps- When scale out on Web Apps happens does it put load balancer - azure

Sorry guys if my question does not make sense. Let us say I have a website running in cloud. It is running under one instance.
I have a Scale out app service plan such that when CPU usage is more than 80% it creates one more instance. On day 3 let us say CPU usage gets to 85% and one more instance is created. My question is
1) Is it going to put a load balancer in front of these two instances.
2) Are these two Virtual machines going to be in different fault domain?
3) when I have two instances and I deploy from Visual studio, is it going to deploy to both instances?

1) Is it going to put a load balancer in front of these two
instances.
The answer is yes, after you enable autoscale settings, when your service receives additional traffic, you will get more instances without doing anything.
2) Are these two Virtual machines going to be in different fault
domain?
When multiple Cloud Service role instances are deployed, Azure deploys these instances to different fault domains.
More information about cloud service instances and fault domains, please refer to this blob.
3) when I have two instances and I deploy from Visual studio, is it
going to deploy to both instances?
No, after we deploy a new package, it will be applied in all instances of your WebApp.
More information about how to deploy APP to Azure app service, please refer to the link.

1-) Yes
2-) Probably, however I can't say this with 100% sure, because WebApps are PaaS, you delegate the management to Microsoft.
3-) When you deploy a new package it will be applied in all instances of your WebApp.

Related

Is it possible to load-balance traffic between IIS on an Azure VM and an Azure App Service?

I have a web application that is currently running on IIS in 3 Azure VMs. I have been working to make my application App-Services friendly, but would like to test the migration to App-Services in a safe / controlled environment.
Would it be possible to spin up the App-Service and use an Azure Load Balancer to redirect a percentage of traffic off the VM and onto the App-Service?
Is there any other technology that would help me get there?
You might be able to achieve this if you are using an App Service Environment and an internal load balancer
https://learn.microsoft.com/en-us/azure/app-service/environment/app-service-environment-with-internal-load-balancer
However, based on your description of your current setup I don't believe there is an ideal solution for this as a standard load balancer only allows for the backend ports to map to VMs. Using an Application Gateway might be another option as well
https://learn.microsoft.com/en-us/azure/application-gateway/
I would suggest you make use of the deployment and production slots available that comes a Web App. Once you have the webapp running in the dev slots, test the site to ensure all works as expected. Once it does, switch it to the production slot and reroute all traffic from the VMs to the App Service.
All in all, running an app on a Web App is quite simple. Microsoft takes away the need to manage the VM settings so you can simply deploy and run. I don't see you having any issues simply migrating. The likelihood for issues is small. You can also minimalism it by performing the migration during off hours in case you need to make any changes.
There is also some Web App migration guidance you might find useful
https://learn.microsoft.com/en-us/dotnet/azure/dotnet-howto-choose-migration?view=azure-dotnet

Multiple Instances working in azure cloud service

I have azure cloud service with 2 instance count small vm so any one could explain how it internally use instances?
Both instance running parallel or run second instance when first one would go down.
Thanks in advance
They are both running in parallel. You should read about it on the Azure Docs: https://learn.microsoft.com/en-us/azure/cloud-services/cloud-services-choose-me
edit: Cloud Services includes the load balancer in front of your web role instances automatically for external endpoints.
Both are running in parallel and each cloud service has one URL with a load balancer and it forwards the traffic to both instances.

Azure Webapps not failover when instance fails

We deployed a Node.js Azure Web App and defined a minimum of 2 instances (for scalability and high-availability).
It seems like the LB is balancing the load between the instances, but it doesn't react on instance error (crash) and seems to insist balancing the load between all the instances including the one which crashed.
Is there a way to set a fail-over mechanism for high-availability?
The load balancer used by Azure App Service will continue to send requests to individual web servers as long as the underlying virtual machines are up and running.
To workaround the issue you are running into, you can try configuring the "auto-heal" feature. If the scenario is that the app gets "stuck" in a permanently broken state, auto-heal rules can be configured to automatically restart the app.
More details on auto-heal here:
Auto-heal for Azure Web Sites

Performance: Azure WebSites two instances vs. two Azure WebSites

I'm running 1 Standard-tier Azure WebSites and trying to get rid of recycle issue and unstable connection for whatever reason.
If I add new instance to same region, is there (1) any difference in performance perspective? (2) Do they have same architectural allocation? (3) and which one is more fail-safe?
Adding another instance to the existing web hosting plan will run on the resources defined by that plan. e.g. if you have two virtual machines instances for your Standard plan, all the web sites associated with that web hosting plan will run on both virtual machines.
Neither is "more" fail-safe, as websites are offered as a Platform-as-a-Service. This means that the servers that are running on are fully managed by Microsoft and are highly available. If you have instance count set to 2, there will always be two instances up, regardless of underlying hardware faults on the Azure fabric.
Source
Azure Websites Web Hosting Plans In-Depth Overview
How does Windows Azure heal?

Multiple Web Sites/Roles on Azure, Impact of staging server

I'm looking to set up two web roles or websites on my Azure Cloud Service.
The websites need to share the same database schema. I use NHibernate ORM, so I have to make sure that both projects are always using the same data model, or else it will cause major problems.
I've researched setting up multiple websites on a single web role (which seems odd to me, can't I just run multiple web roles, each with a single site)?
http://msdn.microsoft.com/en-us/library/windowsazure/gg433110.aspx
Like any good developer, I use a staging server. If I have to manually set the domain name is configuration files, how will azure know not to be sending people who visit that domain to the staging server?! I.E. If they visit blah.foo.com and I have two deployments (staging and production), is IIS going to be able to know only to send people to the production environment?
Please advise on the best way to go about doing this.
First, you can certainly have multiple web roles, each with a single site; however, each role instance will be deployed to different virtual machines. For example, if you do set up two web roles when you deploy this with one instance each then there are two virtual machines you'll be paying for. If you want the SLA to apply to your deployment you'd need to actually set the instance count to 2 for each web role, which now means you have four virtual machines running. By combining web sites onto the same web role you'll cut down on the number of instances you need to run and still get the SLA; however, that option is not without some considersations. The link you provided is how you can set up multiple websites to run on the same virtual machine when deployed. Note that there are some gotchas with using that method. I'd suggest reading Michael Collier's Tips for Publishing Multiple Sites in a Web Role.
Second, if you do NOT need to have a lot of control over the virtual machine (such as registering special components, etc.) you might want to look at Windows Azure Web Sites as an option. You can elect to take one of the paid levels of Web Sites and still have dedicated machines, but you can deploy the websites separately. I will say though, that your requirement of having both sites in lock step because they share the underlying database schema means that it will be less likely you will want to deploy separate changes, but it is still possible.
Finally, regarding the staging server. If you are testing locally you'll want to modify your hosts file to get the host names to point to your local address. Wade Wegner has a post on Running Multiple Websites in a Windows Azure Web Role. Once you deploy to Windows Azure you'd want to change your hosts file back, or comment them out. If you are using the actual idea of the Staging deployment slot you can use the same trick with the hosts file to point to the IP address of the staging deployment when testing.

Resources