servers
Creates, updates, deletes, gets or lists a servers resource.
Overview
| Name | servers |
| Type | Resource |
| Id | azure.sql.servers |
Fields
The following fields are returned by SELECT queries:
- get
- check_name_availability
- list_by_resource_group
- list
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
administratorLogin | string | Administrator username for the server. Once created it cannot be changed. |
administratorLoginPassword | string | The administrator login password (required for server creation). |
administrators | object | The 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. |
createMode | string | Create mode for server, only valid values for this are Normal and Restore. Known values are: "Normal" and "Restore". (Normal, Restore) |
externalGovernanceStatus | string | Status of external governance. Known values are: "Enabled" and "Disabled". (Enabled, Disabled) |
federatedClientId | string | The Client id used for cross tenant CMK scenario. |
fullyQualifiedDomainName | string | The fully qualified domain name of the server. |
identity | object | The Azure Active Directory identity of the server. |
isIPv6Enabled | string | Whether 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) |
keyId | string | A CMK URI of the key to use for encryption. |
kind | string | Kind of sql server. This is metadata used for the Azure portal experience. |
location | string | The geo-location where the resource lives. Required. |
minimalTlsVersion | string | Minimal 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) |
primaryUserAssignedIdentityId | string | The resource id of a user assigned identity to be used by default. |
privateEndpointConnections | array | List of private endpoint connections on a server. |
publicNetworkAccess | string | Whether 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) |
restrictOutboundNetworkAccess | string | Whether 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) |
retentionDays | integer | Number of days this server will stay soft-deleted. |
state | string | The state of the 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 | The version of the server. |
workspaceFeature | string | Whether or not existing server has a workspace created and if it allows connection from workspace. Known values are: "Connected" and "Disconnected". (Connected, Disconnected) |
| Name | Datatype | Description |
|---|---|---|
name | string | The name whose availability was checked. |
available | boolean | True if the name is available, otherwise false. |
message | string | A message explaining why the name is unavailable. Will be undefined if the name is available. |
reason | string | The reason code explaining why the name is unavailable. Will be undefined if the name is available. Known values are: "Invalid" and "AlreadyExists". (Invalid, AlreadyExists) |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
administratorLogin | string | Administrator username for the server. Once created it cannot be changed. |
administratorLoginPassword | string | The administrator login password (required for server creation). |
administrators | object | The 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. |
createMode | string | Create mode for server, only valid values for this are Normal and Restore. Known values are: "Normal" and "Restore". (Normal, Restore) |
externalGovernanceStatus | string | Status of external governance. Known values are: "Enabled" and "Disabled". (Enabled, Disabled) |
federatedClientId | string | The Client id used for cross tenant CMK scenario. |
fullyQualifiedDomainName | string | The fully qualified domain name of the server. |
identity | object | The Azure Active Directory identity of the server. |
isIPv6Enabled | string | Whether 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) |
keyId | string | A CMK URI of the key to use for encryption. |
kind | string | Kind of sql server. This is metadata used for the Azure portal experience. |
location | string | The geo-location where the resource lives. Required. |
minimalTlsVersion | string | Minimal 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) |
primaryUserAssignedIdentityId | string | The resource id of a user assigned identity to be used by default. |
privateEndpointConnections | array | List of private endpoint connections on a server. |
publicNetworkAccess | string | Whether 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) |
restrictOutboundNetworkAccess | string | Whether 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) |
retentionDays | integer | Number of days this server will stay soft-deleted. |
state | string | The state of the 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 | The version of the server. |
workspaceFeature | string | Whether or not existing server has a workspace created and if it allows connection from workspace. Known values are: "Connected" and "Disconnected". (Connected, Disconnected) |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
administratorLogin | string | Administrator username for the server. Once created it cannot be changed. |
administratorLoginPassword | string | The administrator login password (required for server creation). |
administrators | object | The 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. |
createMode | string | Create mode for server, only valid values for this are Normal and Restore. Known values are: "Normal" and "Restore". (Normal, Restore) |
externalGovernanceStatus | string | Status of external governance. Known values are: "Enabled" and "Disabled". (Enabled, Disabled) |
federatedClientId | string | The Client id used for cross tenant CMK scenario. |
fullyQualifiedDomainName | string | The fully qualified domain name of the server. |
identity | object | The Azure Active Directory identity of the server. |
isIPv6Enabled | string | Whether 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) |
keyId | string | A CMK URI of the key to use for encryption. |
kind | string | Kind of sql server. This is metadata used for the Azure portal experience. |
location | string | The geo-location where the resource lives. Required. |
minimalTlsVersion | string | Minimal 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) |
primaryUserAssignedIdentityId | string | The resource id of a user assigned identity to be used by default. |
privateEndpointConnections | array | List of private endpoint connections on a server. |
publicNetworkAccess | string | Whether 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) |
restrictOutboundNetworkAccess | string | Whether 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) |
retentionDays | integer | Number of days this server will stay soft-deleted. |
state | string | The state of the 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 | The version of the server. |
workspaceFeature | string | Whether 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:
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 | |
$expand | string | The child resources to include in the response. Default value is None. |
SELECT examples
- get
- check_name_availability
- list_by_resource_group
- list
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 }}'
;
Determines whether a resource can be created with the specified name.
SELECT
name,
available,
message,
reason
FROM azure.sql.servers
WHERE subscription_id = '{{ subscription_id }}' -- required
;
Gets a list of servers in a resource groups.
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 subscription_id = '{{ subscription_id }}' -- required
AND $expand = '{{ $expand }}'
;
Gets a list of all servers in the subscription.
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 subscription_id = '{{ subscription_id }}' -- required
AND $expand = '{{ $expand }}'
;
INSERT examples
- create_or_update
- Manifest
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
;
# 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: properties
description: |
Resource properties.
value:
administratorLogin: "{{ administratorLogin }}"
administratorLoginPassword: "{{ administratorLoginPassword }}"
version: "{{ version }}"
state: "{{ state }}"
fullyQualifiedDomainName: "{{ fullyQualifiedDomainName }}"
privateEndpointConnections:
- id: "{{ id }}"
properties:
privateEndpoint:
id: "{{ id }}"
groupIds:
- "{{ groupIds }}"
privateLinkServiceConnectionState:
status: "{{ status }}"
description: "{{ description }}"
actionsRequired: "{{ actionsRequired }}"
provisioningState: "{{ provisioningState }}"
minimalTlsVersion: "{{ minimalTlsVersion }}"
publicNetworkAccess: "{{ publicNetworkAccess }}"
workspaceFeature: "{{ workspaceFeature }}"
primaryUserAssignedIdentityId: "{{ primaryUserAssignedIdentityId }}"
federatedClientId: "{{ federatedClientId }}"
keyId: "{{ keyId }}"
administrators:
administratorType: "{{ administratorType }}"
principalType: "{{ principalType }}"
login: "{{ login }}"
sid: "{{ sid }}"
tenantId: "{{ tenantId }}"
azureADOnlyAuthentication: {{ azureADOnlyAuthentication }}
restrictOutboundNetworkAccess: "{{ restrictOutboundNetworkAccess }}"
isIPv6Enabled: "{{ isIPv6Enabled }}"
externalGovernanceStatus: "{{ externalGovernanceStatus }}"
retentionDays: {{ retentionDays }}
createMode: "{{ createMode }}"
- name: identity
description: |
The Azure Active Directory identity of the server.
value:
userAssignedIdentities: "{{ userAssignedIdentities }}"
principalId: "{{ principalId }}"
type: "{{ type }}"
tenantId: "{{ tenantId }}"
UPDATE examples
- update
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
- create_or_update
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
- delete
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
- import_database
- refresh_status
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 }}"
}'
;
Refresh external governance enablement status.
EXEC azure.sql.servers.refresh_status
@resource_group_name='{{ resource_group_name }}' --required,
@server_name='{{ server_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;