Skip to main content

servers

Creates, updates, deletes, gets or lists a servers resource.

Overview

Nameservers
TypeResource
Idazure.mysql_flexible_servers.servers

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}".
namestringThe name of the resource.
administratorLoginstringThe administrator's login name of a server. Can only be specified when the server is being created (and is required for creation).
administratorLoginPasswordstringThe password of the administrator login (required for server creation).
availabilityZonestringavailability Zone information of the server.
backupobjectBackup related properties of a server.
createModestringThe mode to create a new MySQL server. Known values are: "Default", "PointInTimeRestore", "Replica", and "GeoRestore".
dataEncryptionobjectThe Data Encryption for CMK.
databasePortintegerThe server database port. Can only be specified when the server is being created.
fullVersionstringMajor version and actual engine version.
fullyQualifiedDomainNamestringThe fully qualified domain name of a server.
highAvailabilityobjectHigh availability related properties of a server.
identityobjectThe cmk identity for the server.
importSourcePropertiesobjectSource properties for import from storage.
locationstringThe geo-location where the resource lives. Required.
lowerCaseTableNamesintegerThe mysql parameter lower_case_table_names. Can only be specified when the server is being created. Allowed values 1 or 2.
maintenancePolicyobjectMaintenance policy of a server.
maintenanceWindowobjectMaintenance window of a server. Known issue: cannot be set during server creation or updated with other properties during server update; must be updated separately.
networkobjectNetwork related properties of a server.
privateEndpointConnectionsarrayPrivateEndpointConnections related properties of a server.
replicaCapacityintegerThe maximum number of replicas that a primary server can have.
replicationRolestringThe replication role. Known values are: "None", "Source", and "Replica".
restorePointInTimestring (date-time)Restore point creation time (ISO8601 format), specifying the time to restore from.
skuobjectThe SKU (pricing tier) of the server.
sourceServerResourceIdstringThe source MySQL server id.
statestringThe state of a server. Known values are: "Ready", "Dropping", "Disabled", "Starting", "Stopping", "Stopped", and "Updating".
storageobjectStorage related properties of a server.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
tagsobjectResource tags.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".
versionstringMajor version of MySQL. 8.0.21 stands for MySQL 8.0, 5.7.44 stands for MySQL 5.7. Known values are: "5.7", "8.0.21", and "8.4".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, server_name, subscription_idGets information about a server.
list_by_resource_groupselectresource_group_name, subscription_idList all the servers in a given resource group.
listselectsubscription_idList all the servers in a given subscription.
createinsertresource_group_name, server_name, subscription_id, locationCreates a new server or updates an existing server. The update action will overwrite the existing server.
updateupdateresource_group_name, server_name, subscription_idUpdates an existing server. The request body can contain one to many of the properties present in the normal server definition.
deletedeleteresource_group_name, server_name, subscription_idDeletes a server.
detach_vnetexecresource_group_name, server_name, subscription_idDetach VNet on a server.
failoverexecresource_group_name, server_name, subscription_idManual failover a server.
reset_gtidexecresource_group_name, server_name, subscription_idResets GTID on a server.
restartexecresource_group_name, server_name, subscription_idRestarts a server.
startexecresource_group_name, server_name, subscription_idStarts a server.
stopexecresource_group_name, server_name, subscription_idStops a server.
validate_estimate_high_availabilityexecresource_group_name, server_name, subscription_idValidate a deployment of high availability.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
server_namestringThe name of the server. Required.
subscription_idstring

SELECT examples

Gets information about a server.

SELECT
id,
name,
administratorLogin,
administratorLoginPassword,
availabilityZone,
backup,
createMode,
dataEncryption,
databasePort,
fullVersion,
fullyQualifiedDomainName,
highAvailability,
identity,
importSourceProperties,
location,
lowerCaseTableNames,
maintenancePolicy,
maintenanceWindow,
network,
privateEndpointConnections,
replicaCapacity,
replicationRole,
restorePointInTime,
sku,
sourceServerResourceId,
state,
storage,
systemData,
tags,
type,
version
FROM azure.mysql_flexible_servers.servers
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND server_name = '{{ server_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Creates a new server or updates an existing server. The update action will overwrite the existing server.

INSERT INTO azure.mysql_flexible_servers.servers (
tags,
location,
identity,
sku,
properties,
resource_group_name,
server_name,
subscription_id
)
SELECT
'{{ tags }}',
'{{ location }}' /* required */,
'{{ identity }}',
'{{ sku }}',
'{{ properties }}',
'{{ resource_group_name }}',
'{{ server_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
identity,
location,
properties,
sku,
systemData,
tags,
type
;

UPDATE examples

Updates an existing server. The request body can contain one to many of the properties present in the normal server definition.

UPDATE azure.mysql_flexible_servers.servers
SET
identity = '{{ identity }}',
sku = '{{ sku }}',
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND server_name = '{{ server_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
identity,
location,
properties,
sku,
systemData,
tags,
type;

DELETE examples

Deletes a server.

DELETE FROM azure.mysql_flexible_servers.servers
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND server_name = '{{ server_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;

Lifecycle Methods

Detach VNet on a server.

EXEC azure.mysql_flexible_servers.servers.detach_vnet 
@resource_group_name='{{ resource_group_name }}' --required,
@server_name='{{ server_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"publicNetworkAccess": "{{ publicNetworkAccess }}"
}'
;