How to deploy a D365 virtual machine (VM) to your own Azure subscription (Part 2 of 2)

Where do you run your VM?

Did you enjoy the earlier post on how to run a D365 VM using your own Azure subscription?

Do you wish there was an easier and better way? Well, there is.

Let’s try to keep this post as short and sweet as possible. Read part 1 for context if needed.

Notes before we get started
▶ This post is intended for those who have a growth mindset and a passion for learning and who wish to empower themselves because they are not given VMs as part of their jobs
▶ There are other approaches to get either a cloud-hosted VM or local VM deployed, and this is simply one way to get a cloud-hosted VM using personal Microsoft accounts and subscriptions (the only organizational requirement is not a challenge for those currently working for a Microsoft partner/customer)


Prerequisites
▶ Your own personal Azure subscription
▶ Your organization must have the appropriate D365 subscription

Parts 1 and 2 are just one-time setups to get to part 3, which is the easy part and why you are reading this post.

Part 1 – Create a personal project in LCS

Part 2 – Complete the Azure Resource Manager onboarding process

Part 3 – Deploy and use cloud-hosted VM through LCS

Part 1 – Create a personal project in LCS

  • Sign into your organizational Microsoft account and go to the LCS portal
Dynamics Lifecycle Services (LCS) home page
  • In the home page, select the All projects tab and create a project by selecting the + button
  • Select Finance and Operations as the product
Select a product
  • Select Prospective presales as the project purpose
Select the purpose of the project
  • Enter project details as needed and select Create
Create a project
  • Your project is now created and LCS opens your project home page
Project home page in LCS

Let’s move onto the next part.


Part 2 – Complete the Azure Resource Manager onboarding process

This part covers how to set up the Azure connectors for your LCS project that automate the cloud-hosted environment deployments.

There is a great Microsoft Docs article outlining this, and we’ll follow along closely with a few adjustments to handle using a personal Azure subscription, instead of your organization’s enterprise subscription.

  • In your LCS project, open the menu and select Project settings
Project menu in LCS
  • Go to the Azure connectors tab in Project settings
Azure connectors in LCS project settings
  • In the ORGANIZATION LIST area, select Authorize where you see your organization
  • The Grant admin consent page will open
Grant admin consent page in LCS
  • Select Authorize, and read the next steps carefully
Sign in to your account page
  • Do not continue when the Sign in to your account page opens – this is where we make a few adjustments

Note: the following details and this entire post would not be possible without this great Microsoft Dynamics 365 Blog post

  • When the Sign in to your account page opens, copy the URL from your web browser, which should look like this:

‌https://login.microsoftonline.com/common/oauth2/authorize?response_type=code&client_id=a12b3d45-e67f-8g90-12h3-ij4kl567mnop&redirect_uri=https://lcs.dynamics.com/V2/GrantAdminConsent/1234567&state=1a2b34c5-6d78-9e0f-12gh-i34j5kl6m7no&prompt=admin_consent

  • Sign into the Azure portal using your personal Microsoft account, and go to the Azure Active Directory overview
Azure Active Directory overview in Azure portal
  • Get the primary domain – for example, ‘joshdcabreraoutlook.onmicrosoft.com’
  • Going back to the URL copied from the Authorize or Sign in to your account page, replace the ‘common’ text with the primary domain text like this:

‌https://login.microsoftonline.com/joshdcabreraoutlook.onmicrosoft.com/oauth2/authorize?response_type=code&client_id=a12b3d45-e67f-8g90-12h3-ij4kl567mnop&redirect_uri=https://lcs.dynamics.com/V2/GrantAdminConsent/1234567&state=1a2b34c5-6d78-9e0f-12gh-i34j5kl6m7no&prompt=admin_consent

  • Copy the updated URL, go to the URL in a new web browser session, and sign into your personal account
Sign in to your account page
  • Click Accept to grant the necessary permissions to the Dynamics Deployment Services application
Grant authorization to the Dynamics Deployment Services application
  • If the web browser redirects to a page like the one below, do not worry – your personal account does not have LCS access (only organizational Microsoft accounts may access LCS)
