1. Packages
  2. Azure Classic
  3. API Docs
  4. mssql
  5. getManagedDatabase

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

azure.mssql.getManagedDatabase

Explore with Pulumi AI

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

Use this data source to access information about an existing Azure SQL Azure Managed Database.

Example Usage

Coming soon!
Coming soon!
Coming soon!
Coming soon!
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.mssql.MssqlFunctions;
import com.pulumi.azure.mssql.inputs.GetManagedDatabaseArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var example = MssqlFunctions.getManagedDatabase(GetManagedDatabaseArgs.builder()
            .name("example")
            .resourceGroupName(exampleAzurermResourceGroup.name())
            .managedInstanceName(exampleAzurermMssqlManagedInstance.name())
            .build());

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: azure:mssql:getManagedDatabase
      arguments:
        name: example
        resourceGroupName: ${exampleAzurermResourceGroup.name}
        managedInstanceName: ${exampleAzurermMssqlManagedInstance.name}
Copy

Using getManagedDatabase

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getManagedDatabase(args: GetManagedDatabaseArgs, opts?: InvokeOptions): Promise<GetManagedDatabaseResult>
function getManagedDatabaseOutput(args: GetManagedDatabaseOutputArgs, opts?: InvokeOptions): Output<GetManagedDatabaseResult>
Copy
def get_managed_database(managed_instance_id: Optional[str] = None,
                         name: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetManagedDatabaseResult
def get_managed_database_output(managed_instance_id: Optional[pulumi.Input[str]] = None,
                         name: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetManagedDatabaseResult]
Copy
func LookupManagedDatabase(ctx *Context, args *LookupManagedDatabaseArgs, opts ...InvokeOption) (*LookupManagedDatabaseResult, error)
func LookupManagedDatabaseOutput(ctx *Context, args *LookupManagedDatabaseOutputArgs, opts ...InvokeOption) LookupManagedDatabaseResultOutput
Copy

> Note: This function is named LookupManagedDatabase in the Go SDK.

public static class GetManagedDatabase 
{
    public static Task<GetManagedDatabaseResult> InvokeAsync(GetManagedDatabaseArgs args, InvokeOptions? opts = null)
    public static Output<GetManagedDatabaseResult> Invoke(GetManagedDatabaseInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetManagedDatabaseResult> getManagedDatabase(GetManagedDatabaseArgs args, InvokeOptions options)
public static Output<GetManagedDatabaseResult> getManagedDatabase(GetManagedDatabaseArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: azure:mssql/getManagedDatabase:getManagedDatabase
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

ManagedInstanceId
This property is required.
Changes to this property will trigger replacement.
string
The SQL Managed Instance ID.
Name
This property is required.
Changes to this property will trigger replacement.
string
The name of this Azure SQL Azure Managed Database.
ManagedInstanceId
This property is required.
Changes to this property will trigger replacement.
string
The SQL Managed Instance ID.
Name
This property is required.
Changes to this property will trigger replacement.
string
The name of this Azure SQL Azure Managed Database.
managedInstanceId
This property is required.
Changes to this property will trigger replacement.
String
The SQL Managed Instance ID.
name
This property is required.
Changes to this property will trigger replacement.
String
The name of this Azure SQL Azure Managed Database.
managedInstanceId
This property is required.
Changes to this property will trigger replacement.
string
The SQL Managed Instance ID.
name
This property is required.
Changes to this property will trigger replacement.
string
The name of this Azure SQL Azure Managed Database.
managed_instance_id
This property is required.
Changes to this property will trigger replacement.
str
The SQL Managed Instance ID.
name
This property is required.
Changes to this property will trigger replacement.
str
The name of this Azure SQL Azure Managed Database.
managedInstanceId
This property is required.
Changes to this property will trigger replacement.
String
The SQL Managed Instance ID.
name
This property is required.
Changes to this property will trigger replacement.
String
The name of this Azure SQL Azure Managed Database.

getManagedDatabase Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
LongTermRetentionPolicies List<GetManagedDatabaseLongTermRetentionPolicy>
A long_term_retention_policy block as defined below.
ManagedInstanceId string
ManagedInstanceName string
The name of the Managed Instance.
Name string
PointInTimeRestores List<GetManagedDatabasePointInTimeRestore>
A point_in_time_restore block as defined below.
ResourceGroupName string
The name of the Resource Group where the Azure SQL Azure Managed Instance exists.
ShortTermRetentionDays int
The backup retention period in days. This is how many days Point-in-Time Restore will be supported.
Id string
The provider-assigned unique ID for this managed resource.
LongTermRetentionPolicies []GetManagedDatabaseLongTermRetentionPolicy
A long_term_retention_policy block as defined below.
ManagedInstanceId string
ManagedInstanceName string
The name of the Managed Instance.
Name string
PointInTimeRestores []GetManagedDatabasePointInTimeRestore
A point_in_time_restore block as defined below.
ResourceGroupName string
The name of the Resource Group where the Azure SQL Azure Managed Instance exists.
ShortTermRetentionDays int
The backup retention period in days. This is how many days Point-in-Time Restore will be supported.
id String
The provider-assigned unique ID for this managed resource.
longTermRetentionPolicies List<GetManagedDatabaseLongTermRetentionPolicy>
A long_term_retention_policy block as defined below.
managedInstanceId String
managedInstanceName String
The name of the Managed Instance.
name String
pointInTimeRestores List<GetManagedDatabasePointInTimeRestore>
A point_in_time_restore block as defined below.
resourceGroupName String
The name of the Resource Group where the Azure SQL Azure Managed Instance exists.
shortTermRetentionDays Integer
The backup retention period in days. This is how many days Point-in-Time Restore will be supported.
id string
The provider-assigned unique ID for this managed resource.
longTermRetentionPolicies GetManagedDatabaseLongTermRetentionPolicy[]
A long_term_retention_policy block as defined below.
managedInstanceId string
managedInstanceName string
The name of the Managed Instance.
name string
pointInTimeRestores GetManagedDatabasePointInTimeRestore[]
A point_in_time_restore block as defined below.
resourceGroupName string
The name of the Resource Group where the Azure SQL Azure Managed Instance exists.
shortTermRetentionDays number
The backup retention period in days. This is how many days Point-in-Time Restore will be supported.
id str
The provider-assigned unique ID for this managed resource.
long_term_retention_policies Sequence[GetManagedDatabaseLongTermRetentionPolicy]
A long_term_retention_policy block as defined below.
managed_instance_id str
managed_instance_name str
The name of the Managed Instance.
name str
point_in_time_restores Sequence[GetManagedDatabasePointInTimeRestore]
A point_in_time_restore block as defined below.
resource_group_name str
The name of the Resource Group where the Azure SQL Azure Managed Instance exists.
short_term_retention_days int
The backup retention period in days. This is how many days Point-in-Time Restore will be supported.
id String
The provider-assigned unique ID for this managed resource.
longTermRetentionPolicies List<Property Map>
A long_term_retention_policy block as defined below.
managedInstanceId String
managedInstanceName String
The name of the Managed Instance.
name String
pointInTimeRestores List<Property Map>
A point_in_time_restore block as defined below.
resourceGroupName String
The name of the Resource Group where the Azure SQL Azure Managed Instance exists.
shortTermRetentionDays Number
The backup retention period in days. This is how many days Point-in-Time Restore will be supported.

Supporting Types

GetManagedDatabaseLongTermRetentionPolicy

ImmutableBackupsEnabled This property is required. bool
Specifies if the backups are immutable.
MonthlyRetention This property is required. string
The monthly retention policy for an LTR backup in an ISO 8601 format.
WeekOfYear This property is required. int
The week of year to take the yearly backup.
WeeklyRetention This property is required. string
The weekly retention policy for an LTR backup in an ISO 8601 format.
YearlyRetention This property is required. string
The yearly retention policy for an LTR backup in an ISO 8601 format.
ImmutableBackupsEnabled This property is required. bool
Specifies if the backups are immutable.
MonthlyRetention This property is required. string
The monthly retention policy for an LTR backup in an ISO 8601 format.
WeekOfYear This property is required. int
The week of year to take the yearly backup.
WeeklyRetention This property is required. string
The weekly retention policy for an LTR backup in an ISO 8601 format.
YearlyRetention This property is required. string
The yearly retention policy for an LTR backup in an ISO 8601 format.
immutableBackupsEnabled This property is required. Boolean
Specifies if the backups are immutable.
monthlyRetention This property is required. String
The monthly retention policy for an LTR backup in an ISO 8601 format.
weekOfYear This property is required. Integer
The week of year to take the yearly backup.
weeklyRetention This property is required. String
The weekly retention policy for an LTR backup in an ISO 8601 format.
yearlyRetention This property is required. String
The yearly retention policy for an LTR backup in an ISO 8601 format.
immutableBackupsEnabled This property is required. boolean
Specifies if the backups are immutable.
monthlyRetention This property is required. string
The monthly retention policy for an LTR backup in an ISO 8601 format.
weekOfYear This property is required. number
The week of year to take the yearly backup.
weeklyRetention This property is required. string
The weekly retention policy for an LTR backup in an ISO 8601 format.
yearlyRetention This property is required. string
The yearly retention policy for an LTR backup in an ISO 8601 format.
immutable_backups_enabled This property is required. bool
Specifies if the backups are immutable.
monthly_retention This property is required. str
The monthly retention policy for an LTR backup in an ISO 8601 format.
week_of_year This property is required. int
The week of year to take the yearly backup.
weekly_retention This property is required. str
The weekly retention policy for an LTR backup in an ISO 8601 format.
yearly_retention This property is required. str
The yearly retention policy for an LTR backup in an ISO 8601 format.
immutableBackupsEnabled This property is required. Boolean
Specifies if the backups are immutable.
monthlyRetention This property is required. String
The monthly retention policy for an LTR backup in an ISO 8601 format.
weekOfYear This property is required. Number
The week of year to take the yearly backup.
weeklyRetention This property is required. String
The weekly retention policy for an LTR backup in an ISO 8601 format.
yearlyRetention This property is required. String
The yearly retention policy for an LTR backup in an ISO 8601 format.

GetManagedDatabasePointInTimeRestore

RestorePointInTime This property is required. string
The point in time for the restore from source_database_id.
SourceDatabaseId This property is required. string
The source database ID that is used to restore from.
RestorePointInTime This property is required. string
The point in time for the restore from source_database_id.
SourceDatabaseId This property is required. string
The source database ID that is used to restore from.
restorePointInTime This property is required. String
The point in time for the restore from source_database_id.
sourceDatabaseId This property is required. String
The source database ID that is used to restore from.
restorePointInTime This property is required. string
The point in time for the restore from source_database_id.
sourceDatabaseId This property is required. string
The source database ID that is used to restore from.
restore_point_in_time This property is required. str
The point in time for the restore from source_database_id.
source_database_id This property is required. str
The source database ID that is used to restore from.
restorePointInTime This property is required. String
The point in time for the restore from source_database_id.
sourceDatabaseId This property is required. String
The source database ID that is used to restore from.

Package Details

Repository
Azure Classic pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi