{"id":19411585,"url":"https://github.com/suizer98/nextjsazure","last_synced_at":"2026-04-11T12:02:39.133Z","repository":{"id":228329633,"uuid":"773664790","full_name":"Suizer98/nextjsazure","owner":"Suizer98","description":"This project involves deploying and hosting a Nextjs app on Azure platform","archived":false,"fork":false,"pushed_at":"2025-01-18T03:54:43.000Z","size":2343,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-18T04:34:29.271Z","etag":null,"topics":["azure","azure-app-service","azure-functions","azure-pipelines","docker","microsoft","nextjs","react","sqlserver","typescript"],"latest_commit_sha":null,"homepage":"https://nextjsazure.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Suizer98.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-18T07:11:18.000Z","updated_at":"2025-01-18T03:54:44.000Z","dependencies_parsed_at":"2024-11-03T05:17:55.041Z","dependency_job_id":"77682ab2-dc4b-4c69-8794-07762fc9179e","html_url":"https://github.com/Suizer98/nextjsazure","commit_stats":null,"previous_names":["suizer98/weddingbackendnextjs","suizer98/nextjsazure"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Suizer98%2Fnextjsazure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Suizer98%2Fnextjsazure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Suizer98%2Fnextjsazure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Suizer98%2Fnextjsazure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Suizer98","download_url":"https://codeload.github.com/Suizer98/nextjsazure/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240589038,"owners_count":19825285,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["azure","azure-app-service","azure-functions","azure-pipelines","docker","microsoft","nextjs","react","sqlserver","typescript"],"created_at":"2024-11-10T12:22:08.784Z","updated_at":"2026-04-11T12:02:39.088Z","avatar_url":"https://github.com/Suizer98.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nextjs app for Azure use\n\nThis is a nextjs project consisting a OpenLayer Map that show beautiful windy style layer. The main goal of\nthis website is to showcase complete workflow of auto deploy\npipeline using Github Actions to Microsoft Azure platform.\n\nTwo approaches were practiced:\n\n1. **IaaS Approach using Azure Virtual Machines**:\n\n   - Deploy the application on an Azure Ubuntu Virtual Machine.\n   - Manage the entire VM, including Docker containers, ports, application dependencies.\n   - Suitable for scenarios requiring deep customisation and control over the server environment.\n\n2. **PaaS Approach using Azure Web App Service and Azure Container Apps**:\n   - Deploy the application using Azure Web App Service for managed hosting.\n   - Utilize Azure Container Instances to deploy the Docker image from Container Registry.\n   - Simplifies deployment and management with less overhead.\n\n## Tech stacks:\n\n![Tech stacks](https://skillicons.dev/icons?i=ts,next,tailwind,prisma,azure,githubactions,docker,ubuntu,bash,vercel,npm,mysql)\n\nThe application is hosted on:\n\n1. Azure Ubuntu Virtual Machine (Production, discontinued)\n\n2. Azure Web App Service (Staging, discontinued): [https://nextjsazure.azurewebsites.net/](https://nextjsazure.azurewebsites.net/)\n\n3. Azure Container App (Staging, discontinued): [http://suizer.bqazfuf4fmdfdjgr.southeastasia.azurecontainer.io/](http://suizer.bqazfuf4fmdfdjgr.southeastasia.azurecontainer.io/)\n\n4. Vercel (dev site with no database connection): [https://nextjsazure.vercel.app/](https://nextjsazure.vercel.app/)\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### Local development\n\nRuns the app in the development mode.\n\n```\nnpm install\nnpm run dev\n```\n\nOpen [http://localhost:8000/](http://localhost:8000/) to view it in the browser.\n\nThe page will reload if you make edits.\nYou will also see any lint errors in the console.\n\n### Found issues in code style?\n\nTo fix all formatting and linting using `prettier`:\n\n```\nnpm run format\n```\n\n### Storing your database password and secretkey\n\n```.env\nDATABASE_URL=sqlserver://\nSDATABASE_URL=sqlserver:// # Shadow database for prisma migration\n```\n\nYou can store the env variable somewhere using .env or setting this inside your container or pipeline variables so it don't get exposed\n\n### Database connection\n\nIn this project we use Prisma ORM to talk with database:\n\n```\nnpx prisma init\nnpx prisma generate\nnpx prisma migrate dev\n```\n\n### Running inside docker container\n\nMust have wsl2 and Docker Desktop installed:\n\n```\ndocker-compose up --build\ndocker exec nextjsazure-nextjsazure-1 npx prisma generate\ndocker exec nextjsazure-nextjsazure-1 npm run format\n```\n\n### Steps to setup Azure functions\n\n1. Go to Azure Portal\n2. Create a resource group\n3. Create a container registry (ACR) under same resource group\n4. Create a web service/container instance tied to that ACR\n\n---\n\nYou will also need to install Azure Cli to perform:\n\n```\naz login\naz account set --subscription \"\u003cYour-Subscription-Name-Or-ID\u003e\"\naz ad sp create-for-rbac --name \"\u003cYour-Service-Principal-Name\u003e\" --role contributor --scopes /subscriptions/{SubscriptionId}/resourceGroups/\u003cYour-Resource-Group-Name\u003e\naz webapp log tail --name \u003capp-name\u003e --resource-group \u003cresource-group-name\u003e # log\n```\n\n### Connect to Azure Web App SSH\n\nFollow the Dockerfile configuration, then go to:\nhttps://learn.microsoft.com/en-gb/azure/app-service/configure-custom-container?pivots=container-linux\u0026tabs=debian#enable-ssh\n\n### Problem troubleshooting Azure web app linux host connecting to Azure SQL Server\n\nMany people have been facing issues establishing a connection between Azure linux hosted web app and Azure SQL database server.\nSome of the forum discussions: https://serverfault.com/questions/1104918/azure-app-service-to-sql-server-db-connection-fails-with-generic-error-occurred\n\nThe alternative way is to use a Azure virtual machine instead.\n\n### How to deploy nextjsazure to Azure Ubuntu VM\n\nIf you are looking to deploy this Next.js app on an Azure Ubuntu VM, please refer to the documentation provided [here](docs/README_VM.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuizer98%2Fnextjsazure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuizer98%2Fnextjsazure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuizer98%2Fnextjsazure/lists"}