Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
231 commits
Select commit Hold shift + click to select a range
b1bd9a5
fix missing stream response when TOKENPROCESSOR was unknown, fix miss…
nagendramishr Aug 11, 2025
909ce9d
normal stream processing
nagendramishr Aug 13, 2025
2add106
implement batch processing
nagendramishr Aug 13, 2025
3eed92d
add AsyncProcessingERror, rename InQueue => Queued, RetryAdterDelay =…
nagendramishr Aug 13, 2025
7018b3f
use updated status enum, add x-Async-Error if async setup fails
nagendramishr Aug 13, 2025
8ca82dd
log exception with details on why blob failed
nagendramishr Aug 13, 2025
437e919
added AsyncProcessing
nagendramishr Aug 13, 2025
571ec4b
throw BlobWriterException on blob exceptions
nagendramishr Aug 13, 2025
adfa4db
use updated Enum
nagendramishr Aug 13, 2025
1c029e3
remove compiler warning
nagendramishr Aug 13, 2025
6072d66
log the operation on error
nagendramishr Aug 13, 2025
08af262
auto-format, updated disposal to follow consistent pattern.
nagendramishr Aug 13, 2025
7ba78ac
refactor to add a baseclass
nagendramishr Aug 13, 2025
5845469
refactor to add a baseclass
nagendramishr Aug 13, 2025
a8bb41c
added high level doc on disposal
nagendramishr Aug 13, 2025
4287703
refactor code, streamline implementation, Trigger DefaultStreamProces…
nagendramishr Aug 14, 2025
ea726d4
added 202 for async jobs
nagendramishr Aug 15, 2025
f58ffa4
make log details debug level
nagendramishr Aug 15, 2025
50a7e7c
bypass the task delay when its less than 10 ms
nagendramishr Aug 15, 2025
3dd6b5f
calculate delay based on when request was enqueued
nagendramishr Aug 15, 2025
4bdda66
remove unnecessary string lookup
nagendramishr Aug 15, 2025
19a4ee4
update to 2.2.4.p2, add release notes
nagendramishr Aug 15, 2025
14d7cea
Merge pull request #87 from microsoft/feature/eventgrid
nagendramishr Aug 15, 2025
7da3eb1
buffer output for performance improvement, uncomment parsing code, re…
nagendramishr Aug 18, 2025
faed47a
update to v2.2.4.p3
nagendramishr Aug 18, 2025
7be932d
Merge pull request #88 from microsoft/feature/eventgrid
nagendramishr Aug 18, 2025
47422ba
consolidated async mode into single config: AsyncClientConfigFieldNam…
nagendramishr Aug 21, 2025
46e283a
added architecture diagram
nagendramishr Aug 21, 2025
c0d07cc
added sample non-stream calling
nagendramishr Aug 21, 2025
e2b0b64
added sample path with response
nagendramishr Aug 21, 2025
d672844
added sample path with response
nagendramishr Aug 21, 2025
45a6c0a
remove debug variables
nagendramishr Aug 21, 2025
ffbc73f
add sample openai response
nagendramishr Aug 21, 2025
0c599ed
updated to use new config
nagendramishr Aug 21, 2025
cf7516e
added additional files not to check in
nagendramishr Aug 21, 2025
1856f6a
bug fix for 404 response throwing exception, refactor processor selec…
nagendramishr Aug 21, 2025
be6c41f
added Multiline All Usage parser
nagendramishr Aug 22, 2025
e51515a
moved ExtractAllFields to JsonStreamProcessor
nagendramishr Aug 22, 2025
0301d11
update to support up to a configurable number of backlog lines, simpl…
nagendramishr Aug 22, 2025
b189d09
added MultiLineAllUsage processor
nagendramishr Aug 22, 2025
b0dc932
added multiline response
nagendramishr Aug 22, 2025
2ce5022
updated description with scenarios
nagendramishr Aug 22, 2025
6fc0e95
updated to 2.2.4.p4
nagendramishr Aug 22, 2025
c2de565
Merge pull request #89 from microsoft/feature/eventgrid
nagendramishr Aug 22, 2025
0ed0862
updated to keep a journal
nagendramishr Aug 28, 2025
75ec777
add server constant to represent the server related blob writer data
nagendramishr Aug 28, 2025
8f17c08
fix token parsing issues in multiline parser
nagendramishr Aug 28, 2025
f103925
remove ProxyStreamWriter
nagendramishr Aug 28, 2025
b693d1e
add debug logging
nagendramishr Aug 28, 2025
adbc062
add debug logging, add ReadBlobAsStreamAsync
nagendramishr Aug 28, 2025
cddeae2
added additional response formats
nagendramishr Aug 28, 2025
0c83e5c
add initial version of versionized DTO for backing up Requests to blob
nagendramishr Aug 28, 2025
e11452b
remove ProxyStreamWriter, replace StorageDbRequestStorageService with…
nagendramishr Aug 28, 2025
4b9493f
replace Usage. at beginning of token metrics
nagendramishr Aug 28, 2025
495824b
implement backup for incoming requests , delete for completed requests
nagendramishr Aug 29, 2025
5735266
updated to v2.2.p5
nagendramishr Aug 29, 2025
332c97b
Merge pull request #90 from microsoft/feature/eventgrid
nagendramishr Aug 29, 2025
c5887d5
added initial BackupAPI code
nagendramishr Sep 3, 2025
80105e1
added initial BackupAPI shared model code
nagendramishr Sep 3, 2025
5b96bca
remove AsyncTriggered, EspiresAtString, ExpireReason from backup DTO
nagendramishr Sep 3, 2025
dfae0ed
add RequestAPIDocument status to the DTO
nagendramishr Sep 3, 2025
9d200aa
add the initial backup service API caller
nagendramishr Sep 3, 2025
96ffae9
call the backup API service
nagendramishr Sep 3, 2025
0032dc1
stop the backup API service just before the servicebus
nagendramishr Sep 3, 2025
62b0ead
capture userprofile name apart from the userid
nagendramishr Sep 3, 2025
84e589c
make backup status updates for async tasks
nagendramishr Sep 3, 2025
f3ba072
make reference to the Shared Backup API model
nagendramishr Sep 3, 2025
9d635c7
fix update record which was readonly, add id
nagendramishr Sep 5, 2025
09d0961
rename CoalesceDelayMs to FlushIntervalMs, rework shutdown flush
nagendramishr Sep 5, 2025
d10059f
readability
nagendramishr Sep 5, 2025
16ffb14
remove unsed vars
nagendramishr Sep 5, 2025
bce0cee
implement cancel async operation, fix shutdown sequence to kill async…
nagendramishr Sep 5, 2025
c03390f
update version
nagendramishr Sep 5, 2025
aa50394
remove debug
nagendramishr Sep 5, 2025
e2c52e5
added AsyncBackupAPIURL
nagendramishr Sep 5, 2025
88b12c3
Merge pull request #91 from microsoft/feature/eventgrid
nagendramishr Sep 5, 2025
48203a6
initial checkin of deploy scripts
nagendramishr Sep 10, 2025
f46815e
functions to insert into cosmos
nagendramishr Sep 10, 2025
b93706a
functions to insert into cosmos
nagendramishr Sep 10, 2025
9ea88a3
use the service bus to submit status updates instead of direct HTTPS …
nagendramishr Sep 10, 2025
888370e
reuse more efficient backsup API flush mechanism
nagendramishr Sep 10, 2025
8b142ef
added code to get the queue sender
nagendramishr Sep 10, 2025
7bde9ff
no need to keep the unused isRunning method
nagendramishr Sep 10, 2025
0d9f3e7
sample code to send to service bus queue using managed identity
nagendramishr Sep 10, 2025
bbe5a5c
script to setup cosmosdb access for azure function
nagendramishr Sep 10, 2025
c9d7cb3
add AsyncFeeder service, rename ServiceBusSenderFactory to ServiceBus…
nagendramishr Sep 11, 2025
2ae48c1
add debug logs
nagendramishr Sep 12, 2025
673a55d
add debug logs
nagendramishr Sep 12, 2025
553ef87
add toRequestData converter
nagendramishr Sep 12, 2025
2c5d566
initial implementation of rehydration
nagendramishr Sep 12, 2025
aaad489
fix shutdown
nagendramishr Sep 12, 2025
3d2cd0c
rename ServiceBusSenderFactory to ServiceBusFactory
nagendramishr Sep 12, 2025
3edadf4
add logging on shutdown
nagendramishr Sep 12, 2025
5d41344
enhancement for shutdown
nagendramishr Sep 12, 2025
3419009
enhancement for gemini
nagendramishr Sep 12, 2025
2eea36b
enhancement for shutdown
nagendramishr Sep 12, 2025
7b1c6ac
added Resubmitted and Reprocessing
nagendramishr Sep 12, 2025
554cd34
add RestoreAsync to rehydrate an async stream processor
nagendramishr Sep 12, 2025
7921b62
function that refeeds abandobandoned requests into the service bus.
nagendramishr Sep 16, 2025
3210ec0
added AsyncHydrated and setBody to get re-hydration working
nagendramishr Sep 16, 2025
812e90d
add check for blob exists, don't rewrite blobs unnecessarly
nagendramishr Sep 16, 2025
80ea8b5
move NullBlobWriter to its own class
nagendramishr Sep 16, 2025
d852634
add check for blob exists, don't rewrite blobs unnecessarly
nagendramishr Sep 16, 2025
73821c0
return a RequestData object, not a DTO
nagendramishr Sep 16, 2025
2ddd51a
rehydtate the entire requestData object
nagendramishr Sep 16, 2025
8a1c96e
redo the version check on the DTO
nagendramishr Sep 16, 2025
648f1d6
store the proxy event data as well
nagendramishr Sep 16, 2025
53ecbf9
reconstruct the proxyevent
nagendramishr Sep 16, 2025
254be1a
remove debug
nagendramishr Sep 16, 2025
e5cec42
add logic to inject recovered work into the queue
nagendramishr Sep 16, 2025
9cf09bb
seperate out body from the request in the blob storage
nagendramishr Sep 16, 2025
ae9c554
move logs to debug
nagendramishr Sep 16, 2025
afa8c77
update to handle rehydrated work, which doesn't have a lcontext
nagendramishr Sep 16, 2025
4296255
remove unused code
nagendramishr Sep 16, 2025
1113ea5
add code for service bus processing
nagendramishr Sep 16, 2025
a7b79b7
allow rehydrated messages to be refed
nagendramishr Sep 16, 2025
bdf266e
managed identity test for service bus
nagendramishr Sep 16, 2025
79c8a5f
add service bus
nagendramishr Sep 16, 2025
f99ed51
updated release notes, updated version to 2.2.6
nagendramishr Sep 17, 2025
89a52e9
Merge pull request #92 from microsoft/feature/eventgrid
nagendramishr Sep 17, 2025
32b6343
add code to check for x-backend-affinity
nagendramishr Sep 18, 2025
3ffae06
implement session affinity lookup
nagendramishr Sep 18, 2025
8d4bf47
refactor for readability, allow a requeue task to be cancelled and ba…
nagendramishr Sep 18, 2025
227b71a
added comment
nagendramishr Sep 18, 2025
df722a8
vscode configs
nagendramishr Sep 22, 2025
af48e84
sample embeddings doc
nagendramishr Sep 22, 2025
89d589d
bug fixes for throttled backends, add affinity header
nagendramishr Sep 23, 2025
af3addc
fix for throttled backend
nagendramishr Sep 23, 2025
4671be3
merge
nagendramishr Sep 23, 2025
624f806
add background request id
nagendramishr Sep 25, 2025
5ec8a1b
readability fix
nagendramishr Sep 25, 2025
889d3c4
add background request checker
nagendramishr Sep 25, 2025
3469f20
add PostProcessing to prevent re-processing of background requests wh…
nagendramishr Sep 25, 2025
0dae43c
add BackupAPI service, normal async request, background openai async …
nagendramishr Sep 25, 2025
f53b13b
add BackupAPI service, send status updates on RequestAPIDocumentStatu…
nagendramishr Sep 25, 2025
d9a30e2
update signiture to update requestData in place
nagendramishr Sep 25, 2025
7203887
add background status
nagendramishr Sep 25, 2025
3997cd6
update requestData in place
nagendramishr Sep 25, 2025
3301d38
normal async request, background openai async request
nagendramishr Sep 25, 2025
efe54f1
normal async request, background openai async request
nagendramishr Sep 25, 2025
509c2de
normal async request, background openai async request
nagendramishr Sep 25, 2025
5886d5b
refactor to move status updates to requestData
nagendramishr Sep 25, 2025
420ed19
add request api backup
nagendramishr Sep 25, 2025
274b93d
add code to call recovery processor for async and background requests
nagendramishr Sep 25, 2025
e43606d
remove references to background worker
nagendramishr Sep 25, 2025
9856175
add code to deteck background request id
nagendramishr Sep 25, 2025
6bf06b9
add code to deteck background request id
nagendramishr Sep 25, 2025
fffb469
updated policy to return 429 if unthrottled && shouldRequeue
nagendramishr Sep 26, 2025
d26f994
share OutputData across functions
nagendramishr Sep 26, 2025
9020dd2
copy across MID as well
nagendramishr Sep 26, 2025
fbfe57e
add DeepCopy, remove unused status
nagendramishr Sep 26, 2025
fb92b29
track all fields
nagendramishr Sep 26, 2025
4bdb2f6
add content-type header, remove unnecessary status change
nagendramishr Sep 26, 2025
eabf9f7
log Backend Log, don't change to expired log type on error
nagendramishr Sep 26, 2025
fddcec1
add label on log
nagendramishr Sep 26, 2025
11642de
updated version to 2.2.7
nagendramishr Sep 26, 2025
87d19f2
Merge pull request #93 from microsoft/feature/eventgrid
nagendramishr Sep 26, 2025
64144c4
remove functions not being used
nagendramishr Sep 29, 2025
40137f4
refactor to move BackendOptions and BackendHostConfiguration classes …
nagendramishr Sep 29, 2025
101919f
reformat startup and shutdown output logs for readability
nagendramishr Sep 29, 2025
5534324
added process flow diagram, log response code
nagendramishr Oct 2, 2025
d60c50c
moved cleanup code into RequestData for when request completes
nagendramishr Oct 2, 2025
08fbc5a
refactor to simlify logic, move code into DetermineStreamProcessor an…
nagendramishr Oct 2, 2025
f24cc9f
comment out hard coded values
nagendramishr Oct 2, 2025
3c54a94
add gemini-2.5 response
nagendramishr Oct 2, 2025
3bd57f2
add 412 error
nagendramishr Oct 2, 2025
0483b3c
added tests for gemini-2.5-pro and fix parsing
nagendramishr Oct 2, 2025
859fc29
updated release notes and version to 2.2.7.P1
nagendramishr Oct 2, 2025
05afc8c
Merge pull request #95 from microsoft/feature/eventgrid
nagendramishr Oct 2, 2025
85c8ce7
add script to call proxy
nagendramishr Oct 6, 2025
7d6ea38
re-org folder structure, move files into
nagendramishr Oct 9, 2025
c221ec4
updated with model = 4.1
nagendramishr Oct 9, 2025
b017269
rename to call-proxy, updated to issue and recall background requests
nagendramishr Oct 9, 2025
c0a9af7
moved into proxy/streamProcessor folder
nagendramishr Oct 9, 2025
0f0e0d8
fixes for bckground processing
nagendramishr Oct 9, 2025
cc7d9ee
dynamically construct URL to check for background task completed
nagendramishr Oct 9, 2025
4e750fc
rename ProcessRequestAsync to ConvertDocumentToRequest
nagendramishr Oct 9, 2025
499b24d
copy over fullURL
nagendramishr Oct 9, 2025
c389eeb
add logDebug messages
nagendramishr Oct 9, 2025
f270c08
remove unnecessary System.Threading.Tasks
nagendramishr Oct 9, 2025
2c57af1
add GUID and async status to log
nagendramishr Oct 9, 2025
8a529ef
add and copy over fullURL
nagendramishr Oct 9, 2025
0740507
change condition for determining new
nagendramishr Oct 9, 2025
b454604
add GUID and async status to log
nagendramishr Oct 9, 2025
57b40a5
fix bug where 404 would return a 429
nagendramishr Oct 9, 2025
1288a4b
stop tracking new2.xml
nagendramishr Oct 9, 2025
b181d23
rename to ArrayOfString
nagendramishr Oct 9, 2025
67ae76f
add DependancyHeaders
nagendramishr Oct 9, 2025
b4f3b04
move async related paramters together
nagendramishr Oct 10, 2025
d77934e
add comments for status codes
nagendramishr Oct 10, 2025
87284fb
fix bug related to background requests gerring reprocessed
nagendramishr Oct 10, 2025
87da272
add debug message
nagendramishr Oct 10, 2025
4c1995c
fix bug related to background requests gerring reprocessed
nagendramishr Oct 10, 2025
d09bc99
added debug mode
nagendramishr Oct 10, 2025
36cb8a8
updated change log
nagendramishr Oct 10, 2025
e707eaf
Merge pull request #97 from microsoft/background-requests
nagendramishr Oct 10, 2025
1b8592b
add downstream attempts, renamed attempts to BackentAttempts, refacto…
nagendramishr Oct 10, 2025
70db669
add downstream attempts, renamed attempts to BackentAttempts, refacto…
nagendramishr Oct 10, 2025
86115bc
track x-policyCycleCounter between proxy and policy
nagendramishr Oct 10, 2025
dea89c9
updated release notes and version to 2.2.8
nagendramishr Oct 10, 2025
879fe19
Merge pull request #98 from microsoft/Track-policy-attempts
nagendramishr Oct 10, 2025
02323a0
Add AZD deployment templates and environment configurations
nagendramishr Oct 10, 2025
f26bd05
add code for local dev scenario
nagendramishr Oct 16, 2025
ac491e8
make port for stream_server configurable, update instructions
nagendramishr Oct 16, 2025
c1af203
add background request file
nagendramishr Oct 16, 2025
36fa313
Merge pull request #100 from microsoft/azd-deployment-templates
nagendramishr Oct 16, 2025
f772edf
use defaults file
nagendramishr Oct 17, 2025
824f2d4
abstract the instructions into a seperate file
nagendramishr Oct 17, 2025
6a5d9ca
cleanup local dev instructions
nagendramishr Oct 17, 2025
96468e9
update instructions
nagendramishr Oct 17, 2025
9be2bae
simplify the script
nagendramishr Oct 17, 2025
9e70447
Merge pull request #101 from microsoft/azd-deployment-templates
nagendramishr Oct 17, 2025
4a29ef2
update docs
nagendramishr Oct 22, 2025
c7ab3b9
Merge pull request #102 from microsoft/azd-deployment-templates
nagendramishr Oct 23, 2025
30944f5
Delete test/openai/call-localhost.sh
nagendramishr Oct 30, 2025
592275d
Delete test/openai/call-nvmtr2apim.sh
nagendramishr Oct 30, 2025
7da2e3f
fix for timeouts > 100 seconds
nagendramishr Nov 3, 2025
00d8570
add enhanced logging policy
nagendramishr Dec 4, 2025
7984a5b
add null check for backup service
nagendramishr Dec 4, 2025
004af8c
remove log when servicebus is not being used
nagendramishr Dec 4, 2025
fa934e7
add AsyncAllowed in user profiles
nagendramishr Dec 4, 2025
bb957d3
better error checking during asyncFeeder startup
nagendramishr Dec 4, 2025
b28d655
bug fix for when async mode is disabled
nagendramishr Dec 4, 2025
4b1810e
remove debug
nagendramishr Dec 4, 2025
5aed899
log to events.json instead of events.log
nagendramishr Dec 9, 2025
8b4953f
add UserConfigRequired
nagendramishr Dec 9, 2025
41b6c21
add code to check number of user profiles if UserConfigRequired is set
nagendramishr Dec 9, 2025
56238bd
integrate user profile check into health probe
nagendramishr Dec 9, 2025
d312373
added check for status 200 with no content
nagendramishr Dec 9, 2025
c9c8129
added check for status 200 with no content
nagendramishr Dec 9, 2025
e03b119
update version to 2.2.8.p2
nagendramishr Dec 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .azure/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Ignore local development environment file which is auto-generated
local-dev.env
143 changes: 143 additions & 0 deletions .azure/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# SimpleL7Proxy Deployment with Azure Developer CLI (AZD)

