Fix cross-platform deploy issues in Azure Copilot MicroHack#333
Merged
qxsch merged 3 commits intomicrosoft:mainfrom Apr 7, 2026
Merged
Conversation
- Replace $env:TEMP with [System.IO.Path]::GetTempPath() in Deploy-Lab.ps1 ($env:TEMP is null on macOS/Linux, causing script to crash) - Add --timeout 600 to az webapp deploy to prevent 504 Gateway Timeout during Oryx Python build on B1 App Service plan - Auto-install application-insights CLI extension in Test-CopilotWorkshop.ps1 to prevent interactive prompt that hangs the test suite Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Author
|
@qxsch can you please review and approve? |
Additional improvements to the Azure Copilot MicroHack discovered via dual advanced AI agent review (GPT-5.4-pro breadth + o3-pro robustness): Deploy-Lab.ps1: - Add missing shebang (#!/usr/bin/env pwsh) for consistency - Fix Invoke-Az: use @Args splatting and throw instead of exit - Replace Az PowerShell RBAC (Get/New-AzRoleAssignment) with az CLI commands for cross-platform compatibility Test-CopilotWorkshop.ps1: - Add pre-flight az login check before ConvertFrom-Json app.py: - Guard configure_azure_monitor() against missing connection string requirements.txt: - Pin upper-bound version constraints to prevent breaking changes Readme.md: - Add PowerShell 7+ (pwsh) as prerequisite - Fix LinkedIn URL in Contributors section challenges/challenge-06.md & walkthrough/solution-06.md: - Add note that AKS cluster is not deployed; Task 3 is exploratory challenges/challenge-07.md: - Add navigation link to finish.md challenges/finish.md: - Replace GitHub emoji shortcode with Unicode emoji Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…nt error handling - Remove UTF-8 BOM (ef bb bf) from Test-CopilotWorkshop.ps1, Send-CopilotTraffic.ps1, Remove-CopilotWorkshop.ps1, and requirements.txt — BOM before shebang prevents direct execution on Linux/macOS (kernel reads 0xEF not 0x23) - Widen gunicorn pin from <23.0 to <26.0 to include current stable - Replace Write-Error+exit with throw in ssh-keygen check (consistent with Invoke-Az fix from prior commit) Found via iterative GPT-5.4-pro red-team/counter-argue/verdict review. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
qxsch
approved these changes
Apr 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Tested the Azure Copilot MicroHack deployment end-to-end on macOS (pwsh + az CLI) against a live Azure subscription. Found and fixed cross-platform deployment issues plus several robustness and documentation improvements.
Changelog
Deploy-Lab.ps1
$env:TEMP(Windows-only) with[System.IO.Path]::GetTempPath()--timeout 600toaz webapp deploy— Kudu/Oryx build on B1 exceeds default timeoutGet-AzRoleAssignment/New-AzRoleAssignmentrequires Az module not available on macOS/Linux. Replaced withaz role assignment list/create#!/usr/bin/env pwshfor direct execution on Linux/macOSInvoke-Azhelper$args→@args(proper splatting) +Write-Error; exit→throw(consistent error handling)Write-Error; exit→throwpattern for consistencyTest-CopilotWorkshop.ps1
az extension add --name application-insights --yesprevents interactive hang$LASTEXITCODEafteraz account showbefore proceedingScripts (Send-CopilotTraffic.ps1, Remove-CopilotWorkshop.ps1)
0xEFinstead of#!app/app.py
configure_azure_monitor()APPLICATIONINSIGHTS_CONNECTION_STRINGnot set. Now conditionally called only when env var is presentapp/requirements.txt
flask>=3.0→flask>=3.0,<4.0etc. to prevent future breaking changes<23.0→<26.0— current stable is 25.3.0; old pin excluded 2+ years of releasesDocumentation
Readme.mdReadme.md— Contributors sectionchallenge-06.md+solution-06.md— Task 3 references AKS cluster not deployed by labchallenge-07.mdfinish.md—:partying_face:→ 🥳