Skip to content

Commit 03aa494

Browse files
authored
Merge pull request #85 from microsoft/Add-customization-docs
docs: Add customization docs
2 parents 75c9614 + 984ff9b commit 03aa494

File tree

8 files changed

+296
-205
lines changed

8 files changed

+296
-205
lines changed

README.md

Lines changed: 122 additions & 204 deletions
Large diffs are not rendered by default.

docs/CustomizingAzdParameters.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
## [Optional]: Customizing resource names
2+
13
By default this template will use the environment name as the prefix to prevent naming collisions within Azure. The parameters below show the default values. You only need to run the statements below if you need to change the values.
24

35

4-
> To override any of the parameters, run `azd env set <key> <value>` before running `azd up`. On the first azd command, it will prompt you for the environment name. Be sure to choose 3-20 charaters alphanumeric unique name.
6+
> To override any of the parameters, run `azd env set <key> <value>` before running `azd up`. On the first azd command, it will prompt you for the environment name. Be sure to choose 3-20 characters alphanumeric unique name.
57
68
Change the Model Deployment Type (allowed values: Standard, GlobalStandard)
79

docs/CustomizingScenario.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## [Optional]: Customizing scenario
2+
3+
This template pattern can be used for other types of conversions requiring the same or similar agent workflows. This document provides a suggested path to modifying the template to support a new scenario - for example an infrastructure as code template conversion. Generally the API backend is modified with the API used to support a new user experience / UI. This document will focus on necessary backend changes.
4+
5+
The first step is to determine the overall architecture for the system, how the agents will interact, and details regarding the step by step architecture. If the conversion needs to be validated by a tool or tested in an environment, full details on how to configure and run this are also necessary. After this, follow the steps below to quickly create a proof of concept for the new system.
6+
7+
1. Copy the agent workflow folder (sql_agents) into a new sibling folder within src/backend and name it as appropriate to your scenario
8+
1. Modify the agent folder and file names as appropriate to support new agent types
9+
1. Modify the agent response class to represent the structured response needed from the agent
10+
1. Modify the agents prompting in the associated prompt.txt file. Note that changing the conversion inputs and outputs will also require changes to agent_config.py as well as src/backend/api/api_routes in the definition of start-processing.
11+
1. If workflow modification is necessary, those changes would take place in the src/backend/sql_agents/helper/comms_manager.py file as well as the src/backend/sql_agents/convert_script.py file.
12+
1. There are two primary ways of messaging state changes to the front end. The first results from state storage in Cosmos. This is updated primarily in the convert_script.py file with the creation of file logs. The second is for transitory state changes that are communicated through websockets to the client. These are also primarily in the convert_script.py file.
13+
1. Create a function to validate conversions using a test environment or utility. Provide this function to an agent to perform the validation role and iterate with another agent which can attempt to fix any issues. You can follow the plug in example within the current Syntax checker agent.
14+
15+
Agent code in src/backend/agents including agent_base.py, agent_factory.py, and agent_config.py is designed to be largely reused in any scenario. Code in sql_agents/helpers is aso designed for reuse.

