Skip to content

Commit 3736b99

Browse files
adjust Azure CLI command execution for cross-platform compatibility
1 parent 4307e5f commit 3736b99

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

content-gen/scripts/post_deploy.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,13 @@ def print_warning(text: str):
103103
def run_az_command(args: List[str], capture_output: bool = True) -> subprocess.CompletedProcess:
104104
"""Run an Azure CLI command."""
105105
cmd = ["az"] + args
106-
return subprocess.run(cmd, capture_output=capture_output, text=True)
106+
107+
if sys.platform == "win32":
108+
# Windows: shell=True required to find az.cmd
109+
return subprocess.run(cmd, capture_output=capture_output, text=True, shell=True)
110+
else:
111+
# Linux/Mac: Don't use shell=True to avoid /bin/sh triggering welcome banner
112+
return subprocess.run(cmd, capture_output=capture_output, text=True)
107113

108114

109115
def discover_resources(resource_group: str, app_name: Optional[str] = None, api_key: str = "") -> ResourceConfig:

0 commit comments

Comments
 (0)