Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

Get-AzSqlDeletedServer

Module:
Az.Sql Module

Gets information about deleted Azure SQL servers. (Server soft-delete feature is currently in Public Preview)

Syntax

Default (Default)

Get-AzSqlDeletedServer
 -Location <String>
 [-ServerName <String>]
 [-DefaultProfile <IAzureContextContainer>]
 [<CommonParameters>]

Description

The Get-AzSqlDeletedServer cmdlet gets information about deleted Azure SQL servers in a specified location. You can get information about a specific deleted server by providing the server name, or you can list all deleted servers in a location.

Examples

Example 1: Get all deleted servers in a location

Get-AzSqlDeletedServer -Location "centralus"
ServerName : myserver
Location : centralus
DeletionTime : 11/6/2025 12:30:00 PM
FullyQualifiedDomainName : myserver.database.windows.net
Version : 12.0
Id : /subscriptions/12345678-1234-1234-1234-123456789012/providers/Microsoft.Sql/locations/centralus/deletedServers/myserver
OriginalId : /subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/myresourcegroup/providers/Microsoft.Sql/servers/myserver
ResourceGroupName : myresourcegroup
SubscriptionId : 12345678-1234-1234-1234-123456789012

This command gets all deleted SQL servers in the Central US location under the current subscription.

Example 2: Get a specific deleted server

Get-AzSqlDeletedServer -Location "centralus" -ServerName "myserver"
ServerName : myserver
DeletionTime : 11/6/2025 12:30:00 PM
FullyQualifiedDomainName : myserver.database.windows.net
Version : 12.0
Id : /subscriptions/12345678-1234-1234-1234-123456789012/providers/Microsoft.Sql/locations/centralus/deletedServers/myserver
OriginalId : /subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/myresourcegroup/providers/Microsoft.Sql/servers/myserver
ResourceGroupName : myresourcegroup
SubscriptionId : 12345678-1234-1234-1234-123456789012

This command gets information about a specific deleted SQL server named "myserver" in the Central US location.

Parameters

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

-Location

The Azure region where the deleted server was located.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-ServerName

The name of the deleted server to retrieve. If not specified, lists all deleted servers in the location.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

String

Outputs

AzureSqlDeletedServerModel

Related Links


Feedback

Was this page helpful?