servers
Creates, updates, deletes, gets or lists a servers resource.
Overview
| Name | servers |
| Type | Resource |
| Id | azure.mysql_flexible_servers.servers |
Fields
The following fields are returned by SELECT queries:
- get
- list_by_resource_group
- list
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". |
name | string | The name of the resource. |
administratorLogin | string | The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). |
administratorLoginPassword | string | The password of the administrator login (required for server creation). |
availabilityZone | string | availability Zone information of the server. |
backup | object | Backup related properties of a server. |
createMode | string | The mode to create a new MySQL server. Known values are: "Default", "PointInTimeRestore", "Replica", and "GeoRestore". |
dataEncryption | object | The Data Encryption for CMK. |
databasePort | integer | The server database port. Can only be specified when the server is being created. |
fullVersion | string | Major version and actual engine version. |
fullyQualifiedDomainName | string | The fully qualified domain name of a server. |
highAvailability | object | High availability related properties of a server. |
identity | object | The cmk identity for the server. |
importSourceProperties | object | Source properties for import from storage. |
location | string | The geo-location where the resource lives. Required. |
lowerCaseTableNames | integer | The mysql parameter lower_case_table_names. Can only be specified when the server is being created. Allowed values 1 or 2. |
maintenancePolicy | object | Maintenance policy of a server. |
maintenanceWindow | object | Maintenance window of a server. Known issue: cannot be set during server creation or updated with other properties during server update; must be updated separately. |
network | object | Network related properties of a server. |
privateEndpointConnections | array | PrivateEndpointConnections related properties of a server. |
replicaCapacity | integer | The maximum number of replicas that a primary server can have. |
replicationRole | string | The replication role. Known values are: "None", "Source", and "Replica". |
restorePointInTime | string (date-time) | Restore point creation time (ISO8601 format), specifying the time to restore from. |
sku | object | The SKU (pricing tier) of the server. |
sourceServerResourceId | string | The source MySQL server id. |
state | string | The state of a server. Known values are: "Ready", "Dropping", "Disabled", "Starting", "Stopping", "Stopped", and "Updating". |
storage | object | Storage related properties of a server. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
version | string | Major 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". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". |
name | string | The name of the resource. |
administratorLogin | string | The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). |
administratorLoginPassword | string | The password of the administrator login (required for server creation). |
availabilityZone | string | availability Zone information of the server. |
backup | object | Backup related properties of a server. |
createMode | string | The mode to create a new MySQL server. Known values are: "Default", "PointInTimeRestore", "Replica", and "GeoRestore". |
dataEncryption | object | The Data Encryption for CMK. |
databasePort | integer | The server database port. Can only be specified when the server is being created. |
fullVersion | string | Major version and actual engine version. |
fullyQualifiedDomainName | string | The fully qualified domain name of a server. |
highAvailability | object | High availability related properties of a server. |
identity | object | The cmk identity for the server. |
importSourceProperties | object | Source properties for import from storage. |
location | string | The geo-location where the resource lives. Required. |
lowerCaseTableNames | integer | The mysql parameter lower_case_table_names. Can only be specified when the server is being created. Allowed values 1 or 2. |
maintenancePolicy | object | Maintenance policy of a server. |
maintenanceWindow | object | Maintenance window of a server. Known issue: cannot be set during server creation or updated with other properties during server update; must be updated separately. |
network | object | Network related properties of a server. |
privateEndpointConnections | array | PrivateEndpointConnections related properties of a server. |
replicaCapacity | integer | The maximum number of replicas that a primary server can have. |
replicationRole | string | The replication role. Known values are: "None", "Source", and "Replica". |
restorePointInTime | string (date-time) | Restore point creation time (ISO8601 format), specifying the time to restore from. |
sku | object | The SKU (pricing tier) of the server. |
sourceServerResourceId | string | The source MySQL server id. |
state | string | The state of a server. Known values are: "Ready", "Dropping", "Disabled", "Starting", "Stopping", "Stopped", and "Updating". |
storage | object | Storage related properties of a server. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
version | string | Major 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". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". |
name | string | The name of the resource. |
administratorLogin | string | The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). |
administratorLoginPassword | string | The password of the administrator login (required for server creation). |
availabilityZone | string | availability Zone information of the server. |
backup | object | Backup related properties of a server. |
createMode | string | The mode to create a new MySQL server. Known values are: "Default", "PointInTimeRestore", "Replica", and "GeoRestore". |
dataEncryption | object | The Data Encryption for CMK. |
databasePort | integer | The server database port. Can only be specified when the server is being created. |
fullVersion | string | Major version and actual engine version. |
fullyQualifiedDomainName | string | The fully qualified domain name of a server. |
highAvailability | object | High availability related properties of a server. |
identity | object | The cmk identity for the server. |
importSourceProperties | object | Source properties for import from storage. |
location | string | The geo-location where the resource lives. Required. |
lowerCaseTableNames | integer | The mysql parameter lower_case_table_names. Can only be specified when the server is being created. Allowed values 1 or 2. |
maintenancePolicy | object | Maintenance policy of a server. |
maintenanceWindow | object | Maintenance window of a server. Known issue: cannot be set during server creation or updated with other properties during server update; must be updated separately. |
network | object | Network related properties of a server. |
privateEndpointConnections | array | PrivateEndpointConnections related properties of a server. |
replicaCapacity | integer | The maximum number of replicas that a primary server can have. |
replicationRole | string | The replication role. Known values are: "None", "Source", and "Replica". |
restorePointInTime | string (date-time) | Restore point creation time (ISO8601 format), specifying the time to restore from. |
sku | object | The SKU (pricing tier) of the server. |
sourceServerResourceId | string | The source MySQL server id. |
state | string | The state of a server. Known values are: "Ready", "Dropping", "Disabled", "Starting", "Stopping", "Stopped", and "Updating". |
storage | object | Storage related properties of a server. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
version | string | Major 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, server_name, subscription_id | Gets information about a server. | |
list_by_resource_group | select | resource_group_name, subscription_id | List all the servers in a given resource group. | |
list | select | subscription_id | List all the servers in a given subscription. | |
create | insert | resource_group_name, server_name, subscription_id, location | Creates a new server or updates an existing server. The update action will overwrite the existing server. | |
update | update | resource_group_name, server_name, subscription_id | Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. | |
delete | delete | resource_group_name, server_name, subscription_id | Deletes a server. | |
detach_vnet | exec | resource_group_name, server_name, subscription_id | Detach VNet on a server. | |
failover | exec | resource_group_name, server_name, subscription_id | Manual failover a server. | |
reset_gtid | exec | resource_group_name, server_name, subscription_id | Resets GTID on a server. | |
restart | exec | resource_group_name, server_name, subscription_id | Restarts a server. | |
start | exec | resource_group_name, server_name, subscription_id | Starts a server. | |
stop | exec | resource_group_name, server_name, subscription_id | Stops a server. | |
validate_estimate_high_availability | exec | resource_group_name, server_name, subscription_id | Validate 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.
| Name | Datatype | Description |
|---|---|---|
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
server_name | string | The name of the server. Required. |
subscription_id | string |
SELECT examples
- get
- list_by_resource_group
- list
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
;
List all the servers in a given resource group.
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 subscription_id = '{{ subscription_id }}' -- required
;
List all the servers in a given subscription.
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 subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: servers
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the servers resource.
- name: server_name
value: "{{ server_name }}"
description: Required parameter for the servers resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the servers resource.
- name: tags
value: "{{ tags }}"
description: |
Resource tags.
- name: location
value: "{{ location }}"
description: |
The geo-location where the resource lives. Required.
- name: identity
description: |
The cmk identity for the server.
value:
principalId: "{{ principalId }}"
tenantId: "{{ tenantId }}"
type: "{{ type }}"
userAssignedIdentities: "{{ userAssignedIdentities }}"
- name: sku
description: |
The SKU (pricing tier) of the server.
value:
name: "{{ name }}"
tier: "{{ tier }}"
- name: properties
value:
administratorLogin: "{{ administratorLogin }}"
administratorLoginPassword: "{{ administratorLoginPassword }}"
version: "{{ version }}"
availabilityZone: "{{ availabilityZone }}"
createMode: "{{ createMode }}"
sourceServerResourceId: "{{ sourceServerResourceId }}"
restorePointInTime: "{{ restorePointInTime }}"
replicationRole: "{{ replicationRole }}"
dataEncryption:
primaryUserAssignedIdentityId: "{{ primaryUserAssignedIdentityId }}"
primaryKeyURI: "{{ primaryKeyURI }}"
geoBackupUserAssignedIdentityId: "{{ geoBackupUserAssignedIdentityId }}"
geoBackupKeyURI: "{{ geoBackupKeyURI }}"
type: "{{ type }}"
databasePort: {{ databasePort }}
storage:
storageSizeGB: {{ storageSizeGB }}
iops: {{ iops }}
autoGrow: "{{ autoGrow }}"
logOnDisk: "{{ logOnDisk }}"
storageSku: "{{ storageSku }}"
autoIoScaling: "{{ autoIoScaling }}"
storageRedundancy: "{{ storageRedundancy }}"
backup:
backupRetentionDays: {{ backupRetentionDays }}
backupIntervalHours: {{ backupIntervalHours }}
geoRedundantBackup: "{{ geoRedundantBackup }}"
earliestRestoreDate: "{{ earliestRestoreDate }}"
highAvailability:
mode: "{{ mode }}"
state: "{{ state }}"
standbyAvailabilityZone: "{{ standbyAvailabilityZone }}"
replicationMode: "{{ replicationMode }}"
network:
publicNetworkAccess: "{{ publicNetworkAccess }}"
delegatedSubnetResourceId: "{{ delegatedSubnetResourceId }}"
privateDnsZoneResourceId: "{{ privateDnsZoneResourceId }}"
maintenancePolicy:
patchStrategy: "{{ patchStrategy }}"
maintenanceWindow:
customWindow: "{{ customWindow }}"
startHour: {{ startHour }}
startMinute: {{ startMinute }}
dayOfWeek: {{ dayOfWeek }}
batchOfMaintenance: "{{ batchOfMaintenance }}"
importSourceProperties:
storageType: "{{ storageType }}"
storageUrl: "{{ storageUrl }}"
sasToken: "{{ sasToken }}"
dataDirPath: "{{ dataDirPath }}"
lowerCaseTableNames: {{ lowerCaseTableNames }}
UPDATE examples
- update
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
- delete
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
- failover
- reset_gtid
- restart
- start
- stop
- validate_estimate_high_availability
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 }}"
}'
;
Manual failover a server.
EXEC azure.mysql_flexible_servers.servers.failover
@resource_group_name='{{ resource_group_name }}' --required,
@server_name='{{ server_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Resets GTID on a server.
EXEC azure.mysql_flexible_servers.servers.reset_gtid
@resource_group_name='{{ resource_group_name }}' --required,
@server_name='{{ server_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"gtidSet": "{{ gtidSet }}"
}'
;
Restarts a server.
EXEC azure.mysql_flexible_servers.servers.restart
@resource_group_name='{{ resource_group_name }}' --required,
@server_name='{{ server_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"restartWithFailover": "{{ restartWithFailover }}",
"maxFailoverSeconds": {{ maxFailoverSeconds }}
}'
;
Starts a server.
EXEC azure.mysql_flexible_servers.servers.start
@resource_group_name='{{ resource_group_name }}' --required,
@server_name='{{ server_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Stops a server.
EXEC azure.mysql_flexible_servers.servers.stop
@resource_group_name='{{ resource_group_name }}' --required,
@server_name='{{ server_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Validate a deployment of high availability.
EXEC azure.mysql_flexible_servers.servers.validate_estimate_high_availability
@resource_group_name='{{ resource_group_name }}' --required,
@server_name='{{ server_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"expectedStandbyAvailabilityZone": "{{ expectedStandbyAvailabilityZone }}"
}'
;