Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azd deploy frontend cant deploy #34

Closed
ahmedzafar89 opened this issue May 13, 2024 · 2 comments
Closed

azd deploy frontend cant deploy #34

ahmedzafar89 opened this issue May 13, 2024 · 2 comments

Comments

@ahmedzafar89
Copy link

Hi thank you for the amazing workshop.
Whenever I'm trying to deploy the workshop i'm getting this error in azd deploy for frontend. Backend can be deployed without any issue. Can you please help on this. Thank you.

azd deploy

Deploying services (azd deploy)

  (✓) Done: Deploying service backend
  - Endpoint: https://backend.prouddune-953d9eb4.japaneast.azurecontainerapps.io/

  |===    | Deploying service frontend (Copying deployment package)Export-ModuleMember: C:\Users\Ahmed\AppData\Local\Temp\azd-predeploy-1559059345.ps1:4
Line |
   4 |  Export-ModuleMember -Variable BACKEND_API_URI && npm run build
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | The Export-ModuleMember cmdlet can only be called from inside a module.
  (x) Failed: Deploying service frontend

ERROR: failed deploying service 'frontend': failed invoking event handlers for 'predeploy', 'predeploy' hook failed with exit code: '1', Path: 'C:\Users\Ahmed\AppData\Local\Temp\azd-predeploy-1559059345.ps1'. : exit code: 1
@sinedied
Copy link
Collaborator

Thanks for the report.
Could you provide us the following information to help us debug this?

  • What's your Windows version?
  • What terminal did you use to run the azd command?
  • Could you run $PsVersionTable in a Powershell terminal and copy/paste the output here?

@ahmedzafar89
Copy link
Author

hi, sorry for the late reply.
I was able to run the deployment after changing that line to
run: $env:BACKEND_API_URI = (Get-Content ../../.env | ForEach-Object { $name, $value = $_.split('='); if ($name -eq 'BACKEND_API_URI') { $value } })[0] && npm run build
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants