Skip to main content

Notifications

Dynamics 365 Community / Blogs / ELandAX blog / How to change Azure subscri...

How to change Azure subscription for LCS project?

Hello World!


What does it take to change an Azure subscription on an already running LCS project?

Why would you do that you may ask? Well, the problem was that we started creating everything in an existing subscription where many other things had already existed.

Over the time we bumped into several issues:
  • We did not have ownership rights thus every time we needed something, we had to contact Azure team.
  • There were new policies introduced along the way that prevented from automatic deployment through LCS.
  • D365 Finance resources created fell of the Azure team's standard best practices and support model.
Inconsistency and the lack of control made us decide to move on to a dedicated subscription where we will have ownership rights and more control.

Note: It is only necessary to move cloud-hosted environments (CHE) and not Microsoft managed ones like UAT or PROD. All Microsoft managed environments are deployed on Microsoft Azure subscriptions.

We had a bunch of CHEs deployed on the previous subscription. And you cannot just magically move them to a new subscription. Well, Azure team can move resources from Azure side but LCS would not update the links to them. LCS would not know that resources have moved.

We need a different approach. 

Here is the process we followed to switch to a new subscription.
The new subscription was of the same tenant. The steps might differ if the tenants were different.

The process
  1. Add a new Azure connector in LCS.
  2. Deploy new environments using new connector. 
    • You will be asked to pick a connector during creation of CHE.
    • The environment names must be different in the scope of LCS project.
    • Both environments can coexist at the same time.
  3. Backup anything you need to backup
    • Make a database backup and place it somewhere out of the environment.
    • Check in source code
  4. Configure new environments
    • Connect version control
    • Restore database
    • Reconfigure parameters related to the environment URL (Application registrations etc.)
  5. Switch to the new environments.
    • Environments from both subscriptions can coexist so switch whenever you are ready.
  6. Deallocate environments deployed on the old subscription.
    • Important! If you reused virtual network configuration you must delete the dependent CHEs first before removing the one which they depend on. Otherwise you will get an error during deletion of the CHE which does not say anything.
      I got a meeningfull error from Microsoft support.

  7. Remove the old Azure connector

Build machine would only require redeployment. No other additional configuration steps for it. The first time build will run a little longer.

This is as simple as it gets.

Be aware and take care!

Comments

*This post is locked for comments