We recommend using Azure Native.
Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
We recommend using Azure Native.
Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
Use this data source to access information about an existing MySQL Server.
Example Usage
using Pulumi;
using Azure = Pulumi.Azure;
class MyStack : Stack
{
public MyStack()
{
var example = Output.Create(Azure.MySql.GetServer.InvokeAsync(new Azure.MySql.GetServerArgs
{
Name = "existingMySqlServer",
ResourceGroupName = "existingResGroup",
}));
this.Id = example.Apply(example => example.Id);
}
[Output("id")]
public Output<string> Id { get; set; }
}
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/mysql"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := mysql.LookupServer(ctx, &mysql.LookupServerArgs{
Name: "existingMySqlServer",
ResourceGroupName: "existingResGroup",
}, nil)
if err != nil {
return err
}
ctx.Export("id", example.Id)
return nil
})
}
Example coming soon!
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.mysql.getServer({
name: "existingMySqlServer",
resourceGroupName: "existingResGroup",
});
export const id = example.then(example => example.id);
import pulumi
import pulumi_azure as azure
example = azure.mysql.get_server(name="existingMySqlServer",
resource_group_name="existingResGroup")
pulumi.export("id", example.id)
Example coming soon!
Using getServer
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 getServer(args: GetServerArgs, opts?: InvokeOptions): Promise<GetServerResult>
function getServerOutput(args: GetServerOutputArgs, opts?: InvokeOptions): Output<GetServerResult>def get_server(name: Optional[str] = None,
resource_group_name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetServerResult
def get_server_output(name: Optional[pulumi.Input[str]] = None,
resource_group_name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetServerResult]func LookupServer(ctx *Context, args *LookupServerArgs, opts ...InvokeOption) (*LookupServerResult, error)
func LookupServerOutput(ctx *Context, args *LookupServerOutputArgs, opts ...InvokeOption) LookupServerResultOutput> Note: This function is named LookupServer in the Go SDK.
public static class GetServer
{
public static Task<GetServerResult> InvokeAsync(GetServerArgs args, InvokeOptions? opts = null)
public static Output<GetServerResult> Invoke(GetServerInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetServerResult> getServer(GetServerArgs args, InvokeOptions options)
public static Output<GetServerResult> getServer(GetServerArgs args, InvokeOptions options)
fn::invoke:
function: azure:mysql/getServer:getServer
arguments:
# arguments dictionaryThe following arguments are supported:
- Name string
- Specifies the name of the MySQL Server.
- Resource
Group stringName - The name of the resource group for the MySQL Server.
- Name string
- Specifies the name of the MySQL Server.
- Resource
Group stringName - The name of the resource group for the MySQL Server.
- name String
- Specifies the name of the MySQL Server.
- resource
Group StringName - The name of the resource group for the MySQL Server.
- name string
- Specifies the name of the MySQL Server.
- resource
Group stringName - The name of the resource group for the MySQL Server.
- name str
- Specifies the name of the MySQL Server.
- resource_
group_ strname - The name of the resource group for the MySQL Server.
- name String
- Specifies the name of the MySQL Server.
- resource
Group StringName - The name of the resource group for the MySQL Server.
getServer Result
The following output properties are available:
- Administrator
Login string - The Administrator Login for the MySQL Server.
- Auto
Grow boolEnabled - The auto grow setting for this MySQL Server.
- Backup
Retention intDays - The backup retention days for this MySQL server.
- Fqdn string
- The FQDN of the MySQL Server.
- Geo
Redundant boolBackup Enabled - The geo redundant backup setting for this MySQL Server.
- Id string
- The provider-assigned unique ID for this managed resource.
- Identities
List<Get
Server Identity> - An
identityblock for this MySQL server as defined below. - Infrastructure
Encryption boolEnabled - Whether or not infrastructure is encrypted for this MySQL Server.
- Location string
- The Azure location where the resource exists.
- Name string
- Public
Network boolAccess Enabled - Whether or not public network access is allowed for this MySQL Server.
- Resource
Group stringName - Restore
Point stringIn Time - Sku
Name string - The SKU Name for this MySQL Server.
- Ssl
Enforcement boolEnabled - Specifies if SSL should be enforced on connections for this MySQL Server.
- Ssl
Minimal stringTls Version Enforced - The minimum TLS version to support for this MySQL Server.
- Storage
Mb int - Max storage allowed for this MySQL Server.
- Dictionary<string, string>
A mapping of tags to assign to the resource.
- Threat
Detection List<GetPolicies Server Threat Detection Policy> - Threat detection policy configuration, known in the API as Server Security Alerts Policy. The
threat_detection_policyblock exports fields documented below. - Version string
- The version of this MySQL Server.
- Administrator
Login string - The Administrator Login for the MySQL Server.
- Auto
Grow boolEnabled - The auto grow setting for this MySQL Server.
- Backup
Retention intDays - The backup retention days for this MySQL server.
- Fqdn string
- The FQDN of the MySQL Server.
- Geo
Redundant boolBackup Enabled - The geo redundant backup setting for this MySQL Server.
- Id string
- The provider-assigned unique ID for this managed resource.
- Identities
[]Get
Server Identity - An
identityblock for this MySQL server as defined below. - Infrastructure
Encryption boolEnabled - Whether or not infrastructure is encrypted for this MySQL Server.
- Location string
- The Azure location where the resource exists.
- Name string
- Public
Network boolAccess Enabled - Whether or not public network access is allowed for this MySQL Server.
- Resource
Group stringName - Restore
Point stringIn Time - Sku
Name string - The SKU Name for this MySQL Server.
- Ssl
Enforcement boolEnabled - Specifies if SSL should be enforced on connections for this MySQL Server.
- Ssl
Minimal stringTls Version Enforced - The minimum TLS version to support for this MySQL Server.
- Storage
Mb int - Max storage allowed for this MySQL Server.
- map[string]string
A mapping of tags to assign to the resource.
- Threat
Detection []GetPolicies Server Threat Detection Policy - Threat detection policy configuration, known in the API as Server Security Alerts Policy. The
threat_detection_policyblock exports fields documented below. - Version string
- The version of this MySQL Server.
- administrator
Login String - The Administrator Login for the MySQL Server.
- auto
Grow BooleanEnabled - The auto grow setting for this MySQL Server.
- backup
Retention IntegerDays - The backup retention days for this MySQL server.
- fqdn String
- The FQDN of the MySQL Server.
- geo
Redundant BooleanBackup Enabled - The geo redundant backup setting for this MySQL Server.
- id String
- The provider-assigned unique ID for this managed resource.
- identities
List<Get
Server Identity> - An
identityblock for this MySQL server as defined below. - infrastructure
Encryption BooleanEnabled - Whether or not infrastructure is encrypted for this MySQL Server.
- location String
- The Azure location where the resource exists.
- name String
- public
Network BooleanAccess Enabled - Whether or not public network access is allowed for this MySQL Server.
- resource
Group StringName - restore
Point StringIn Time - sku
Name String - The SKU Name for this MySQL Server.
- ssl
Enforcement BooleanEnabled - Specifies if SSL should be enforced on connections for this MySQL Server.
- ssl
Minimal StringTls Version Enforced - The minimum TLS version to support for this MySQL Server.
- storage
Mb Integer - Max storage allowed for this MySQL Server.
- Map<String,String>
A mapping of tags to assign to the resource.
- threat
Detection List<GetPolicies Server Threat Detection Policy> - Threat detection policy configuration, known in the API as Server Security Alerts Policy. The
threat_detection_policyblock exports fields documented below. - version String
- The version of this MySQL Server.
- administrator
Login string - The Administrator Login for the MySQL Server.
- auto
Grow booleanEnabled - The auto grow setting for this MySQL Server.
- backup
Retention numberDays - The backup retention days for this MySQL server.
- fqdn string
- The FQDN of the MySQL Server.
- geo
Redundant booleanBackup Enabled - The geo redundant backup setting for this MySQL Server.
- id string
- The provider-assigned unique ID for this managed resource.
- identities
Get
Server Identity[] - An
identityblock for this MySQL server as defined below. - infrastructure
Encryption booleanEnabled - Whether or not infrastructure is encrypted for this MySQL Server.
- location string
- The Azure location where the resource exists.
- name string
- public
Network booleanAccess Enabled - Whether or not public network access is allowed for this MySQL Server.
- resource
Group stringName - restore
Point stringIn Time - sku
Name string - The SKU Name for this MySQL Server.
- ssl
Enforcement booleanEnabled - Specifies if SSL should be enforced on connections for this MySQL Server.
- ssl
Minimal stringTls Version Enforced - The minimum TLS version to support for this MySQL Server.
- storage
Mb number - Max storage allowed for this MySQL Server.
- {[key: string]: string}
A mapping of tags to assign to the resource.
- threat
Detection GetPolicies Server Threat Detection Policy[] - Threat detection policy configuration, known in the API as Server Security Alerts Policy. The
threat_detection_policyblock exports fields documented below. - version string
- The version of this MySQL Server.
- administrator_
login str - The Administrator Login for the MySQL Server.
- auto_
grow_ boolenabled - The auto grow setting for this MySQL Server.
- backup_
retention_ intdays - The backup retention days for this MySQL server.
- fqdn str
- The FQDN of the MySQL Server.
- geo_
redundant_ boolbackup_ enabled - The geo redundant backup setting for this MySQL Server.
- id str
- The provider-assigned unique ID for this managed resource.
- identities
Sequence[Get
Server Identity] - An
identityblock for this MySQL server as defined below. - infrastructure_
encryption_ boolenabled - Whether or not infrastructure is encrypted for this MySQL Server.
- location str
- The Azure location where the resource exists.
- name str
- public_
network_ boolaccess_ enabled - Whether or not public network access is allowed for this MySQL Server.
- resource_
group_ strname - restore_
point_ strin_ time - sku_
name str - The SKU Name for this MySQL Server.
- ssl_
enforcement_ boolenabled - Specifies if SSL should be enforced on connections for this MySQL Server.
- ssl_
minimal_ strtls_ version_ enforced - The minimum TLS version to support for this MySQL Server.
- storage_
mb int - Max storage allowed for this MySQL Server.
- Mapping[str, str]
A mapping of tags to assign to the resource.
- threat_
detection_ Sequence[Getpolicies Server Threat Detection Policy] - Threat detection policy configuration, known in the API as Server Security Alerts Policy. The
threat_detection_policyblock exports fields documented below. - version str
- The version of this MySQL Server.
- administrator
Login String - The Administrator Login for the MySQL Server.
- auto
Grow BooleanEnabled - The auto grow setting for this MySQL Server.
- backup
Retention NumberDays - The backup retention days for this MySQL server.
- fqdn String
- The FQDN of the MySQL Server.
- geo
Redundant BooleanBackup Enabled - The geo redundant backup setting for this MySQL Server.
- id String
- The provider-assigned unique ID for this managed resource.
- identities List<Property Map>
- An
identityblock for this MySQL server as defined below. - infrastructure
Encryption BooleanEnabled - Whether or not infrastructure is encrypted for this MySQL Server.
- location String
- The Azure location where the resource exists.
- name String
- public
Network BooleanAccess Enabled - Whether or not public network access is allowed for this MySQL Server.
- resource
Group StringName - restore
Point StringIn Time - sku
Name String - The SKU Name for this MySQL Server.
- ssl
Enforcement BooleanEnabled - Specifies if SSL should be enforced on connections for this MySQL Server.
- ssl
Minimal StringTls Version Enforced - The minimum TLS version to support for this MySQL Server.
- storage
Mb Number - Max storage allowed for this MySQL Server.
- Map<String>
A mapping of tags to assign to the resource.
- threat
Detection List<Property Map>Policies - Threat detection policy configuration, known in the API as Server Security Alerts Policy. The
threat_detection_policyblock exports fields documented below. - version String
- The version of this MySQL Server.
Supporting Types
GetServerIdentity
- Principal
Id string - The Client ID of the Service Principal assigned to this MySQL Server.
- Tenant
Id string The ID of the Tenant the Service Principal is assigned in.
- Type string
- The Type of Identity used for this MySQL Server.
- Principal
Id string - The Client ID of the Service Principal assigned to this MySQL Server.
- Tenant
Id string The ID of the Tenant the Service Principal is assigned in.
- Type string
- The Type of Identity used for this MySQL Server.
- principal
Id String - The Client ID of the Service Principal assigned to this MySQL Server.
- tenant
Id String The ID of the Tenant the Service Principal is assigned in.
- type String
- The Type of Identity used for this MySQL Server.
- principal
Id string - The Client ID of the Service Principal assigned to this MySQL Server.
- tenant
Id string The ID of the Tenant the Service Principal is assigned in.
- type string
- The Type of Identity used for this MySQL Server.
- principal_
id str - The Client ID of the Service Principal assigned to this MySQL Server.
- tenant_
id str The ID of the Tenant the Service Principal is assigned in.
- type str
- The Type of Identity used for this MySQL Server.
- principal
Id String - The Client ID of the Service Principal assigned to this MySQL Server.
- tenant
Id String The ID of the Tenant the Service Principal is assigned in.
- type String
- The Type of Identity used for this MySQL Server.
GetServerThreatDetectionPolicy
- Disabled
Alerts List<string> - Specifies a list of alerts which should be disabled. Possible values include
Access_Anomaly,Sql_InjectionandSql_Injection_Vulnerability. - Email
Account boolAdmins - Should the account administrators be emailed when this alert is triggered?
- Email
Addresses List<string> - A list of email addresses which alerts should be sent to.
- Enabled bool
- Is the policy enabled?
- Retention
Days int - Specifies the number of days to keep in the Threat Detection audit logs.
- Storage
Account stringAccess Key - Specifies the identifier key of the Threat Detection audit storage account.
- Storage
Endpoint string - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs.
- Disabled
Alerts []string - Specifies a list of alerts which should be disabled. Possible values include
Access_Anomaly,Sql_InjectionandSql_Injection_Vulnerability. - Email
Account boolAdmins - Should the account administrators be emailed when this alert is triggered?
- Email
Addresses []string - A list of email addresses which alerts should be sent to.
- Enabled bool
- Is the policy enabled?
- Retention
Days int - Specifies the number of days to keep in the Threat Detection audit logs.
- Storage
Account stringAccess Key - Specifies the identifier key of the Threat Detection audit storage account.
- Storage
Endpoint string - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs.
- disabled
Alerts List<String> - Specifies a list of alerts which should be disabled. Possible values include
Access_Anomaly,Sql_InjectionandSql_Injection_Vulnerability. - email
Account BooleanAdmins - Should the account administrators be emailed when this alert is triggered?
- email
Addresses List<String> - A list of email addresses which alerts should be sent to.
- enabled Boolean
- Is the policy enabled?
- retention
Days Integer - Specifies the number of days to keep in the Threat Detection audit logs.
- storage
Account StringAccess Key - Specifies the identifier key of the Threat Detection audit storage account.
- storage
Endpoint String - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs.
- disabled
Alerts string[] - Specifies a list of alerts which should be disabled. Possible values include
Access_Anomaly,Sql_InjectionandSql_Injection_Vulnerability. - email
Account booleanAdmins - Should the account administrators be emailed when this alert is triggered?
- email
Addresses string[] - A list of email addresses which alerts should be sent to.
- enabled boolean
- Is the policy enabled?
- retention
Days number - Specifies the number of days to keep in the Threat Detection audit logs.
- storage
Account stringAccess Key - Specifies the identifier key of the Threat Detection audit storage account.
- storage
Endpoint string - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs.
- disabled_
alerts Sequence[str] - Specifies a list of alerts which should be disabled. Possible values include
Access_Anomaly,Sql_InjectionandSql_Injection_Vulnerability. - email_
account_ booladmins - Should the account administrators be emailed when this alert is triggered?
- email_
addresses Sequence[str] - A list of email addresses which alerts should be sent to.
- enabled bool
- Is the policy enabled?
- retention_
days int - Specifies the number of days to keep in the Threat Detection audit logs.
- storage_
account_ straccess_ key - Specifies the identifier key of the Threat Detection audit storage account.
- storage_
endpoint str - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs.
- disabled
Alerts List<String> - Specifies a list of alerts which should be disabled. Possible values include
Access_Anomaly,Sql_InjectionandSql_Injection_Vulnerability. - email
Account BooleanAdmins - Should the account administrators be emailed when this alert is triggered?
- email
Addresses List<String> - A list of email addresses which alerts should be sent to.
- enabled Boolean
- Is the policy enabled?
- retention
Days Number - Specifies the number of days to keep in the Threat Detection audit logs.
- storage
Account StringAccess Key - Specifies the identifier key of the Threat Detection audit storage account.
- storage
Endpoint String - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.
We recommend using Azure Native.
Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
