Skip to main content

servers

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

Overview

Nameservers
TypeResource
Idazure.sql.servers

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
administratorLoginstringAdministrator username for the server. Once created it cannot be changed.
administratorLoginPasswordstringThe administrator login password (required for server creation).
administratorsobjectThe Azure Active Directory administrator can be utilized during server creation and for server updates, except for the azureADOnlyAuthentication property. To update the azureADOnlyAuthentication property, individual API must be used.
createModestringCreate mode for server, only valid values for this are Normal and Restore. Known values are: "Normal" and "Restore". (Normal, Restore)
externalGovernanceStatusstringStatus of external governance. Known values are: "Enabled" and "Disabled". (Enabled, Disabled)
federatedClientIdstringThe Client id used for cross tenant CMK scenario.
fullyQualifiedDomainNamestringThe fully qualified domain name of the server.
identityobjectThe Azure Active Directory identity of the server.
isIPv6EnabledstringWhether or not to enable IPv6 support for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Known values are: "Enabled" and "Disabled". (Enabled, Disabled)
keyIdstringA CMK URI of the key to use for encryption.
kindstringKind of sql server. This is metadata used for the Azure portal experience.
locationstringThe geo-location where the resource lives. Required.
minimalTlsVersionstringMinimal TLS version. Allowed values: 'None', 1.0', '1.1', '1.2', '1.3'. Known values are: "None", "1.0", "1.1", "1.2", and "1.3". (None, 1.0, 1.1, 1.2, 1.3)
primaryUserAssignedIdentityIdstringThe resource id of a user assigned identity to be used by default.
privateEndpointConnectionsarrayList of private endpoint connections on a server.
publicNetworkAccessstringWhether or not public endpoint access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled' or 'SecuredByPerimeter'. Known values are: "Enabled", "Disabled", and "SecuredByPerimeter". (Enabled, Disabled, SecuredByPerimeter)
restrictOutboundNetworkAccessstringWhether or not to restrict outbound network access for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Known values are: "Enabled" and "Disabled". (Enabled, Disabled)
retentionDaysintegerNumber of days this server will stay soft-deleted.
statestringThe state of the 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".
versionstringThe version of the server.
workspaceFeaturestringWhether or not existing server has a workspace created and if it allows connection from workspace. Known values are: "Connected" and "Disconnected". (Connected, Disconnected)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, server_name, subscription_id$expandGets a server.
check_name_availabilityselectsubscription_idDetermines whether a resource can be created with the specified name.
list_by_resource_groupselectresource_group_name, subscription_id$expandGets a list of servers in a resource groups.
listselectsubscription_id$expandGets a list of all servers in the subscription.
create_or_updateinsertresource_group_name, server_name, subscription_id, locationCreates or updates a server.
updateupdateresource_group_name, server_name, subscription_idUpdates a server.
create_or_updatereplaceresource_group_name, server_name, subscription_id, locationCreates or updates a server.
deletedeleteresource_group_name, server_name, subscription_idDeletes a server.
import_databaseexecresource_group_name, server_name, subscription_id, storageKeyType, storageKey, storageUri, administratorLoginImports a bacpac into a new database.
refresh_statusexecresource_group_name, server_name, subscription_idRefresh external governance enablement status.

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
$expandstringThe child resources to include in the response. Default value is None.

SELECT examples

Gets a server.

SELECT
id,
name,
administratorLogin,
administratorLoginPassword,
administrators,
createMode,
externalGovernanceStatus,
federatedClientId,
fullyQualifiedDomainName,
identity,
isIPv6Enabled,
keyId,
kind,
location,
minimalTlsVersion,
primaryUserAssignedIdentityId,
privateEndpointConnections,
publicNetworkAccess,
restrictOutboundNetworkAccess,
retentionDays,
state,
systemData,
tags,
type,
version,
workspaceFeature
FROM azure.sql.servers
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND server_name = '{{ server_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $expand = '{{ $expand }}'
;

INSERT examples

Creates or updates a server.

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

UPDATE examples

Updates a server.

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

REPLACE examples

Creates or updates a server.

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

DELETE examples

Deletes a server.

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

Lifecycle Methods

Imports a bacpac into a new database.

EXEC azure.sql.servers.import_database 
@resource_group_name='{{ resource_group_name }}' --required,
@server_name='{{ server_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"databaseName": "{{ databaseName }}",
"edition": "{{ edition }}",
"serviceObjectiveName": "{{ serviceObjectiveName }}",
"maxSizeBytes": "{{ maxSizeBytes }}",
"storageKeyType": "{{ storageKeyType }}",
"storageKey": "{{ storageKey }}",
"storageUri": "{{ storageUri }}",
"administratorLogin": "{{ administratorLogin }}",
"administratorLoginPassword": "{{ administratorLoginPassword }}",
"authenticationType": "{{ authenticationType }}",
"networkIsolation": "{{ networkIsolation }}"
}'
;