static-web-apps-cli icon indicating copy to clipboard operation
static-web-apps-cli copied to clipboard

Successfully logged into Azure! – Failed to setup project: EPERM: operation not permitted

Open mbouthillette opened this issue 1 year ago • 7 comments

Publish Azure Static Web Apps using Visual Studio Community 2022. This problem is new after the lastest upgrade of VS.

Authentification avec Static Web Apps... swa.cmd login --subscription-id 96fb6c8f-d34e-401b-919e-0a990e0f5100 --tenant-id d99bfd9c-0927-435b-9a7c-192aaf7a687e --app-name P-DELTA --resource-group P-DELTA_group --no-use-keychain Welcome to Azure Static Web Apps CLI (1.1.8) Checking Azure session... ✔ Successfully logged into Azure! ✖ Failed to setup project: EPERM: operation not permitted, open 'C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE.env' ✖ If you believe this behavior is unexpected, please raise a GitHub issue at: https://github.com/Azure/static-web-apps-cli/issues/new/choose Impossible de s’authentifier auprès de Static Web App 'P-DELTA'.

mbouthillette avatar May 23 '24 15:05 mbouthillette

@mbouthillette please have you found a solution to this, i have the same error to

SlimAhmad avatar Jun 01 '24 08:06 SlimAhmad

please have you found a solution to this, i have the same error to

ZYF500 avatar Jun 14 '24 15:06 ZYF500

Same error here.

improwise avatar Jun 20 '24 09:06 improwise

@improwise just make use of the cli, it works (swa) command

SlimAhmad avatar Jun 20 '24 10:06 SlimAhmad

Can you please provide the precise version of Visual Studio and the extension please?

adrianhall avatar Jul 01 '24 16:07 adrianhall

Here is how I fixed this issue:

  1. Open an admin terminal
  2. Change directory to C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE
  3. Create an empty file called ".env" in that folder
  4. Change the permissions on that file to all all access to all users (or your specific user if preferred)

This .env file is used to persist your Azure subscription ID and tenant ID. It is not clear what other things it do, so it is possible this may introduce a security issue; perhaps someone from Microsoft could comment.

payetools avatar Jul 22 '24 15:07 payetools

@payetools proposed solution did not work for me. Deployment still fails with a new error message "Failed to setup project: EISDIR: illegal operation on a directory, read"

Bengkel avatar Jul 31 '24 05:07 Bengkel