Wednesday, December 18, 2024
Access the Development Environment (UDE) Database with Just-In-Time Credentials
Posted by
Accessing the Finance and Operations (FO) database during development has evolved with the Unified Development Environments (UDEs). UDEs are Power Platform-based cloud environments. These environments replace the older LCS-based cloud-hosted environments, which used Azure-hosted virtual machines installed via Lifecycle Services (LCS).
Previously, in LCS-based environments, developers would connect to local databases using tools like SQL Server Management Studio (SSMS). Now, databases in UDEs are hosted in the Azure cloud, and access is managed securely through Just-In-Time (JIT) credentials.
This guide walks you through obtaining JIT credentials and connecting to the UDE FO database using Visual Studio and external tools.
Obtain JIT Credentials
To access the UDE FO database, follow these steps to obtain JIT credentials:
1. Launch Visual Studio and Connect to Dataverse
- Open Visual Studio and ensure you have the Power Platform Tools extension installed.
- Connect to your Dataverse instance.
2. Request JIT SQL Credentials
- Navigate to Tools -> SQL Credentials for Dynamics 365 FinOps....
- Provide the following details:
- Reason for Access: Briefly explain why you need access.
- Access Level: Choose between Read or Write access.
- Click Request Access.
Once the credentials are successfully generated, you will see the SQL JIT Response section with the following details:
Credential Details
- SQL Server Name: The server hosting the database.
- SQL Database Name: The name of the target database.
- SQL User Name: The username for authentication.
- Credential Expires On: Displays the expiration time (valid for 8 hours).
Copy JIT Credentials to Clipboard
You can copy the credentials using the buttons provided:
- Password: Copies the generated password to the clipboard.
- Connection String: Copies the full connection string for use in external tools.
Connect to the FO Database
Once you have your JIT credentials, you can connect using various tools:
Option 1: Visual Studio SQL Query
- Go to Tools -> SQL Server -> New Query... in Visual Studio.
- Enter the JIT credentials to authenticate.
- Start running SQL queries directly in Visual Studio.
Option 2: Visual Studio Server Explorer
- Navigate to Tools -> Connect to Database.
- Select Microsoft SQL Server from the data source list and select Continue.
- Enter the JIT credentials to authenticate.
Option 3: External Tools
- Use external applications like SQL Server Management Studio (SSMS).
- Enter the JIT credentials to authenticate.
Troubleshoot Common Errors
Error: Unable to Obtain SQL JIT
Message: Unable to obtain SQL JIT. Confirm that the environment supports it and retry. OperationHistoryID: 000000-0000-0000000-000-00000
Solution:
- Ensure you are using the latest Power Platform Tools extension.
- Check the updates from Extensions -> Manage Extensions... -> Installed (tab) -> Power Platform Tools for VS 2022.
Error: Invalid Credentials
- Verify the credentials are still valid (JIT credentials expire after 8 hours).
- Re-request credentials if needed.
Error: No Credentials Received
Message: SQL JIT Response is empty. No credentials were received.
Solution:
- Verify that you have the necessary permissions to request JIT credentials. The
System Customizer
role is not sufficient for this request. - Check your access rights in the Power Platform Admin Center.
- Ensure that your user role has the appropriate privileges to access the UDE FO database.
Summary
By using JIT access, developers can securely connect to UDE FO databases hosted in the Azure cloud. Visual Studio provides integrated tools for querying, while external tools like SSMS remain available for advanced operations.
Stay updated with the latest tools and extensions to ensure smooth access and minimize errors.