Related:
/issues/4560
/pull/4872
Repro
azd init --template Azure-Samples/todo-python-mongo
- If testing on Linux, edit
azure.yaml to change the shell from sh to pwsh.
- Make sure PS 7 is uninstalled, or temporarily rename
pwsh in your PATH to something like pwsh1.
azd package web
Observed:
There should be a suggestion text printed out, like:
PowerShell 7 is not installed or not in the path. To install PowerShell 7, visit https://learn.microsoft.com/powershell/scripting/install/installing-powershell
Additional details
It seems that service-level hooks do not show the suggestion text when pwsh isn't installed, but command(?) hooks do:
Service-level hooks
services:
web:
project: ./src/web
dist: dist
language: js
host: appservice
hooks:
prepackage:
windows:
shell: pwsh
run: 'echo "VITE_API_BASE_URL=""$env:API_BASE_URL""" > .env.local ; echo "VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=""$env:APPLICATIONINSIGHTS_CONNECTION_STRING""" >> .env.local'
| Command |
Suggestion text shown? |
azd package web |
❌ |
azd hooks run prepackage --service web |
✅ |
Command hooks
hooks:
preprovision:
posix:
shell: pwsh
run: 'echo "AZURE_STORAGE_CONNECTION_STRING=$env:AZURE_STORAGE_CONNECTION_STRING" > .env'
windows:
shell: pwsh
run: 'echo "AZURE_STORAGE_CONNECTION_STRING=$env:AZURE_STORAGE_CONNECTION_STRING" > .env'
| Command |
Suggestion text shown? |
azd provision |
✅ |
azd hooks run preprovision |
✅ |
Related:
/issues/4560
/pull/4872
Repro
azd init --template Azure-Samples/todo-python-mongoazure.yamlto change theshellfromshtopwsh.pwshin your PATH to something likepwsh1.azd package webObserved:
There should be a suggestion text printed out, like:
Additional details
It seems that service-level hooks do not show the suggestion text when
pwshisn't installed, but command(?) hooks do:Service-level hooks
azd package webazd hooks run prepackage --service webCommand hooks
azd provisionazd hooks run preprovision