Skip to content

Commit 7b38e3c

Browse files
author
Seth
committed
Infra - minor doc updates and fixes
1 parent a77c494 commit 7b38e3c

6 files changed

Lines changed: 39 additions & 22 deletions

File tree

azure.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ infra:
44
metadata:
55
template: deploy-your-ai-application-in-production@1.0
66
hooks:
7-
preprovision:
7+
preup:
88
windows:
99
shell: pwsh
10-
run: ./scripts/SetConnectionsEnvironmentVariables.ps1 -Tenant $env:AZURE_ORIGINAL_AI_PROJECT_TENTANT -Subscription $env:AZURE_ORIGINAL_AI_PROJECT_SUBSCRIPTION -ResourceGroup $env:AZURE_ORIGINAL_AI_PROJECT_RESOURCE_GROUP -Workspace $env:AZURE_ORIGINAL_AI_PROJECT_WORKSPACE
10+
run: ./scripts/SetConnectionsEnvironmentVariables.ps1
1111
interactive: false
1212
continueOnError: false

infra/main.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ module aiHub 'modules/ai-foundry/hub.bicep' = {
307307
connections,
308308
searchEnabled ? [
309309
{
310-
name: toLower('${aiSearch.outputs.name}-connection')
310+
name: aiSearch.outputs.name
311311
value: null
312312
category: 'CognitiveSearch'
313313
target: 'https://${aiSearch.outputs.name}.search.windows.net/'

infra/modules/ai-foundry/hub.bicep

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@description('Name of the Storage Account.')
1+
@description('Name of the AI Hub.')
22
param name string
33

44
@description('Specifies the location for all the Azure resources.')
@@ -28,7 +28,7 @@ param storageAccountResourceId string
2828
@description('Resource ID of the Container Registry for the Hub.')
2929
param containerRegistryResourceId string?
3030

31-
@description('Specifies whether network isolation is enabled. This will create a private endpoint for the Storage Account and link the private DNS zone.')
31+
@description('Specifies whether network isolation is enabled. This will create a private endpoint for the AI Hub and link the private DNS zone.')
3232
param networkIsolation bool = true
3333

3434
@description('Optional. Array of role assignments to create.')

infra/modules/ai-foundry/project.bicep

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@description('Name of the Storage Account.')
1+
@description('Name of the AI Foundry Project.')
22
param name string
33

44
@description('Specifies the location for all the Azure resources.')
@@ -13,7 +13,7 @@ param hubResourceId string
1313
@description('Resource ID of the Log Analytics workspace to use for diagnostic settings.')
1414
param logAnalyticsWorkspaceResourceId string
1515

16-
@description('Specifies whether network isolation is enabled. This will create a private endpoint for the Storage Account and link the private DNS zone.')
16+
@description('Specifies whether network isolation is enabled to determine public access to the AI Project.')
1717
param networkIsolation bool = true
1818

1919
@description('Optional. Array of role assignments to create.')

infra/modules/cognitive-services/service.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ output systemAssignedMIPrincipalId string? = cognitiveService.outputs.?systemAss
121121
output endpoint string = cognitiveService.outputs.endpoint
122122

123123
output foundryConnection object = {
124-
name: toLower('${cognitiveService.outputs.name}-conn')
124+
name: cognitiveService.outputs.name
125125
value: null
126126
category: category
127127
target: cognitiveService.outputs.endpoint

scripts/SetConnectionsEnvironmentVariables.ps1

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,29 @@ param (
1515
[switch]$includeVerboseResponseOutputs
1616
)
1717

18-
if (-not $PSBoundParameters.ContainsKey('tenant') -or
19-
-not $PSBoundParameters.ContainsKey('subscription') -or
20-
-not $PSBoundParameters.ContainsKey('resourceGroup') -or
21-
-not $PSBoundParameters.ContainsKey('workspace')) {
22-
Write-Output "All parameters (tenant, subscription, resourceGroup, workspace) must be supplied to set Connections environment variables."
23-
Write-Output "Usage: SetConnectionsEnvironmentVariables.ps1 -tenant <tenant> -subscription <subscription> -resourceGroup <resourceGroup> -workspace <workspace>"
24-
exit
18+
if (-not $tenant) {
19+
$tenant = $env:AZURE_ORIGINAL_TENANT_ID
20+
Write-Output "Tenant parameter not provided. Using environment variable AZURE_ORIGINAL_TENANT_ID: $tenant"
21+
}
22+
23+
if (-not $subscription) {
24+
$subscription = $env:AZURE_ORIGINAL_SUBSCRIPTION_ID
25+
Write-Output "Subscription parameter not provided. Using environment variable AZURE_ORIGINAL_SUBSCRIPTION_ID: $subscription"
26+
}
27+
28+
if (-not $resourceGroup) {
29+
$resourceGroup = $env:AZURE_ORIGINAL_RESOURCE_GROUP
30+
Write-Output "ResourceGroup parameter not provided. Using environment variable AZURE_ORIGINAL_RESOURCE_GROUP: $resourceGroup"
31+
}
32+
33+
if (-not $workspace) {
34+
$workspace = $env:AZURE_ORIGINAL_WORKSPACE_NAME
35+
Write-Output "Workspace parameter not provided. Using environment variable AZURE_ORIGINAL_WORKSPACE_NAME: $workspace"
36+
}
37+
38+
if (-not $tenant -or -not $subscription -or -not $resourceGroup -or -not $workspace) {
39+
Write-Output "One or more required parameters are missing. Exiting script."
40+
return
2541
}
2642

2743
if (-not (Get-AzContext)) {
@@ -91,7 +107,7 @@ foreach ($connection in $connections) {
91107
Write-Output "Target: $target"
92108

93109
if ($category -eq "CognitiveSearch") {
94-
$env:AZURE_AI_SEARCH_ENABLED = "true"
110+
azd env set 'AZURE_AI_SEARCH_ENABLED' 'true'
95111
Write-Output "Environment variable AZURE_AI_SEARCH_ENABLED set to true"
96112
}
97113

@@ -104,27 +120,27 @@ foreach ($connection in $connections) {
104120

105121
switch ($account.kind) {
106122
"ContentSafety" {
107-
$env:AZURE_AI_CONTENT_SAFETY_ENABLED = "true"
123+
azd env set 'AZURE_AI_CONTENT_SAFETY_ENABLED' 'true'
108124
Write-Output "Environment variable AZURE_AI_CONTENT_SAFETY_ENABLED set to true"
109125
}
110126
"SpeechServices" {
111-
$env:AZURE_AI_SPEECH_ENABLED = "true"
127+
azd env set 'AZURE_AI_SPEECH_ENABLED' 'true'
112128
Write-Output "Environment variable AZURE_AI_SPEECH_ENABLED set to true"
113129
}
114130
"FormRecognizer" {
115-
$env:AZURE_AI_DOC_INTELLIGENCE_ENABLED = "true"
131+
azd env set 'AZURE_AI_DOC_INTELLIGENCE_ENABLED' 'true'
116132
Write-Output "Environment variable AZURE_AI_DOC_INTELLIGENCE_ENABLED set to true"
117133
}
118134
"ComputerVision" {
119-
$env:AZURE_AI_VISION_ENABLED = "true"
135+
azd env set 'AZURE_AI_VISION_ENABLED' 'true'
120136
Write-Output "Environment variable AZURE_AI_VISION_ENABLED set to true"
121137
}
122138
"TextAnalytics" {
123-
$env:AZURE_AI_LANGUAGE_ENABLED = "true"
139+
azd env set 'AZURE_AI_LANGUAGE_ENABLED' 'true'
124140
Write-Output "Environment variable AZURE_AI_LANGUAGE_ENABLED set to true"
125141
}
126142
"TextTranslation" {
127-
$env:AZURE_AI_TRANSLATOR_ENABLED = "true"
143+
azd env set 'AZURE_AI_TRANSLATOR_ENABLED' 'true'
128144
Write-Output "Environment variable AZURE_AI_TRANSLATOR_ENABLED set to true"
129145
}
130146
Default {
@@ -137,6 +153,7 @@ foreach ($connection in $connections) {
137153

138154
if ($category -eq "ApiKey" -and $target -eq "https://api.bing.microsoft.com/") {
139155
$env:AZURE_AI_BING_GROUNDING_ENABLED = "true"
156+
azd env set 'AZURE_AI_SPEECH_ENABLED' 'true'
140157
Write-Output "Environment variable AZURE_AI_BING_GROUNDING_ENABLED set to true"
141158
}
142159

0 commit comments

Comments
 (0)