Get-AzureSqlDatabaseOperation

Gets the status of database operations on an Azure server.

Note

The cmdlets referenced in this documentation are for managing legacy Azure resources that use Azure Service Manager (ASM) APIs. This legacy PowerShell module isn't recommended when creating new resources since ASM is scheduled for retirement. For more information, see Azure Service Manager retirement.

The Az PowerShell module is the recommended PowerShell module for managing Azure Resource Manager (ARM) resources with PowerShell.

Syntax

Get-AzureSqlDatabaseOperation
   -ConnectionContext <IServerDataServiceContext>
   [-Database <Database>]
   [-DatabaseName <String>]
   [-OperationGuid <Guid>]
   [-Profile <AzureSMProfile>]
   [<CommonParameters>]
Get-AzureSqlDatabaseOperation
   -ServerName <String>
   [-Database <Database>]
   [-DatabaseName <String>]
   [-OperationGuid <Guid>]
   [-Profile <AzureSMProfile>]
   [<CommonParameters>]

Description

The Get-AzureSqlDatabaseOperation cmdlet gets the status of database operations on the specified Azure server. If you specify only the ServerName or ConnectionContext parameter, the cmdlet gets all the database operations for the server. If you also specify a database by using the Database or DatabaseName parameter, this cmdlet gets all the operations for the specified database. If you specify an operation GUID, and ServerName or ConnectionContext, the cmdlet gets a single database operation.

Examples

Example 1: Get the status of all database operations for a database

PS C:\> $Operations = Get-AzureSqlDatabaseOperation -ConnectionContext $Context -DatabaseName "Database17"

This command gets the status of all database operations on the database named Database17 on the server that the connection context $Context specifies.

Example 2: Get the status of all database operations for a server

PS C:\> $Operations = Get-AzureSqlDatabaseOperation -ConnectionContext $Context

This command gets the status of all database operations on the server that the connection context $Context specifies.

Parameters

-ConnectionContext

Specifies the connection context of a server.

Type:IServerDataServiceContext
Aliases:Context
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Database

Specifies an object that represents an Azure SQL Database. If you specify this parameter, you must specify the ServerName parameter or ConnectionContext parameter.

Type:Database
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-DatabaseName

Specifies the name of a database. If you specify this parameter, you must specify the ServerName parameter or the ConnectionContext parameter.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-OperationGuid

Specifies the operation ID that represents a specific database operation for which this cmdlet gets status. You can obtain operation IDs by requesting all the database operations for a Azure SQL Database or server. If you specify this parameter, you must specify the ServerName parameter or the ConnectionContext parameter.

Type:Guid
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Profile

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.

Type:AzureSMProfile
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ServerName

Specifies the name of a server.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

Inputs

Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Server.Database

Microsoft.WindowsAzure.Commands.SqlDatabase.Model.SqlDatabaseServerContext

Guid

Outputs

Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Server.Database.DatabaseOperationResponseList[]

This cmdlet returns an array of DatabaseOperationResponseList objects if you get multiple operations.

Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Server.Database.DatabaseOperationResponse