forked from Azure/GPT-RAG
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
3,639 additions
and
265 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
.azure | ||
.azure | ||
local/ |
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 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
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,123 @@ | ||
@description('Cosmos DB account name, max length 44 characters, lowercase') | ||
param accountName string | ||
|
||
@description('Location for the Cosmos DB account.') | ||
param location string = resourceGroup().location | ||
|
||
param tags object = {} | ||
|
||
@description('The default consistency level of the Cosmos DB account.') | ||
@allowed([ | ||
'Eventual' | ||
'ConsistentPrefix' | ||
'Session' | ||
'BoundedStaleness' | ||
'Strong' | ||
]) | ||
param defaultConsistencyLevel string = 'Session' | ||
|
||
@description('Max stale requests. Required for BoundedStaleness. Valid ranges, Single Region: 10 to 2147483647. Multi Region: 100000 to 2147483647.') | ||
@minValue(10) | ||
@maxValue(2147483647) | ||
param maxStalenessPrefix int = 100000 | ||
|
||
@description('Max lag time (minutes). Required for BoundedStaleness. Valid ranges, Single Region: 5 to 84600. Multi Region: 300 to 86400.') | ||
@minValue(5) | ||
@maxValue(86400) | ||
param maxIntervalInSeconds int = 300 | ||
|
||
@description('Enable system managed failover for regions') | ||
param systemManagedFailover bool = true | ||
|
||
@description('The name for the database') | ||
param databaseName string | ||
|
||
@description('The name for the container') | ||
param containerName string | ||
|
||
@description('Maximum autoscale throughput for the container') | ||
@minValue(1000) | ||
@maxValue(1000000) | ||
param autoscaleMaxThroughput int = 1000 | ||
|
||
var consistencyPolicy = { | ||
Eventual: { | ||
defaultConsistencyLevel: 'Eventual' | ||
} | ||
ConsistentPrefix: { | ||
defaultConsistencyLevel: 'ConsistentPrefix' | ||
} | ||
Session: { | ||
defaultConsistencyLevel: 'Session' | ||
} | ||
BoundedStaleness: { | ||
defaultConsistencyLevel: 'BoundedStaleness' | ||
maxStalenessPrefix: maxStalenessPrefix | ||
maxIntervalInSeconds: maxIntervalInSeconds | ||
} | ||
Strong: { | ||
defaultConsistencyLevel: 'Strong' | ||
} | ||
} | ||
var locations = [ | ||
{ | ||
locationName: location | ||
failoverPriority: 0 | ||
isZoneRedundant: false | ||
} | ||
] | ||
|
||
resource account 'Microsoft.DocumentDB/databaseAccounts@2022-05-15' = { | ||
name: toLower(accountName) | ||
kind: 'GlobalDocumentDB' | ||
location: location | ||
tags: tags | ||
properties: { | ||
consistencyPolicy: consistencyPolicy[defaultConsistencyLevel] | ||
locations: locations | ||
databaseAccountOfferType: 'Standard' | ||
enableAutomaticFailover: systemManagedFailover | ||
} | ||
} | ||
|
||
resource database 'Microsoft.DocumentDB/databaseAccounts/sqlDatabases@2022-05-15' = { | ||
parent: account | ||
name: databaseName | ||
properties: { | ||
resource: { | ||
id: databaseName | ||
} | ||
} | ||
} | ||
|
||
resource container 'Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers@2022-05-15' = { | ||
parent: database | ||
name: containerName | ||
properties: { | ||
resource: { | ||
id: containerName | ||
partitionKey: { | ||
paths: [ | ||
'/id' | ||
] | ||
kind: 'Hash' | ||
} | ||
indexingPolicy: { | ||
indexingMode: 'consistent' | ||
includedPaths: [ | ||
{ | ||
path: '/*' | ||
} | ||
] | ||
} | ||
defaultTtl: 86400 | ||
} | ||
options: { | ||
autoscaleSettings: { | ||
maxThroughput: autoscaleMaxThroughput | ||
} | ||
} | ||
} | ||
} | ||
|
||
output azureDBkey string = account.listKeys().primaryMasterKey |
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,24 @@ | ||
param location string = resourceGroup().location | ||
param utcValue string = utcNow() | ||
param sleepName string = 'sleep-1' | ||
param sleepSeconds int = 120 | ||
resource sleepDelay 'Microsoft.Resources/deploymentScripts@2020-10-01' = { | ||
name: sleepName | ||
location: location | ||
kind: 'AzurePowerShell' | ||
properties: { | ||
forceUpdateTag: utcValue | ||
azPowerShellVersion: '8.3' | ||
timeout: 'PT10M' | ||
arguments: '-seconds ${sleepSeconds}' | ||
scriptContent: ''' | ||
param ( [string] $seconds ) | ||
Write-Output Sleeping for: $seconds .... | ||
Start-Sleep -Seconds $seconds | ||
Write-Output Sleep over - resuming .... | ||
''' | ||
cleanupPreference: 'OnSuccess' | ||
retentionInterval: 'P1D' | ||
} | ||
} | ||
output location string = sleepDelay.location |
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,14 @@ | ||
param applicationInsightsName string | ||
param appInsightsLocation string | ||
|
||
resource applicationInsights 'Microsoft.Insights/components@2020-02-02' = { | ||
name: applicationInsightsName | ||
location: appInsightsLocation | ||
kind: 'web' | ||
properties: { | ||
Application_Type: 'web' | ||
Request_Source: 'rest' | ||
} | ||
} | ||
|
||
output instrumentationKey string = applicationInsights.properties.InstrumentationKey |
Oops, something went wrong.