Skip to content

Files

Latest commit

469ee2d · May 2, 2022

History

History
105 lines (68 loc) · 4.1 KB

quickstart-create-mariadb-server-database-bicep.md

File metadata and controls

105 lines (68 loc) · 4.1 KB
title description author ms.author ms.date ms.topic ms.service ms.custom
Quickstart: Create an Azure DB for MariaDB - Bicep
In this Quickstart article, learn how to create an Azure Database for MariaDB server using Bicep.
schaffererin
v-eschaffer
04/28/2022
quickstart
mariadb
devx-track-azurepowershell, subject-armqs, mode-arm

Quickstart: Use Bicep to create an Azure Database for MariaDB server

Azure Database for MariaDB is a managed service that you use to run, manage, and scale highly available MariaDB databases in the cloud. In this quickstart, you use Bicep to create an Azure Database for MariaDB server in PowerShell or Azure CLI.

[!INCLUDE About Bicep]

Prerequisites

You'll need an Azure account with an active subscription. Create one for free.

Review the Bicep file

You create an Azure Database for MariaDB server with a defined set of compute and storage resources. To learn more, see Azure Database for MariaDB pricing tiers. You create the server within an Azure resource group.

The Bicep file used in this quickstart is from Azure Quickstart Templates.

:::code language="bicep" source="~/quickstart-templates/quickstarts/microsoft.dbformariadb/managed-mariadb-with-vnet/main.bicep":::

The Bicep file defines five Azure resources:

Deploy the Bicep file

  1. Save the Bicep file as main.bicep to your local computer.

  2. Deploy the Bicep file using either Azure CLI or Azure PowerShell.

    az group create --name exampleRG --location eastus
    az deployment group create --resource-group exampleRG --template-file main.bicep --parameters serverName=<server-name> administratorLogin=<admin-login>
    
    New-AzResourceGroup -Name exampleRG -Location eastus
    New-AzResourceGroupDeployment -ResourceGroupName exampleRG -TemplateFile ./main.bicep -serverName "<server-name>" -administratorLogin "<admin-login>"
    

    [!NOTE] Replace <server-name> with the name of the server. Replace <admin-login> with the database administrator login name. The minimum required length is one character. You'll also be prompted to enter administratorLoginPassword. The minimum password length is eight characters.

    When the deployment finishes, you should see a message indicating the deployment succeeded.

Review deployed resources

Use the Azure portal, Azure CLI, or Azure PowerShell to list the deployed resources in the resource group.

az resource list --resource-group exampleRG
Get-AzResource -ResourceGroupName exampleRG

Clean up resources

When no longer needed, use the Azure portal, Azure CLI, or Azure PowerShell to delete the resource group and its resources.

az group delete --name exampleRG
Remove-AzResourceGroup -Name exampleRG

Next steps

For a step-by-step tutorial that guides you through the process of creating a Bicep file using Visual Studio Code, see:

[!div class="nextstepaction"] Quickstart: Create Bicep files with Visual Studio Code