Azure / static-web-apps-cli

Azure Static Web Apps CLI ✨
https://aka.ms/swa/cli-local-development
MIT License
583 stars 110 forks source link

Running swa locally on a arm64 with --data-api-location (CosmoDB connection) fails #703

Open kevinrs5855 opened 1 year ago

kevinrs5855 commented 1 year ago

Before filing this issue, please ensure you're using the latest CLI by running swa --version and comparing to the latest version on npm.

Are you accessing the CLI from the default port :4280 ?

Make sure you are accessing the URL printed in the console when running swa start!

ℹ️ NOTE: Make sure to enable debug logs when running any swa commands using --verbose=silly

Describe the bug I am following this tutorial, https://learn.microsoft.com/en-us/azure/static-web-apps/database-azure-cosmos-db?tabs=bash, to run Cosmo DB on my local desktop. When running, swa start --data-api-location swa-db-connections --verbose=silly I encounter a failure, [dataApi] /bin/sh: /Users/XXXX/.swa/dataApiBuilder/0.6.14/Microsoft.DataApiBuilder: cannot execute binary file

To Reproduce Steps to reproduce the behavior:

  1. npm install -g @azure/static-web-apps-cli
  2. npm update
  3. swa start --data-api-location swa-db-connections --verbose=silly

Expected behavior I expected swa to start with dab. I even tried to install dab locally, in the hopes swa would use the arm dba already installed. Notice the version downloaded is, dab_osx-x64-0.6.14.zip@0.6.14 but this is an arm computer.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Debug Logs: MacBook-Pro:GatewayGamers XXXX$ swa start --data-api-location swa-db-connections --verbose=silly

Welcome to Azure Static Web Apps CLI (1.1.2)

Getting config file options from swa-cli.config.json... Changed directory to /Users/XXXX/Documents/sourcecode/GatewayGamers Using configuration "gateway-gamers" from file: /Users/XXXX/Documents/sourcecode/GatewayGamers/swa-cli.config.json


Checking if localhost:4280 is accepting TCP connections... Port 4280 is available. Use it. Resolved port number: 4280 appDevserverUrl provided, we will try connect to dev server at build Data Api Folder found: /Users/XXXX/Documents/sourcecode/GatewayGamers/swa-db-connections Trying to read workflow config with values:

Downloading the version 0.6.14 [swa] ✔ Downloading https://github.com/Azure/data-api-builder/releases/download/v0.6.14/dab_osx-x64-0.6.14.zip@0.6.14 Checksum match: 7965ba21b9c480a2ce87832b2f11655bfaae9726962aa0b194c39c31499290b3 Saved binary to /Users/XXXX/.swa/dataApiBuilder/0.6.14/dab_osx-x64-0.6.14.zip Saved metadata to /Users/XXXX/.swa/dataApiBuilder/DataApiBuilder.json Setting executable permissions for data-api-builder binary DataApiBuilder found: /Users/XXXX/.swa/dataApiBuilder/0.6.14/Microsoft.DataApiBuilder. Using this to start data-api server Running cd "/Users/XXXX/Documents/sourcecode/GatewayGamers/swa-db-connections" && "/Users/XXXX/.swa/dataApiBuilder/0.6.14/Microsoft.DataApiBuilder" start -c staticwebapp.database.config.json --no-https-redirect Starting the SWA emulator with the following configuration:

Note, dab is installed: MacBook-Pro:GatewayGamers XXXX$ dab --version Microsoft.DataApiBuilder 0.7.6+61de247acf65280d93783072226f695536591ffb

thomasgauvin commented 1 year ago

Thanks for reporting this, we will investigate