How to change Azure subscription for LCS project?
Evaldas
1,798
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
- Add a new Azure connector in LCS.
- 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.
- Backup anything you need to backup
- Make a database backup and place it somewhere out of the environment.
- Check in source code
- Configure new environments
- Connect version control
- Restore database
- Reconfigure parameters related to the environment URL (Application registrations etc.)
- Switch to the new environments.
- Environments from both subscriptions can coexist so switch whenever you are ready.
- Deallocate environments deployed on the old subscription.
- 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!
*This post is locked for comments