Skip to content

Commit 94ff047

Browse files
fix: Merge pull request #244 from microsoft/dev
fix: Merging dev changed to main branch
2 parents efe4d10 + 89548a5 commit 94ff047

File tree

7 files changed

+124
-162
lines changed

7 files changed

+124
-162
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ Please check the link [Azure Products by Region](https://azure.microsoft.com/en-
6464

6565
- GPT model from the drop-down list of values
6666

67-
- GPT model deployment capacity
67+
- GPT model deployment capacity (GPT-4, GPT-4o, and GPT-4o Mini)
6868

69-
- Embedding model from the drop-down list of values
69+
- Embedding model from the drop-down list of values (text-embedding-ada-002)
7070

7171
- Embedding model capacity
7272

@@ -76,7 +76,8 @@ Please check the link [Azure Products by Region](https://azure.microsoft.com/en-
7676
- Navigate to the [Azure AI Foundry portal](https://ai.azure.com/)
7777
- Select the AI Project you are using for this accelerator if you are not already in the project.
7878
- Select `Management center` from the bottom left navigation menu
79-
- Select `Quota`, click the `GlobalStandard` dropdown and select the GPT model and region you are using for this accelerator to see your available quota.
79+
- Select `Quota`, click the `GlobalStandard` dropdown and select the GPT model (`GPT-4 / GPT-4o / GPT-4o mini`) or embeddings model (`text-embedding-ada-002`) and region you are using for this accelerator to see your available quota. Please note `GPT-4o mini` and `text-embedding-ada-002` are used as default.
80+
8081
- Request more quota or delete any unused model deployments as needed.
8182

8283

infra/deploy_ai_foundry.bicep

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,3 +658,6 @@ output aiSearchId string = aiSearch.id
658658
output aiSearchTarget string = 'https://${aiSearch.name}.search.windows.net'
659659
output aiSearchService string = aiSearch.name
660660
output aiProjectName string = aiHubProject.name
661+
662+
output applicationInsightsId string = applicationInsights.id
663+
output storageAccountName string = storageNameCleaned

infra/deploy_app_service.bicep

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ param HostingPlanSku string = 'P0v3'
2525
@description('Name of Web App')
2626
param WebsiteName string = '${ solutionName }-app-service'
2727

28-
@description('Name of Application Insights')
29-
param ApplicationInsightsName string = '${ solutionName }-app-insights'
28+
// @description('Name of Application Insights')
29+
// param ApplicationInsightsName string = '${ solutionName }-app-insights'
3030

3131
@description('Azure OpenAI Model Deployment Name')
3232
param AzureOpenAIModel string
@@ -64,6 +64,7 @@ param AZURE_COSMOSDB_DATABASE string = ''
6464
param AZURE_COSMOSDB_ENABLE_FEEDBACK string = 'True'
6565

6666
param imageTag string
67+
param applicationInsightsId string
6768
// var WebAppImageName = 'DOCKER|byoaiacontainer.azurecr.io/byoaia-app:latest'
6869

6970
// var WebAppImageName = 'DOCKER|ncwaappcontainerreg1.azurecr.io/ncqaappimage:v1.0.0'
@@ -155,10 +156,12 @@ resource Website 'Microsoft.Web/sites@2020-06-01' = {
155156
properties: {
156157
serverFarmId: HostingPlanName
157158
siteConfig: {
159+
alwaysOn: true
160+
ftpsState: 'Disabled'
158161
appSettings: [
159162
{
160163
name: 'APPINSIGHTS_INSTRUMENTATIONKEY'
161-
value: reference(ApplicationInsights.id, '2015-05-01').InstrumentationKey
164+
value: reference(applicationInsightsId, '2015-05-01').InstrumentationKey
162165
}
163166
{
164167
name: 'AZURE_OPENAI_API_VERSION'
@@ -225,21 +228,33 @@ resource Website 'Microsoft.Web/sites@2020-06-01' = {
225228
linuxFxVersion: WebAppImageName
226229
}
227230
}
228-
dependsOn: [HostingPlan]
229-
}
230-
231-
resource ApplicationInsights 'Microsoft.Insights/components@2020-02-02' = {
232-
name: ApplicationInsightsName
233-
location: resourceGroup().location
234-
tags: {
235-
'hidden-link:${resourceId('Microsoft.Web/sites',ApplicationInsightsName)}': 'Resource'
231+
resource basicPublishingCredentialsPoliciesFtp 'basicPublishingCredentialsPolicies' = {
232+
name: 'ftp'
233+
properties: {
234+
allow: false
235+
}
236236
}
237-
properties: {
238-
Application_Type: 'web'
237+
resource basicPublishingCredentialsPoliciesScm 'basicPublishingCredentialsPolicies' = {
238+
name: 'scm'
239+
properties: {
240+
allow: false
241+
}
239242
}
240-
kind: 'web'
243+
dependsOn: [HostingPlan]
241244
}
242245

246+
// resource ApplicationInsights 'Microsoft.Insights/components@2020-02-02' = {
247+
// name: ApplicationInsightsName
248+
// location: resourceGroup().location
249+
// tags: {
250+
// 'hidden-link:${resourceId('Microsoft.Web/sites',ApplicationInsightsName)}': 'Resource'
251+
// }
252+
// properties: {
253+
// Application_Type: 'web'
254+
// }
255+
// kind: 'web'
256+
// }
257+
243258
resource cosmos 'Microsoft.DocumentDB/databaseAccounts@2022-08-15' existing = {
244259
name: AZURE_COSMOSDB_ACCOUNT
245260
}
@@ -259,4 +274,5 @@ resource role 'Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments@2022-05-
259274
dependsOn: [Website]
260275
}
261276

277+
output webAppUrl string = 'https://${WebsiteName}.azurewebsites.net'
262278

infra/deploy_azure_function_charts.bicep

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ param sqlDbUser string
88
param sqlDbPwd string
99
// param managedIdentityObjectId string
1010
param imageTag string
11+
param storageAccountName string
1112
var functionAppName = '${solutionName}-charts-fn'
12-
var storageaccountname = '${solutionName}chartfnacc'
1313
var dockerImage = 'DOCKER|kmcontainerreg.azurecr.io/km-charts-function:${imageTag}'
1414
var environmentName = '${solutionName}-charts-fn-env'
1515

@@ -18,19 +18,6 @@ var environmentName = '${solutionName}-charts-fn-env'
1818
// var sqlDbUser = 'sqladmin'
1919
// var sqlDbPwd = 'TestPassword_1234'
2020

21-
resource storageAccount 'Microsoft.Storage/storageAccounts@2023-05-01' = {
22-
name: storageaccountname
23-
location: resourceGroup().location
24-
sku: {
25-
name: 'Standard_LRS'
26-
}
27-
kind: 'StorageV2'
28-
properties: {
29-
accessTier: 'Hot'
30-
allowSharedKeyAccess: false
31-
}
32-
}
33-
3421
resource managedenv 'Microsoft.App/managedEnvironments@2024-03-01' = {
3522
name: environmentName
3623
location: solutionLocation
@@ -69,8 +56,8 @@ resource azurefn 'Microsoft.Web/sites@2023-12-01' = {
6956
siteConfig: {
7057
appSettings: [
7158
{
72-
name: 'AzureWebJobsStorage'
73-
value: 'DefaultEndpointsProtocol=https;AccountName=${storageAccount};EndpointSuffix=core.windows.net'
59+
name: 'AzureWebJobsStorage__accountname'
60+
value: storageAccountName
7461
}
7562
{
7663
name: 'SQLDB_DATABASE'
@@ -104,13 +91,4 @@ resource azurefn 'Microsoft.Web/sites@2023-12-01' = {
10491
}
10592
}
10693

107-
resource roleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
108-
name: guid(subscription().id, resourceGroup().id, azurefn.id, 'StorageBlobDataContributor')
109-
scope: storageAccount
110-
properties: {
111-
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe') // Storage Blob Data Contributor
112-
principalId: azurefn.identity.principalId
113-
}
114-
}
115-
11694

infra/deploy_azure_function_rag.bicep

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ param sqlDbUser string
2020
param sqlDbPwd string
2121
// param managedIdentityObjectId string
2222
param imageTag string
23+
param storageAccountName string
2324
var functionAppName = '${solutionName}-rag-fn'
24-
var storageaccountname = '${solutionName}ragfnacc'
2525
var dockerImage = 'DOCKER|kmcontainerreg.azurecr.io/km-rag-function:${imageTag}'
2626
var environmentName = '${solutionName}-rag-fn-env'
2727

@@ -30,19 +30,6 @@ var environmentName = '${solutionName}-rag-fn-env'
3030
// var sqlDbUser = 'sqladmin'
3131
// var sqlDbPwd = 'TestPassword_1234'
3232

33-
resource storageAccount 'Microsoft.Storage/storageAccounts@2023-05-01' = {
34-
name: storageaccountname
35-
location: resourceGroup().location
36-
sku: {
37-
name: 'Standard_LRS'
38-
}
39-
kind: 'StorageV2'
40-
properties: {
41-
accessTier: 'Hot'
42-
allowSharedKeyAccess: false
43-
}
44-
}
45-
4633
resource managedenv 'Microsoft.App/managedEnvironments@2024-03-01' = {
4734
name: environmentName
4835
location: solutionLocation
@@ -81,8 +68,8 @@ resource azurefn 'Microsoft.Web/sites@2023-12-01' = {
8168
siteConfig: {
8269
appSettings: [
8370
{
84-
name: 'AzureWebJobsStorage'
85-
value: 'DefaultEndpointsProtocol=https;AccountName=${storageAccount};EndpointSuffix=core.windows.net'
71+
name: 'AzureWebJobsStorage__accountname'
72+
value: storageAccountName
8673
}
8774
{
8875
name: 'PYTHON_ENABLE_INIT_INDEXING'
@@ -155,15 +142,6 @@ resource azurefn 'Microsoft.Web/sites@2023-12-01' = {
155142
}
156143
}
157144

158-
resource roleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
159-
name: guid(subscription().id, resourceGroup().id, azurefn.id, 'StorageBlobDataContributor')
160-
scope: storageAccount
161-
properties: {
162-
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe') // Storage Blob Data Contributor
163-
principalId: azurefn.identity.principalId
164-
}
165-
}
166-
167145
resource aiHubProject 'Microsoft.MachineLearningServices/workspaces@2024-01-01-preview' existing = {
168146
name: aiProjectName
169147
}

infra/main.bicep

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ module azureFunctionsCharts 'deploy_azure_function_charts.bicep' = {
192192
sqlDbUser: sqlDBModule.outputs.sqlDbUser
193193
sqlDbPwd:keyVault.getSecret('SQLDB-PASSWORD')
194194
// managedIdentityObjectId:managedIdentityModule.outputs.managedIdentityOutput.objectId
195+
storageAccountName:aifoundry.outputs.storageAccountName
195196
}
196197
dependsOn:[keyVault]
197198
}
@@ -217,6 +218,7 @@ module azureragFunctionsRag 'deploy_azure_function_rag.bicep' = {
217218
sqlDbPwd:keyVault.getSecret('SQLDB-PASSWORD')
218219
aiProjectName:aifoundry.outputs.aiProjectName
219220
// managedIdentityObjectId:managedIdentityModule.outputs.managedIdentityOutput.objectId
221+
storageAccountName:aifoundry.outputs.storageAccountName
220222
}
221223
dependsOn:[keyVault]
222224
}
@@ -235,6 +237,7 @@ module appserviceModule 'deploy_app_service.bicep' = {
235237
name: 'deploy_app_service'
236238
params: {
237239
imageTag: imageTag
240+
applicationInsightsId: aifoundry.outputs.applicationInsightsId
238241
// identity:managedIdentityModule.outputs.managedIdentityOutput.id
239242
solutionName: solutionPrefix
240243
// solutionLocation: solutionLocation
@@ -258,3 +261,5 @@ module appserviceModule 'deploy_app_service.bicep' = {
258261
scope: resourceGroup(resourceGroup().name)
259262
dependsOn:[sqlDBModule]
260263
}
264+
265+
output WEB_APP_URL string = appserviceModule.outputs.webAppUrl

0 commit comments

Comments
 (0)