Azure / static-web-apps

Azure Static Web Apps. For bugs and feature requests, please create an issue in this repo. For community discussions, latest updates, kindly refer to the Discussions Tab. To know what's new in Static Web Apps, visit https://aka.ms/swa/ThisMonth
https://aka.ms/swa
MIT License
318 stars 53 forks source link

Deployment issue with swa cli : Forbidden issue #1482

Open mathieumack opened 1 month ago

mathieumack commented 1 month ago

Describe the bug

Hi, When I try to deploy a static web app content with the cli, I have an error during the deployment with this error message :

ℹ Try to validate location at: 'C:\xxx\wwwroot\staticwebapp.config.json'.
ℹ config_file_location: config file 'C:\xxx\wwwroot\staticwebapp.config.json' was found.
ℹ Looking for event info
ℹ Could not get event info. Proceeding
ℹ The content server has unexpectedly rejected the request with: Forbidden
ℹ Failed to record upload telemtry.
ℹ For further information, please visit the Azure Static Web Apps documentation at https://docs.microsoft.com/en-us/azure/static-web-apps/
ℹ If you believe this behavior is unexpected, please raise a GitHub issue at https://github.com/azure/static-web-apps/issues/

SUCCESS: There are no changes to provision for your application.
WARNING: your version of azd is out of date, you have 1.9.2 and the latest version is 1.9.3

Launched command :

swa deploy ./output/wwwroot -T $Env:AZURE_TENANT_ID -S $Env:AZURE_SUBSCRIPTION_ID -R $Env:AZURE_RESOURCE_GROUP -n $Env:AZURE_STATIC_APP --env Production --verbose silly

I don't know what is the issue and what is forbidden as deployment of the Azure Static WebApp service is done by IAC (bicep file), and for other environments everything works.

Device info (if applicable):

I use the azd cli to provision azure services, and have different environments in many tenants, and on all other environments everything works.

I don't think that it's an RBAC issue on Azure as on all tenants I have the same rights (Contributor + Role base access administrator).

Additional datas

Here is the logs before deployment :

Deploying project to Azure Static Web Apps...
Fetching release metadata for version: stable. Please wait...
 - version: stable
 - buildId: 1.0.026911
 - publishDate: 2024-05-15T19:23:23.3973684Z
- files:
 - linux-x64:
   - url: https://swalocaldeploy.azureedge.net/downloads/1.0.026911/linux/StaticSitesClient
   - sha: e1d9e033c973a35f64b7e41b6a114bd8e48022c9c3f7676e79047e87245a874d
 - win-x64:
   - url: https://swalocaldeploy.azureedge.net/downloads/1.0.026911/windows/StaticSitesClient.exe
   - sha: c67e5eed2b28fcf5c98348732653d1e2b37d842e6dde9a6b30322832c5d86fc7
 - osx-x64:
   - url: https://swalocaldeploy.azureedge.net/downloads/1.0.026911/macOS/StaticSitesClient
   - sha: 18ca42a1b13db9b8b6db6bd8c77e65def56fa7bf3ce3fb1184e890d8cd7dd033
Local client binary is up to date. Skipping download.
Deploying using C:\Users\xxx\.swa\deploy\1.0.026911\StaticSitesClient.exe@1.0.026911
Deploying using the following options:
- env:
  - SWA_CLI_DEBUG: silly
  - SWA_RUNTIME_WORKFLOW_LOCATION: <undefined>
  - SWA_RUNTIME_CONFIG_LOCATION: C:\xxx\wwwroot
  - SWA_RUNTIME_CONFIG: C:\xxx\wwwroot\staticwebapp.config.json
  - SWA_CLI_VERSION: 1.1.8
  - SWA_CLI_DEPLOY_DRY_RUN: false
  - SWA_CLI_DEPLOY_BINARY: C:\Users\xxx\.swa\deploy\1.0.026911\StaticSitesClient.exe@1.0.026911
  - DEPLOYMENT_ACTION: upload
  - DEPLOYMENT_PROVIDER: SwaCli
  - REPOSITORY_BASE: C:\xxx
  - SKIP_APP_BUILD: true
  - SKIP_API_BUILD: true
  - DEPLOYMENT_TOKEN: <hidden>
  - APP_LOCATION: C:\xxx\output\wwwroot
  - API_LOCATION: <undefined>
  - DATA_API_LOCATION: <undefined>
  - CONFIG_FILE_LOCATION: C:\xxx\wwwroot
  - VERBOSE: true
  - FUNCTION_LANGUAGE: node
  - FUNCTION_LANGUAGE_VERSION: 16
mathieumack commented 1 month ago

To complete my issue : I've checked to logon multiple times and tried to clear cache :

swa login --tenant-id xxx -cc

Thanks for any comment or help on this issue