Skip to content

Commit c00a306

Browse files
Revert "updated local dev scripts"
This reverts commit 9e50355.
1 parent 9e50355 commit c00a306

4 files changed

Lines changed: 5 additions & 166 deletions

File tree

content-gen/infra/main.bicep

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,15 +1006,3 @@ output CONTAINER_INSTANCE_FQDN string = enablePrivateNetworking ? '' : container
10061006

10071007
@description('Contains ACR Name')
10081008
output ACR_NAME string = acrResourceName
1009-
1010-
@description('Contains flag for Azure AI Foundry usage')
1011-
output USE_FOUNDRY bool = useFoundryMode ? true : false
1012-
1013-
@description('Contains Azure AI Project Endpoint')
1014-
output AZURE_AI_PROJECT_ENDPOINT string = aiFoundryAiProjectEndpoint
1015-
1016-
@description('Contains Azure AI Model Deployment Name')
1017-
output AZURE_AI_MODEL_DEPLOYMENT_NAME string = gptModelName
1018-
1019-
@description('Contains Azure AI Image Model Deployment Name (empty if none selected)')
1020-
output AZURE_AI_IMAGE_MODEL_DEPLOYMENT string = imageModelConfig[imageModelChoice].name

content-gen/infra/main.json

Lines changed: 1 addition & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"_generator": {
77
"name": "bicep",
88
"version": "0.39.26.7824",
9-
"templateHash": "12629934330443935294"
9+
"templateHash": "9059763401810969608"
1010
},
1111
"name": "Intelligent Content Generation Accelerator",
1212
"description": "Solution Accelerator for multimodal marketing content generation using Microsoft Agent Framework.\n"
@@ -172,13 +172,6 @@
172172
"description": "Optional. Enable monitoring for applicable resources (WAF-aligned)."
173173
}
174174
},
175-
"useFoundryMode": {
176-
"type": "bool",
177-
"defaultValue": true,
178-
"metadata": {
179-
"description": "Optional. Enable Azure AI Foundry mode for multi-agent orchestration."
180-
}
181-
},
182175
"enableScalability": {
183176
"type": "bool",
184177
"defaultValue": false,
@@ -33267,22 +33260,6 @@
3326733260
{
3326833261
"name": "RUNNING_IN_PRODUCTION",
3326933262
"value": "true"
33270-
},
33271-
{
33272-
"name": "USE_FOUNDRY",
33273-
"value": "[if(parameters('useFoundryMode'), 'true', 'false')]"
33274-
},
33275-
{
33276-
"name": "AZURE_AI_PROJECT_ENDPOINT",
33277-
"value": "[if(variables('useExistingAiFoundryAiProject'), format('https://{0}.services.ai.azure.com/api/projects/{1}', variables('aiFoundryAiServicesResourceName'), variables('aiFoundryAiProjectResourceName')), reference('aiFoundryAiServicesProject').outputs.apiEndpoint.value)]"
33278-
},
33279-
{
33280-
"name": "AZURE_AI_MODEL_DEPLOYMENT_NAME",
33281-
"value": "[parameters('gptModelName')]"
33282-
},
33283-
{
33284-
"name": "AZURE_AI_IMAGE_MODEL_DEPLOYMENT",
33285-
"value": "[variables('imageModelConfig')[parameters('imageModelChoice')].name]"
3328633263
}
3328733264
]
3328833265
}
@@ -33479,7 +33456,6 @@
3347933456
}
3348033457
},
3348133458
"dependsOn": [
33482-
"aiFoundryAiServicesProject",
3348333459
"userAssignedIdentity",
3348433460
"virtualNetwork"
3348533461
]
@@ -33716,34 +33692,6 @@
3371633692
"description": "Contains ACR Name"
3371733693
},
3371833694
"value": "[variables('acrResourceName')]"
33719-
},
33720-
"USE_FOUNDRY": {
33721-
"type": "bool",
33722-
"metadata": {
33723-
"description": "Contains flag for Azure AI Foundry usage"
33724-
},
33725-
"value": "[if(parameters('useFoundryMode'), true(), false())]"
33726-
},
33727-
"AZURE_AI_PROJECT_ENDPOINT": {
33728-
"type": "string",
33729-
"metadata": {
33730-
"description": "Contains Azure AI Project Endpoint"
33731-
},
33732-
"value": "[if(variables('useExistingAiFoundryAiProject'), format('https://{0}.services.ai.azure.com/api/projects/{1}', variables('aiFoundryAiServicesResourceName'), variables('aiFoundryAiProjectResourceName')), reference('aiFoundryAiServicesProject').outputs.apiEndpoint.value)]"
33733-
},
33734-
"AZURE_AI_MODEL_DEPLOYMENT_NAME": {
33735-
"type": "string",
33736-
"metadata": {
33737-
"description": "Contains Azure AI Model Deployment Name"
33738-
},
33739-
"value": "[parameters('gptModelName')]"
33740-
},
33741-
"AZURE_AI_IMAGE_MODEL_DEPLOYMENT": {
33742-
"type": "string",
33743-
"metadata": {
33744-
"description": "Contains Azure AI Image Model Deployment Name (empty if none selected)"
33745-
},
33746-
"value": "[variables('imageModelConfig')[parameters('imageModelChoice')].name]"
3374733695
}
3374833696
}
3374933697
}

