Skip to content

Commit ec2a094

Browse files
fix: Added DIsable local Auth for Now Waf deployment to work
1 parent fd4d917 commit ec2a094

2 files changed

Lines changed: 151 additions & 11 deletions

File tree

Deployment/resourcedeployment.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ try {
713713
ValidateVariableIsNullOrEmpty -variableValue $deploymentResult.ResourceGroupName -variableName "Resource group name"
714714

715715
ValidateVariableIsNullOrEmpty -variableValue $deploymentResult.AksName -variableName "AKS cluster name"
716-
716+
717717
# Get vmss resource group name
718718
$vmssResourceGroupName = $(az aks show --resource-group $deploymentResult.ResourceGroupName --name $deploymentResult.AksName --query nodeResourceGroup --output tsv)
719719

@@ -728,7 +728,7 @@ try {
728728

729729
# Create System Assigned Managed Identity
730730
$systemAssignedIdentity = $(az vmss identity assign --resource-group $vmssResourceGroupName --name $vmssName --query systemAssignedIdentity --output tsv)
731-
731+
732732
# Validate if System Assigned Identity is null or empty
733733
ValidateVariableIsNullOrEmpty -variableValue $systemAssignedIdentity -variableName "System-assigned managed identity"
734734

@@ -737,14 +737,14 @@ try {
737737

738738
# Assign the role for aks system assigned managed identity to App Configuration Data Reader role with the scope of Resourcegroup
739739
az role assignment create --assignee $systemAssignedIdentity --role "App Configuration Data Reader" --scope $deploymentResult.ResourceGroupId
740-
740+
741741
# Assign the role for aks system assigned managed identity to Azure blob storage Data Contributor role with the scope of Storage Account
742742
Write-Host "Assign the role for aks system assigned managed identity to App Storage Blob Data Contributor role" -ForegroundColor Green
743-
az role assignment create --assignee $systemAssignedIdentity --role "Storage Blob Data Contributor" --scope "/subscriptions/$subscriptionID/resourceGroups/$($deploymentResult.ResourceGroupName)/providers/Microsoft.Storage/storageAccounts/$($deploymentResult.StorageAccountName)"
743+
az role assignment create --assignee $systemAssignedIdentity --role "Storage Blob Data Contributor" --scope "/subscriptions/$($deploymentResult.SubscriptionId)/resourceGroups/$($deploymentResult.ResourceGroupName)/providers/Microsoft.Storage/storageAccounts/$($deploymentResult.StorageAccountName)"
744744

745745
# Assign the role for aks system assigned managed identity to Azure Queue Data Contributor role with the scope of Storage Account
746746
Write-Host "Assign the role for aks system assigned managed identity to App Storage Queue Data Contributor role" -ForegroundColor Green
747-
az role assignment create --assignee $systemAssignedIdentity --role "Storage Queue Data Contributor" --scope "/subscriptions/$subscriptionID/resourceGroups/$($deploymentResult.ResourceGroupName)/providers/Microsoft.Storage/storageAccounts/$($deploymentResult.StorageAccountName)"
747+
az role assignment create --assignee $systemAssignedIdentity --role "Storage Queue Data Contributor" --scope "/subscriptions/$($deploymentResult.SubscriptionId)/resourceGroups/$($deploymentResult.ResourceGroupName)/providers/Microsoft.Storage/storageAccounts/$($deploymentResult.StorageAccountName)"
748748

749749
# 8. Update aks nodepools to updated new role
750750
try {

infra/main.bicep

Lines changed: 146 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ For model limits specific to your region, refer to the documentation at https://
3939
''')
4040
@minValue(1)
4141
@maxValue(40)
42-
param embeddingDeploymentCapacity int = 30
42+
param embeddingDeploymentCapacity int = 1
4343

4444
@description('Optional. The tags to apply to all deployed Azure resources.')
4545
param tags resourceInput<'Microsoft.Resources/resourceGroups@2025-04-01'>.tags = {}
@@ -119,15 +119,15 @@ var useExistingLogAnalytics = !empty(existingLogAnalyticsWorkspaceId)
119119

120120
var chatGpt = {
121121
modelName: 'gpt-4.1-mini'
122-
deploymentName: 'chat'
122+
deploymentName: 'gpt-4.1-mini'
123123
deploymentVersion: '2025-04-14'
124124
deploymentCapacity: chatGptDeploymentCapacity
125125
}
126126

127127
var embedding = {
128-
modelName: 'text-embedding-ada-002'
129-
deploymentName: 'embedding'
130-
deploymentVersion: '2'
128+
modelName: 'text-embedding-3-large'
129+
deploymentName: 'text-embedding-3-large'
130+
deploymentVersion: '1'
131131
deploymentCapacity: embeddingDeploymentCapacity
132132
}
133133

@@ -387,7 +387,7 @@ module avmAppConfig 'br/public:avm/res/app-configuration/configuration-store:0.6
387387
sku: 'Standard'
388388
enableTelemetry: enableTelemetry
389389
tags: tags
390-
390+
disableLocalAuth: false
391391
roleAssignments: [
392392
{
393393
principalId: userAssignedIdentity.outputs.principalId
@@ -396,6 +396,144 @@ module avmAppConfig 'br/public:avm/res/app-configuration/configuration-store:0.6
396396
}
397397
]
398398

399+
// keyValues: [
400+
// {
401+
// name: 'Application:AIServices:GPT-4o-mini:Endpoint'
402+
// value: avmOpenAi.outputs.endpoint
403+
// }
404+
// {
405+
// name: 'Application:AIServices:GPT-4o-mini:Key'
406+
// value: '' // Todo: avmOpenAi.outputs.
407+
// }
408+
// {
409+
// name: 'Application:AIServices:GPT-4o-mini:ModelName'
410+
// value: chatGpt.modelName
411+
// }
412+
// {
413+
// name: 'Application:AIServices:GPT-4o:Endpoint'
414+
// value: avmOpenAi.outputs.endpoint
415+
// }
416+
// {
417+
// name: 'Application:AIServices:GPT-4o:Key'
418+
// value: '{gpt-4o-mini-apikey}'
419+
// }
420+
// {
421+
// name: 'Application:AIServices:GPT-4o:ModelName'
422+
// value: chatGpt.modelName
423+
// }
424+
// {
425+
// name: 'Application:AIServices:TextEmbedding:Endpoint'
426+
// value: avmOpenAi.outputs.endpoint
427+
// }
428+
// {
429+
// name: 'Application:AIServices:TextEmbedding:Key'
430+
// value: '{textembedding-key}'
431+
// }
432+
// {
433+
// name: 'Application:AIServices:TextEmbedding:ModelName'
434+
// value: embedding.modelName
435+
// }
436+
// {
437+
// name: 'Application:Services:CognitiveService:DocumentIntelligence:APIKey'
438+
// value: documentIntelligence.outputs.exportedSecrets.primaryAdminKey
439+
// }
440+
// {
441+
// name: 'Application:Services:CognitiveService:DocumentIntelligence:Endpoint'
442+
// value: documentIntelligence.outputs.endpoint
443+
// }
444+
// {
445+
// name: 'Application:Services:KernelMemory:Endpoint'
446+
// value: 'http://kernelmemory-service'
447+
// }
448+
// {
449+
// name: 'Application:Services:PersistentStorage:CosmosMongo:Collections:ChatHistory:Collection'
450+
// value: 'ChatHistory'
451+
// }
452+
// {
453+
// name: 'Application:Services:PersistentStorage:CosmosMongo:Collections:ChatHistory:Database'
454+
// value: 'DPS'
455+
// }
456+
// {
457+
// name: 'Application:Services:PersistentStorage:CosmosMongo:Collections:DocumentManager:Collection'
458+
// value: 'Documents'
459+
// }
460+
// {
461+
// name: 'Application:Services:PersistentStorage:CosmosMongo:Collections:DocumentManager:Database'
462+
// value: 'DPS'
463+
// }
464+
// {
465+
// name: 'Application:Services:PersistentStorage:CosmosMongo:ConnectionString'
466+
// value: avmCosmosDB.outputs.primaryReadWriteConnectionString
467+
// }
468+
// {
469+
// name: 'Application:Services:AzureAISearch:APIKey'
470+
// value: avmSearchSearchServices.outputs.exportedSecrets.primaryAdminKey
471+
// }
472+
// {
473+
// name: 'Application:Services:AzureAISearch:Endpoint'
474+
// value: 'https://${avmSearchSearchServices.outputs.name}.search.windows.net'
475+
// }
476+
// {
477+
// name: 'KernelMemory:Services:AzureAIDocIntel:APIKey'
478+
// value: documentIntelligence.outputs.exportedSecrets.primaryAdminKey
479+
// }
480+
// {
481+
// name: 'KernelMemory:Services:AzureAIDocIntel:Endpoint'
482+
// value: documentIntelligence.outputs.endpoint
483+
// }
484+
// {
485+
// name: 'KernelMemory:Services:AzureAISearch:APIKey'
486+
// value: avmSearchSearchServices.outputs.exportedSecrets.primaryAdminKey
487+
// }
488+
// {
489+
// name: 'KernelMemory:Services:AzureAISearch:Endpoint'
490+
// value: 'https://${avmSearchSearchServices.outputs.name}.search.windows.net'
491+
// }
492+
// {
493+
// name: 'KernelMemory:Services:AzureBlobs:Account'
494+
// value: avmStorageAccount.outputs.name
495+
// }
496+
// {
497+
// name: 'KernelMemory:Services:AzureBlobs:ConnectionString'
498+
// value: avmStorageAccount.outputs.primaryConnectionString
499+
// }
500+
// {
501+
// name: 'KernelMemory:Services:AzureBlobs:Container'
502+
// value: 'smemory'
503+
// }
504+
// {
505+
// name: 'KernelMemory:Services:AzureOpenAIEmbedding:APIKey'
506+
// value: '{azureopenaiembedding-apikey}'
507+
// }
508+
// {
509+
// name: 'KernelMemory:Services:AzureOpenAIEmbedding:Deployment'
510+
// value: embedding.deploymentName
511+
// }
512+
// {
513+
// name: 'KernelMemory:Services:AzureOpenAIEmbedding:Endpoint'
514+
// value: avmOpenAi.outputs.endpoint
515+
// }
516+
// {
517+
// name: 'KernelMemory:Services:AzureOpenAIText:APIKey'
518+
// value: '{azureopenaitext-apikey}'
519+
// }
520+
// {
521+
// name: 'KernelMemory:Services:AzureOpenAIText:Deployment'
522+
// value: chatGpt.deploymentName
523+
// }
524+
// {
525+
// name: 'KernelMemory:Services:AzureOpenAIText:Endpoint'
526+
// value: avmOpenAi.outputs.endpoint
527+
// }
528+
// {
529+
// name: 'KernelMemory:Services:AzureQueues:Account'
530+
// value: avmStorageAccount.outputs.name
531+
// }
532+
// {
533+
// name: 'KernelMemory:Services:AzureQueues:ConnectionString'
534+
// value: avmStorageAccount.outputs.primaryConnectionString
535+
// }
536+
// ]
399537
// WAF aligned networking
400538
publicNetworkAccess: enablePrivateNetworking ? 'Disabled' : 'Enabled'
401539
privateEndpoints: enablePrivateNetworking
@@ -560,6 +698,7 @@ module avmOpenAi 'br/public:avm/res/cognitive-services/account:0.13.2' = {
560698
tags: tags
561699
enableTelemetry: enableTelemetry
562700
customSubDomainName: openAiAccountName
701+
disableLocalAuth: false
563702
managedIdentities: {
564703
systemAssigned: true
565704
}
@@ -619,6 +758,7 @@ module documentIntelligence 'br/public:avm/res/cognitive-services/account:0.13.2
619758
tags: tags
620759
sku: 'S0'
621760
customSubDomainName: docIntelAccountName
761+
disableLocalAuth: false
622762
managedIdentities: {
623763
systemAssigned: true
624764
}

0 commit comments

Comments
 (0)