⚠️ This repository is no longer maintained ⚠️
Modernize your code solution accelerator
Welcome to the Modernize your code solution accelerator, designed to help customers transition their SQL queries to new environments quickly and efficiently. This accelerator is particularly useful for organizations modernizing their data estates, as it simplifies the process of translating SQL queries from various dialects.
When dealing with legacy code, users often face significant challenges, including the absence of proper documentation, loss of knowledge of outdated languages, and missing business logic that explains functional requirements.
The Modernize your code solution accelerator allows users to specify a group of SQL queries and the target SQL dialect for translation. It then initiates a batch process where each query is translated using a group of Large Language Model (LLM) agents. This automation not only saves time but also ensures accuracy and consistency in query translation.
SOLUTION OVERVIEW | QUICK DEPLOY | BUSINESS SCENARIO | SUPPORTING DOCUMENTATION
Note: With any AI solutions you create using these templates, you are responsible for assessing all associated risks and for complying with all applicable laws and safety standards. Learn more in the transparency documents for Agent Service and Agent Framework.
Solution overview
The solution leverages Azure AI Foundry, Azure OpenAI Service, Azure Container Apps, Azure Cosmos DB, and Azure Storage to create an intelligent code modernization pipeline. It uses a multi-agent approach where specialized AI agents work together to translate, validate, and optimize SQL queries for the target environment.
Solution architecture
This architecture will be deployed with the 'sandbox' setting of our deployment process. Optionally you can deploy Well-Architected Framework (WAF) aligned architecture, described in WAF-Aligned Solution Architecture, with the WAF-Aligned deployment option described in Deployment Guide.
Agentic architecture
Additional resources
If you'd like to customize the solution accelerator, here are some common areas to start:
Custom scenario
For detailed technical information, see the component documentation:
Azure AI Foundry documentation
Semantic Kernel Agent Framework
Azure OpenAI Service Documentation
Features
Key features
Click to learn more about the key features this solution enables
Code language modernization
Modernizing outdated code ensures compatibility with current technologies, reduces reliance on legacy expertise, and keeps businesses competitive.
Summary and review of new code
Generating summaries and translating code files keeps humans in the loop, enhances their understanding, and facilitates timely interventions, ensuring the files are ready to export.
Business logic analysis
Leveraging AI to decipher business logic from legacy code helps minimizes the risk of human error.
Efficient code transformation
Streamlining the process of analyzing, converting, and iterative error testing reduces time and effort required to modernize the systems.
Getting Started
Quick deploy
How to install or deploy
Follow the quick deploy steps on the deployment guide to deploy this solution to your own Azure subscription.
Note: This solution accelerator requires Azure Developer CLI (azd) version 1.18.0 or higher. Please ensure you have the latest version installed before proceeding with deployment. Download azd here.
Note: This solution accelerator also requires Bicep CLI version 0.33.0 or higher for compiling infrastructure templates. Install Bicep.
Click here to launch the deployment guide
Note: Some tenants may have additional security restrictions that run periodically and could impact the application (e.g., blocking public network access). If you experience issues or the application stops working, check if these restrictions are the cause. In such cases, consider deploying the WAF-supported version to ensure compliance. To configure, Click here.
⚠️ Important: Check Azure OpenAI Quota Availability
To ensure sufficient quota is available in your subscription, please follow quota check instructions guide before you deploy the solution.
Guidance
Prerequisites and costs
To deploy this solution accelerator, ensure you have access to an Azure subscription with the necessary permissions to create resource groups, resources, app registrations, and assign roles at the resource group level. This should include Contributor role at the subscription level and Role Based Access Control role on the subscription and/or resource group level. Follow the steps in Azure Account Set Up.
Here are some example regions where the services are available: East US, East US2, Japan East, UK South, Sweden Central.
Check the Azure Products by Region page and select a region where the following services are available: Azure AI Foundry, Azure OpenAI Service, and GPT Model Capacity.
Pricing varies per region and usage, so it isn't possible to predict exact costs for your usage. The majority of the Azure resources used in this infrastructure are on usage-based pricing tiers. However, Azure Container Registry has a fixed cost per registry per day.
Use the Azure pricing calculator to calculate the cost of this solution in your subscription.
⚠️ Important: To avoid unnecessary costs, remember to take down your app if it's no longer in use,
either by deleting the resource group in the Portal or running azd down.
Resources
Business scenario
Companies maintaining and modernizing their data estates often face large migration projects. They may have volumes of files in various dialects, which need to be translated into a modern alternative. Some of the challenges they face include:
- Difficulty analyzing and maintaining legacy systems due to missing documentation
- Time-consuming process to manually update legacy code and extract missing business logic
- High risk of errors from manual translations, which can lead to incorrect query results and data integrity issues
- Lack of available knowledge and expertise for legacy languages creates additional effort, cost, and reliance on niche skills
By using the Modernize your code solution accelerator, users can automate this process, ensuring that all queries are accurately translated and ready for use in the new modern environment.
For an in-depth look at the applicability of using multiple agents for this code modernization use case, please see the supporting AI Research paper.
⚠️ The sample data used in this repository is synthetic and generated using Azure OpenAI service. The data is intended for use as sample data only.
Business value
Click to learn more about what value this solution provides
Automate the translation of SQL queries, significantly reducing migration time and effort.
Multi-agent validation ensures accurate translations and maintains data integrity.
Captures and preserves business logic during the modernization process.
Reduces reliance on specialized legacy system expertise and manual translation efforts.
Ensures consistent query translation across the organization.
Supporting documentation
Security guidelines