content-gen/scripts/local_dev.ps1

Lines changed: 2 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ $ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
3131
$ProjectRoot = Split-Path -Parent $ScriptDir
3232
$SrcDir = Join-Path $ProjectRoot "src"
3333
$BackendDir = Join-Path $SrcDir "backend"
34-
$FrontendDir = Join-Path $SrcDir "app\frontend"
34+
$FrontendDir = Join-Path $SrcDir "frontend"
3535

3636
# Default ports
3737
$BackendPort = if ($env:BACKEND_PORT) { $env:BACKEND_PORT } else { "5000" }
@@ -174,7 +174,7 @@ function Ensure-CosmosDBRole {
174174
$roleDefId = "00000000-0000-0000-0000-000000000002"
175175

176176
# Check if role already assigned
177-
$existing = az cosmosdb sql role assignment list --resource-group $resourceGroup --account-name $cosmosAccount --query "[?principalId=='$signedUserId' && contains(roleDefinitionId, '$roleDefId')].id | [0]" -o tsv 2>$null
177+
$existing = az cosmosdb sql role assignment list --resource-group $resourceGroup --account-name $cosmosAccount --query "[?principalId=='$signedUserId'].id" -o tsv 2>$null
178178

179179
if ($existing) {
180180
Write-Success "Cosmos DB role already assigned."
@@ -189,53 +189,6 @@ function Ensure-CosmosDBRole {
189189
}
190190
}
191191

192-
function Ensure-StorageRole {
193-
Write-Info "Checking Storage Blob Data Contributor role..."
194-
195-
# Get env vars
196-
$storageAccount = $null
197-
$resourceGroup = $null
198-
if (Test-Path ".env") {
199-
Get-Content ".env" | ForEach-Object {
200-
if ($_ -match "^AZURE_BLOB_ACCOUNT_NAME=(.*)$") { $storageAccount = $matches[1].Trim('"').Trim("'") }
201-
if ($_ -match "^RESOURCE_GROUP_NAME=(.*)$") { $resourceGroup = $matches[1].Trim('"').Trim("'") }
202-
}
203-
}
204-
205-
if (-not $storageAccount -or -not $resourceGroup) {
206-
Write-Error "AZURE_BLOB_ACCOUNT_NAME or RESOURCE_GROUP_NAME not found in .env"
207-
exit 1
208-
}
209-
210-
$signedUserId = az ad signed-in-user show --query id -o tsv 2>$null
211-
if (-not $signedUserId) {
212-
Write-Error "Could not get signed-in user ID."
213-
exit 1
214-
}
215-
216-
# Get storage account resource ID
217-
$storageResourceId = az storage account show --name $storageAccount --resource-group $resourceGroup --query id -o tsv 2>$null
218-
if (-not $storageResourceId) {
219-
Write-Error "Could not get storage account resource ID."
220-
exit 1
221-
}
222-
223-
$roleId = "Storage Blob Data Contributor"
224-
$existing = az role assignment list --assignee $signedUserId --role $roleId --scope $storageResourceId --query "[0].id" -o tsv 2>$null
225-
226-
if ($existing) {
227-
Write-Success "Storage Blob Data Contributor role already assigned."
228-
} else {
229-
Write-Info "Assigning Storage Blob Data Contributor role..."
230-
az role assignment create --assignee $signedUserId --role $roleId --scope $storageResourceId --output none 2>$null
231-
if ($LASTEXITCODE -ne 0) {
232-
Write-Error "Failed to assign Storage Blob Data Contributor role."
233-
exit 1
234-
}
235-
Write-Success "Storage Blob Data Contributor role assigned."
236-
}
237-
}
238-
239192
# =============================================================================
240193
# Setup Function
241194
# =============================================================================
@@ -386,7 +339,6 @@ function Start-Backend {
386339
Ensure-AzureLogin
387340
Ensure-AzureAIUserRole
388341
Ensure-CosmosDBRole
389-
Ensure-StorageRole
390342

391343
# Activate virtual environment
392344
if (Test-Path ".venv") {
@@ -482,7 +434,6 @@ function Start-All {
482434
Ensure-AzureLogin
483435
Ensure-AzureAIUserRole
484436
Ensure-CosmosDBRole
485-
Ensure-StorageRole
486437

487438
Write-Info "Starting backend and frontend in parallel..."
488439
Write-Info ""

content-gen/scripts/local_dev.sh

Lines changed: 2 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
3434
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
3535
SRC_DIR="$PROJECT_ROOT/src"
3636
BACKEND_DIR="$SRC_DIR/backend"
37-
FRONTEND_DIR="$SRC_DIR/app/frontend"
37+
FRONTEND_DIR="$SRC_DIR/frontend"
3838

3939
# Default ports
4040
BACKEND_PORT=${BACKEND_PORT:-5000}
@@ -168,7 +168,7 @@ ensure_cosmosdb_role() {
168168

169169
# Check if role already assigned
170170
local existing
171-
existing=$(az cosmosdb sql role assignment list --resource-group "$resource_group" --account-name "$cosmos_account" --query "[?principalId=='$signed_user_id' && contains(roleDefinitionId, '$role_def_id')].id | [0]" -o tsv 2>/dev/null)
171+
existing=$(az cosmosdb sql role assignment list --resource-group "$resource_group" --account-name "$cosmos_account" --query "[?principalId=='$signed_user_id'].id" -o tsv 2>/dev/null)
172172

173173
if [ -n "$existing" ]; then
174174
print_success "Cosmos DB role already assigned."
@@ -183,52 +183,6 @@ ensure_cosmosdb_role() {
183183
fi
184184
}
185185

186-
ensure_storage_role() {
187-
print_info "Checking Storage Blob Data Contributor role..."
188-
189-
local storage_account=""
190-
local resource_group=""
191-
if [ -f ".env" ]; then
192-
storage_account=$(grep "^AZURE_BLOB_ACCOUNT_NAME=" .env | cut -d'=' -f2- | tr -d '"' | tr -d "'" || echo "")
193-
resource_group=$(grep "^RESOURCE_GROUP_NAME=" .env | cut -d'=' -f2- | tr -d '"' | tr -d "'" || echo "")
194-
fi
195-
196-
if [ -z "$storage_account" ] || [ -z "$resource_group" ]; then
197-
print_error "AZURE_BLOB_ACCOUNT_NAME or RESOURCE_GROUP_NAME not found in .env"
198-
exit 1
199-
fi
200-
201-
local signed_user_id
202-
signed_user_id=$(az ad signed-in-user show --query id -o tsv 2>/dev/null)
203-
if [ -z "$signed_user_id" ]; then
204-
print_error "Could not get signed-in user ID."
205-
exit 1
206-
fi
207-
208-
# Get storage account resource ID
209-
local storage_resource_id
210-
storage_resource_id=$(az storage account show --name "$storage_account" --resource-group "$resource_group" --query id -o tsv 2>/dev/null)
211-
if [ -z "$storage_resource_id" ]; then
212-
print_error "Could not get storage account resource ID."
213-
exit 1
214-
fi
215-
216-
local role_name="Storage Blob Data Contributor"
217-
local existing
218-
existing=$(MSYS_NO_PATHCONV=1 az role assignment list --assignee "$signed_user_id" --role "$role_name" --scope "$storage_resource_id" --query "[0].id" -o tsv 2>/dev/null)
219-
220-
if [ -n "$existing" ]; then
221-
print_success "Storage Blob Data Contributor role already assigned."
222-
else
223-
print_info "Assigning Storage Blob Data Contributor role..."
224-
if ! MSYS_NO_PATHCONV=1 az role assignment create --assignee "$signed_user_id" --role "$role_name" --scope "$storage_resource_id" --output none 2>/dev/null; then
225-
print_error "Failed to assign Storage Blob Data Contributor role."
226-
exit 1
227-
fi
228-
print_success "Storage Blob Data Contributor role assigned."
229-
fi
230-
}
231-
232186
# =============================================================================
233187
# Setup Function
234188
# =============================================================================
@@ -369,7 +323,6 @@ start_backend() {
369323
ensure_azure_login
370324
ensure_azure_ai_user_role
371325
ensure_cosmosdb_role
372-
ensure_storage_role
373326

374327
# Activate virtual environment
375328
if [ -d ".venv" ]; then
@@ -457,7 +410,6 @@ start_all() {
457410
ensure_azure_login
458411
ensure_azure_ai_user_role
459412
ensure_cosmosdb_role
460-
ensure_storage_role
461413

462414
print_info "Starting backend and frontend in parallel..."
463415
print_info ""

0 commit comments

Comments
 (0)