{"id":20697612,"url":"https://github.com/epomatti/azure-serverless-autoscaling","last_synced_at":"2026-04-11T03:33:48.978Z","repository":{"id":108712322,"uuid":"543367036","full_name":"epomatti/azure-serverless-autoscaling","owner":"epomatti","description":"Java Spring Boot microservices using Azure serverless technology","archived":false,"fork":false,"pushed_at":"2022-10-19T22:18:15.000Z","size":301,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-06T07:08:33.454Z","etag":null,"topics":["autoscaling","azure","azure-container-apps","azure-sql-database","azure-sqlserver-serverless","java","serverless","spring","spring-boot","terraform"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/epomatti.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-09-30T00:17:10.000Z","updated_at":"2023-06-05T02:58:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"5e7c121b-298c-4b66-8efa-196b047317af","html_url":"https://github.com/epomatti/azure-serverless-autoscaling","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/epomatti/azure-serverless-autoscaling","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epomatti%2Fazure-serverless-autoscaling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epomatti%2Fazure-serverless-autoscaling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epomatti%2Fazure-serverless-autoscaling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epomatti%2Fazure-serverless-autoscaling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/epomatti","download_url":"https://codeload.github.com/epomatti/azure-serverless-autoscaling/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epomatti%2Fazure-serverless-autoscaling/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31668048,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T17:19:37.612Z","status":"online","status_checked_at":"2026-04-11T02:00:05.776Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["autoscaling","azure","azure-container-apps","azure-sql-database","azure-sqlserver-serverless","java","serverless","spring","spring-boot","terraform"],"created_at":"2024-11-17T00:19:10.501Z","updated_at":"2026-04-11T03:33:48.951Z","avatar_url":"https://github.com/epomatti.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Azure Serverless Auto Scaling\n\nContainer Apps and SQL Server Serverless operating with auto-scale.\n\n\u003cimg src=\".docs/dashboard.png\" /\u003e\n\n## Setup the Infrastructure\n\nTo create the infrastructure simply enter the `infra` directory and apply:\n\n```sh\ncd infra\n\nterraform init\nterraform apply -auto-approve\n```\n\nThe setup has default variables that you can override with an `.auto.tfvars` file:\n\n```hcl\n# Resources\nlocation = \"eastus2\"\n\n# SQL Server\nsqlserver_version                     = \"12.0\"\nsqlserver_max_size_gb                 = 10\nsqlserver_sku_name                    = \"GP_S_Gen5_4\"\nsqlserver_auto_pause_delay_in_minutes = 60\nsqlserver_min_capacity                = 0.5\nsqlserver_zone_redundant              = false\n\n# Apps\napp_cpu                            = 1\napp_memory                         = \"2.0Gi\"\napp_min_replicas                   = 1\napp_max_replicas                   = 20\napp_auto_scale_concurrent_requests = 50\nauto_scale_cpu                     = 50\n```\n\nSimply run a load testing tool to view the application metrics. Example with K6:\n\n```sh\nk6 run \\\n    -e HOST_URL=\"https://\u003caddress\u003e\" \\\n    --vus 100 \\\n    --duration 500s \\\n    http_post.js\n```\n\n```sh\nk6 run \\\n    --vus 100 \\\n    --duration 500s \\\n    orders.js\n```\n\n## Local Development\n\nSetup for local development:\n\n```sh\ncd app\n\ndocker run -e \"ACCEPT_EULA=Y\" -e \"MSSQL_SA_PASSWORD=P4ssw0rd#777\" -p 1433:1433 -d mcr.microsoft.com/mssql/server:2022-latest\n\nmvn spring-boot:run -Dspring-boot.run.profiles=dev\n```\n\nSetting the \n\n```sh\nexport APPLICATIONINSIGHTS_CONNECTION_STRING=\"\u003c...\u003e\"\n```\n\n## Update Docker image\n\n```sh\ncd app\n\ndocker build . -t epomatti/azure-sqlserverless-books\ndocker login --username=epomatti\ndocker push epomatti/azure-sqlserverless-books\n```\n\nTesting the image locally:\n\n```sh\ndocker run -it --rm \\\n    -e SQLSERVER_JDBC_URL=\"jdbc:sqlserver://\u003c\u003c\u003cSERVER\u003e\u003e\u003e.database.windows.net:1433;database=\u003c\u003c\u003cDATABASE\u003e\u003e\u003e;user=\u003c\u003c\u003cUSERNAME\u003e\u003e\u003e;password=\u003c\u003c\u003cPASSWORD\u003e\u003e\u003e;encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30;\" \\\n    -e APPLICATIONINSIGHTS_CONNECTION_STRING=\"InstrumentationKey=00000000000000000000000000;IngestionEndpoint=https://eastus2-3.in.applicationinsights.azure.com/;LiveEndpoint=https://eastus2.livediagnostics.monitor.azure.com/\" \\\n    -e HIKARI_CONFIG_LOGGING_LEVEL=\"INFO\" \\\n    -e HIKARI_LOGGING_LEVEL=\"INFO\" \\\n    -p 8080:8080 \\\n    -t epomatti/azure-sqlserverless-books\n```\n\n## References\n\n- [9 tips for containerizing your Spring Boot code](https://www.docker.com/blog/9-tips-for-containerizing-your-spring-boot-code/)\n- [Azure Container Apps Virtual Network integration](https://techcommunity.microsoft.com/t5/apps-on-azure-blog/azure-container-apps-virtual-network-integration/ba-p/3096932)\n- [Microsoft - Container Apps REST API](https://learn.microsoft.com/en-us/rest/api/containerapps/managed-environments/create-or-update?tabs=HTTP#vnetconfiguration)\n- [Azure Private Link vs Service Endpoints](https://sameeraman.wordpress.com/2019/10/30/azure-private-link-vs-azure-service-endpoints/)\n- [Microsoft Blog - Optimize Price Performance](https://azure.microsoft.com/pt-br/blog/optimize-price-performance-with-compute-auto-scaling-in-azure-sql-database-serverless/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fepomatti%2Fazure-serverless-autoscaling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fepomatti%2Fazure-serverless-autoscaling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fepomatti%2Fazure-serverless-autoscaling/lists"}