Skip to content

Commit 927daad

Browse files
Merge pull request #55 from microsoft/ai-foundry-main-dev-merge
feat: Down merge from main and conflicts resolved
2 parents 152211e + e35e15b commit 927daad

32 files changed

Lines changed: 2859 additions & 16692 deletions

.devcontainer/devcontainer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"image": "mcr.microsoft.com/devcontainers/python:3.10-bullseye",
55
"features": {
66
// See https://containers.dev/features for list of features
7-
"ghcr.io/devcontainers/features/docker-in-docker:2": {
8-
},
9-
"ghcr.io/azure/azure-dev/azd:latest": {}
7+
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
8+
"ghcr.io/azure/azure-dev/azd:latest": {},
9+
"ghcr.io/devcontainers/features/azure-cli:1": {}
1010
}
1111
}

.github/workflows/azure-dev.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,19 @@ jobs:
2525
uses: actions/checkout@v4
2626
- name: Install azd
2727
uses: Azure/setup-azd@v2
28-
- name: Log in with Azure (Federated Credentials)
28+
- name: Azure Developer CLI Login
2929
run: |
3030
azd auth login `
3131
--client-id "$Env:AZURE_CLIENT_ID" `
3232
--federated-credential-provider "github" `
3333
--tenant-id "$Env:AZURE_TENANT_ID"
3434
shell: pwsh
35-
35+
- name: Azure CLI Login
36+
uses: azure/login@v2
37+
with:
38+
client-id: ${{ vars.AZURE_CLIENT_ID }}
39+
tenant-id: ${{ vars.AZURE_TENANT_ID }}
40+
subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }}
3641
- name: Provision Infrastructure
3742
run: azd provision --no-prompt
3843
env:

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
.vscode
2-
.vs
2+
.vs
3+
.venv
4+
__pycache__

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ All notable changes to this project will be documented in this file.
3535

3636
## [1.0] - 2025-03-10
3737
### Added
38-
- Initial release of the template.
38+
- Initial release of the template.

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,16 @@ Offers ability to [start with an existing Azure AI Project](docs/transfer_projec
5050
1. Have access to an Azure subscription and Entra ID account with Contributor permissions.
5151
2. Confirm the subscription you are deploying into has the [Required Roles and Scopes](docs/Required_roles_scopes_resources.md).
5252
3. The solution ensures secure access to the private VNET through a jump-box VM with Azure Bastion. By default, Bastion does not require an inbound NSG rule for network traffic. However, if your environment enforces specific policy rules, you can resolve access issues by entering your machine's IP address in the `allowedIpAddress` parameter when prompted during deployment. If not specified, all IP addresses are allowed to connect to Azure Bastion.
53-
4. If deploying from your [local environment](docs/local_environment_steps.md), install the [Azure Developer CLI (AZD)](https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/install-azd?tabs=winget-windows%2Cbrew-mac%2Cscript-linux&pivots=os-windows).
53+
4. If deploying from your [local environment](docs/local_environment_steps.md), install the [Azure CLI (AZ)](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest) and the [Azure Developer CLI (AZD)](https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/install-azd?tabs=winget-windows%2Cbrew-mac%2Cscript-linux&pivots=os-windows).
5454
5. If deploying via [GitHub Codespaces](docs/github_code_spaces_steps.md) - requires the user to be on a GitHub Team or Enterprise Cloud plan.
5555
6. If leveraging [GitHub Actions](docs/github_actions_steps.md).
5656

57+
### Check Azure OpenAI Quota Availability
58+
59+
To ensure sufficient quota is available in your subscription, please follow **[quota check instructions guide](./docs/quota_check.md)** before deploying the solution.
60+
61+
### Services Enabled
62+
5763
For additional documentation of the default enabled services of this solution accelerator, please see:
5864

5965
1. [Azure Open AI Service](https://learn.microsoft.com/en-us/azure/ai-services/openai/)
@@ -94,7 +100,7 @@ Follow the post deployment steps [Post Deployment Steps](docs/github_code_spaces
94100

95101
### Region Availability
96102

97-
By default, this template uses AI models which may not be available in all Azure regions. Check for [up-to-date region availability](https://learn.microsoft.com/azure/ai-services/openai/concepts/models#standard-deployment-model-availability) and select a region during deployment accordingly.
103+
By default, this template uses AI models which may not be available in all Azure regions. Please follow [quota check instructions guide](./docs/quota_check.md) before deploying the solution. Additionally, check for [up-to-date region availability](https://learn.microsoft.com/azure/ai-services/openai/concepts/models#standard-deployment-model-availability) and select a region during deployment accordingly.
98104

99105
### Costs
100106

@@ -104,16 +110,12 @@ You can estimate the cost of this project's architecture with [Azure's pricing c
104110

105111
This template has [Managed Identity](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/overview) built in to eliminate the need for developers to manage these credentials. Applications can use managed identities to obtain Microsoft Entra tokens without having to manage any credentials.
106112

107-
108113
## Resources
109114

110115
- [Azure AI Foundry documentation](https://learn.microsoft.com/en-us/azure/ai-foundry/)
111116
- [Azure Well Architecture Framework documentation](https://learn.microsoft.com/en-us/azure/well-architected/)
112117
- [Azure OpenAI Service - Documentation, quickstarts, API reference - Azure AI services | Microsoft Learn](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/use-your-data)
113118
- [Azure AI Content Understanding documentation](https://learn.microsoft.com/en-us/azure/ai-services/content-understanding/)
114-
115-
116-
117119
---
118120

119121
## Disclaimers

azure.yaml

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,28 @@
1-
name: deploy-your-ai-application-in-production
2-
infra:
3-
provider: "bicep"
4-
metadata:
5-
template: deploy-your-ai-application-in-production@1.0
6-
hooks:
7-
preup:
8-
windows:
9-
shell: pwsh
10-
run: ./scripts/SetConnectionsEnvironmentVariables.ps1
11-
interactive: true
12-
continueOnError: false
1+
name: deploy-your-ai-application-in-production
2+
infra:
3+
provider: "bicep"
4+
metadata:
5+
template: deploy-your-ai-application-in-production@1.0
6+
hooks:
7+
preup:
8+
windows:
9+
shell: pwsh
10+
run: ./scripts/set_conns_env_vars.ps1
11+
interactive: true
12+
continueOnError: false
13+
posix:
14+
shell: sh
15+
run: chmod u+r+x ./scripts/set_conns_env_vars.sh; ./scripts/set_conns_env_vars.sh
16+
interactive: true
17+
continueOnError: false
18+
preprovision:
19+
posix:
20+
shell: sh
21+
run: chmod u+r+x ./scripts/validate_model_deployment_quotas.sh; chmod u+r+x ./scripts/validate_model_quota.sh; ./scripts/validate_model_deployment_quotas.sh --subscription $AZURE_SUBSCRIPTION_ID --location $AZURE_LOCATION --models-parameter "aiModelDeployments"
22+
interactive: false
23+
continueOnError: false
24+
windows:
25+
shell: pwsh
26+
run: ./scripts/validate_model_deployment_quotas.ps1 -Subscription $env:AZURE_SUBSCRIPTION_ID -Location $env:AZURE_LOCATION -ModelsParameter "aiModelDeployments"
27+
interactive: false
28+
continueOnError: false

docs/Verify_Services_On_Network.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This guide will walk you through using a secure jump-box virtual machine to inst
66

77
### 1. Copy Testing Script to Virtual Machine
88

9-
Copy [TestConnections.ps1](./scripts/TestConnections.ps1) to the Virtual Machine.
9+
Copy [test_azure_resource_conns.ps1](./scripts/test_azure_resource_conns.ps1) to the Virtual Machine.
1010

1111
### 2. Install Azure CLI
1212

@@ -41,7 +41,7 @@ $containerRegistry = "your-container-registry-name"
4141
### 5. Execute Testing PowerShell Script
4242

4343
```powershell
44-
.\TestConnections.ps1 `
44+
.\test_azure_resource_conns.ps1 `
4545
-SubscriptionId $subscriptionId `
4646
-ResourceGroup $resourceGroup `
4747
-KeyVault $keyvault `

docs/github_code_spaces_steps.md

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,31 +32,40 @@ You can run this solution using GitHub Codespaces. The button will open a web-ba
3232

3333
![Image showing the password prompt for azure](../img/provisioning/enterpassword.png)
3434

35-
**Prompting for MFA**
35+
7. Return to the codespaces window and type “az login”. 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.
36+
![image showing theaz login in the vs code terminal](../img/provisioning/az_login.png)
3637

37-
![Image showing the pop up window in the web browser for azd auth](../img/provisioning/azdauthpopup.png)
38-
39-
7. Return to the codespaces window now. In the terminal window, begin by initializing the environment by typing the command “azd init”
38+
8. Return to the codespaces window now. In the terminal window, begin by initializing the environment by typing the command “azd init”
4039

4140
![image showing the initial screen in the vs code terminal](../img/provisioning/azd_init_terminal.png)
4241

43-
8. Enter the name for your environment
42+
9. Enter the name for your environment
4443

4544
![aImage showing entering a new environment name](../img/provisioning/enter_evn_name.png)
4645

47-
9. Now start the deployment of the infrastructure by typing the command “azd provision”
46+
10. Now start the deployment of the infrastructure by typing the command “azd up”
47+
48+
![image showing the terminal in vs code](../img/provisioning/azd_provision_terminal.png)
49+
50+
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.
51+
52+
**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.
53+
54+
55+
11. 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.
56+
![image showing model quota pre-provision code executing](../img/provisioning/preprovision_output.png)
57+
58+
59+
If the location selected has sufficient quota for the models you plan to deploy, the provisioning will begin without notification.
4860

49-
![image showing the terminal in vs code](../img/provisioning/azd_provision_terminal.png)
61+
![image showing model quota pre-provision pass](../img/provisioning/preprovision_success.png)
5062

51-
This step will allow you to choose from the subscriptions you have available, based on the account you logged in with in the azd auth login step. Next it will prompt you for the region to deploy the resources into.
63+
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.
5264

53-
![image showing region selection](../img/provisioning/azdprovision_select_location.png)
65+
![image showing model quota pre-provision fail](../img/provisioning/preprovision_fail.png)
5466

55-
10. Next you will be prompted for values to enable additional features outside of the AI Foundry required features. They are false by default.
56-
![image of prompts](../img/provisioning/prompts.png)
57-
**Be sure to remember the vm password and vm username. This will be used in a later step. Because we are using FDPO subscriptions, we do not have access to Entra to create the SSO to the jump box at this time. You are still required to log into Azure once you connect to the virtual machine.
67+
12. 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.
5868

59-
11. After completeing the required paramters that you were prompted for, the provisioning of resources will run and deploy the Network Isolated AI hub, project and dependent resources in about 20 minutes.
6069

6170
# Post Deployment Steps:
6271
These steps will help to check that the isolated environment was set up correctly.

docs/local_environment_steps.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,22 @@ git clone https://github.com/microsoft/Deploy-Your-AI-Application-In-Production.
77
cd Deploy-Your-AI-Application-In-Production
88
```
99