This guide helps you deploy the SimpleL7Proxy service to Azure using the Azure Developer CLI (AZD).

## Prerequisites

1. [Azure Developer CLI (AZD)](https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/install-azd)
2. [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli)
3. [Docker](https://www.docker.com/products/docker-desktop/)

## Deployment Steps

### 1. Clone the Repository

```bash
git clone <repository-url>
cd SimpleL7Proxy
```

### 2. Run the Setup Script

#### For Windows:

```powershell
# Run in PowerShell
.\.azure\setup.ps1
```

#### For Linux/macOS:

```bash
# Make the script executable
chmod +x .azure/setup.sh

# Run the setup script
./.azure/setup.sh
```

The setup script will:
- Verify prerequisites
- Ask you for deployment configuration
- Create an AZD environment with your settings

### 3. Deploy the Infrastructure

```bash
azd provision
```

This command will deploy the Azure infrastructure defined in the Bicep templates:
- Azure Container Registry
- Azure Container App Environment
- Azure Container App
- Storage Account
- Log Analytics Workspace (if enabled)
- Application Insights (if enabled)
- Virtual Network (if enabled)

### 4. Build and Deploy the Application

#### For Windows:

```powershell
# Run in PowerShell
.\.azure\deploy.ps1
```

#### For Linux/macOS:

```bash
# Make the script executable
chmod +x .azure/deploy.sh

# Run the deployment script
./.azure/deploy.sh
```

The deployment script will:
- Build the Docker image
- Push it to Azure Container Registry
- Update the Container App with the new image

Alternatively, you can use the AZD all-in-one command:

```bash
azd up
```

## Configuration Options

For detailed configuration options, see the [questionnaire](questionnaire.md).

Key configuration areas include:
- Azure environment settings
- Container configuration
- Network configuration
- Authentication settings
- Storage configuration
- Backend services
- Monitoring configuration
- Advanced settings

## Deployment Scenarios

To simplify the deployment process, several predefined scenarios are available that configure common deployment patterns:

### Available Scenarios

1. **Local Proxy with Public APIM** - For local development with a public APIM backend
2. **ACA Proxy with Public APIM** - For Azure Container Apps deployment with a public APIM backend
3. **VNET Proxy Deployment** - For secure deployment within a Virtual Network

When running the setup script, you can choose to use one of these predefined scenarios instead of manually configuring all settings.

For more information about scenarios and how to customize them, see the [scenarios README](scenarios/README.md).

## Post-Deployment

After deployment:

1. Access your SimpleL7Proxy service at the URL provided at the end of the deployment
2. Configure additional settings through environment variables in the Azure Portal
3. Monitor your service using Application Insights

## Troubleshooting

If you encounter issues:

1. Check Azure Container App logs in the Azure Portal
2. Verify the Azure Container App configuration
3. Check Application Insights for error logs

## Cleanup

To remove deployed resources:

```bash
azd down
```

## Additional Documentation

For more information about SimpleL7Proxy, refer to the [main documentation](docs/README.md).
87 changes: 87 additions & 0 deletions .azure/aca-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
#!/bin/bash

# ACA-specific setup helper for SimpleL7Proxy
echo "========================================================"
echo " SimpleL7Proxy Azure Container Apps (ACA) Setup"
echo "========================================================="
echo ""

read_input() {
local prompt="$1"
local default="$2"
local input=""
if [ -n "$default" ]; then
prompt="$prompt [$default]"
fi
read -p "$prompt: " input
if [ -z "$input" ] && [ -n "$default" ]; then
input="$default"
fi
echo "$input"
}

echo "🔧 Configuring Container App settings (ACA)..."

# Container App name
default_app_name="${env_AZURE_CONTAINER_APP_NAME:-s7p-${environment}}"
container_app_name=$(read_input "Enter Container App name" "$default_app_name")

# Container registry
default_acr="${env_AZURE_CONTAINER_REGISTRY_NAME:-}"
container_registry=$(read_input "Enter container registry name or leave blank for default" "$default_acr")
if [ -z "$container_registry" ]; then
container_registry="acr${environment}s7p"
fi

# Container App Environment
default_env_ca="${env_AZURE_CONTAINER_APP_ENVIRONMENT_NAME:-}"
container_app_env=$(read_input "Enter Container App Environment name or leave blank for default" "$default_env_ca")
if [ -z "$container_app_env" ]; then
container_app_env="cae-${environment}-s7p"
fi

echo ""
echo "🔧 Scaling Configuration (ACA)"
default_min="${env_AZURE_CONTAINER_APP_MIN_REPLICAS:-1}"
default_max="${env_AZURE_CONTAINER_APP_MAX_REPLICAS:-5}"
min_replicas=$(read_input "Enter minimum number of replicas" "$default_min")
max_replicas=$(read_input "Enter maximum number of replicas" "$default_max")

echo ""
echo "🔧 Network Configuration (ACA)"
default_vnet="${env_USE_VNET:-no}"
use_vnet=$(read_input "Do you want to deploy in a VNET? (yes/no)" "$default_vnet")
vnet_prefix=""
subnet_prefix=""
if [ "$use_vnet" = "yes" ] || [ "$use_vnet" = "true" ]; then
use_vnet="true"
echo ""
default_vnet_prefix="${env_VNET_ADDRESS_PREFIX:-10.0.0.0/16}"
default_subnet_prefix="${env_SUBNET_ADDRESS_PREFIX:-10.0.0.0/21}"
vnet_prefix=$(read_input "Enter VNET address space" "$default_vnet_prefix")
subnet_prefix=$(read_input "Enter subnet address space" "$default_subnet_prefix")
else
use_vnet="false"
fi

echo ""
echo "⏳ Applying ACA settings to AZD environment..."

# Ensure AZD environment exists/selected before setting ACA vars
azd env set AZURE_CONTAINER_REGISTRY_NAME "$container_registry"
azd env set AZURE_CONTAINER_APP_NAME "$container_app_name"
azd env set AZURE_CONTAINER_APP_ENVIRONMENT_NAME "$container_app_env"
azd env set AZURE_CONTAINER_APP_MIN_REPLICAS "$min_replicas"
azd env set AZURE_CONTAINER_APP_MAX_REPLICAS "$max_replicas"
azd env set USE_VNET "$use_vnet"
[ "$use_vnet" = "true" ] && azd env set VNET_ADDRESS_PREFIX "$vnet_prefix"
[ "$use_vnet" = "true" ] && azd env set SUBNET_ADDRESS_PREFIX "$subnet_prefix"

echo "✅ ACA settings applied."

echo "📋 ACA Summary:"
echo " • Container App: $container_app_name"
echo " • Container Registry: $container_registry"
echo " • Container App Environment: $container_app_env"
echo " • Replicas: min=$min_replicas, max=$max_replicas"
echo " • Use VNET: $use_vnet"
130 changes: 130 additions & 0 deletions .azure/azd.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"version": "0.1.0-alpha",
"name": "simple-l7-proxy",
"description": "SimpleL7Proxy is a layer 7 proxy service that supports prioritization, retries, and timeouts",
"resources": {
"simpleL7Proxy": {
"type": "application",
"properties": {
"language": "dotnet",
"host": "containerapp",
"services": {}
}
}
},
"parameters": {
"environmentName": {
"type": "string",
"defaultValue": "dev",
"metadata": {
"description": "Environment name (dev, test, prod)"
}
},
"location": {
"type": "string",
"defaultValue": "westus2",
"metadata": {
"description": "Azure region for the deployment"
}
},
"containerAppMinReplicas": {
"type": "int",
"defaultValue": 1,
"metadata": {
"description": "Minimum number of Container App replicas"
}
},
"containerAppMaxReplicas": {
"type": "int",
"defaultValue": 5,
"metadata": {
"description": "Maximum number of Container App replicas"
}
},
"useVNET": {
"type": "bool",
"defaultValue": false,
"metadata": {
"description": "Flag to determine if VNET should be used"
}
},
"vnetAddressPrefix": {
"type": "string",
"defaultValue": "10.0.0.0/16",
"metadata": {
"description": "VNET address space"
}
},
"subnetAddressPrefix": {
"type": "string",
"defaultValue": "10.0.0.0/21",
"metadata": {
"description": "Subnet address space"
}
},
"enableAuthentication": {
"type": "bool",
"defaultValue": false,
"metadata": {
"description": "Flag to enable authentication"
}
},
"authType": {
"type": "string",
"defaultValue": "none",
"allowedValues": ["entraID", "servicebus", "none"],
"metadata": {
"description": "Authentication type"
}
},
"useAsyncStorage": {
"type": "bool",
"defaultValue": false,
"metadata": {
"description": "Flag to enable async storage features"
}
},
"backendHostURLs": {
"type": "string",
"metadata": {
"description": "Comma-separated list of backend URLs"
}
},
"defaultRequestTimeout": {
"type": "int",
"defaultValue": 100000,
"metadata": {
"description": "Default timeout for requests in milliseconds"
}
},
"enableAppInsights": {
"type": "bool",
"defaultValue": true,
"metadata": {
"description": "Flag to enable Application Insights"
}
},
"queuePriorityLevels": {
"type": "int",
"defaultValue": 3,
"metadata": {
"description": "Number of priority levels to configure"
}
},
"enableScaleRule": {
"type": "bool",
"defaultValue": true,
"metadata": {
"description": "Enable auto-scaling based on HTTP concurrent requests"
}
},
"httpConcurrentRequestsThreshold": {
"type": "int",
"defaultValue": 10,
"metadata": {
"description": "Number of concurrent requests that trigger scaling"
}
}
}
}
Loading