13

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.

Nil Pun
  • 17,035
  • 39
  • 172
  • 294

1 Answers1

26

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/

David Ebbo
  • 42,443
  • 8
  • 103
  • 117
  • Thank you! Is it possible to either FTP or view the physical files on each instances? Or each of these instances have common shared physical folder Or we FTP to one central location which gets replicated to instances? – Nil Pun Jan 18 '16 at 02:40
  • 3
    It's a shared folder, so Instances don't matter. – David Ebbo Jan 18 '16 at 04:00
  • So my take is that if we have 3 instances MVC website they all share the common folder which hosts DLLs? Your answer contracts with this one http://stackoverflow.com/questions/34629623/clarification-on-azure-web-app-scale-instance/34654102#34654102 where Brij has mentioned that changes will be continuously deployed to each VMs. – Nil Pun Jan 18 '16 at 06:23
  • Also I managed to use your trick to access the site hosted on each instance. Is it also possible to FTP to specific instance and view the physical folders and files. – Nil Pun Jan 18 '16 at 06:35
  • 3
    All instances share the same files (even if that other answer implies otherwise!). FTP happens on a VM that is not any of your instances, so it is completely instance agnostic. So the need to aim FTP at a specific instance just does not arise. – David Ebbo Jan 18 '16 at 17:29
  • 1
    What happens when your ARRAffinity value is incorrect - i.e. beceause the instance got scaled down? Does it keep going to a random server until you set a different cookie? – Dirk Boer Jan 08 '19 at 10:45