Azure / awesome-azd

An awesome list that curates content (articles, videos, tutorials and docs) and templates (ready to use) for the Azure Developer CLI (`azd`). Plus a hosted azd-templates Gallery to simplify search & discovery
https://aka.ms/awesome-azd
MIT License
177 stars 89 forks source link

[Submit Template] Azure SQL + Prisma #43

Closed glaucia86 closed 8 months ago

glaucia86 commented 2 years ago

New azd-template Submission

Fill in the sections below to populate a new Gallery carry for your template. An example of a valid template object is given at the end for reference. All fields are mandatory unless explicitly identified as optional

1. Title

Full Stack Application with Azure SQL & Prisma

2. Description

A real study case application how to apply Node.Js with:

3. Author Profile

GitHub Repository Link Author - Glaucia Lemos

4. Author Name

Glaucia Lemos

5. Template Repo

The GitHub repo containing the template being contributed - must be a valid, complete template

6. Standard Tags

vuejs, azure-functions, azure-static-web-apps, azure-sql, nodejs, javascript, azure, prisma, github-actions, dev-container

7. Additional Tags (optional)

Don't see a relevant standard tag for your template? Request these tags be added, and then used for your template. These could be new languages, services, or application domains.

8. Architecture Diagram or Application Screenshot

HERE


Example Of Valid Template

  {
    title: 'Full Stack Application with Azure SQL & Prisma',
    description: 'A Full Stack Application how you can build a CRUD application using Azure SQL, Prisma, Azure Functions and with a deployment of this application with Azure Static Web Apps integrated with GitHub Actions. ',
      preview: ``,
    website: 'https://github.com/glaucia86',
    author: 'Glaucia Lemos',
    source: 'https://github.com/glaucia86/azure-sql-prisma-vue',
    tags: ['vuejs','azure-functions','javascript','nodejs','azure-sql','azure-static-web-apps','prisma','dev-container'],
  },

Next Steps

Once submitted the issue will be reviewed - we plan to do reviews on a rolling basis at regular intervals. The process will involve checking that template information is complete, and the template is valid.

jongio commented 2 years ago

Awesome! Thanks a lot. Can you please:

  1. Add azd to the devcontainer - see https://github.com/Azure/azure-dev/tree/main/templates/common/.devcontainer for a bunch of examples
  2. Add azd up and azd install steps to the readme.

I'm testing it otherwise now.

jongio commented 2 years ago
  1. Please have a look at the all new bicep module structure and get the /core modules in the project and then follow that same structure as much as possible.
  2. In azure.yaml, provider section is optional. You can remove it.
  3. Please update azure.yaml to include the full app.

I think it will be best if you open a PR against your repo so I can provide feedback in the form of PR comments.

jongio commented 2 years ago

Since you are using SQL server, you may want to reach out to @madebygps who is wrapping up a similar template. You'll want to follow that same pattern for getting and setting passwords (if you can).

https://github.com/Azure/azure-dev/pull/551

glaucia86 commented 2 years ago
  1. Please have a look at the all new bicep module structure and get the /core modules in the project and then follow that same structure as much as possible.
  2. In azure.yaml, provider section is optional. You can remove it.
  3. Please update azure.yaml to include the full app.

I think it will be best if you open a PR against your repo so I can provide feedback in the form of PR comments.

Hi, @jongio. I confess that I have some difficult to create these azd files stuff. Once I'm still learning it and I think so difficult how to create (my feedback as a developer). Who created for me this infra folder was @manekinekko. I asked for his help. If you could update it, I really appreciated it. If you can't, I will ask for someone for update it.

manekinekko commented 2 years ago

I am working on this issue @glaucia86 👍

manekinekko commented 2 years ago

@jongio while working on updating the PR for Glaucia, I had a few comments and questions:

Please have a look at the all new bicep module structure and get the /core modules in the project and then follow that same structure as much as possible.

Are all those core modules required for this template? The template doesn't need all of those services. Is azd parsing this exact folder structure? Or can it be flexible?

In azure.yaml, provider section is optional. You can remove it.

Done.

You'll want to follow that same pattern for getting and setting passwords (if you can).

The app in this template is not using KeyVault. This is why we haven't provisioned that resource. Also, I was checking PR #551 and noted this function secretOrRandomPassword. Where is this function defined?

Add azd to the devcontainer - see https://github.com/Azure/azure-dev/tree/main/templates/common/.devcontainer for a bunch of examples

Done.

Please update azure.yaml to include the full app.

The template is meant to be deployed to SWA. Both client and API. This is currently not possible using azd deploy (see https://github.com/Azure/azure-dev/issues/837 )

Add azd up and azd install steps to the readme.

It's already there (at the bottom under > Project: db). Do you need to be moved elsewhere?

jongio commented 2 years ago

Okay, I didn't see that as it is a collapsed section.

  1. Please move to using azd env set commands for setting env vars instead of asking them to create a .env in the api folder.
  2. You don't need all of what is in /core. But the structure should be adopted in templates coming from MS. You can remove what you don't need.
  3. secretOrRandomPassword https://github.com/Azure/azure-dev/blob/8bb8e2d992b7fb2878d2be489adaedac5d567e93/cli/azd/pkg/cmdsubst/secretOrRandomPassword.go
  4. Are you using the SWA config file in this app to deploy the API?
manekinekko commented 2 years ago

Please move to using azd env set commands for setting env vars instead of asking them to create a .env in the api folder.

@glaucia86 are you OK with this change? Would this affect the structure of your videos?

You don't need all of what is in /core. But the structure should be adopted in templates coming from MS. You can remove what you don't need.

Gotcha!

Are you using the SWA config file in this app to deploy the API?

Yes. Because of this https://github.com/Azure/azure-dev/issues/837

glaucia86 commented 2 years ago

Please move to using azd env set commands for setting env vars instead of asking them to create a .env in the api folder.

@glaucia86 are you OK with this change? Would this affect the structure of your videos?

You don't need all of what is in /core. But the structure should be adopted in templates coming from MS. You can remove what you don't need.

Gotcha!

Are you using the SWA config file in this app to deploy the API?

Yes. Because of this Azure/azure-dev#837

Sorry for my delay here. No problem @manekinekko. Later I can create a article or another video with these new changes.

jongio commented 2 years ago

/core has been updated. please have a look at what is in main

Also LMK if you want to work together on this.

jongio commented 1 year ago

@glaucia86 - Would you like to work on getting this updated/added?

glaucia86 commented 1 year ago

@glaucia86 - Would you like to work on getting this updated/added? Hi, @jongio! If you could help me, I will really appreciate it!

rajeshkamal5050 commented 1 year ago

@jongio can you help @glaucia86 in moving to core bicep modules?

manekinekko commented 1 year ago

@rajeshkamal5050 @jongio fwiw, I've started doing some migration work in my PR here for @glaucia86. Feel free to grab that PR so that you don't have to start from scratch.

glaucia86 commented 1 year ago

Thank you, @manekinekko. I really appreciate all your effort here. But, please rest up! You have been working hard on the other project. I was scheduling a call meeting 2 weeks ago with @jongio to help me with this project after I return from my vacation. Please, rest up!

rajeshkamal5050 commented 1 year ago

@glaucia86 any updates on the template?