Skip to content

Commit 6910647

Browse files
committed
dynamic and fixed the broken ps1 variables
1 parent b9a2a11 commit 6910647

1 file changed

Lines changed: 24 additions & 7 deletions

File tree

src/a2a/status_automation.ps1

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,35 @@
1-
# Check A2A Automation Framework Status
1+
param(
2+
[string]$WebAppName = $env:WEB_APP_NAME,
3+
[string]$StatusUrl = $env:A2A_AUTOMATION_STATUS_URL
4+
)
5+
6+
# Check A2A Automation Framework Status
27
Write-Host "Checking A2A Automation Framework status..."
3-
= Get-Process -Name "python" -ErrorAction SilentlyContinue | Where-Object { .CommandLine -like "*automated_main*" }
4-
if () {
8+
$processes = Get-CimInstance Win32_Process -ErrorAction SilentlyContinue |
9+
Where-Object { $_.CommandLine -like "*automated_main*" }
10+
11+
if ($processes) {
512
Write-Host "A2A Automation Framework is RUNNING"
6-
Write-Host "Processes: 0"
7-
| Format-Table Id,ProcessName,StartTime
13+
Write-Host "Processes: $($processes.Count)"
14+
$processes | Select-Object ProcessId,Name,CreationDate | Format-Table -AutoSize
815
} else {
916
Write-Host "A2A Automation Framework is STOPPED"
1017
}
1118

19+
# Build status URL dynamically
20+
if (-not $StatusUrl -and $WebAppName) {
21+
$StatusUrl = "https://$WebAppName.azurewebsites.net/a2a/automation/status"
22+
}
23+
24+
if (-not $StatusUrl) {
25+
Write-Host "Automation endpoint not accessible (missing WebAppName or StatusUrl)"
26+
return
27+
}
28+
1229
# Check automation endpoint
1330
try {
14-
= Invoke-RestMethod -Uri "https://zava-45552363-app.azurewebsites.net/a2a/automation/status" -TimeoutSec 5
15-
Write-Host "Automation Status: "
31+
$status = Invoke-RestMethod -Uri $StatusUrl -TimeoutSec 5
32+
Write-Host "Automation Status: $($status | ConvertTo-Json -Compress)"
1633
} catch {
1734
Write-Host "Automation endpoint not accessible"
1835
}

0 commit comments

Comments
 (0)