{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.

image

 

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

image

 

You final rule would look like this.

image

 

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!


Discover more from Debajit's Power Apps & Dynamics 365 Blog

Subscribe to get the latest posts sent to your email.

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

    1. 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.

  1. 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.

    1. 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.

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

      2. 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.

        1. 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.
          regards
          Debajit

  2. 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 –
    https://debajmecrm.com/2016/03/30/knowhow-redirect-users-to-an-intermediate-disclaimer-page-while-logging-in-dynamics-crm-on-premise/
    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.
    Regards,
    Ruchi

Comments are closed.

Discover more from Debajit's Power Apps & Dynamics 365 Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading