Azure-Samples / contoso-real-estate

Intelligent enterprise-grade reference architecture for JavaScript, featuring OpenAI integration, Azure Developer CLI template and Playwright tests.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug] `azd up` failed

dfberry opened this issue · comments

Are you accessing the project from the GitHub Codespaces?

  • No, I am running the project on my local machine (I will fill in the OS section below)
  • [X ] Yes, I am using GitHub Codespaces.

Note: The project is optimized to run on Codespaces. We welcome contributions to enhance it for cross-platform local development, but it's not something we will prioritize right now. Thank you!

Describe the bug
azd up failed - see screenshot

To Reproduce
Steps to reproduce the behavior:

  1. New codespaces environment
  2. azd login successful
  3. azd up
  4. See error
No match found for {{SERVICE_BLOG_URI_PLACEHOLDER}}. Skipping replacement.
  (x) Failed: Packaging service portal

ERROR: failed packaging service 'portal': failed invoking event handlers for 'postpackage', 'postpackage' hook failed with exit code: '1', Path: '../../infra/hooks/portal/predeploy.js'. : exit code: 1

Expected behavior
Successful deployment

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

image

OS (please complete the following information):

  • OS:
  • OS Version:
  • npm version:
  • Node.js version:
  • output of azd version:

Additional context
Add any other context about the problem here.

We do not recommend the use of azd up, but azd provision and then azd deploy. This is because when running azd up, the application is built before the provisioning, and then the provisioning urls and other env. variables that come from the provisioning phase (connection strings, secrets, etc) are not available. As explained in the readme https://github.com/Azure-Samples/contoso-real-estate#deploy-to-azure-1 the commands should be executed in that order.

I just ran into this same issue/error and it would be nice to potentially get more info in the error or a suggestion to try the seperate commands. Coming from other templates, I just naievly ran azd up like I have everywhere so tooling/message prompts to help me understand this was needed (yes I should have read the docs but I wanted to go fast :P ) would be great <3

@crazy4pi314 If azd up could have told you the resources weren't provisioned and do you want to provision first in a separate command, would that be helpful? Not sure if it is possible ...