Get-AzSqlInstanceDatabase
Returns information about Azure SQL Managed Instance database.
Syntax
GetInstanceDatabaseFromInputParameters (Default)
Get-AzSqlInstanceDatabase
[[-Name] <String>]
[-InstanceName] <String>
[-ResourceGroupName] <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
GetInstanceDatabaseFromAzureResourceId
Get-AzSqlInstanceDatabase
[[-Name] <String>]
[-InstanceResourceId] <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
GetInstanceDatabaseFromInstanceObject
Get-AzSqlInstanceDatabase
[[-Name] <String>]
[-InstanceObject] <AzureSqlManagedInstanceModel>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
The Get-AzSqlInstanceDatabase cmdlet gets one or more Azure SQL databases from an Azure SQL Managed Instance.
Examples
Example 1: Get all databases on a instance
Get-AzSqlInstanceDatabase -InstanceName "managedInstance1" -ResourceGroupName "resourcegroup01"
ResourceGroupName : resourcegroup01
ManagedInstanceName : managedInstance1
Location : westcentralus
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Sql/managedInstances/managedInstance1/databases/managedDatabase1
Name : managedDatabase1
Tags :
Collation : SQL_Latin1_General_CP1_CI_AS
Status : Online
CreationDate : 4/27/2018 2:30:07 PM
EarliestRestorePoint : 4/27/2018 2:40:47 PM
RestorePointInTime :
DefaultSecondaryLocation : West US 2
CatalogCollation :
CreateMode :
StorageContainerUri :
StorageContainerSasToken :
SourceDatabaseId :
FailoverGroupId :
ResourceGroupName : resourcegroup01
ManagedInstanceName : managedInstance1
Location : westcentralus
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Sql/managedInstances/managedInstance1/databases/managedDatabase2
Name : managedDatabase2
Tags :
Collation : SQL_Latin1_General_CP1_CI_AS
Status : Online
CreationDate : 4/23/2018 5:21:07 PM
EarliestRestorePoint : 4/23/2018 5:31:47 PM
RestorePointInTime :
DefaultSecondaryLocation : West US 2
CatalogCollation :
CreateMode :
StorageContainerUri :
StorageContainerSasToken :
SourceDatabaseId :
FailoverGroupId :
This command gets all databases on the instance named managedInstance1.
Example 2: Get a database by name on a Managed instance
Get-AzSqlInstanceDatabase -Name "managedDatabase1" -InstanceName "managedInstance1" -ResourceGroupName "ResourceGroup01"
ResourceGroupName : resourcegroup01
ManagedInstanceName : managedInstance1
Location : westcentralus
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Sql/managedInstances/managedInstance1/databases/managedDatabase1
Name : managedDatabase1
Tags :
Collation : SQL_Latin1_General_CP1_CI_AS
Status : Online
CreationDate : 4/27/2018 2:30:07 PM
EarliestRestorePoint : 4/27/2018 2:40:47 PM
RestorePointInTime :
DefaultSecondaryLocation : West US 2
CatalogCollation :
CreateMode :
StorageContainerUri :
StorageContainerSasToken :
SourceDatabaseId :
FailoverGroupId :
This command gets a database named managedDatabase1 from a instance named managedInstance1.
Example 3: Get all databases on a instance using filtering
Get-AzSqlInstanceDatabase -InstanceName "managedInstance1" -ResourceGroupName "resourcegroup01" -Name "managedDatabase*"
ResourceGroupName : resourcegroup01
ManagedInstanceName : managedInstance1
Location : westcentralus
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Sql/managedInstances/managedInstance1/databases/managedDatabase1
Name : managedDatabase1
Tags :
Collation : SQL_Latin1_General_CP1_CI_AS
Status : Online
CreationDate : 4/27/2018 2:30:07 PM
EarliestRestorePoint : 4/27/2018 2:40:47 PM
RestorePointInTime :
DefaultSecondaryLocation : West US 2
CatalogCollation :
CreateMode :
StorageContainerUri :
StorageContainerSasToken :
SourceDatabaseId :
FailoverGroupId :
ResourceGroupName : resourcegroup01
ManagedInstanceName : managedInstance1
Location : westcentralus
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Sql/managedInstances/managedInstance1/databases/managedDatabase2
Name : managedDatabase2
Tags :
Collation : SQL_Latin1_General_CP1_CI_AS
Status : Online
CreationDate : 4/23/2018 5:21:07 PM
EarliestRestorePoint : 4/23/2018 5:31:47 PM
RestorePointInTime :
DefaultSecondaryLocation : West US 2
CatalogCollation :
CreateMode :
StorageContainerUri :
StorageContainerSasToken :
SourceDatabaseId :
FailoverGroupId :
This command gets all databases on the instance named managedInstance1 that start with "managedDatabase".
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
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-InstanceName
The instance name.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
GetInstanceDatabaseFromInputParameters
Position: | 1 |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-InstanceObject
The instance object to use for getting instance database
Parameter properties
Type: | AzureSqlManagedInstanceModel |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | ParentObject |
Parameter sets
GetInstanceDatabaseFromInstanceObject
Position: | 0 |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-InstanceResourceId
The resource id of instance object to get
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | ParentResourceId |
Parameter sets
GetInstanceDatabaseFromAzureResourceId
Position: | 0 |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | True |
Value from remaining arguments: | False |
-Name
The name of the Azure SQL Instance Database to retrieve.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | True |
DontShow: | False |
Aliases: | InstanceDatabaseName |
Parameter sets
(All)
Position: | 0 |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-ResourceGroupName
The name of the resource group.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
GetInstanceDatabaseFromInputParameters
Position: | 2 |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
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.