docs/DeploymentGuide.md

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
## **Deployment Guide**
2+
3+
### **Pre-requisites**
4+
5+
To deploy this solution accelerator, ensure you have access to an [Azure subscription](https://azure.microsoft.com/free/) with the necessary permissions to create **resource groups and resources**. Follow the steps in [Azure Account Set Up](./docs/AzureAccountSetUp.md)
6+
7+
Check the [Azure Products by Region](https://azure.microsoft.com/en-us/explore/global-infrastructure/products-by-region/?products=all&regions=all) page and select a **region** where the following services are available:
8+
9+
- Azure AI Foundry
10+
- Azure OpenAI Service
11+
- GPT Model Capacity
12+
13+
Here are some example regions where the services are available: East US, East US2, Japan East, UK South, Sweden Central.
14+
15+
### ⚠️ Important: Check Azure OpenAI Quota Availability
16+
17+
➡️ To ensure sufficient quota is available in your subscription, please follow **[Quota check instructions guide](../docs/quota_check.md)** before you deploy the solution.
18+
19+
| [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/microsoft/Modernize-your-Code-Solution-Accelerator) | [![Open in Dev Containers](https://img.shields.io/static/v1?style=for-the-badge&label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/Modernize-your-Code-Solution-Accelerator) |
20+
|---|---|
21+
22+
### **Configurable Deployment Settings**
23+
24+
When you start the deployment, most parameters will have **default values**, but you can update the following settings by following the steps [here](../docs/CustomizingAzdParameters.md):
25+
26+
| **Setting** | **Description** | **Default value** |
27+
|------------|----------------| ------------|
28+
| **Azure Region** | The region where resources will be created. | East US|
29+
| **Resource Prefix** | Prefix for all resources created by this template. This prefix will be used to create unique names for all resources. The prefix must be unique within the resource group. | None |
30+
| **AI Location** | Location for all AI services resources. This location can be different from the resource group location | None |
31+
| **Capacity** | Configure capacity for **gpt-4o**. | 5k |
32+
33+
This accelerator can be configured to use authentication.
34+
35+
* To use authentication the installer must have the rights to create and register an application identity in their Azure environment.
36+
After installation is complete, follow the directions in the [App Authentication](../docs/AddAuthentication.md) document to enable authentication.
37+
* Note: If you enable authentication, all processing history and current processing will be performed for your specific user. Without authentication, all batch history from the tool will be visible to all users.
38+
39+
### [Optional] Quota Recommendations
40+
By default, the **GPT model capacity** in deployment is set to **5k tokens**.
41+
> **We recommend increasing the capacity to 200k tokens for optimal performance.**
42+
43+
To adjust quota settings, follow these [steps](../docs/AzureGPTQuotaSettings.md)
44+
45+
### Deployment Options
46+
Pick from the options below to see step-by-step instructions for: GitHub Codespaces, VS Code Dev Containers, Local Environments, and Bicep deployments.
47+
48+
<details>
49+
<summary><b>Deploy in GitHub Codespaces</b></summary>
50+
51+
### GitHub Codespaces
52+
53+
You can run this solution using GitHub Codespaces. The button will open a web-based VS Code instance in your browser:
54+
55+
1. Open the solution accelerator (this may take several minutes):
56+
57+
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/microsoft/Modernize-your-Code-Solution-Accelerator)
58+
2. Accept the default values on the create Codespaces page
59+
3. Open a terminal window if it is not already open
60+
4. Continue with the [deploying steps](#deploying)
61+
62+
</details>
63+
64+
<details>
65+
<summary><b>Deploy in VS Code</b></summary>
66+
67+
### VS Code Dev Containers
68+
69+
You can run this solution in VS Code Dev Containers, which will open the project in your local VS Code using the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers):
70+
71+
1. Start Docker Desktop (install it if not already installed)
72+
2. Open the project:
73+
74+
[![Open in Dev Containers](https://img.shields.io/static/v1?style=for-the-badge&label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/Modernize-your-Code-Solution-Accelerator)
75+
76+
77+
3. In the VS Code window that opens, once the project files show up (this may take several minutes), open a terminal window.
78+
4. Continue with the [deploying steps](#deploying)
79+
80+
</details>
81+
82+
<details>
83+
<summary><b>Deploy in your local environment</b></summary>
84+
85+
### Local environment
86+
87+
If you're not using one of the above options for opening the project, then you'll need to:
88+
89+
1. Make sure the following tools are installed:
90+
91+
* [Azure Developer CLI (azd)](https://aka.ms/install-azd)
92+
* [Python 3.9+](https://www.python.org/downloads/)
93+
* [Docker Desktop](https://www.docker.com/products/docker-desktop/)
94+
* [Git](https://git-scm.com/downloads)
95+
96+
2. Download the project code:
97+
98+
```shell
99+
azd init -t microsoft/Modernize-your-Code-Solution-Accelerator/
100+
```
101+
102+
3. Open the project folder in your terminal or editor.
103+
104+
4. Continue with the [deploying steps](#deploying).
105+
106+
</details>
107+
108+
### Deploying
109+
110+
Once you've opened the project in [Codespaces](#github-codespaces) or in [Dev Containers](#vs-code-dev-containers) or [locally](#local-environment), you can deploy it to Azure following the following steps.
111+
112+
To change the azd parameters from the default values, follow the steps [here](../docs/CustomizingAzdParameters.md).
113+
114+
115+
1. Login to Azure:
116+
117+
```shell
118+
azd auth login
119+
```
120+
121+
#### Note: To authenticate with Azure Developer CLI (`azd`) to a specific tenant, use the previous command with your **Tenant ID**:
122+
123+
```sh
124+
azd auth login --tenant-id <tenant-id>
125+
```
126+
127+
2. Provision and deploy all the resources:
128+
129+
```shell
130+
azd up
131+
```
132+
133+
3. Provide an `azd` environment name (like "cmsaapp")
134+
4. Select a subscription from your Azure account, and select a location which has quota for all the resources.
135+
* This deployment will take *6-9 minutes* to provision the resources in your account and set up the solution with sample data.
136+
* If you get an error or timeout with deployment, changing the location can help, as there may be availability constraints for the resources.
137+
138+
5. Once the deployment has completed successfully, open the [Azure Portal](https://portal.azure.com/), go to the deployed resource group, find the container app with "frontend" in the name, and get the app URL from `Application URI`.
139+
140+
6. You can now delete the resources by running `azd down`, when you have finished trying out the application.
141+
142+
<h2>
143+
Additional Steps
144+
</h2>
145+
146+
1. **Deleting Resources After a Failed Deployment**
147+
148+
Follow steps in [Delete Resource Group](../docs/DeleteResourceGroup.md) If your deployment fails and you need to clean up the resources.
149+
150+
1. **Add App Authentication**
151+
152+
If you chose to enable authentication for the deployment, follow the steps in [App Authentication](../docs/AddAuthentication.md)
153+
154+
## Running the application
155+
156+
To help you get started, sample Informix queries have been included in the data/informix/functions and data/informix/simple directories. You can choose to upload these files to test the application.
14.4 KB
Loading

docs/images/read_me/quick-deploy.png

19 KB
Loading
15.5 KB
Loading
17 KB
Loading

0 commit comments

Comments
 (0)