Skip to content

Commit 24d0aac

Browse files
authored
Enhance port management and environment variable support in azure.yaml (#32)
1 parent 77aafc6 commit 24d0aac

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+6941
-770
lines changed

CONTRIBUTING.md

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,22 @@ go build -o bin/app.exe ./src/cmd/app
5353
3. **Install locally for testing**:
5454
```bash
5555
cd cli
56-
# Install mage if not already installed
57-
go install github.com/magefile/mage@latest
5856

59-
# Build and install
60-
mage install
57+
# First time setup: Uninstall any existing version and clean cache
58+
azd extension uninstall jongio.azd.app
59+
rm -r ~/.azd/extensions/jongio.azd.app # On Windows: Remove-Item -Recurse -Force ~\.azd\extensions\jongio.azd.app
60+
61+
# Build and install extension
62+
azd x build --skip-install=false
63+
64+
# Verify installation
65+
azd app version
66+
```
67+
68+
4. **Development workflow with watch mode**:
69+
```bash
70+
# For active development, use watch mode to auto-rebuild on file changes
71+
azd x watch
6172
```
6273

6374
## Development Workflow
@@ -107,23 +118,16 @@ git checkout -b feature/your-feature-name
107118

108119
### 3. Test Your Changes
109120
```bash
110-
# Run unit tests
111-
mage test
112-
113-
# Run with coverage
114-
mage testcoverage
115-
116-
# Run all tests including integration
117-
mage testall
121+
# Build and install for testing
122+
azd x build --skip-install=false
118123

119-
# Run linter
120-
mage lint
124+
# Or use watch mode during active development
125+
azd x watch
121126

122-
# Test locally
123-
mage install
127+
# Test the extension
124128
azd app <your-command>
125129

126-
# Alternative: Use go directly
130+
# Run unit tests (legacy - use azd x build instead)
127131
go test ./...
128132
go test -cover ./...
129133
```

cli/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ App automatically detects and manages dependencies for:
2121
- 📦 **Multi-Language Support**: Works with Node.js, Python, and .NET projects
2222
- 🚀 **One-Command Setup**: Install all dependencies with a single command
2323
- 🎯 **Environment-Aware**: Creates and manages virtual environments for Python
24+
- 🐳 **Docker Compose Compatible**: Environment variable syntax matches Docker Compose exactly
2425
-**Fast Iteration**: Minimal test dependencies for quick validation
2526

2627
## Installation
@@ -257,6 +258,27 @@ azd app run --env-file .env.local
257258
- `--verbose, -v`: Enable verbose logging
258259
- `--dry-run`: Show what would be run without starting services
259260

261+
**Environment Variables:**
262+
263+
Services can define environment variables in `azure.yaml` using Docker Compose-compatible syntax:
264+
265+
```yaml
266+
services:
267+
api:
268+
# Map format (recommended)
269+
environment:
270+
NODE_ENV: production
271+
PORT: "3000"
272+
273+
web:
274+
# Array of strings (Docker Compose style)
275+
environment:
276+
- API_URL=http://localhost:5000
277+
- DEBUG=true
278+
```
279+
280+
See [Environment Variables Documentation](docs/environment-variables.md) for all supported formats and advanced usage.
281+
260282
**Runtime Modes:**
261283
- **azd** (default): Runs services through azd's built-in dashboard, works with all project types
262284
- **aspire**: Uses native .NET Aspire dashboard via `dotnet run` (only for Aspire projects)

cli/docs/commands/run.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,6 @@ STRIPE_API_KEY=sk_test_abc456
713713
# Application settings
714714
LOG_LEVEL=debug
715715
ENABLE_METRICS=true
716-
CORS_ORIGINS=http://localhost:3000
717716
```
718717

719718
## Output Examples

0 commit comments

Comments
 (0)