-
Notifications
You must be signed in to change notification settings - Fork 424
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat: use managed identity for storage * feat: use openai managed identity * chore: add identity package * fix: db connection string * refactor: add getCredentials helper * chore: remove key references * chore: update dependencies * docs: migrate docs to mention AI search * feat: replace MongoDB with AI search in infra * fix: infra template * chore: fix infra template to disable local auth * feat: migrate DB code to AI Search * fix: migrate filename metadata * chore: disable blob public access * chore: update dependency * docs: add RBAC permissions * chore: update chat model and reduce db cost * chore: update infra * docs: suggest default region * chore: revert gpt version * chore: fix typo
- Loading branch information
Showing
18 changed files
with
799 additions
and
326 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
metadata description = 'Creates an Azure AI Search instance.' | ||
param name string | ||
param location string = resourceGroup().location | ||
param tags object = {} | ||
|
||
param sku object = { | ||
name: 'standard' | ||
} | ||
|
||
param authOptions object = {} | ||
param disableLocalAuth bool = false | ||
param disabledDataExfiltrationOptions array = [] | ||
param encryptionWithCmk object = { | ||
enforcement: 'Unspecified' | ||
} | ||
@allowed([ | ||
'default' | ||
'highDensity' | ||
]) | ||
param hostingMode string = 'default' | ||
param networkRuleSet object = { | ||
bypass: 'None' | ||
ipRules: [] | ||
} | ||
param partitionCount int = 1 | ||
@allowed([ | ||
'enabled' | ||
'disabled' | ||
]) | ||
param publicNetworkAccess string = 'enabled' | ||
param replicaCount int = 1 | ||
@allowed([ | ||
'disabled' | ||
'free' | ||
'standard' | ||
]) | ||
param semanticSearch string = 'disabled' | ||
|
||
var searchIdentityProvider = (sku.name == 'free') ? null : { | ||
type: 'SystemAssigned' | ||
} | ||
|
||
resource search 'Microsoft.Search/searchServices@2021-04-01-preview' = { | ||
name: name | ||
location: location | ||
tags: tags | ||
// The free tier does not support managed identity | ||
identity: searchIdentityProvider | ||
properties: { | ||
authOptions: disableLocalAuth ? null : authOptions | ||
disableLocalAuth: disableLocalAuth | ||
disabledDataExfiltrationOptions: disabledDataExfiltrationOptions | ||
encryptionWithCmk: encryptionWithCmk | ||
hostingMode: hostingMode | ||
networkRuleSet: networkRuleSet | ||
partitionCount: partitionCount | ||
publicNetworkAccess: publicNetworkAccess | ||
replicaCount: replicaCount | ||
semanticSearch: semanticSearch | ||
} | ||
sku: sku | ||
} | ||
|
||
output id string = search.id | ||
output endpoint string = 'https://${name}.search.windows.net/' | ||
output name string = search.name | ||
output principalId string = !empty(searchIdentityProvider) ? search.identity.principalId : '' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
metadata description = 'Creates a role assignment for a service principal.' | ||
param principalId string | ||
|
||
@allowed([ | ||
'Device' | ||
'ForeignGroup' | ||
'Group' | ||
'ServicePrincipal' | ||
'User' | ||
]) | ||
param principalType string = 'ServicePrincipal' | ||
param roleDefinitionId string | ||
|
||
resource role 'Microsoft.Authorization/roleAssignments@2022-04-01' = { | ||
name: guid(subscription().id, resourceGroup().id, principalId, roleDefinitionId) | ||
properties: { | ||
principalId: principalId | ||
principalType: principalType | ||
roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', roleDefinitionId) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.