-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'aliencube:main' into feature/22-request-payload-definition
- Loading branch information
Showing
86 changed files
with
4,614 additions
and
1,038 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto | ||
|
||
*.sln text eol=crlf | ||
*.csproj text eol=crlf | ||
*.props text eol=crlf | ||
*.sh text eol=lf |
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 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 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,118 @@ | ||
metadata description = 'Creates an Azure storage account.' | ||
param name string | ||
param location string = resourceGroup().location | ||
param tags object = {} | ||
|
||
@allowed([ | ||
'Cool' | ||
'Hot' | ||
'Premium' ]) | ||
param accessTier string = 'Hot' | ||
param allowBlobPublicAccess bool = true | ||
param allowCrossTenantReplication bool = true | ||
param allowSharedKeyAccess bool = true | ||
param containers array = [] | ||
param corsRules array = [] | ||
param defaultToOAuthAuthentication bool = false | ||
param deleteRetentionPolicy object = {} | ||
@allowed([ 'AzureDnsZone', 'Standard' ]) | ||
param dnsEndpointType string = 'Standard' | ||
param files array = [] | ||
param kind string = 'StorageV2' | ||
param minimumTlsVersion string = 'TLS1_2' | ||
param queues array = [] | ||
param shareDeleteRetentionPolicy object = {} | ||
param supportsHttpsTrafficOnly bool = true | ||
param tables array = [] | ||
param networkAcls object = { | ||
bypass: 'AzureServices' | ||
defaultAction: 'Allow' | ||
} | ||
@allowed([ 'Enabled', 'Disabled' ]) | ||
param publicNetworkAccess string = 'Enabled' | ||
param sku object = { name: 'Standard_LRS' } | ||
param keyVaultName string = '' | ||
|
||
resource storage 'Microsoft.Storage/storageAccounts@2023-01-01' = { | ||
name: name | ||
location: location | ||
tags: tags | ||
kind: kind | ||
sku: sku | ||
properties: { | ||
accessTier: accessTier | ||
allowBlobPublicAccess: allowBlobPublicAccess | ||
allowCrossTenantReplication: allowCrossTenantReplication | ||
allowSharedKeyAccess: allowSharedKeyAccess | ||
defaultToOAuthAuthentication: defaultToOAuthAuthentication | ||
dnsEndpointType: dnsEndpointType | ||
minimumTlsVersion: minimumTlsVersion | ||
networkAcls: networkAcls | ||
publicNetworkAccess: publicNetworkAccess | ||
supportsHttpsTrafficOnly: supportsHttpsTrafficOnly | ||
} | ||
|
||
resource blobServices 'blobServices' = if (!empty(containers)) { | ||
name: 'default' | ||
properties: { | ||
cors: { | ||
corsRules: corsRules | ||
} | ||
deleteRetentionPolicy: deleteRetentionPolicy | ||
} | ||
resource container 'containers' = [for container in containers: { | ||
name: container.name | ||
properties: { | ||
// todo: Warning use-safe-access: Use the safe access (.?) operator instead of checking object contents with the 'contains' function. [https://aka.ms/bicep/linter/use-safe-access] | ||
publicAccess: contains(container, 'publicAccess') ? container.publicAccess : 'None' | ||
} | ||
}] | ||
} | ||
|
||
resource fileServices 'fileServices' = if (!empty(files)) { | ||
name: 'default' | ||
properties: { | ||
cors: { | ||
corsRules: corsRules | ||
} | ||
shareDeleteRetentionPolicy: shareDeleteRetentionPolicy | ||
} | ||
} | ||
|
||
resource queueServices 'queueServices' = if (!empty(queues)) { | ||
name: 'default' | ||
properties: { | ||
|
||
} | ||
resource queue 'queues' = [for queue in queues: { | ||
name: queue.name | ||
properties: { | ||
metadata: {} | ||
} | ||
}] | ||
} | ||
|
||
resource tableServices 'tableServices' = if (!empty(tables)) { | ||
name: 'default' | ||
properties: {} | ||
// create tables pre-defined in aspire.bicep | ||
resource table 'tables' = [for table in tables: { | ||
name: table | ||
properties: {} | ||
}] | ||
} | ||
} | ||
|
||
// Save Storage Account Connection String in Key Vault Secret | ||
module keyVaultSecrets '../../core/security/keyvault-secret.bicep' = { | ||
name: 'keyVaultSecrets' | ||
params: { | ||
name: 'storage-connection-string' | ||
secretValue:'DefaultEndpointsProtocol=https;EndpointSuffix=${environment().suffixes.storage};AccountName=${storage.name};AccountKey=${storage.listKeys().keys[0].value};BlobEndpoint=${storage.properties.primaryEndpoints.blob};FileEndpoint=${storage.properties.primaryEndpoints.file};QueueEndpoint=${storage.properties.primaryEndpoints.queue};TableEndpoint=${storage.properties.primaryEndpoints.table}' | ||
keyVaultName:keyVaultName | ||
} | ||
} | ||
|
||
output id string = storage.id | ||
output name string = storage.name | ||
output primaryEndpoints object = storage.properties.primaryEndpoints |
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
17 changes: 17 additions & 0 deletions
17
src/AzureOpenAIProxy.ApiApp/Configurations/StorageAccountSettings.cs
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,17 @@ | ||
namespace AzureOpenAIProxy.ApiApp.Configurations; | ||
|
||
/// <summary> | ||
/// This represents the settings entity for storage account. | ||
/// </summary> | ||
public class StorageAccountSettings | ||
{ | ||
/// <summary> | ||
/// Gets the name of the configuration settings. | ||
/// </summary> | ||
public const string Name = "StorageAccount"; | ||
|
||
/// <summary> | ||
/// Gets or sets the <see cref="TableStorageSettings"/> instance. | ||
/// </summary> | ||
public TableStorageSettings TableStorage { get; set; } = new(); | ||
} |
17 changes: 17 additions & 0 deletions
17
src/AzureOpenAIProxy.ApiApp/Configurations/TableStorageSettings.cs
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,17 @@ | ||
namespace AzureOpenAIProxy.ApiApp.Configurations; | ||
|
||
/// <summary> | ||
/// This represents the settings entity for Azure Table Stroage. | ||
/// </summary> | ||
public class TableStorageSettings | ||
{ | ||
/// <summary> | ||
/// Gets the name of the configuration settings. | ||
/// </summary> | ||
public const string Name = "TableStorage"; | ||
|
||
/// <summary> | ||
/// Gets or sets the table name. | ||
/// </summary> | ||
public string? TableName { get; set; } | ||
} |
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
Oops, something went wrong.