Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Web Apps : How to access specific instance directly via URL?

We have deployed our Sitecore CMS on to Azure Web Apps and having some indexing issues or similar. i.e. the updated changes is reflected for some users and not for all.

We have a scale turned on to 2.

I would like to troubleshoot by accessing the instance 1 and 2 directly via URL to make sure both instances have index built 100%.

How do I access each Azure Web Role instances directly via URL?

Thanks.

like image 891
Nil Pun Avatar asked Jan 16 '16 23:01

Nil Pun


1 Answers

The first step is to get the list of instance names. There is an Azure API for it, which you can easily invoke using Resource Explorer (https://resources.azure.com/). Use these steps:

  • In Resource Explorer, find your Web App (in the tree or using search box)
  • Under the app, click on Instances, which gives you an array of instances. Each instance has a long name like 622e6b27f9077701f23789e5e512844d22a7dfdd29261bc226f65cd000e2d94a

Once you have the instance names, you can add a cookie in your requests to aim at a specific instance by setting the ARRAffinity cookie to that value. e.g.

ARRAffinity=622e6b27f9077701f23789e5e512844d22a7dfdd29261bc226f65cd000e2d94a

You can do it using a tool like curl. Or I like to use the EditThisCookie Chrome extension (link), which lets you set it from the browser.

In fact, you'll find that after hitting the page normally from the browser, you'll already get an ARRAffinity, as it's used for session stickiness. But the Chrome extension lets you change it and aim at other instances.

See also related blog post: http://blog.amitapple.com/post/2014/03/access-specific-instance/

like image 71
David Ebbo Avatar answered Oct 23 '22 03:10

David Ebbo