{Dynamics CRM + Maintenance Page} How to pull down specific CRM Organization for maintenance in a multi-tenant CRM environment with IFD configured

I know the title of the blog is a bit confusing. So if you are reading this, I would suggest you continue reading this.

So first the requirement. Our client had two CRM Organizations in a single installation of CRM. And both the organizations are on IFD.

With time one organization because of it more transaction data and usage grew significantly bigger and business decided to move it on a separate server altogether and on a newer version of CRM. To illustrate this even more let us take names here.

Organization Name

Org1 is to be moved to a new server to a newer version of CRM. It was decided we would have 3 days of downtime for this. Users have been communicated accordingly that https://org1.contoso.com would be unavailable for 3 days. But during this time, users should be able to access https://org2.contoso.com

To bring a CRM website down, we can usually create a HTML with the appropriate markup and name it app_offline.htm and then place it in the root folder. Make sure you name it exactly like this, otherwise it would not work. However in our case this would not work since that would bring the whole website down and org2 won’t be accessible as well.

So we were left with no other choice but to configure rewrite rule.

Go to IIS –> Microsoft Dynamics Website –> URL Rewrite. If you do not see this icon, rewrite module is not installed. You need to install the rewrite module in that case.



Click on “Add Rule” and select “Blank Rule” from the menu.



You final rule would look like this.



And voila! You are done. Users would still be able to access org2.contoso.com but when they try to access org1.contoso.com, they would get the maintenance page.

I am redirecting here to a local page called maintenance.htm where the appropriate message is shown to the user with downtime notification.


Hope this helps!

About Debajit
I am a Dynamics CRM Most Valuable Professional (MVP) with 12 years of experience in Microsoft .NET Technologies and 9 years of dedicated experience in Microsoft Dynamics CRM. I have worked with companies like Microsoft, SanDisk, PwC, TMF Group and have extensive experience of implementing complex CRM solutions from both offshore and client side. Currently the face of XrmForYou.com with significant experience in delivering corporate training on Dynamics CRM and have already delivered multiple projects to client through XrmForYou.com Author of multiple tools on codeplex including the 'Role Based Views' and 'CRM-Sharepoint Metadata manager & Attachment Extractor' which are available for commercial use under XrmForYou.com For consulting/ training, drop me a note at info@xrmforyou.com or visit our website www.xrmforyou.com

9 Responses to {Dynamics CRM + Maintenance Page} How to pull down specific CRM Organization for maintenance in a multi-tenant CRM environment with IFD configured

  1. Santhi Kumari says:

    Why can’t we simply disable the Org1 in deployment manager???

    • Debajit says:

      Hi Santhi,

      Point 1 – If you disable the organization, then the users would end up with an ugly message (probably Error 404- Not found, not sure though). And for commercial applications you do not want your end users to view those messages. Rather you would display a message with all the maintenance details.On top of that, you have to update the federation metadata of the replying party trust as well.

      Point 2 – And this is perhaps the more important point. The blog aims at redirecting users to the maintenance page when they browse through the internal URL. However as a part of IT Team you would need to perform many stuffs on your application. And CRM needs to be accessible to you through the internal endpoint. Disabling a CRM org would leave you only with database access.

  2. Ruchi Dureja says:

    Hi Debajit, Nice explanation. I am working on something similar and want to ask you a question. We have only one organization and not two. Client wants that the system users should be redirected to a maintenance page during data recovery switches or other down time while the people deploying on the server should be continue to work without maintenance page. Can you please give me some pointers or information on this? Thanks.

    • Debajit says:

      Hi Ruchi,

      Then its actually very easy. Just create a html file named app_offline.htm and place it in the root folder of your CRM. Whatever you need to show to the end user, put that in app_offline.htm. That’s it. Reset the IIS. The next time somebody requests CRM, the app_offline page would be thrown to the user.

      • Ruchi Dureja says:

        Thanks Debajit, I am going to implement it tomorrow and come back to you with my thoughts. Thanks again for prompt response 🙂

      • Ruchi says:

        Hi Debajit, I am trying to implement this, but not able to get it to work. Below are the steps that I did –
        1. Created two organizations and pointed them to same database.
        2. Created maintenance.htm file and placed them in CRMWeb\root folder. (Not sure if this is the right place).
        3. Created URL rewrite rule to redirect to first organization.
        4. IIS reset.

        In my case the user can also make crm request via outlook add in and therefore, I can not always know the source url in advance (I may have to try all possible combinations and find the urls myself though). Please advice what I am missing here. Thanks.

      • Debajit says:

        Hi Ruchi,
        I am not sure if you are doing this correctly.

        First of all, what i understand is you want to redirect the user to org1 if org2 is requested. Then why the maintenance page?
        Also pointing both the organizations to the same database is something you should never do and is strictly unsupported.

        Basically I am confused about your requirement.
        Let me know.


  3. Ruchi says:

    Hi Debajit,

    Yes, I am going in loops here on this requirement :). Sorry for confusing you but I try to explain the scenario properly.

    Actual scenario at my client is that we can access crm via web browser as well as through outlook addin. We have our own deployment automation tool which is used weekly for deployments. Therefore, client wants that when the crm deployments/other troubleshooting is in progress, end user should be shown the maintenance page and the original url should remain unchanged(so that we don’t have to manually adjust everytime in our deployment tool).

    When I came across your above article, I found it a good solution for above scenario. Having two pointers/aliases to one database and using one for maintenance purposes. However I was not aware that it is not supported. So thanks for letting me know :). So far I am not able to make anything work for our requirement, therefore now I am focusing on redirecting the crm url to another url and throwing maintenance page at the end user. For this, I am following your below article –

    I have placed a maintenance.htm page in the CRMWeb folder and created url rewrite for my crm url. Here I am stuck because I am not even able to bring CRM down :). I do not want to disable the organization and disabling the services does not bring crm website down. If I disable the defaultapppool, then it just throws another error, but not my maintenance page.

    I hope that I am not confusing you more with the above story 🙂 but let me know what is a good solution in the above case. Thanks.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: