Open ankur198 opened 2 months ago
Changes Explanation: Instead of utilizing the --app-location
and --output-location
flags of the swa
CLI, we can execute the swa
CLI directly within the directory of the appFolderPath
. This approach allows the swa
CLI to identify the swa-cli.config.json
file if it exists. If it doesn't then swa
CLI's default behaviour will be invoked which will be consistent experience for developers who were using swa
CLI previously.
@ankur198 , thank you for your contribution.
Your initial changes were not enough because azd was not using the swa cli
for building the service. I have updated the PR so azd follows the same approach as it does with docker
.
When azd detects staticwebapp
as the host for the service, azd will not directly build the service based on the language. Instead, it will invoke swa build
and use the configuration from swa-cli.config.json
If there is not a swa-cli.config.json
, azd returns the same error from the swa-cli.
/azp run azure-dev - cli
/azp run azure-dev - cli
/azp run azure-dev - repoman
Repoman pushed changes to remotes for the following projects:
You can initialize this project with:
azd init -t Azure-Samples/todo-csharp-cosmos-sql -b pr/3553
View Changes | Compare Changes
You can initialize this project with:
azd init -t Azure-Samples/todo-csharp-sql-swa-func -b pr/3553
View Changes | Compare Changes
You can initialize this project with:
azd init -t Azure-Samples/todo-csharp-sql -b pr/3553
View Changes | Compare Changes
You can initialize this project with:
azd init -t Azure-Samples/todo-java-mongo-aca -b pr/3553
View Changes | Compare Changes
You can initialize this project with:
azd init -t Azure-Samples/todo-java-mongo -b pr/3553
View Changes | Compare Changes
You can initialize this project with:
azd init -t Azure-Samples/todo-java-postgresql-terraform -b pr/3553
View Changes | Compare Changes
You can initialize this project with:
azd init -t Azure-Samples/todo-nodejs-mongo-aca -b pr/3553
View Changes | Compare Changes
You can initialize this project with:
azd init -t Azure-Samples/todo-nodejs-mongo-aks -b pr/3553
View Changes | Compare Changes
You can initialize this project with:
azd init -t Azure-Samples/todo-nodejs-mongo-swa-func -b pr/3553
View Changes | Compare Changes
You can initialize this project with:
azd init -t Azure-Samples/todo-nodejs-mongo -b pr/3553
View Changes | Compare Changes
You can initialize this project with:
azd init -t Azure-Samples/todo-nodejs-mongo-terraform -b pr/3553
View Changes | Compare Changes
You can initialize this project with:
azd init -t Azure-Samples/todo-python-mongo-aca -b pr/3553
View Changes | Compare Changes
You can initialize this project with:
azd init -t Azure-Samples/todo-python-mongo-swa-func -b pr/3553
View Changes | Compare Changes
You can initialize this project with:
azd init -t Azure-Samples/todo-python-mongo -b pr/3553
View Changes | Compare Changes
You can initialize this project with:
azd init -t Azure-Samples/todo-python-mongo-terraform -b pr/3553
View Changes | Compare Changes
/azp run azure-dev - cli
/azp run azure-dev - cli
/azp run azure-dev - cli
/azp run azure-dev - cli
/azp run azure-dev - cli
/azp run azure-dev - cli
/azp run azure-dev - cli
May elevate using
sudo
on some platforms and configurations
bash:
curl -fsSL https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3553/uninstall-azd.sh | bash;
curl -fsSL https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3553/install-azd.sh | bash -s -- --base-url https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3553 --version '' --verbose --skip-verify
pwsh:
Invoke-RestMethod 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3553/uninstall-azd.ps1' -OutFile uninstall-azd.ps1; ./uninstall-azd.ps1
Invoke-RestMethod 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3553/install-azd.ps1' -OutFile install-azd.ps1; ./install-azd.ps1 -BaseUrl 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3553' -Version '' -SkipVerify -Verbose
PowerShell install
powershell -c "Set-ExecutionPolicy Bypass Process; irm 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3553/uninstall-azd.ps1' > uninstall-azd.ps1; ./uninstall-azd.ps1;"
powershell -c "Set-ExecutionPolicy Bypass Process; irm 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3553/install-azd.ps1' > install-azd.ps1; ./install-azd.ps1 -BaseUrl 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3553' -Version '' -SkipVerify -Verbose;"
MSI install
powershell -c "irm 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3553/azd-windows-amd64.msi' -OutFile azd-windows-amd64.msi; msiexec /i azd-windows-amd64.msi /qn"
When deploying SWA using
azd
lacked the ability to configure complex build commands.swa
cli natively utilisesswa-cli.config.json
along with flags.Changes on this PR allows
azd
to detect theswa-cli.config.json
. If not present, then use the default behavior ofswa
cli.IMO this is much better trade off than lacking ability to setup swa options.
Linked issue: #1953 #1759
fix: #1953