Skip to content

Commit 2b91977

Browse files
Merge pull request #766 from microsoft/main
chore: Merging from main branch
2 parents b0e4265 + 7912c58 commit 2b91977

File tree

14 files changed

+335
-7
lines changed

14 files changed

+335
-7
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ Follow the quick deploy steps on the deployment guide to deploy this solution
7272
<br/><br/>
7373

7474

75-
| [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/microsoft/Build-your-own-copilot-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/Build-your-own-copilot-Solution-Accelerator) |
76-
|---|---|
75+
| [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/microsoft/Build-your-own-copilot-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/Build-your-own-copilot-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=eyJiYXNlVXJsIjogImh0dHBzOi8vcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbS9taWNyb3NvZnQvQnVpbGQteW91ci1vd24tY29waWxvdC1Tb2x1dGlvbi1BY2NlbGVyYXRvci9yZWZzL2hlYWRzL21haW4vaW5mcmEvdnNjb2RlX3dlYiIsICJpbmRleFVybCI6ICIvaW5kZXguanNvbiIsICJ2YXJpYWJsZXMiOiB7ImFnZW50SWQiOiAiIiwgImNvbm5lY3Rpb25TdHJpbmciOiAiIiwgInRocmVhZElkIjogIiIsICJ1c2VyTWVzc2FnZSI6ICIiLCAicGxheWdyb3VuZE5hbWUiOiAiIiwgImxvY2F0aW9uIjogIiIsICJzdWJzY3JpcHRpb25JZCI6ICIiLCAicmVzb3VyY2VJZCI6ICIiLCAicHJvamVjdFJlc291cmNlSWQiOiAiIiwgImVuZHBvaW50IjogIiJ9LCAiY29kZVJvdXRlIjogWyJhaS1wcm9qZWN0cy1zZGsiLCAicHl0aG9uIiwgImRlZmF1bHQtYXp1cmUtYXV0aCIsICJlbmRwb2ludCJdfQ==) |
76+
|---|---|---|
7777

7878
<br/>
7979

docs/DeploymentGuide.md

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ azd env set AZURE_ENV_VM_ADMIN_PASSWORD <your-password>
6363
6464
## Deployment Options & Steps
6565

66-
Pick from the options below to see step-by-step instructions for GitHub Codespaces, VS Code Dev Containers, and Local Environments.
66+
Pick from the options below to see step-by-step instructions for GitHub Codespaces, VS Code Dev Containers, Visual Studio Code (WEB), and Local Environments.
6767

