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

[New azd-template] Flask container with CDN #89

Closed
pamelafox opened this issue Feb 3, 2023 · 14 comments
Closed

[New azd-template] Flask container with CDN #89

pamelafox opened this issue Feb 3, 2023 · 14 comments

Comments

@pamelafox
Copy link
Member

New azd-template Submission

Fill in the sections below to populate a new gallery card for your template. All fields are mandatory unless explicitly identified as optional

1. Description

1-2 sentence description of the architecture or solution that is defined by the template. If this is a requested template, please tag the GitHub issue containing the request.

A simple photos website written with Python Flask and Bootstrap. Can be run locally with Docker and then deployed to Azure Container Apps with an Azure CDN in front.

2. Author Information

Name: Pamela Fox

Link: https://github.com/pamelafox

3. Template Repo

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

https://github.com/pamelafox/flask-gallery-container-app

4. Link to PR where you made your repo azd compatible

To allow us to provide feedback on your template, please include a link to the PR where you added azd compatibility

Sorry, there's not one particular PR, but you can check azure.yaml, the infra/ folder, and .github/workflows.

5. Tags

Standard: One or more tags representing the template. Look at the currently available tags on the Gallery page. Provide at least 1 tag for programming language used and at least 1 tag for Azure services integrated. Also tag the IaC provider (Bicep or Terraform)

Python, Flask, Web Apps, Azure Container Apps

Additional: Don't see a relevant tag for your template? Suggest tags to be added and used for your template. These could be new languages, services, or application domains.

Azure CDN

6. Architecture Diagram or Application Screenshot

Used as display image for gallery card-- should include all services and their connections. Example

readme_diagram

7. Related Issues (optional)

Is this a template that was requested in a separate issue? If so, please tag the related issue here.

Next Steps

Once submitted, the issue will be reviewed - we plan to do reviews on a rolling basis at regular intervals. The process will include verifying all information required for the template gallery is provided and the template works (i.e., successfully deploys to Azure with azd up).

  • If we have questions or enhancements, we will add comments in issue thread (issue stays open)
  • If the contribution is approved, we'll update the gallery directly (issue will then be closed)
@rajeshkamal5050
Copy link
Contributor

rajeshkamal5050 commented Feb 6, 2023

@v-xuto can you do a dry-run on this template and update here for any issues/feedback?

@v-xuto
Copy link
Member

v-xuto commented Feb 17, 2023

@pamelafox We have finished testing this template. There is only one small issue, the discussion link in README is unavailable, please update README.
image

@pamelafox
Copy link
Member Author

Thanks! I've removed the link and just bolded the word (it's a tab on the Github page, so fairly easy to find).

@jongio
Copy link
Member

jongio commented Feb 17, 2023

@pamelafox - Can you get your new resources in azure-dev/core?

@pamelafox
Copy link
Member Author

Do you mean the CDN stuff? The most reusable bit is the CDN profile:
https://github.com/pamelafox/flask-gallery-container-app/blob/main/infra/cdn-profile.bicep

The endpoint is a lot more variable since it depends what rules you want:
https://github.com/pamelafox/flask-gallery-container-app/blob/main/infra/cdn-endpoint.bicep

If I made the CDN endpoint into a module, devs would still need to pass in their lengthy rules (and possibly other customizations). But maybe it's still useful?

@v-xuto
Copy link
Member

v-xuto commented Feb 22, 2023

@pamelafox Please add expected results for try '/hello?name=yourname' on the Readme.

image

@pamelafox
Copy link
Member Author

I've updated the readme step to say "Confirm the photos load on the index page and click a photo to see the order page."
Good catch!

@v-xuto
Copy link
Member

v-xuto commented Feb 23, 2023

@jongio We have run this template without any issues. Please review it.

@pamelafox
Copy link
Member Author

After a discussion with some App Service and ACA PMs last week, I've realized that websites aren't the most appropriate use of ACA. A website should be hosted as a BYOC Web App, which azd does not yet support (Azure/azure-dev#1608).
This article goes more into optimal uses of ACA:
https://learn.microsoft.com/en-us/azure/container-apps/compare-options

So my proposal is to table this template until azd supports BYOC, and I will submit another template instead that's more of a service than a website. It's nearly done, will send today. The infrastructure will be the same.

@jongio I'll also send a PR for cdn modules in azure-dev infra.

@pamelafox
Copy link
Member Author

Another option: I could also turn this into an App Service template, since App Service + CDN would be a standard combo.

@pamelafox
Copy link
Member Author

Here's my API-oriented version of this architecture:
#98

@pamelafox
Copy link
Member Author

Update: I ran the numbers today on my personal websites, and hosting on ACA with a CDN in front is actually much more cost effective than App Service + CDN, due the way ACA pricing is done. My ACA is $3 ($0 for the CDN at my traffic level), whereas App Service is $12.
So another reason for ACA plus CDN being a viable option.

@jongio
Copy link
Member

jongio commented Mar 15, 2023

:shipit:

@rajeshkamal5050
Copy link
Contributor

@hemarina please add it to the gallery

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

No branches or pull requests

9 participants