Skip to content

Commit 5ad723c

Browse files
Merge pull request #163 from microsoft/dev
feat: Merging the NSG bicep changes from dev to main
2 parents 92bbcef + 39f1ace commit 5ad723c

15 files changed

+5148
-1117
lines changed

azure.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: modernize-your-code-solution-accelerator
22
metadata:
33
4+
5+
requiredVersions:
6+
azd: '>=1.17.1'
7+
48
parameters:
59
AzureAiServiceLocation:
610
type: string

docs/CustomizingAzdParameters.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ By default this template will use the environment name as the prefix to prevent
2020
| `AZURE_ENV_JUMPBOX_ADMIN_USERNAME` | string | `JumpboxAdminUser` | Specifies the administrator username for the Jumpbox Virtual Machine. |
2121
| `AZURE_ENV_JUMPBOX_ADMIN_PASSWORD` | string | `JumpboxAdminP@ssw0rd1234!` | Specifies the administrator password for the Jumpbox Virtual Machine. |
2222
| `AZURE_ENV_COSMOS_SECONDARY_LOCATION` | string | *(not set by default)* | Specifies the secondary region for Cosmos DB. Required if `enableRedundancy` is `true`. |
23+
| `AZURE_EXISTING_AI_PROJECT_RESOURCE_ID` | string | *(not set by default)* | Specifies the existing AI Foundry Project Resource ID if it needs to be reused. |
2324
---
2425

2526
## How to Set a Parameter
@@ -30,11 +31,16 @@ To customize any of the above values, run the following command **before** `azd
3031
azd env set <PARAMETER_NAME> <VALUE>
3132
```
3233

33-
Set the Log Analytics Workspace Id if you need to reuse the existing workspace which is already existing
34+
Set the Log Analytics Workspace Id if you need to reuse the existing workspace
3435
```shell
3536
azd env set AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID '/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.OperationalInsights/workspaces/<workspace-name>'
3637
```
3738

39+
Set the Azure Existing AI Foundry Project Resource ID if you need to reuse the existing AI Foundry Project
40+
```shell
41+
azd env set AZURE_EXISTING_AI_PROJECT_RESOURCE_ID '/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.CognitiveServices/accounts/<account-name>/projects/<project-name>'
42+
```
43+
3844
**Example:**
3945

4046
```bash

docs/DeploymentGuide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ If you're not using one of the above options for opening the project, then you'l
107107

108108
1. Make sure the following tools are installed:
109109

110-
* [Azure Developer CLI (azd)](https://aka.ms/install-azd)
110+
* [Azure Developer CLI (azd)](https://aka.ms/install-azd) <small>(v1.17.1+)</small> - version
111111
* [Python 3.9+](https://www.python.org/downloads/)
112112
* [Docker Desktop](https://www.docker.com/products/docker-desktop/)
113113
* [Git](https://git-scm.com/downloads)

infra/main.bicep

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ param imageVersion string = 'latest'
9696
@description('Version of the GPT model to deploy:')
9797
param gptModelVersion string = '2024-08-06'
9898

99+
@description('Use this parameter to use an existing AI project resource ID')
100+
param azureExistingAIProjectResourceId string = ''
101+
99102
param existingLogAnalyticsWorkspaceId string = ''
100103

101104
var allTags = union(
@@ -221,23 +224,40 @@ module network 'modules/network.bicep' = if (enablePrivateNetworking) {
221224
}
222225

223226
module aiServices 'modules/ai-foundry/main.bicep' = {
224-
name: take('aiservices-${resourcesName}-deployment', 64)
227+
name: take('avm.res.cognitive-services.account.${resourcesName}', 64)
225228
#disable-next-line no-unnecessary-dependson
226229
dependsOn: [logAnalyticsWorkspace, network] // required due to optional flags that could change dependency
227230
params: {
228231
name: '${abbrs.ai.aiFoundry}${resourcesName}'
229232
location: aiDeploymentsLocation
230233
sku: 'S0'
231234
kind: 'AIServices'
232-
deployments: [modelDeployment]
235+
deployments: [ modelDeployment ]
233236
projectName: '${abbrs.ai.aiFoundryProject}${resourcesName}'
237+
projectDescription: '${abbrs.ai.aiFoundryProject}${resourcesName}'
234238
logAnalyticsWorkspaceResourceId: enableMonitoring ? logAnalyticsWorkspaceResourceId : ''
235239
privateNetworking: enablePrivateNetworking
236240
? {
237241
virtualNetworkResourceId: network.outputs.vnetResourceId
238242
subnetResourceId: network.outputs.subnetPrivateEndpointsResourceId
239243
}
240244
: null
245+
existingFoundryProjectResourceId: azureExistingAIProjectResourceId
246+
disableLocalAuth: true //Should be set to true for WAF aligned configuration
247+
customSubDomainName: 'ais-${resourcesName}'
248+
apiProperties: {
249+
//staticsEnabled: false
250+
}
251+
allowProjectManagement: true
252+
managedIdentities: {
253+
systemAssigned: true
254+
}
255+
publicNetworkAccess: 'Enabled'
256+
networkAcls: {
257+
bypass: 'AzureServices'
258+
defaultAction: 'Allow'
259+
}
260+
privateEndpoints: []
241261
roleAssignments: [
242262
{
243263
principalId: appIdentity.outputs.principalId
@@ -314,9 +334,9 @@ module keyVault 'modules/keyVault.bicep' = {
314334
: null
315335
roleAssignments: [
316336
{
317-
principalId: aiServices.outputs.?systemAssignedMIPrincipalId ?? ''
337+
principalId: aiServices.outputs.?systemAssignedMIPrincipalId ?? appIdentity.outputs.principalId
318338
principalType: 'ServicePrincipal'
319-
roleDefinitionIdOrName: 'Key Vault Reader'
339+
roleDefinitionIdOrName: 'Key Vault Administrator'
320340
}
321341
]
322342
tags: allTags
@@ -473,15 +493,15 @@ module containerAppBackend 'br/public:avm/res/app/container-app:0.17.0' = {
473493
}
474494
{
475495
name: 'AI_PROJECT_ENDPOINT'
476-
value: aiServices.outputs.project.apiEndpoint // or equivalent
496+
value: aiServices.outputs.aiProjectInfo.apiEndpoint // or equivalent
477497
}
478498
{
479499
name: 'AZURE_AI_AGENT_PROJECT_CONNECTION_STRING' // This was not really used in code.
480-
value: aiServices.outputs.project.apiEndpoint
500+
value: aiServices.outputs.aiProjectInfo.apiEndpoint
481501
}
482502
{
483503
name: 'AZURE_AI_AGENT_PROJECT_NAME'
484-
value: aiServices.outputs.project.name
504+
value: aiServices.outputs.aiProjectInfo.name
485505
}
486506
{
487507
name: 'AZURE_AI_AGENT_RESOURCE_GROUP_NAME'
@@ -493,7 +513,7 @@ module containerAppBackend 'br/public:avm/res/app/container-app:0.17.0' = {
493513
}
494514
{
495515
name: 'AZURE_AI_AGENT_ENDPOINT'
496-
value: aiServices.outputs.project.apiEndpoint
516+
value: aiServices.outputs.aiProjectInfo.apiEndpoint
497517
}
498518
{
499519
name: 'AZURE_CLIENT_ID'

0 commit comments

Comments
 (0)