ad
ad

Get your on-prem apps AI-ready using GitHub Copilot and Azure Migrate Code Assessment tool

Science & Technology


Introduction

In the era of digital transformation, many organizations are seeking effective ways to modernize and migrate their on-premises applications—particularly ASP.NET and Java web applications—to cloud platforms like Azure App Service. The introduction of advanced generative AI capabilities provides additional opportunities to enhance existing applications. In this article, we will explore how to effectively modernize your on-premises web applications, utilize Azure migration tools, and integrate generative AI using GitHub Copilot and Azure OpenAI.

Modernizing Web Applications

When embarking on the journey of modernizing web applications that operate on-premises, several critical steps need to be taken. Leveraging the Visual Studio Application Code Assessment Toolkit allows you to analyze your existing ASP.NET applications effectively.

Step-by-Step Process

  1. Download the Assessment Toolkit: The Visual Studio Application Code Assessment Toolkit can be obtained from the Marketplace at no cost. It provides a new menu option titled "Rep Platform to Azure" once installed.

  2. Run a New Assessment: By selecting the new assessment option, you can choose your target platform for Azure App Service (Windows or Linux).

  3. Include Dependencies: Alongside your source code, you have the option to include binary dependencies for thorough analysis.

  4. Generate Compatibility Report: After running the analysis, a compatibility report is generated within seconds. This report categorizes issues into three severity levels: Mandatory, Service, Potential, and Optional.

Addressing Issues

Upon reviewing the issues, one crucial piece of feedback may indicate that your application uses Windows Authentication, which is unsupported on Azure App Service. To address this, you can consult GitHub Copilot for suggestions on switching to Azure Entra for user authentication.

The toolkit can also flag database connection strings used within your application. It is essential to ensure that your web application successfully connects to the migrated database, whether it's Azure SQL or another service.

Migrating to Azure App Service

Once the necessary code changes have been made, various tools are available to migrate your application:

  • Azure Migrate: This integrated experience facilitates the discovery, assessment, and bulk migration of applications.
  • PowerShell Scripts: For single server migrations.
  • Azure App Service Migration Assistant: Ideal for experimenting with migrations.

After successfully migrating your web application, you can implement generative AI capabilities to enhance its functionality.

Integrating Generative AI

For this demonstration, we used the Azure OpenAI Client SDK for .NET with the GPT-3.5 Turbo model. With existing ASP.NET framework applications, you don't have to rewrite your application from scratch to introduce AI features. Instead, you can enhance it by creating AI-powered chat functionalities.

Utilizing AI Capabilities

In our example, we added a chatbox functionality that allows users to query product recommendations. Here’s a brief overview of the integration process:

  1. Azure OpenAI SDK: Initialize the Azure OpenAI SDK using Managed Identity for secure authentication between your web application and the Azure OpenAI endpoint.

  2. Chat Completions API: Implement this API to process user queries while leveraging a prompt template to give persona context to the AI.

  3. User Interaction: The chatbot processes the query and returns a relevant response to the users.

This AI-assisted modernization not only enhances the interactivity of the application but also opens doors to more advanced AI integrations.

Conclusion

The convergence of Azure Migrate for code assessment and GitHub Copilot for code suggestions offers a powerful route to modernize on-premises applications, infuse AI capabilities, and ensure successful migration to Azure App Service. Through this process, organizations can leverage the latest technologies without overwhelming rewrites of existing applications.


Keywords

  • Azure App Service
  • Modernization
  • GitHub Copilot
  • OpenAI
  • ASP.NET
  • Azure Migrate
  • Code Assessment
  • Managed Identity
  • Chat Completions API

FAQ

Q1: What is Azure Migrate?
Azure Migrate is an integrated experience that helps organizations discover, assess, and migrate their applications to Azure.

Q2: Can I use GitHub Copilot for multiple projects?
Yes, GitHub Copilot can assist in various coding tasks across different projects.

Q3: Is it necessary to rewrite the entire application to integrate generative AI?
No, you can introduce AI capabilities into your existing applications without the need for complete rewrites.

Q4: What is the benefit of using the Visual Studio Application Code Assessment Toolkit?
The toolkit provides a comprehensive assessment of your application's compatibility with Azure App Service, highlighting potential issues that may arise during migration.

Q5: How does Managed Identity enhance security when connecting to Azure OpenAI?
Managed Identity simplifies authentication by eliminating the need for hard-coded credentials, providing a more secure way to access Azure resources.