|
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 |
2 | 7 | 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) { |
5 | 12 | 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 |
8 | 15 | } else { |
9 | 16 | Write-Host "A2A Automation Framework is STOPPED" |
10 | 17 | } |
11 | 18 |
|
| 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 | + |
12 | 29 | # Check automation endpoint |
13 | 30 | 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)" |
16 | 33 | } catch { |
17 | 34 | Write-Host "Automation endpoint not accessible" |
18 | 35 | } |
0 commit comments