Skip to content

Commit 7195197

Browse files
Merge pull request #278 from microsoft/main
chore: Merging from main branch
2 parents 67ce043 + 000b0ae commit 7195197

File tree

15 files changed

+321
-5
lines changed

15 files changed

+321
-5
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# Each line is a file pattern followed by one or more owners.
33

44
# These owners will be the default owners for everything in the repo.
5-
* @Avijit-Microsoft @Roopan-Microsoft @Prajwal-Microsoft @aniaroramsft @marktayl1 @Vinay-Microsoft
5+
* @Avijit-Microsoft @Roopan-Microsoft @Prajwal-Microsoft @aniaroramsft @marktayl1 @Vinay-Microsoft @toherman-msft @nchandhi

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ The Modernize your code solution accelerator allows users to specify a group of
1414
</div>
1515
<br/>
1616

17+
**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](https://learn.microsoft.com/en-us/azure/ai-foundry/responsible-ai/agents/transparency-note) and [Agent Framework](https://github.com/microsoft/agent-framework/blob/main/TRANSPARENCY_FAQ.md).
18+
<br/>
19+
1720
<h2><img src="./docs/images/read_me/solution-overview.png" width="48" />
1821
Solution overview
1922
</h2>
@@ -80,8 +83,8 @@ Follow the quick deploy steps on the deployment guide to deploy this solution to
8083
[Click here to launch the deployment guide](./docs/DeploymentGuide.md)
8184
<br/><br/>
8285

83-
| [![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) |
84-
|---|---|
86+
| [![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) | [![Open in Visual Studio Code Web](https://img.shields.io/static/v1?style=for-the-badge&label=Visual%20Studio%20Code%20(Web)&message=Open&color=blue&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/azure/?vscode-azure-exp=foundry&agentPayload=eyJiYXNlVXJsIjogImh0dHBzOi8vcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbS9taWNyb3NvZnQvTW9kZXJuaXplLXlvdXItY29kZS1zb2x1dGlvbi1hY2NlbGVyYXRvci9yZWZzL2hlYWRzL21haW4vaW5mcmEvdnNjb2RlX3dlYiIsICJpbmRleFVybCI6ICIvaW5kZXguanNvbiIsICJ2YXJpYWJsZXMiOiB7ImFnZW50SWQiOiAiIiwgImNvbm5lY3Rpb25TdHJpbmciOiAiIiwgInRocmVhZElkIjogIiIsICJ1c2VyTWVzc2FnZSI6ICIiLCAicGxheWdyb3VuZE5hbWUiOiAiIiwgImxvY2F0aW9uIjogIiIsICJzdWJzY3JpcHRpb25JZCI6ICIiLCAicmVzb3VyY2VJZCI6ICIiLCAicHJvamVjdFJlc291cmNlSWQiOiAiIiwgImVuZHBvaW50IjogIiJ9LCAiY29kZVJvdXRlIjogWyJhaS1wcm9qZWN0cy1zZGsiLCAicHl0aG9uIiwgImRlZmF1bHQtYXp1cmUtYXV0aCIsICJlbmRwb2ludCJdfQ==) |
87+
|---|---|---|
8588

8689
<br/>
8790

docs/DeploymentGuide.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ For **production deployments**, the repository also provides [`main.waf.paramete
5252

5353
Pick from the options below to see step-by-step instructions for: GitHub Codespaces, VS Code Dev Containers, Local Environments, and Bicep deployments.
5454

55-
| [![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) |
56-
|---|---|
55+
| [![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) | [![Open in Visual Studio Code Web](https://img.shields.io/static/v1?style=for-the-badge&label=Visual%20Studio%20Code%20(Web)&message=Open&color=blue&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/azure/?vscode-azure-exp=foundry&agentPayload=eyJiYXNlVXJsIjogImh0dHBzOi8vcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbS9taWNyb3NvZnQvTW9kZXJuaXplLXlvdXItY29kZS1zb2x1dGlvbi1hY2NlbGVyYXRvci9yZWZzL2hlYWRzL21haW4vaW5mcmEvdnNjb2RlX3dlYiIsICJpbmRleFVybCI6ICIvaW5kZXguanNvbiIsICJ2YXJpYWJsZXMiOiB7ImFnZW50SWQiOiAiIiwgImNvbm5lY3Rpb25TdHJpbmciOiAiIiwgInRocmVhZElkIjogIiIsICJ1c2VyTWVzc2FnZSI6ICIiLCAicGxheWdyb3VuZE5hbWUiOiAiIiwgImxvY2F0aW9uIjogIiIsICJzdWJzY3JpcHRpb25JZCI6ICIiLCAicmVzb3VyY2VJZCI6ICIiLCAicHJvamVjdFJlc291cmNlSWQiOiAiIiwgImVuZHBvaW50IjogIiJ9LCAiY29kZVJvdXRlIjogWyJhaS1wcm9qZWN0cy1zZGsiLCAicHl0aG9uIiwgImRlZmF1bHQtYXp1cmUtYXV0aCIsICJlbmRwb2ludCJdfQ==) |
56+
|---|---|---|
5757

5858
<details>
5959
<summary><b>Deploy in GitHub Codespaces</b></summary>
@@ -89,6 +89,24 @@ You can run this solution in VS Code Dev Containers, which will open the project
8989

9090
</details>
9191

92+
<details>
93+
<summary><b>Deploy in VS Code Web</b></summary>
94+
95+
### VS Code Web
96+
97+
[![Open in Visual Studio Code Web](https://img.shields.io/static/v1?style=for-the-badge&label=Visual%20Studio%20Code%20(Web)&message=Open&color=blue&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/azure/?vscode-azure-exp=foundry&agentPayload=eyJiYXNlVXJsIjogImh0dHBzOi8vcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbS9taWNyb3NvZnQvTW9kZXJuaXplLXlvdXItY29kZS1zb2x1dGlvbi1hY2NlbGVyYXRvci9yZWZzL2hlYWRzL21haW4vaW5mcmEvdnNjb2RlX3dlYiIsICJpbmRleFVybCI6ICIvaW5kZXguanNvbiIsICJ2YXJpYWJsZXMiOiB7ImFnZW50SWQiOiAiIiwgImNvbm5lY3Rpb25TdHJpbmciOiAiIiwgInRocmVhZElkIjogIiIsICJ1c2VyTWVzc2FnZSI6ICIiLCAicGxheWdyb3VuZE5hbWUiOiAiIiwgImxvY2F0aW9uIjogIiIsICJzdWJzY3JpcHRpb25JZCI6ICIiLCAicmVzb3VyY2VJZCI6ICIiLCAicHJvamVjdFJlc291cmNlSWQiOiAiIiwgImVuZHBvaW50IjogIiJ9LCAiY29kZVJvdXRlIjogWyJhaS1wcm9qZWN0cy1zZGsiLCAicHl0aG9uIiwgImRlZmF1bHQtYXp1cmUtYXV0aCIsICJlbmRwb2ludCJdfQ==)
98+
99+
1. Click the badge above (may take a few minutes to load)
100+
2. Sign in with your Azure account when prompted
101+
3. Select the subscription where you want to deploy the solution
102+
4. Wait for the environment to initialize (includes all deployment tools)
103+
5. When prompted in the VS Code Web terminal, choose one of the available options shown below:
104+
105+
![VS Code Initial Prompt](./images/vscodeweb_intialize.png)
106+
6. Continue with the [deploying steps](#deploying-with-azd)
107+
108+
</details>
109+
92110
<details>
93111
<summary><b>Deploy in your local environment</b></summary>
94112

34.8 KB
Loading

infra/vscode_web/.env

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
AZURE_EXISTING_AGENT_ID="<%= agentId %>"
2+
AZURE_ENV_NAME="<%= playgroundName %>"
3+
# AZURE_LOCATION="<%= location %>"
4+
AZURE_SUBSCRIPTION_ID="<%= subscriptionId %>"
5+
AZURE_EXISTING_AIPROJECT_ENDPOINT="<%= endpoint %>"
6+
AZURE_EXISTING_AIPROJECT_RESOURCE_ID="<%= projectResourceId %>"
7+
AZD_ALLOW_NON_EMPTY_FOLDER=true

infra/vscode_web/.gitignore

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# ========== .NET ========== #
2+
## Build results
3+
bin/
4+
obj/
5+
[Bb]uild/
6+
[Ll]ogs/
7+
*.log
8+
## User-specific files
9+
*.user
10+
*.suo
11+
*.userosscache
12+
*.sln.docstates
13+
*.vsp
14+
*.vspx
15+
*.vspscc
16+
## Rider / VS Code / Visual Studio
17+
.idea/
18+
.vscode/
19+
.vs/
20+
## NuGet packages
21+
*.nupkg
22+
packages/
23+
*.snupkg
24+
project.lock.json
25+
project.assets.json
26+
## Dotnet tools
27+
.tools/
28+
# ========== Java ========== #
29+
## Compiled class files
30+
*.class
31+
## Logs
32+
*.log
33+
## Maven
34+
target/
35+
## Gradle
36+
.gradle/
37+
build/
38+
## Eclipse
39+
.project
40+
.classpath
41+
.settings/
42+
.loadpath
43+
## IntelliJ IDEA
44+
*.iml
45+
*.ipr
46+
*.iws
47+
out/
48+
.idea/
49+
# ========== Python ========== #
50+
## Byte-compiled / cache
51+
__pycache__/
52+
*.py[cod]
53+
*$py.class
54+
## Virtual environment
55+
env/
56+
venv/
57+
ENV/
58+
.venv/
59+
.env*
60+
## PyInstaller
61+
*.spec
62+
dist/
63+
build/
64+
## Jupyter Notebook
65+
.ipynb_checkpoints/
66+
## Misc
67+
*.log
68+
*.pot
69+
*.pyc
70+
.DS_Store
71+
*.sqlite3
72+
# ========== General ========== #
73+
## OS generated
74+
Thumbs.db
75+
ehthumbs.db
76+
Desktop.ini
77+
.DS_Store
78+
*.swp
79+
*.swo
80+
*.bak
81+
*.tmp
82+
*.old
83+
## Node (just in case mixed project)
84+
node_modules/
85+
# End

infra/vscode_web/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Microsoft Corporation.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

infra/vscode_web/README-noazd.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# VS Code for the Web - Azure AI Foundry Templates
2+

infra/vscode_web/README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# VS Code for the Web - Azure AI Foundry Templates
2+
3+
We've generated a simple development environment for you to deploy the templates.
4+
5+
The Azure AI Foundry extension provides tools to help you build, test, and deploy AI models and AI Applications directly from VS Code. It offers simplified operations for interacting with your models, agents, and threads without leaving your development environment. Click on the Azure AI Foundry Icon on the left to see more.
6+
7+
Follow the instructions below to get started!
8+
9+
You should see a terminal opened with the template code already cloned.
10+
11+
## Deploy the template
12+
13+
You can provision and deploy this template using:
14+
15+
```bash
16+
azd up
17+
```
18+
19+
Follow any instructions from the deployment script and launch the application.
20+
21+
22+
If you need to delete the deployment and stop incurring any charges, run:
23+
24+
```bash
25+
azd down
26+
```
27+
28+
## Continuing on your local desktop
29+
30+
You can keep working locally on VS Code Desktop by clicking "Continue On Desktop..." at the bottom left of this screen. Be sure to take the .env file with you using these steps:
31+
32+
- Right-click the .env file
33+
- Select "Download"
34+
- Move the file from your Downloads folder to the local git repo directory
35+
- For Windows, you will need to rename the file back to .env using right-click "Rename..."
36+
37+
## More examples
38+
39+
Check out [Azure AI Projects client library for Python](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/ai/azure-ai-projects/README.md) for more information on using this SDK.
40+
41+
## Troubleshooting
42+
43+
- If you are instantiating your client via endpoint on an Azure AI Foundry project, ensure the endpoint is set in the `.env` as https://{your-foundry-resource-name}.services.ai.azure.com/api/projects/{your-foundry-project-name}`

infra/vscode_web/codeSample.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
from azure.ai.projects import AIProjectClient
2+
from azure.identity import DefaultAzureCredential
3+
4+
project_client = AIProjectClient.from_connection_string(
5+
credential=DefaultAzureCredential(),
6+
conn_str="<%= connectionString %>")
7+
8+
agent = project_client.agents.get_agent("<%= agentId %>")
9+
10+
thread = project_client.agents.create_thread()
11+
print(f"Created thread, ID: {thread.id}")
12+
13+
message = project_client.agents.create_message(
14+
thread_id=thread.id,
15+
role="user",
16+
content="<%= userMessage %>"
17+
)
18+
19+
run = project_client.agents.create_and_process_run(
20+
thread_id=thread.id,
21+
agent_id=agent.id)
22+
messages = project_client.agents.list_messages(thread_id=thread.id)
23+
24+
for text_message in messages.text_messages:
25+
print(text_message.as_dict())

0 commit comments

Comments
 (0)