10-
### Establish AZD Environment
10+
### Establish Environment
1111

12-
This solution uses the [Azure Developer CLI](https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/overview) to quickly provision and deploy infrastructure and applications to Azure.
12+
This solution uses the [Azure CLI](https://learn.microsoft.com/en-us/cli/azure/what-is-azure-cli?view=azure-cli-latest) and the [Azure Developer CLI](https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/overview) to quickly provision and deploy infrastructure and applications to Azure.
1313

1414
To get started, authenticate with an Azure Subscription ([details](https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/reference#azd-auth-login)):
1515

1616
```powershell
1717
azd auth login
1818
```
1919

20+
Also authenticate with the Azure CLI ([details](https://learn.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest)):
21+
22+
```powershell
23+
az login
24+
```
25+
2026
Establish a new environment. Provide a name that represents the application domain:
2127

2228
```powershell

docs/post_deployment_steps.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,54 +4,54 @@ Follow these steps to check the creation of the required private endpoints in th
44

55
One way to check if the access is private to the hub is to launch the AI Foundry hub from the portal.
66

7-
![Image showing if network isolation is checked](img/provisioning/checkNetworkIsolation3.png)
7+
![Image showing if network isolation is checked](../img/provisioning/checkNetworkIsolation3.png)
88

99
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!
1010

11-
![Image showing the virtual machine in the browser](img/provisioning/checkNetworkIsolation4.png)
11+
![Image showing the virtual machine in the browser](../img/provisioning/checkNetworkIsolation4.png)
1212

1313
A more thorough check is to look for the networking settings and checking for private endpoints.
1414
1. Go to the Azure Portal and select your Azure AI hub that was just created.
1515

1616
2. Click on Settings and then Networking.
1717

18-
![Image showing the Azure Portal for AI Foundry Hub and the settings blade](img/provisioning/checkNetworkIsolation1.png)
18+
![Image showing the Azure Portal for AI Foundry Hub and the settings blade](../img/provisioning/checkNetworkIsolation1.png)
1919

2020
3. Open the Workspace managed outbound access tab.
2121

22-
![Image showing the Azure Portal for AI Foundry Hub and the Workspace managed outbound access tab](img/provisioning/checkNetworkIsolation2.png)
22+
![Image showing the Azure Portal for AI Foundry Hub and the Workspace managed outbound access tab](../img/provisioning/checkNetworkIsolation2.png)
2323

2424
Here, you will find the private endpoints that are connected to the resources within the hub managed virtual network. Ensure that these private endpoints are active.
2525
The hub should show that Public access is ‘disabled’.
2626

2727
## Connecting to the isolated network via RDP
2828
1. Navigate to the resource group where the isolated AI Foundry was deployed to and select the virtual machine.
2929

30-
![Image showing the Azure Portal for the virtual machine](img/provisioning/checkNetworkIsolation5.png)
30+
![Image showing the Azure Portal for the virtual machine](../img/provisioning/checkNetworkIsolation5.png)
3131

3232
2. Be sure that the Virtual Machine is running. If not, start the VM.
3333

34-
![Image showing the Azure Portal VM and the start/stop button](img/provisioning/checkNetworkIsolation6.png)
34+
![Image showing the Azure Portal VM and the start/stop button](../img/provisioning/checkNetworkIsolation6.png)
3535

3636
3. Select “Bastion” under the ‘Connect’ heading in the VM resource.
3737

38-
![Image showing the bastion blade selected](img/provisioning/checkNetworkIsolation7.png)
38+
![Image showing the bastion blade selected](../img/provisioning/checkNetworkIsolation7.png)
3939

4040
4. Supply the username and the password you created as environment variables and press the connect button.
4141

42-
![Image showing the screen to enter the VM Admin info and the connect to bastion button](img/provisioning/checkNetworkIsolation8.png)
42+
![Image showing the screen to enter the VM Admin info and the connect to bastion button](../img/provisioning/checkNetworkIsolation8.png)
4343

4444
5. Your virtual machine will launch and you will see a different screen.
4545

46-
![Image showing the opening of the Virtual machine in another browser tab](img/provisioning/checkNetworkIsolation9.png)
46+
![Image showing the opening of the Virtual machine in another browser tab](../img/provisioning/checkNetworkIsolation9.png)
4747

4848
6. Launch Edge browser and navigate to your AI Foundry Hub. https://ai.azure.com Sign in using your credentials.
4949

5050

5151
7. You are challenged by MFA to connect.
5252

53-
![Image showing the Multi Factor Authentication popup](img/provisioning/checkNetworkIsolation10.png)
53+
![Image showing the Multi Factor Authentication popup](../img/provisioning/checkNetworkIsolation10.png)
5454

5555
8. You will now be able to view the Foundry Hub which is contained in an isolated network.
5656

57-
![Image showing the Azure Foundry AI Hub with a private bubble icon](img/provisioning/checkNetworkIsolation11.png)
57+
![Image showing the Azure Foundry AI Hub with a private bubble icon](../img/provisioning/checkNetworkIsolation11.png)

0 commit comments

Comments
 (0)