Skip to content

Commit 4996feb

Browse files
Merge pull request #116591 from mikefrobbins/mr-mariadb
Added PowerShell content for MariaDB
2 parents 981578b + 502040d commit 4996feb

9 files changed

+1047
-13
lines changed

articles/mariadb/TOC.yml

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@
99
- name: Quickstarts
1010
expanded: true
1111
items:
12-
- name: Create DB - Portal
13-
href: quickstart-create-mariadb-server-database-using-azure-portal.md
14-
- name: Create DB - Azure CLI
15-
href: quickstart-create-mariadb-server-database-using-azure-cli.md
16-
- name: Create DB - ARM template
17-
href: quickstart-create-mariadb-server-database-arm-template.md
18-
displayName: deploy azure resource manager template
12+
- name: Create DB
13+
items:
14+
- name: Create DB - Portal
15+
href: quickstart-create-mariadb-server-database-using-azure-portal.md
16+
- name: Create DB - Azure CLI
17+
href: quickstart-create-mariadb-server-database-using-azure-cli.md
18+
- name: Create DB - Azure PowerShell
19+
href: quickstart-create-mariadb-server-database-using-azure-powershell.md
20+
- name: Create DB - ARM template
21+
href: quickstart-create-mariadb-server-database-arm-template.md
22+
displayName: deploy azure resource manager template
1923
- name: Connect & query
2024
items:
2125
- name: MySQL Workbench
@@ -28,6 +32,8 @@
2832
href: tutorial-design-database-using-portal.md
2933
- name: Azure CLI
3034
href: tutorial-design-database-cli.md
35+
- name: Azure PowerShell
36+
href: tutorial-design-database-using-powershell.md
3137
- name: Samples
3238
items:
3339
- name: Azure CLI
@@ -50,7 +56,7 @@
5056
- name: Pricing tiers
5157
href: concepts-pricing-tiers.md
5258
- name: Prepay for reserved capacity
53-
href: concept-reserved-pricing.md
59+
href: concept-reserved-pricing.md
5460
- name: Limits
5561
href: concepts-limits.md
5662
- name: Data access & security
@@ -68,7 +74,7 @@
6874
- name: Private Link
6975
href: concepts-data-access-security-private-link.md
7076
- name: Advanced Threat Protection
71-
href: concepts-data-access-and-security-threat-protection.md
77+
href: concepts-data-access-and-security-threat-protection.md
7278
- name: Security baseline
7379
href: security-baseline.md
7480
- name: Business continuity
@@ -103,7 +109,7 @@
103109
- name: Data-in replication
104110
href: concepts-data-in-replication.md
105111
- name: Read replicas
106-
href: concepts-read-replicas.md
112+
href: concepts-read-replicas.md
107113
- name: How-to guides
108114
items:
109115
- name: Manage a server
@@ -122,6 +128,8 @@
122128
href: howto-restore-server-portal.md
123129
- name: Azure CLI
124130
href: howto-restore-server-cli.md
131+
- name: Azure PowerShell
132+
href: howto-restore-server-powershell.md
125133
- name: Migrate a database
126134
items:
127135
- name: Dump & restore
@@ -140,26 +148,30 @@
140148
href: howto-server-parameters.md
141149
- name: Azure CLI
142150
href: howto-configure-server-parameters-cli.md
151+
- name: Azure PowerShell
152+
href: howto-configure-server-parameters-using-powershell.md
143153
- name: Auto grow storage
144154
items:
145155
- name: Azure portal
146156
href: howto-auto-grow-storage-portal.md
147157
- name: Azure CLI
148-
href: howto-auto-grow-storage-cli.md
158+
href: howto-auto-grow-storage-cli.md
159+
- name: Azure PowerShell
160+
href: howto-auto-grow-storage-powershell.md
149161
- name: Deny Public Network Access
150162
items:
151163
- name: Azure portal
152164
href: howto-deny-public-network-access.md
153165
- name: Access server logs
154166
items:
155167
- name: Slow query logs
156-
items:
168+
items:
157169
- name: Azure portal
158170
href: howto-configure-server-logs-portal.md
159171
- name: Azure CLI
160172
href: howto-configure-server-logs-cli.md
161173
- name: Audit logs
162-
items:
174+
items:
163175
- name: Azure portal
164176
href: howto-configure-audit-logs-portal.md
165177
- name: Azure CLI
@@ -176,6 +188,8 @@
176188
href: howto-read-replicas-portal.md
177189
- name: Create read replicas Azure CLI, REST API
178190
href: howto-read-replicas-cli.md
191+
- name: Create read replicas Azure PowerShell
192+
href: howto-read-replicas-powershell.md
179193
- name: Troubleshoot
180194
items:
181195
- name: Troubleshoot connection errors
@@ -204,6 +218,8 @@
204218
href: howto-restart-server-portal.md
205219
- name: Azure CLI
206220
href: howto-restart-server-cli.md
221+
- name: Azure PowerShell
222+
href: howto-restart-server-powershell.md
207223
- name: Reference
208224
items:
209225
- name: Azure CLI
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
title: Auto grow storage - Azure PowerShell - Azure Database for MariaDB
3+
description: This article describes how you can enable auto grow storage using PowerShell in Azure Database for MariaDB.
4+
author: ajlam
5+
ms.author: andrela
6+
ms.service: mariadb
7+
ms.topic: conceptual
8+
ms.date: 5/26/2020
9+
---
10+
# Auto grow storage in Azure Database for MariaDB server using PowerShell
11+
12+
This article describes how you can configure an Azure Database for MariaDB server storage to grow
13+
without impacting the workload.
14+
15+
Storage auto grow prevents your server from
16+
[reaching the storage limit](/azure/mariadb/concepts-pricing-tiers#reaching-the-storage-limit) and
17+
becoming read-only. For servers with 100 GB or less of provisioned storage, the size is increased by
18+
5 GB when the free space is below 10%. For servers with more than 100 GB of provisioned storage, the
19+
size is increased by 5% when the free space is below 10 GB. Maximum storage limits apply as
20+
specified in the storage section of the
21+
[Azure Database for MariaDB pricing tiers](/azure/mariadb/concepts-pricing-tiers#storage).
22+
23+
> [!IMPORTANT]
24+
> Remember that storage can only be scaled up, not down.
25+
26+
## Prerequisites
27+
28+
To complete this how-to guide, you need:
29+
30+
- The [Az PowerShell module](https://docs.microsoft.com/powershell/azure/install-az-ps) installed locally or
31+
[Azure Cloud Shell](https://shell.azure.com/) in the browser
32+
- An [Azure Database for MariaDB server](quickstart-create-mariadb-server-database-using-azure-powershell.md)
33+
34+
> [!IMPORTANT]
35+
> While the Az.MariaDb PowerShell module is in preview, you must install it separately from the Az
36+
> PowerShell module using the following command: `Install-Module -Name Az.MariaDb -AllowPrerelease`.
37+
> Once the Az.MariaDb PowerShell module is generally available, it becomes part of future Az
38+
> PowerShell module releases and available natively from within Azure Cloud Shell.
39+
40+
If you choose to use PowerShell locally, connect to your Azure account using the
41+
[Connect-AzAccount](https://docs.microsoft.com/powershell/module/az.accounts/connect-azaccount) cmdlet.
42+
43+
## Enable MariaDB server storage auto grow
44+
45+
Enable server auto grow storage on an existing server with the following command:
46+
47+
```azurepowershell-interactive
48+
Update-AzMariaDbServer -Name mydemoserver -ResourceGroupName myresourcegroup -StorageAutogrow Enabled
49+
```
50+
51+
Enable server auto grow storage while creating a new server with the following command:
52+
53+
```azurepowershell-interactive
54+
$Password = Read-Host -Prompt 'Please enter your password' -AsSecureString
55+
New-AzMariaDbServer -Name mydemoserver -ResourceGroupName myresourcegroup -Sku GP_Gen5_2 -StorageAutogrow Enabled -Location westus -AdministratorUsername myadmin -AdministratorLoginPassword $Password
56+
```
57+
58+
## Next steps
59+
60+
> [!div class="nextstepaction"]
61+
> [How to create and manage read replicas in Azure Database for MariaDB using PowerShell](howto-read-replicas-powershell.md).
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
title: Configure server parameters - Azure PowerShell - Azure Database for MariaDB
3+
description: This article describes how to configure the service parameters in Azure Database for MariaDB using PowerShell.
4+
author: ajlam
5+
ms.author: andrela
6+
ms.service: mariadb
7+
ms.devlang: azurepowershell
8+
ms.topic: conceptual
9+
ms.date: 5/26/2020
10+
---
11+
12+
# Customize Azure Database for MariaDB server parameters using PowerShell
13+
14+
You can list, show, and update configuration parameters for an Azure Database for MariaDB server using
15+
PowerShell. A subset of engine configurations is exposed at the server-level and can be modified.
16+
17+
## Prerequisites
18+
19+
To complete this how-to guide, you need:
20+
21+
- The [Az PowerShell module](https://docs.microsoft.com/powershell/azure/install-az-ps) installed locally or
22+
[Azure Cloud Shell](https://shell.azure.com/) in the browser
23+
- An [Azure Database for MariaDB server](quickstart-create-mariadb-server-database-using-azure-powershell.md)
24+
25+
> [!IMPORTANT]
26+
> While the Az.MariaDb PowerShell module is in preview, you must install it separately from the Az
27+
> PowerShell module using the following command: `Install-Module -Name Az.MariaDb -AllowPrerelease`.
28+
> Once the Az.MariaDb PowerShell module is generally available, it becomes part of future Az
29+
> PowerShell module releases and available natively from within Azure Cloud Shell.
30+
31+
If you choose to use PowerShell locally, connect to your Azure account using the
32+
[Connect-AzAccount](https://docs.microsoft.com/powershell/module/az.accounts/connect-azaccount) cmdlet.
33+
34+
[!INCLUDE [cloud-shell-try-it.md](../../includes/cloud-shell-try-it.md)]
35+
36+
## List server configuration parameters for Azure Database for MariaDB server
37+
38+
To list all modifiable parameters in a server and their values, run the `Get-AzMariaDbConfiguration`
39+
cmdlet.
40+
41+
The following example lists the server configuration parameters for the server **mydemoserver** in
42+
resource group **myresourcegroup**.
43+
44+
```azurepowershell-interactive
45+
Get-AzMariaDbConfiguration -ResourceGroupName myresourcegroup -ServerName mydemoserver
46+
```
47+
48+
For the definition of each of the listed parameters, see the MariaDB reference section on
49+
[Server System Variables](https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html).
50+
51+
## Show server configuration parameter details
52+
53+
To show details about a particular configuration parameter for a server, run the
54+
`Get-AzMariaDbConfiguration` cmdlet and specify the **Name** parameter.
55+
56+
This example shows details of the **slow\_query\_log** server configuration parameter for server
57+
**mydemoserver** under resource group **myresourcegroup**.
58+
59+
```azurepowershell-interactive
60+
Get-AzMariaDbConfiguration -Name slow_query_log -ResourceGroupName myresourcegroup -ServerName mydemoserver
61+
```
62+
63+
## Modify a server configuration parameter value
64+
65+
You can also modify the value of a certain server configuration parameter, which updates the
66+
underlying configuration value for the MariaDB server engine. To update the configuration, use the
67+
`Update-AzMariaDbConfiguration` cmdlet.
68+
69+
To update the **slow\_query\_log** server configuration parameter of server
70+
**mydemoserver** under resource group **myresourcegroup**.
71+
72+
```azurepowershell-interactive
73+
Update-AzMariaDbConfiguration -Name slow_query_log -ResourceGroupName myresourcegroup -ServerName mydemoserver -Value On
74+
```
75+
76+
## Next steps
77+
78+
> [!div class="nextstepaction"]
79+
> [Auto grow storage in Azure Database for MariaDB server using PowerShell](howto-auto-grow-storage-powershell.md).
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
---
2+
title: Manage read replicas - Azure PowerShell - Azure Database for MariaDB
3+
description: Learn how to set up and manage read replicas in Azure Database for MariaDB using PowerShell.
4+
author: ajlam
5+
ms.author: andrela
6+
ms.service: mariadb
7+
ms.topic: conceptual
8+
ms.date: 5/26/2020
9+
---
10+
11+
# How to create and manage read replicas in Azure Database for MariaDB using PowerShell
12+
13+
In this article, you learn how to create and manage read replicas in the Azure Database for MariaDB
14+
service using PowerShell. To learn more about read replicas, see the
15+
[overview](concepts-read-replicas.md).
16+
17+
## Azure PowerShell
18+
19+
You can create and manage read replicas using PowerShell.
20+
21+
## Prerequisites
22+
23+
To complete this how-to guide, you need:
24+
25+
- The [Az PowerShell module](https://docs.microsoft.com/powershell/azure/install-az-ps) installed
26+
locally or [Azure Cloud Shell](https://shell.azure.com/) in the browser
27+
- An [Azure Database for MariaDB server](quickstart-create-mariadb-server-database-using-azure-powershell.md)
28+
29+
> [!IMPORTANT]
30+
> While the Az.MariaDb PowerShell module is in preview, you must install it separately from the Az
31+
> PowerShell module using the following command: `Install-Module -Name Az.MariaDb -AllowPrerelease`.
32+
> Once the Az.MariaDb PowerShell module is generally available, it becomes part of future Az
33+
> PowerShell module releases and available natively from within Azure Cloud Shell.
34+
35+
If you choose to use PowerShell locally, connect to your Azure account using the
36+
[Connect-AzAccount](https://docs.microsoft.com/powershell/module/az.accounts/connect-azaccount) cmdlet.
37+
38+
[!INCLUDE [cloud-shell-try-it.md](../../includes/cloud-shell-try-it.md)]
39+
40+
> [!IMPORTANT]
41+
> The read replica feature is only available for Azure Database for MariaDB servers in the General
42+
> Purpose or Memory Optimized pricing tiers. Ensure the master server is in one of these pricing
43+
> tiers.
44+
45+
### Create a read replica
46+
47+
A read replica server can be created using the following command:
48+
49+
```azurepowershell-interactive
50+
Get-AzMariaDbServer -Name mydemoserver -ResourceGroupName myresourcegroup |
51+
New-AzMariaDbServerReplica -Name mydemoreplicaserver -ResourceGroupName myresourcegroup
52+
```
53+
54+
The `New-AzMariaDbServerReplica` command requires the following parameters:
55+
56+
| Setting | Example value | Description  |
57+
| --- | --- | --- |
58+
| ResourceGroupName |  myresourcegroup |  The resource group where the replica server is created.  |
59+
| Name | mydemoreplicaserver | The name of the new replica server that is created. |
60+
61+
To create a cross region read replica, use the **Location** parameter. The following example creates
62+
a replica in the **West US** region.
63+
64+
```azurepowershell-interactive
65+
Get-AzMariaDbServer -Name mrdemoserver -ResourceGroupName myresourcegroup |
66+
New-AzMariaDServerReplica -Name mydemoreplicaserver -ResourceGroupName myresourcegroup -Location westus
67+
```
68+
69+
To learn more about which regions you can create a replica in, visit the
70+
[read replica concepts article](concepts-read-replicas.md).
71+
72+
By default, read replicas are created with the same server configuration as the master unless the
73+
**Sku** parameter is specified.
74+
75+
> [!NOTE]
76+
> It is recommended that the replica server's configuration should be kept at equal or greater
77+
> values than the master to ensure the replica is able to keep up with the master.
78+
79+
### List replicas for a master server
80+
81+
To view all replicas for a given master server, run the following command:
82+
83+
```azurepowershell-interactive
84+
Get-AzMariaDReplica -ResourceGroupName myresourcegroup -ServerName mydemoserver
85+
```
86+
87+
The `Get-AzMariaDReplica` command requires the following parameters:
88+
89+
| Setting | Example value | Description  |
90+
| --- | --- | --- |
91+
| ResourceGroupName |  myresourcegroup |  The resource group where the replica server will be created to.  |
92+
| ServerName | mydemoserver | The name or ID of the master server. |
93+
94+
### Delete a replica server
95+
96+
Deleting a read replica server can be done by running the `Remove-AzMariaDbServer` cmdlet.
97+
98+
```azurepowershell-interactive
99+
Remove-AzMariaDbServer -Name mydemoreplicaserver -ResourceGroupName myresourcegroup
100+
```
101+
102+
### Delete a master server
103+
104+
> [!IMPORTANT]
105+
> Deleting a master server stops replication to all replica servers and deletes the master server
106+
> itself. Replica servers become standalone servers that now support both read and writes.
107+
108+
To delete a master server, you can run the `Remove-AzMariaDbServer` cmdlet.
109+
110+
```azurepowershell-interactive
111+
Remove-AzMariaDbServer -Name mydemoserver -ResourceGroupName myresourcegroup
112+
```
113+
114+
## Next steps
115+
116+
> [!div class="nextstepaction"]
117+
> [Restart Azure Database for MariaDB server using PowerShell](howto-restart-server-powershell.md)

0 commit comments

Comments
 (0)