Redirected to LCS after previous step
  • Go back to the Azure Active Directory in your personal Azure subscription, and select Enterprise applications
Enterprise applications for Azure Active Directory
  • From your personal Azure subscription, go to Access control (IAM)
Access control (IAM) for Azure subscription
  • Select +Add and Add role assignment
  • Select Contributor and Next
Add role assignment for Azure subscription
  • Select User, group, or service principal for Assign access to, and then select +Select members
Select members for role assignment in Azure subscription
  • Search for ‘dynamics’, and select Dynamics Deployment Services [wsfed-enabled] as a member
  • Continue by selecting Review + assign
Review and assign role for Azure subscription
  • Validate the Contributor role assignment using the Access control (IAM) page and the Role assignments tab for your personal Azure subscription
Access control (IAM) role assignments for Azure subscription
  • Go back to your LCS project, and open the Azure connectors tab in the Project settings page
Azure connectors in LCS project settings
  • In the AZURE CONNECTORS area, select +Add
  • Enter the Name, Azure subscription ID, and Azure Active Directory Tenant ID, and then select Next to continue
    • Note: the IDs are available in the Azure Active Directory overview – same area where you got the primary domain in earlier steps
Microsoft Azure connector setup in LCS
  • Review the details, and select Next to continue
Microsoft Azure connector setup in LCS
  • From here, select Download to get the management certificate file needed for the following steps
Microsoft Azure connector setup in LCS
  • Back in your personal Azure subscription, go to Access control (IAM)
  • Select +Add and Add co-administrator
  • Select and add your personal Microsoft account
Access control (IAM) for Azure subscription
  • Remaining in your personal Azure subscription, select Management certificates and then Upload the file downloaded from LCS earlier
Management certificates for Azure subscription
  • Switching back to LCS, select Next to continue
  • Select an Azure region and then Connect to continue
Microsoft Azure connector setup in LCS
  • You should now see the Azure connector created
Completed Microsoft Azure connector setup in LCS

Finally, we can move onto the part you’ve been waiting for!


Part 3 – Deploy and use cloud-hosted VM through LCS

What if there was an easy button for this?

Staples Easy Button

Wait a second, there is one?

With just a few clicks, you can now deploy a cloud-hosted VM.

  • Continuing from our last steps, open the project menu in LCS, and go to Cloud-hosted environments
Project menu in LCS
  • Select +Add to start
Cloud-hosted environments page
  • Select the Application version and Platform version
    • Note: you can get the latest versions using this approach while the other approach outlined in part 1 limits you to whatever versions are available for the downloadable VHDs
Cloud-hosted environments page
  • Select an environment topology – e.g., DEVTEST
Cloud-hosted environments page
  • Select an environment topology – e.g., Finance and Operations – Develop (10.0.24 with Platform update 48)
Cloud-hosted environments page
  • Review and update various details such as the Environment name, Size, and other settings
    • Note: the VM size, disks, etc. will drive your Azure costs
Cloud-hosted environments page
  • After selecting the terms agreement checkbox and Next, you will receive a final confirmation prompt
Deployment confirmation
  • Select Cancel
  • Just kidding, select Deploy – your VM will now show as queued for deployment
Cloud-hosted environment queued for deployment
  • Note: deployment may take a few hours – this one took ~4 hours – so it’s time for a well deserved break
  • When you have returned and refreshed the Cloud-hosted environments page, you should see that your environment now shows as Deployed
Deployed cloud-hosted environment details
  • Review the environment details such as the LOCAL ACCOUNTS that enable Remote Desktop access
Remote Desktop view of cloud-hosted environment
  • Or use Log on to environment to access the application from any supported web browser – e.g., Google Chrome on Apple iOS
Logging into application from mobile device

You now have your own VM at your fingertips. So how will you achieve more using the Dynamics 365 and Azure platforms?

How are you making your people, process, and product better with Dynamics?

What are you thinking?

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 )

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