Skip to content

Commit ccf5baf

Browse files
author
Yoichi Kawasaki
committed
Added documentations
1 parent ee448b1 commit ccf5baf

File tree

8 files changed

+39
-5
lines changed

8 files changed

+39
-5
lines changed

README.md

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,38 @@
11
# azure-database-scaler
2-
Event driven Logic App and Functions that scale-up or scale-down the capacity of your Azure database service instance (Currently only vCore # is supported)
2+
Event driven Azure Logic App & Functions App that scale-up or scale-down the capacity of your Azure database service instance (Currently only vCore # is supported)
33

4+
Targets Azure Databases to scale in this project:
5+
- [Azure Database for MySQL](https://azure.microsoft.com/en-us/services/mysql/)
6+
- [Azure Database for PostgreSQL](https://azure.microsoft.com/en-us/services/postgresql/)
7+
8+
What to scale up/down?
9+
- vCores ([What is vCore?](https://docs.microsoft.com/en-us/azure/mysql/concepts-pricing-tiers#compute-generations-vcores-and-memory))
10+
11+
How to scale up/down?
12+
- azure-database-scaler starts scaling-up or scaling-down the number of vCore when it is triggered by Azure Monitor Metric Alerts (Alerts providers must be either `Microsoft.DBforMySQL` or `Microsoft.DBforPostgreSQL`)
13+
- azure-database-scaler scale-up or scale-down the number of vCore within the same database tier & the same compute generations (Gen4 / Gen5) of your instance in the way like:
14+
- Basic Tier: 1 <-> 2
15+
- General Purpose Tier: 2 <-> 4 <-> 8 <-> 16 <-> 32
16+
- Memory Optimized Tier: 2 <-> 4 <-> 8 <-> 16 <-> 32
17+
- azure-database-scaler scale-up the number of vCore when Alert Operator of triggering Alerts is either `GreaterThan` or `GreaterThanOrEqual`
18+
- azure-database-scaler scale-down the number of vCore when Alert Operator of triggering Alerts is either `LessThan` or `LessThanOrEqual`
19+
20+
Architecture:
21+
![](images/architecture-overview.png)
22+
23+
Relevant Services:
24+
- [Azure Database for MySQL](https://azure.microsoft.com/en-us/services/mysql/)
25+
- [Azure Database for PostgreSQL](https://azure.microsoft.com/en-us/services/postgresql/)
26+
- [Azure Functions](https://azure.microsoft.com/en-us/services/functions/)
27+
- [Azure Logic Apps](https://azure.microsoft.com/en-us/services/logic-apps/)
28+
- [Azure Monitor Alerts (Classic)](https://docs.microsoft.com/en-us/azure/monitoring-and-diagnostics/monitoring-overview-alerts)
29+
- [Azure Monitor Alerts (New)](https://docs.microsoft.com/en-us/azure/monitoring-and-diagnostics/monitoring-overview-unified-alerts)
30+
- [Slack (for notification)](https://slack.com)
431

532
## How to deploy the scaler app
633
- [How to deploy the database scaler app](./docs/HOW-TO-DEPLOY-APP.md)
734

8-
## How to setup autoscale trigger
9-
- [How to setup Azure Alerts for autoscaling Azure Database Services](./docs/HOW-TO-SETUP-ALERTS.md)
35+
## How to setup Azure Metric Monitor for Autoscaling
36+
- [[Classic Metric Alert] How to setup Azure Monitor Metric Alerts](./docs/HOW-TO-SETUP-ALERTS.md)
37+
- \[New Metric Alert\] How to setup Azure Monitor Metric Alerts
38+

docs/HOW-TO-DEPLOY-APP.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ pip install -U azure-cli
1010
```
1111
[NOTE] you can skip azure-cli installation if you execute bash commands from [Azure Cloud Shell](https://docs.microsoft.com/en-us/azure/cloud-shell/overview). I recommend you to use [Azure Cloud Shell Bash](https://docs.microsoft.com/en-us/azure/cloud-shell/overview) as it's browser based and you can run anywhere
1212

13+
![](../images/azure-cloud-shell-bash.png)
14+
15+
1316
## Create Resources and Deploy applications
1417

1518
### 1. Create Resource Group
@@ -93,7 +96,7 @@ Get the following functions' URLs (scheme + host/path + query) in the Azure Port
9396
- webhookhandler
9497

9598
Here is how you get get-sas-token function's URL.
96-
![](../images/screenshot-functions-url.png)
99+
![](../images/webhookhandler-url.png)
97100

98101
Once you get `webhookhandler` function URL, replace `WebhookSubscribeAPIEndpoint` value with `webhookhandler` function URL in `project.conf` like this:
99102
```
@@ -107,5 +110,6 @@ Create Azure Logic App Account and deploy a workflow to the account by running a
107110
scripts/setup-logicapp.sh
108111
```
109112

110-
### 8. Configure Connection to your Slack account
113+
### 8. Authorize the logic app to access your Slack account
111114

115+
![](../images/slack-authorization-steps.png)

docs/HOW-TO-SETUP-ALERTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# How to setup Azure Alerts for Azure Database autoscaling
22

33

4+
![](../images/alert-configuration-steps.png)
1.04 MB
Loading

images/architecture-overview.png

450 KB
Loading

images/azure-cloud-shell-bash.png

1010 KB
Loading
1.07 MB
Loading

images/webhookhandler-url.png

1.02 MB
Loading

0 commit comments

Comments
 (0)