Skip to content

Commit 31ad63d

Browse files
Merge pull request #1 from microsoft/main
chore: merge changes from upstream
2 parents 0012d11 + 2b1e24a commit 31ad63d

25 files changed

+14745
-9313
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 @Vinay-Microsoft @aniaroramsft
5+
* @Avijit-Microsoft @Roopan-Microsoft @Prajwal-Microsoft @Vinay-Microsoft @aniaroramsft @toherman-msft @nchandhi

.github/workflows/azd-template-validation.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/azure-dev.yml

Lines changed: 57 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,74 @@
1-
name: AZD Deployment
2-
on:
1+
name: AZD Template Validation
2+
on:
33
workflow_dispatch:
44
push:
55
branches:
66
- main
77

88
permissions:
9-
id-token: write
109
contents: read
10+
id-token: write
11+
pull-requests: write
1112

1213
jobs:
13-
build:
14+
template_validation:
1415
runs-on: ubuntu-latest
15-
env:
16-
AZURE_CLIENT_ID: ${{ vars.AZURE_CLIENT_ID }}
17-
AZURE_TENANT_ID: ${{ vars.AZURE_TENANT_ID }}
18-
AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }}
19-
AZURE_RESOURCE_GROUP: ${{ vars.AZURE_RESOURCE_GROUP }}
20-
AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME }}
21-
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
22-
AZURE_USER_OBJECT_ID: ''
16+
name: azd template validation
2317
steps:
24-
- name: Checkout
25-
uses: actions/checkout@v4
26-
- name: Install azd
27-
uses: Azure/setup-azd@v2
28-
- name: Azure Developer CLI Login
29-
run: |
30-
azd auth login `
31-
--client-id "$Env:AZURE_CLIENT_ID" `
32-
--federated-credential-provider "github" `
33-
--tenant-id "$Env:AZURE_TENANT_ID"
34-
shell: pwsh
35-
- name: Azure CLI Login
18+
- uses: actions/checkout@v4
19+
20+
- name: Azure Login
3621
uses: azure/login@v2
3722
with:
3823
client-id: ${{ vars.AZURE_CLIENT_ID }}
3924
tenant-id: ${{ vars.AZURE_TENANT_ID }}
4025
subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }}
41-
- name: Provision Infrastructure
42-
run: azd provision --no-prompt
26+
27+
- name: Create Resource Group for Validation
28+
run: |
29+
ENV_NAME="${{ vars.AZURE_ENV_NAME }}"
30+
RG_NAME="rg-${ENV_NAME}"
31+
echo "Creating resource group for template validation: ${RG_NAME}"
32+
az group create \
33+
--name "${RG_NAME}" \
34+
--location "${{ vars.AZURE_LOCATION }}" \
35+
--tags "CreatedBy=GitHubActions"
36+
echo "Resource group ${RG_NAME} created successfully"
37+
38+
- uses: microsoft/template-validation-action@Latest
39+
with:
40+
validateAzd: ${{ vars.TEMPLATE_VALIDATE_AZD }}
41+
useDevContainer: ${{ vars.TEMPLATE_USE_DEV_CONTAINER }}
42+
validateTests: ${{ vars.AZD_VALIDATE_TESTS }}
43+
id: validation
4344
env:
44-
AZD_INITIAL_ENVIRONMENT_CONFIG: ${{ secrets.AZD_INITIAL_ENVIRONMENT_CONFIG }}
45+
AZURE_CLIENT_ID: ${{ vars.AZURE_CLIENT_ID }}
46+
AZURE_TENANT_ID: ${{ vars.AZURE_TENANT_ID }}
47+
AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }}
48+
AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME }}
49+
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
50+
AZURE_RESOURCE_GROUP: rg-${{ vars.AZURE_ENV_NAME }}
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
# Set correct principal type for GitHub Actions ServicePrincipal
53+
AZURE_DEPLOYER_PRINCIPAL_TYPE: ServicePrincipal
54+
# Infrastructure parameter defaults for pipeline
55+
AZURE_ACR_ENABLED: 'false'
56+
AZURE_API_MANAGEMENT_ENABLED: 'false'
57+
AZURE_AI_CONTENT_SAFETY_ENABLED: 'false'
58+
AZURE_AI_DOC_INTELLIGENCE_ENABLED: 'false'
59+
AZURE_AI_LANGUAGE_ENABLED: 'false'
60+
AZURE_AI_SEARCH_ENABLED: 'true'
61+
AZURE_AI_SPEECH_ENABLED: 'false'
62+
AZURE_AI_TRANSLATOR_ENABLED: 'false'
63+
64+
AZURE_AI_VISION_ENABLED: 'false'
65+
AZURE_APP_SAMPLE_ENABLED: 'false'
66+
AZURE_COSMOS_DB_ENABLED: 'true'
67+
AZURE_NETWORK_ISOLATION: 'false'
68+
AZURE_SQL_SERVER_ENABLED: 'false'
69+
AZURE_AI_DEPLOYMENTS_LOCATION: ${{ vars.AZURE_LOCATION }}
70+
AZURE_DEV_COLLECT_TELEMETRY: ${{ vars.AZURE_DEV_COLLECT_TELEMETRY }}
71+
72+
73+
- name: print result
74+
run: cat ${{ steps.validation.outputs.resultFile }}

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
# Deploy your AI Application in Production
44

5+
**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).
6+
57
## Overview
68

79
<span style="font-size: 3em;">🚀</span> **New: Updated deployment to match Foundry release at Build 2025!**
@@ -85,7 +87,7 @@ QUICK DEPLOY
8587

8688
| [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/microsoft/Deploy-Your-AI-Application-In-Production) | [![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/Deploy-Your-AI-Application-In-Production) |
8789
|---|---|
88-
[Steps to deploy with GitHub Codespaces](docs/github_code_spaces_steps.md)
90+
[Steps to deploy with GitHub Codespaces](docs/github_code_spaces_steps.md)| [Steps to deploy with Dev Container](docs/Dev_ContainerSteps.md)
8991

9092

9193
## Connect to and validate access to the new environment

docs/Dev_ContainerSteps.md

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
### VS Code Dev Containers
2+
3+
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):
4+
5+
1. Open the project:
6+
7+
[![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/Deploy-Your-AI-Application-In-Production)
8+
9+
3. In the VS Code window that opens, once the project files show up (this may take several minutes), open a terminal window.
10+
4. Continue with the [deploying steps](#steps-to-provision-network-isolated-environment-using-dev-container).
11+
12+
# Steps to Provision Network Isolated environment using Dev Container
13+
14+
1. Log into your Azure subscription:
15+
16+
```shell
17+
azd auth login
18+
```
19+
20+
![Image showing the entering of the command 'azd auth' in the terminal of VS Code](../img/provisioning/azdauthcommandline.png)
21+
22+
![image showing the authorization window opening in the browser](../img/provisioning/azdauthpopup.png)
23+
24+
![Image showing the password prompt for azure](../img/provisioning/enterpassword.png)
25+
26+
2. Login to azure, run the below command:
27+
```shell
28+
az login
29+
```
30+
The [Azure CLI](https://learn.microsoft.com/en-us/cli/azure/what-is-azure-cli?view=azure-cli-latest) is used to validate available AI model quota.
31+
32+
![image showing theaz login in the vs code terminal](../img/provisioning/az_login.png)
33+
3. Return to terminal and type the below command for initializing the environment.
34+
```shell
35+
azd init
36+
```
37+
![image showing the initial screen in the vs code terminal](../img/provisioning/azd_init_terminal.png)
38+
39+
4. Enter the environment name.
40+
> **Note:** Length of the environment name should be less than or equal to 12 characters.
41+
42+
![aImage showing entering a new environment name](../img/provisioning/enter_evn_name.png)
43+
44+
5. Now start the deployment of the infrastructure by typing the below command:
45+
```shell
46+
azd up
47+
```
48+
> ⚠️ **Note:** The latest version of the Azure Developer CLI (AZD) is currently limited on prompting for missing parameters. The feature flag parameters in this solution have been temporarily defaulted to `'disabled'` until this limitation is lifted and prompting will resume.
49+
50+
51+
![image showing the terminal in vs code](images/re_use_log/nonwaf.png)
52+
Log in to **Azure** for authentication. ![alt text](images/re_use_log/login.png)
53+
This step will allow you to choose from the subscriptions you have available, based on the account you logged in with in the login step. Next it will prompt you for the region to deploy the resources into as well as any additional Azure resources to be provisioned and configured.
54+
55+
**Important:** Be sure to remember the vm password. This will be used in a later step. You are still required to log into Azure once you connect through the virtual machine.
56+
> ⚠️ **Note:**
57+
> 1. For **WAF Deployment**, Select the **Network Isolation** as **'True'**.
58+
> ![alt text](images/re_use_log/waf.png)
59+
> 2. For **Sample App Deployment**, Select the **appSampleEnabled** as **'True'**.
60+
> ![alt text](images/re_use_log/samapp.png)
61+
62+
63+
6. The automated model quota check will run, and will check if the location selected will have the necessary quota for the AI Models that are listed in the parameters file prior to deploying any resources.
64+
![image showing model quota pre-provision code executing](../img/provisioning/preprovision_output.png)
65+
66+
67+
If the location selected has sufficient quota for the models you plan to deploy, the provisioning will begin without notification.
68+
69+
![image showing model quota pre-provision pass](../img/provisioning/preprovision_success.png)
70+
71+
If the location selected does not have the available quota for the models selected in your parameters, there will be a message back to the user, prior to any provisioning of resources. This will allow the developer to change the location of the provisiong and try again. Note that in our example, Italy North had capacity for gpt-4o but not for text-embedding-ada-002. This terminated the entire provisioning, because both models could not be deployed due to a quota issue.
72+
73+
![image showing model quota pre-provision fail](../img/provisioning/preprovision_fail.png)
74+
75+
7. After completeing the required paramters that you were prompted for, and a successful model quota validation, the provisioning of resources will run and deploy the Network Isolated AI Foundry development portal and dependent resources in about 20 minutes.
76+
77+
78+
# Post Deployment Steps:
79+
These steps will help to check that the isolated environment was set up correctly.
80+
Follow these steps to check the creation of the required private endpoints in the environment (when set to networkIsolation = true).
81+
82+
One way to verify whether access is private to the foundry is by launching Azure AI Foundry from the portal.
83+
84+
![Image showing if network isolation is checked](images/re_use_log/AI_Foundry_Portal.png)
85+
86+
When a user that is not connected through the virtual network via an RDP approved connection will see the following screen in their browser. This is the intended behavior!
87+
88+
![Image showing the virtual machine in the browser](images/re_use_log/AI_Foundry_view.png)
89+
90+
A more thourough check is to look for the networking settings and checking for private end points.
91+
92+
1. Go to the Azure Portal and select your Azure AI hub that was just created.
93+
94+
2. Click on Resource Management and then Networking.
95+
96+
![Image showing the Azure Portal for AI Foundry Hub and the settings blade](images/re_use_log/Private_network_endpoints.png)
97+
98+
99+
Here, you will find the private endpoints that are connected to the resources within the foundry managed virtual network. Ensure that these private endpoints are active.
100+
The foundry should show that Public access is ‘disabled’.
101+
102+
## Connecting to the isolated network via RDP
103+
1. Navigate to the resource group where the isolated AI Foundry was deployed to and select the virtual machine.
104+
105+
![Image showing the Azure Portal for the virtual machine](../img/provisioning/checkNetworkIsolation5.png)
106+
107+
2. Be sure that the Virtual Machine is running. If not, start the VM.
108+
109+
![Image showing the Azure Portal VM and the start/stop button](../img/provisioning/checkNetworkIsolation6.png)
110+
111+
3. Select “Bastion” under the ‘Connect’ heading in the VM resource.
112+
113+
![Image showing the bastion blade selected](../img/provisioning/checkNetworkIsolation7.png)
114+
115+
4. Supply the username and the password you created as environment variables and press the connect button.
116+
117+
![Image showing the screen to enter the VM Admin info and the connect to bastion button](../img/provisioning/Bastion.png)
118+
119+
5. Your virtual machine will launch and you will see a different screen.
120+
121+
![Image showing the opening of the Virtual machine in another browser tab](../img/provisioning/checkNetworkIsolation9.png)
122+
123+
6. Launch Edge browser and navigate to your Azure AI Foundry. https://ai.azure.com Sign in using your credentials.
124+
125+
126+
7. You are challenged by MFA to connect.
127+
128+
![Image showing the Multi Factor Authentication popup](../img/provisioning/checkNetworkIsolation10.png)
129+
130+
8. You will now be able to view the Azure AI Foundry which is contained in an isolated network.
131+
132+
![Image showing the Azure Foundry AI Hub with a private bubble icon](images/re_use_log/Azure_ai_foundry_inside_vm.png)
133+
134+
## Contributing
135+
136+
This project welcomes contributions and suggestions. Most contributions require you to agree to a
137+
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
138+
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
139+
140+
When you submit a pull request, a CLA bot will automatically determine whether you need to provide
141+
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
142+
provided by the bot. You will only need to do this once across all repos using our CLA.
143+
144+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
145+
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
146+
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
147+
148+
## Trademarks
149+
150+
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft
151+
trademarks or logos is subject to and must follow
152+
[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
153+
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
154+
Any use of third-party trademarks or logos are subject to those third-party's policies.

0 commit comments

Comments
 (0)