Add Vacation Planner for Azure Database for MySQL Flexible Server - #7
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new “Vacation Planner” sample that runs a Flask web app backed by Azure Database for MySQL Flexible Server, plus supporting deployment scripts/manifests for AKS (and LocalStack).
Changes:
- Introduces a Flask + PyMySQL implementation of the Vacation Planner app (UI, DB helper, gunicorn config).
- Adds AKS deployment artifacts (Dockerfile, scripts, ConfigMap/Secret/Deployment/Service/Namespace manifests).
- Registers the new sample in the repository root README.
Reviewed changes
Copilot reviewed 24 out of 65 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| samples/web-app-mysql-flexible-server/src/templates/index.html | UI template for listing/adding/editing/deleting activities |
| samples/web-app-mysql-flexible-server/src/static/style.css | Styling for the Vacation Planner UI |
| samples/web-app-mysql-flexible-server/src/static/bootstrap/css/bootstrap-utilities.rtl.min.css | Vendored Bootstrap utilities (RTL, minified) |
| samples/web-app-mysql-flexible-server/src/static/bootstrap/css/bootstrap-utilities.min.css | Vendored Bootstrap utilities (minified) |
| samples/web-app-mysql-flexible-server/src/static/bootstrap/css/bootstrap-reboot.rtl.min.css.map | Source map for Bootstrap reboot (RTL, minified) |
| samples/web-app-mysql-flexible-server/src/static/bootstrap/css/bootstrap-reboot.rtl.min.css | Vendored Bootstrap reboot (RTL, minified) |
| samples/web-app-mysql-flexible-server/src/static/bootstrap/css/bootstrap-reboot.rtl.css | Vendored Bootstrap reboot (RTL) |
| samples/web-app-mysql-flexible-server/src/static/bootstrap/css/bootstrap-reboot.min.css.map | Source map for Bootstrap reboot (minified) |
| samples/web-app-mysql-flexible-server/src/static/bootstrap/css/bootstrap-reboot.min.css | Vendored Bootstrap reboot (minified) |
| samples/web-app-mysql-flexible-server/src/static/bootstrap/css/bootstrap-reboot.css | Vendored Bootstrap reboot (unminified) |
| samples/web-app-mysql-flexible-server/src/requirements.txt | Python dependencies for the sample |
| samples/web-app-mysql-flexible-server/src/gunicorn.conf.py | Gunicorn worker signal handling configuration |
| samples/web-app-mysql-flexible-server/src/database.py | MySQL client wrapper (connect/init schema/CRUD) |
| samples/web-app-mysql-flexible-server/src/app.py | Flask application routes and wiring to the DB client |
| samples/web-app-mysql-flexible-server/scripts/service.yml | Kubernetes Service for the web app |
| samples/web-app-mysql-flexible-server/scripts/secret.yml | Kubernetes Secret template for sensitive env vars |
| samples/web-app-mysql-flexible-server/scripts/namespace.yml | Kubernetes Namespace manifest |
| samples/web-app-mysql-flexible-server/scripts/Dockerfile | Multi-stage build for the app container image |
| samples/web-app-mysql-flexible-server/scripts/deployment.yml | Kubernetes Deployment (replicas, probes, env wiring) |
| samples/web-app-mysql-flexible-server/scripts/configmap.yml | Kubernetes ConfigMap template for non-secret env vars |
| samples/web-app-mysql-flexible-server/scripts/05-deploy-app.sh | Applies manifests with yq templating and deploys to AKS |
| samples/web-app-mysql-flexible-server/scripts/04-push-docker-image.sh | Tags and pushes the image to ACR |
| samples/web-app-mysql-flexible-server/scripts/03-run-docker-container.sh | Local container run script for smoke testing |
| samples/web-app-mysql-flexible-server/scripts/02-build-docker-image.sh | Docker build script targeting the src/ build context |
| samples/web-app-mysql-flexible-server/scripts/01-deploy-resources.sh | Provisions Azure resources + bootstraps schema/seed data |
| samples/web-app-mysql-flexible-server/scripts/00-variables.sh | Shared script variables (resource names, creds, ports, etc.) |
| samples/web-app-mysql-flexible-server/README.md | Sample-level documentation and usage instructions |
| README.md | Adds the new MySQL Flexible Server sample to the samples list |
Files not reviewed (4)
- samples/web-app-mysql-flexible-server/src/static/bootstrap/css/bootstrap-grid.min.css: Generated file
- samples/web-app-mysql-flexible-server/src/static/bootstrap/css/bootstrap-grid.rtl.min.css: Generated file
- samples/web-app-mysql-flexible-server/src/static/bootstrap/css/bootstrap-reboot.css: Generated file
- samples/web-app-mysql-flexible-server/src/static/bootstrap/css/bootstrap-reboot.min.css: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| </button> | ||
| </td> | ||
| <td class="col-btn"> | ||
| <form method="post" action="{{ url_for('delete', activity_id=loop.index0) }}" class="delete-form"> |
Comment on lines
+81
to
+86
| @app.route("/delete/<int:activity_id>", methods=["POST"]) | ||
| def delete(activity_id: int): | ||
| if 0 <= activity_id < len(activities): | ||
| db_client.delete_activity(activities[activity_id][0]) | ||
| flash("Activity deleted.") | ||
| return redirect(url_for("index")) |
Comment on lines
+52
to
+53
| activity = request.form.get("activity") | ||
| if activity: |
Comment on lines
+67
to
+68
| except (ConnectionError, ValueError) as e: | ||
| logger.error("Error writing activity: %s", e) |
Comment on lines
+108
to
+111
| ssl_ctx = ssl.create_default_context() | ||
| ssl_ctx.check_hostname = False | ||
| ssl_ctx.verify_mode = ssl.CERT_NONE | ||
| kwargs["ssl"] = ssl_ctx |
Comment on lines
+87
to
+89
| httpGet: | ||
| path: / | ||
| port: http |
Comment on lines
+54
to
+55
| yq "(.data.MYSQL_PASSWORD)|="\""$(echo -n $MYSQL_USER_PASSWORD | base64 -w0)"\" | | ||
| yq "(.data.SECRET_KEY)|="\""$(echo -n $FLASK_SECRET_KEY | base64 -w0)"\" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
This pull request adds the Vacation Planner sample for Azure Database for MySQL Flexible Server to the repository.
Changes
This pull requests adds:
samples/web-app-mysql-flexible-server/srcfolder.samples/web-app-mysql-flexible-server/scriptsfolder.