68-
| [![Open in Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?repo=microsoft/Build-your-own-copilot-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/Build-your-own-copilot-Solution-Accelerator) |
69-
|---|---|
68+
| [![Open in Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?repo=microsoft/Build-your-own-copilot-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/Build-your-own-copilot-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=eyJiYXNlVXJsIjogImh0dHBzOi8vcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbS9taWNyb3NvZnQvQnVpbGQteW91ci1vd24tY29waWxvdC1Tb2x1dGlvbi1BY2NlbGVyYXRvci9yZWZzL2hlYWRzL21haW4vaW5mcmEvdnNjb2RlX3dlYiIsICJpbmRleFVybCI6ICIvaW5kZXguanNvbiIsICJ2YXJpYWJsZXMiOiB7ImFnZW50SWQiOiAiIiwgImNvbm5lY3Rpb25TdHJpbmciOiAiIiwgInRocmVhZElkIjogIiIsICJ1c2VyTWVzc2FnZSI6ICIiLCAicGxheWdyb3VuZE5hbWUiOiAiIiwgImxvY2F0aW9uIjogIiIsICJzdWJzY3JpcHRpb25JZCI6ICIiLCAicmVzb3VyY2VJZCI6ICIiLCAicHJvamVjdFJlc291cmNlSWQiOiAiIiwgImVuZHBvaW50IjogIiJ9LCAiY29kZVJvdXRlIjogWyJhaS1wcm9qZWN0cy1zZGsiLCAicHl0aG9uIiwgImRlZmF1bHQtYXp1cmUtYXV0aCIsICJlbmRwb2ludCJdfQ==) |
69+
|---|---|---|
7070

7171
<details>
7272
<summary><b>Deploy in GitHub Codespaces</b></summary>
@@ -100,6 +100,39 @@ You can run this solution in [VS Code Dev Containers](https://code.visualstudio.
100100
3. In the VS Code window that opens, once the project files show up (this may take several minutes), open a terminal window.
101101
4. Continue with the [deploying steps](#deploying-with-azd).
102102

103+
</details>
104+
105+
<details>
106+
<summary><b>Deploy in Visual Studio Code (WEB)</b></summary>
107+
108+
### Visual Studio Code (WEB)
109+
110+
You can run this solution in VS Code Web. The button will open a web-based VS Code instance in your browser:
111+
112+
1. Open the solution accelerator (this may take several minutes):
113+
114+
[![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=eyJiYXNlVXJsIjogImh0dHBzOi8vcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbS9taWNyb3NvZnQvQnVpbGQteW91ci1vd24tY29waWxvdC1Tb2x1dGlvbi1BY2NlbGVyYXRvci9yZWZzL2hlYWRzL21haW4vaW5mcmEvdnNjb2RlX3dlYiIsICJpbmRleFVybCI6ICIvaW5kZXguanNvbiIsICJ2YXJpYWJsZXMiOiB7ImFnZW50SWQiOiAiIiwgImNvbm5lY3Rpb25TdHJpbmciOiAiIiwgInRocmVhZElkIjogIiIsICJ1c2VyTWVzc2FnZSI6ICIiLCAicGxheWdyb3VuZE5hbWUiOiAiIiwgImxvY2F0aW9uIjogIiIsICJzdWJzY3JpcHRpb25JZCI6ICIiLCAicmVzb3VyY2VJZCI6ICIiLCAicHJvamVjdFJlc291cmNlSWQiOiAiIiwgImVuZHBvaW50IjogIiJ9LCAiY29kZVJvdXRlIjogWyJhaS1wcm9qZWN0cy1zZGsiLCAicHl0aG9uIiwgImRlZmF1bHQtYXp1cmUtYXV0aCIsICJlbmRwb2ludCJdfQ==)
115+
116+
2. When prompted, sign in using your Microsoft account linked to your Azure subscription.
117+
118+
Select the appropriate subscription to continue.
119+
120+
3. Once the solution opens, the **AI Foundry terminal** will automatically start running the following command to install the required dependencies:
121+
122+
```shell
123+
sh install.sh
124+
```
125+
During this process, you’ll be prompted with the message:
126+
```
127+
What would you like to do with these files?
128+
- Overwrite with versions from template
129+
- Keep my existing files unchanged
130+
```
131+
Choose “**Overwrite with versions from template**” and provide a unique environment name when prompted.
132+
133+
4. Continue with the [deploying steps](#deploying-with-azd).
134+
135+
103136
</details>
104137

105138
<details>
@@ -168,7 +201,7 @@ To adjust quota settings, follow these [steps](./AzureGPTQuotaSettings.md).
168201

169202
### Deploying with AZD
170203

171-
Once you've opened the project in [Codespaces](#github-codespaces), [Dev Containers](#vs-code-dev-containers), or [locally](#local-environment), you can deploy it to Azure by following these steps:
204+
Once you've opened the project in [Codespaces](#github-codespaces), [Dev Containers](#vs-code-dev-containers), [Visual Studio Code (WEB)](#visual-studio-code-web), or [locally](#local-environment), you can deploy it to Azure by following these steps:
172205
173206
1. Login to Azure:
174207

infra/scripts/process_sample_data.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ if [ -n "$managedIdentityClientId" ]; then
485485
else
486486
# Use Azure CLI login if running locally
487487
echo "Authenticating with Azure CLI..."
488-
az login
488+
az login --use-device-code
489489
fi
490490
echo ""
491491

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())
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
azure-ai-projects==1.0.0b12
2+
azure-identity==1.20.0
3+
ansible-core~=2.17.0

0 commit comments

Comments
 (0)