We recommend using Azure Native.
Azure v6.28.0 published on Friday, Oct 3, 2025 by Pulumi
azure.mysql.getFlexibleServer
Start a Neo task
Explain and create an azure.mysql.getFlexibleServer resource
Use this data source to access information about an existing MySQL Flexible Server.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.mysql.getFlexibleServer({
name: "existingMySqlFlexibleServer",
resourceGroupName: "existingResGroup",
});
export const id = example.then(example => example.id);
import pulumi
import pulumi_azure as azure
example = azure.mysql.get_flexible_server(name="existingMySqlFlexibleServer",
resource_group_name="existingResGroup")
pulumi.export("id", example.id)
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/mysql"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := mysql.LookupFlexibleServer(ctx, &mysql.LookupFlexibleServerArgs{
Name: "existingMySqlFlexibleServer",
ResourceGroupName: "existingResGroup",
}, nil)
if err != nil {
return err
}
ctx.Export("id", example.Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = Azure.MySql.GetFlexibleServer.Invoke(new()
{
Name = "existingMySqlFlexibleServer",
ResourceGroupName = "existingResGroup",
});
return new Dictionary<string, object?>
{
["id"] = example.Apply(getFlexibleServerResult => getFlexibleServerResult.Id),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.mysql.MysqlFunctions;
import com.pulumi.azure.mysql.inputs.GetFlexibleServerArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var example = MysqlFunctions.getFlexibleServer(GetFlexibleServerArgs.builder()
.name("existingMySqlFlexibleServer")
.resourceGroupName("existingResGroup")
.build());
ctx.export("id", example.id());
}
}
variables:
example:
fn::invoke:
function: azure:mysql:getFlexibleServer
arguments:
name: existingMySqlFlexibleServer
resourceGroupName: existingResGroup
outputs:
id: ${example.id}
API Providers
This data source uses the following Azure API Providers:
Microsoft.DBforMySQL- 2023-12-30
Using getFlexibleServer
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getFlexibleServer(args: GetFlexibleServerArgs, opts?: InvokeOptions): Promise<GetFlexibleServerResult>
function getFlexibleServerOutput(args: GetFlexibleServerOutputArgs, opts?: InvokeOptions): Output<GetFlexibleServerResult>def get_flexible_server(name: Optional[str] = None,
resource_group_name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetFlexibleServerResult
def get_flexible_server_output(name: Optional[pulumi.Input[str]] = None,
resource_group_name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetFlexibleServerResult]func LookupFlexibleServer(ctx *Context, args *LookupFlexibleServerArgs, opts ...InvokeOption) (*LookupFlexibleServerResult, error)
func LookupFlexibleServerOutput(ctx *Context, args *LookupFlexibleServerOutputArgs, opts ...InvokeOption) LookupFlexibleServerResultOutput> Note: This function is named LookupFlexibleServer in the Go SDK.
public static class GetFlexibleServer
{
public static Task<GetFlexibleServerResult> InvokeAsync(GetFlexibleServerArgs args, InvokeOptions? opts = null)
public static Output<GetFlexibleServerResult> Invoke(GetFlexibleServerInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetFlexibleServerResult> getFlexibleServer(GetFlexibleServerArgs args, InvokeOptions options)
public static Output<GetFlexibleServerResult> getFlexibleServer(GetFlexibleServerArgs args, InvokeOptions options)
fn::invoke:
function: azure:mysql/getFlexibleServer:getFlexibleServer
arguments:
# arguments dictionaryThe following arguments are supported:
- Name string
- Specifies the name of the MySQL Flexible Server.
- Resource
Group stringName - The name of the resource group for the MySQL Flexible Server.
- Name string
- Specifies the name of the MySQL Flexible Server.
- Resource
Group stringName - The name of the resource group for the MySQL Flexible Server.
- name String
- Specifies the name of the MySQL Flexible Server.
- resource
Group StringName - The name of the resource group for the MySQL Flexible Server.
- name string
- Specifies the name of the MySQL Flexible Server.
- resource
Group stringName - The name of the resource group for the MySQL Flexible Server.
- name str
- Specifies the name of the MySQL Flexible Server.
- resource_
group_ strname - The name of the resource group for the MySQL Flexible Server.
- name String
- Specifies the name of the MySQL Flexible Server.
- resource
Group StringName - The name of the resource group for the MySQL Flexible Server.
getFlexibleServer Result
The following output properties are available:
- Administrator
Login string - The Administrator login of the MySQL Flexible Server.
- Backup
Retention intDays - The backup retention days of the MySQL Flexible Server.
- Delegated
Subnet stringId - The ID of the virtual network subnet the MySQL Flexible Server is created in.
- Fqdn string
- The fully qualified domain name of the MySQL Flexible Server.
- Geo
Redundant boolBackup Enabled - Is geo redundant backup enabled?
- High
Availabilities List<GetFlexible Server High Availability> - A
high_availabilityblock for this MySQL Flexible Server as defined below. - Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- The Azure Region of the MySQL Flexible Server.
- Maintenance
Windows List<GetFlexible Server Maintenance Window> - A
maintenance_windowblock for this MySQL Flexible Server as defined below. - Name string
- Private
Dns stringZone Id - The ID of the Private DNS zone of the MySQL Flexible Server.
- Public
Network boolAccess Enabled - Is the public network access enabled?
- Replica
Capacity int - The maximum number of replicas that a primary MySQL Flexible Server can have.
- Replication
Role string - The replication role of the MySQL Flexible Server.
- Resource
Group stringName - Restore
Point stringIn Time - Sku
Name string - The SKU Name of the MySQL Flexible Server.
- Storages
List<Get
Flexible Server Storage> - A
storageblock for this MySQL Flexible Server as defined below. - Dictionary<string, string>
- A mapping of tags which are assigned to the MySQL Flexible Server.
- Version string
- The version of the MySQL Flexible Server.
- Zone string
- The Availability Zones where this MySQL Flexible Server is located.
- Administrator
Login string - The Administrator login of the MySQL Flexible Server.
- Backup
Retention intDays - The backup retention days of the MySQL Flexible Server.
- Delegated
Subnet stringId - The ID of the virtual network subnet the MySQL Flexible Server is created in.
- Fqdn string
- The fully qualified domain name of the MySQL Flexible Server.
- Geo
Redundant boolBackup Enabled - Is geo redundant backup enabled?
- High
Availabilities []GetFlexible Server High Availability - A
high_availabilityblock for this MySQL Flexible Server as defined below. - Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- The Azure Region of the MySQL Flexible Server.
- Maintenance
Windows []GetFlexible Server Maintenance Window - A
maintenance_windowblock for this MySQL Flexible Server as defined below. - Name string
- Private
Dns stringZone Id - The ID of the Private DNS zone of the MySQL Flexible Server.
- Public
Network boolAccess Enabled - Is the public network access enabled?
- Replica
Capacity int - The maximum number of replicas that a primary MySQL Flexible Server can have.
- Replication
Role string - The replication role of the MySQL Flexible Server.
- Resource
Group stringName - Restore
Point stringIn Time - Sku
Name string - The SKU Name of the MySQL Flexible Server.
- Storages
[]Get
Flexible Server Storage - A
storageblock for this MySQL Flexible Server as defined below. - map[string]string
- A mapping of tags which are assigned to the MySQL Flexible Server.
- Version string
- The version of the MySQL Flexible Server.
- Zone string
- The Availability Zones where this MySQL Flexible Server is located.
- administrator
Login String - The Administrator login of the MySQL Flexible Server.
- backup
Retention IntegerDays - The backup retention days of the MySQL Flexible Server.
- delegated
Subnet StringId - The ID of the virtual network subnet the MySQL Flexible Server is created in.
- fqdn String
- The fully qualified domain name of the MySQL Flexible Server.
- geo
Redundant BooleanBackup Enabled - Is geo redundant backup enabled?
- high
Availabilities List<GetFlexible Server High Availability> - A
high_availabilityblock for this MySQL Flexible Server as defined below. - id String
- The provider-assigned unique ID for this managed resource.
- location String
- The Azure Region of the MySQL Flexible Server.
- maintenance
Windows List<GetFlexible Server Maintenance Window> - A
maintenance_windowblock for this MySQL Flexible Server as defined below. - name String
- private
Dns StringZone Id - The ID of the Private DNS zone of the MySQL Flexible Server.
- public
Network BooleanAccess Enabled - Is the public network access enabled?
- replica
Capacity Integer - The maximum number of replicas that a primary MySQL Flexible Server can have.
- replication
Role String - The replication role of the MySQL Flexible Server.
- resource
Group StringName - restore
Point StringIn Time - sku
Name String - The SKU Name of the MySQL Flexible Server.
- storages
List<Get
Flexible Server Storage> - A
storageblock for this MySQL Flexible Server as defined below. - Map<String,String>
- A mapping of tags which are assigned to the MySQL Flexible Server.
- version String
- The version of the MySQL Flexible Server.
- zone String
- The Availability Zones where this MySQL Flexible Server is located.
- administrator
Login string - The Administrator login of the MySQL Flexible Server.
- backup
Retention numberDays - The backup retention days of the MySQL Flexible Server.
- delegated
Subnet stringId - The ID of the virtual network subnet the MySQL Flexible Server is created in.
- fqdn string
- The fully qualified domain name of the MySQL Flexible Server.
- geo
Redundant booleanBackup Enabled - Is geo redundant backup enabled?
- high
Availabilities GetFlexible Server High Availability[] - A
high_availabilityblock for this MySQL Flexible Server as defined below. - id string
- The provider-assigned unique ID for this managed resource.
- location string
- The Azure Region of the MySQL Flexible Server.
- maintenance
Windows GetFlexible Server Maintenance Window[] - A
maintenance_windowblock for this MySQL Flexible Server as defined below. - name string
- private
Dns stringZone Id - The ID of the Private DNS zone of the MySQL Flexible Server.
- public
Network booleanAccess Enabled - Is the public network access enabled?
- replica
Capacity number - The maximum number of replicas that a primary MySQL Flexible Server can have.
- replication
Role string - The replication role of the MySQL Flexible Server.
- resource
Group stringName - restore
Point stringIn Time - sku
Name string - The SKU Name of the MySQL Flexible Server.
- storages
Get
Flexible Server Storage[] - A
storageblock for this MySQL Flexible Server as defined below. - {[key: string]: string}
- A mapping of tags which are assigned to the MySQL Flexible Server.
- version string
- The version of the MySQL Flexible Server.
- zone string
- The Availability Zones where this MySQL Flexible Server is located.
- administrator_
login str - The Administrator login of the MySQL Flexible Server.
- backup_
retention_ intdays - The backup retention days of the MySQL Flexible Server.
- delegated_
subnet_ strid - The ID of the virtual network subnet the MySQL Flexible Server is created in.
- fqdn str
- The fully qualified domain name of the MySQL Flexible Server.
- geo_
redundant_ boolbackup_ enabled - Is geo redundant backup enabled?
- high_
availabilities Sequence[GetFlexible Server High Availability] - A
high_availabilityblock for this MySQL Flexible Server as defined below. - id str
- The provider-assigned unique ID for this managed resource.
- location str
- The Azure Region of the MySQL Flexible Server.
- maintenance_
windows Sequence[GetFlexible Server Maintenance Window] - A
maintenance_windowblock for this MySQL Flexible Server as defined below. - name str
- private_
dns_ strzone_ id - The ID of the Private DNS zone of the MySQL Flexible Server.
- public_
network_ boolaccess_ enabled - Is the public network access enabled?
- replica_
capacity int - The maximum number of replicas that a primary MySQL Flexible Server can have.
- replication_
role str - The replication role of the MySQL Flexible Server.
- resource_
group_ strname - restore_
point_ strin_ time - sku_
name str - The SKU Name of the MySQL Flexible Server.
- storages
Sequence[Get
Flexible Server Storage] - A
storageblock for this MySQL Flexible Server as defined below. - Mapping[str, str]
- A mapping of tags which are assigned to the MySQL Flexible Server.
- version str
- The version of the MySQL Flexible Server.
- zone str
- The Availability Zones where this MySQL Flexible Server is located.
- administrator
Login String - The Administrator login of the MySQL Flexible Server.
- backup
Retention NumberDays - The backup retention days of the MySQL Flexible Server.
- delegated
Subnet StringId - The ID of the virtual network subnet the MySQL Flexible Server is created in.
- fqdn String
- The fully qualified domain name of the MySQL Flexible Server.
- geo
Redundant BooleanBackup Enabled - Is geo redundant backup enabled?
- high
Availabilities List<Property Map> - A
high_availabilityblock for this MySQL Flexible Server as defined below. - id String
- The provider-assigned unique ID for this managed resource.
- location String
- The Azure Region of the MySQL Flexible Server.
- maintenance
Windows List<Property Map> - A
maintenance_windowblock for this MySQL Flexible Server as defined below. - name String
- private
Dns StringZone Id - The ID of the Private DNS zone of the MySQL Flexible Server.
- public
Network BooleanAccess Enabled - Is the public network access enabled?
- replica
Capacity Number - The maximum number of replicas that a primary MySQL Flexible Server can have.
- replication
Role String - The replication role of the MySQL Flexible Server.
- resource
Group StringName - restore
Point StringIn Time - sku
Name String - The SKU Name of the MySQL Flexible Server.
- storages List<Property Map>
- A
storageblock for this MySQL Flexible Server as defined below. - Map<String>
- A mapping of tags which are assigned to the MySQL Flexible Server.
- version String
- The version of the MySQL Flexible Server.
- zone String
- The Availability Zones where this MySQL Flexible Server is located.
Supporting Types
GetFlexibleServerHighAvailability
- Mode string
- The high availability mode of the MySQL Flexible Server.
- Standby
Availability stringZone - The availability zone of the standby Flexible Server.
- Mode string
- The high availability mode of the MySQL Flexible Server.
- Standby
Availability stringZone - The availability zone of the standby Flexible Server.
- mode String
- The high availability mode of the MySQL Flexible Server.
- standby
Availability StringZone - The availability zone of the standby Flexible Server.
- mode string
- The high availability mode of the MySQL Flexible Server.
- standby
Availability stringZone - The availability zone of the standby Flexible Server.
- mode str
- The high availability mode of the MySQL Flexible Server.
- standby_
availability_ strzone - The availability zone of the standby Flexible Server.
- mode String
- The high availability mode of the MySQL Flexible Server.
- standby
Availability StringZone - The availability zone of the standby Flexible Server.
GetFlexibleServerMaintenanceWindow
- Day
Of intWeek - The day of week of the maintenance window.
- Start
Hour int - The start hour of the maintenance window.
- Start
Minute int - The start minute of the maintenance window.
- Day
Of intWeek - The day of week of the maintenance window.
- Start
Hour int - The start hour of the maintenance window.
- Start
Minute int - The start minute of the maintenance window.
- day
Of IntegerWeek - The day of week of the maintenance window.
- start
Hour Integer - The start hour of the maintenance window.
- start
Minute Integer - The start minute of the maintenance window.
- day
Of numberWeek - The day of week of the maintenance window.
- start
Hour number - The start hour of the maintenance window.
- start
Minute number - The start minute of the maintenance window.
- day_
of_ intweek - The day of week of the maintenance window.
- start_
hour int - The start hour of the maintenance window.
- start_
minute int - The start minute of the maintenance window.
- day
Of NumberWeek - The day of week of the maintenance window.
- start
Hour Number - The start hour of the maintenance window.
- start
Minute Number - The start minute of the maintenance window.
GetFlexibleServerStorage
- Auto
Grow boolEnabled - Is Storage Auto Grow enabled?
- Io
Scaling boolEnabled - Should IOPS be scaled automatically?
- Iops int
- The storage IOPS of the MySQL Flexible Server.
- Size
Gb int - The max storage allowed for the MySQL Flexible Server.
- Auto
Grow boolEnabled - Is Storage Auto Grow enabled?
- Io
Scaling boolEnabled - Should IOPS be scaled automatically?
- Iops int
- The storage IOPS of the MySQL Flexible Server.
- Size
Gb int - The max storage allowed for the MySQL Flexible Server.
- auto
Grow BooleanEnabled - Is Storage Auto Grow enabled?
- io
Scaling BooleanEnabled - Should IOPS be scaled automatically?
- iops Integer
- The storage IOPS of the MySQL Flexible Server.
- size
Gb Integer - The max storage allowed for the MySQL Flexible Server.
- auto
Grow booleanEnabled - Is Storage Auto Grow enabled?
- io
Scaling booleanEnabled - Should IOPS be scaled automatically?
- iops number
- The storage IOPS of the MySQL Flexible Server.
- size
Gb number - The max storage allowed for the MySQL Flexible Server.
- auto_
grow_ boolenabled - Is Storage Auto Grow enabled?
- io_
scaling_ boolenabled - Should IOPS be scaled automatically?
- iops int
- The storage IOPS of the MySQL Flexible Server.
- size_
gb int - The max storage allowed for the MySQL Flexible Server.
- auto
Grow BooleanEnabled - Is Storage Auto Grow enabled?
- io
Scaling BooleanEnabled - Should IOPS be scaled automatically?
- iops Number
- The storage IOPS of the MySQL Flexible Server.
- size
Gb Number - The max storage allowed for the MySQL Flexible Server.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.
