We recommend using Azure Native.
published on Monday, Mar 9, 2026 by Pulumi
We recommend using Azure Native.
published on Monday, Mar 9, 2026 by Pulumi
Import
SQL Managed Databases can be imported using the resource id, e.g.
$ pulumi import azure:sql/managedDatabase:ManagedDatabase example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.Sql/managedInstances/myserver/databases/mydatabase
Example Usage
using Pulumi;
using Azure = Pulumi.Azure;
class MyStack : Stack
{
public MyStack()
{
var example = new Azure.Sql.ManagedDatabase("example", new Azure.Sql.ManagedDatabaseArgs
{
SqlManagedInstanceId = azurerm_sql_managed_instance.Example.Id,
Location = azurerm_resource_group.Example.Location,
});
}
}
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/sql"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := sql.NewManagedDatabase(ctx, "example", &sql.ManagedDatabaseArgs{
SqlManagedInstanceId: pulumi.Any(azurerm_sql_managed_instance.Example.Id),
Location: pulumi.Any(azurerm_resource_group.Example.Location),
})
if err != nil {
return err
}
return nil
})
}
Example coming soon!
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.sql.ManagedDatabase("example", {
sqlManagedInstanceId: azurerm_sql_managed_instance.example.id,
location: azurerm_resource_group.example.location,
});
import pulumi
import pulumi_azure as azure
example = azure.sql.ManagedDatabase("example",
sql_managed_instance_id=azurerm_sql_managed_instance["example"]["id"],
location=azurerm_resource_group["example"]["location"])
Example coming soon!
Create ManagedDatabase Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ManagedDatabase(name: string, args: ManagedDatabaseArgs, opts?: CustomResourceOptions);@overload
def ManagedDatabase(resource_name: str,
args: ManagedDatabaseArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ManagedDatabase(resource_name: str,
opts: Optional[ResourceOptions] = None,
sql_managed_instance_id: Optional[str] = None,
location: Optional[str] = None,
name: Optional[str] = None)func NewManagedDatabase(ctx *Context, name string, args ManagedDatabaseArgs, opts ...ResourceOption) (*ManagedDatabase, error)public ManagedDatabase(string name, ManagedDatabaseArgs args, CustomResourceOptions? opts = null)
public ManagedDatabase(String name, ManagedDatabaseArgs args)
public ManagedDatabase(String name, ManagedDatabaseArgs args, CustomResourceOptions options)
type: azure:sql:ManagedDatabase
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ManagedDatabaseArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ManagedDatabaseArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ManagedDatabaseArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ManagedDatabaseArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ManagedDatabaseArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var azureManagedDatabaseResource = new Azure.Sql.ManagedDatabase("azureManagedDatabaseResource", new()
{
SqlManagedInstanceId = "string",
Location = "string",
Name = "string",
});
example, err := sql.NewManagedDatabase(ctx, "azureManagedDatabaseResource", &sql.ManagedDatabaseArgs{
SqlManagedInstanceId: pulumi.String("string"),
Location: pulumi.String("string"),
Name: pulumi.String("string"),
})
var azureManagedDatabaseResource = new com.pulumi.azure.sql.ManagedDatabase("azureManagedDatabaseResource", com.pulumi.azure.sql.ManagedDatabaseArgs.builder()
.sqlManagedInstanceId("string")
.location("string")
.name("string")
.build());
azure_managed_database_resource = azure.sql.ManagedDatabase("azureManagedDatabaseResource",
sql_managed_instance_id="string",
location="string",
name="string")
const azureManagedDatabaseResource = new azure.sql.ManagedDatabase("azureManagedDatabaseResource", {
sqlManagedInstanceId: "string",
location: "string",
name: "string",
});
type: azure:sql:ManagedDatabase
properties:
location: string
name: string
sqlManagedInstanceId: string
ManagedDatabase Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ManagedDatabase resource accepts the following input properties:
- Sql
Managed stringInstance Id - The SQL Managed Instance ID that this Managed Database will be associated with. Changing this forces a new resource to be created.
- Location string
- Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- Name string
- The name of the SQL Managed Instance. Changing this forces a new resource to be created.
- Sql
Managed stringInstance Id - The SQL Managed Instance ID that this Managed Database will be associated with. Changing this forces a new resource to be created.
- Location string
- Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- Name string
- The name of the SQL Managed Instance. Changing this forces a new resource to be created.
- sql
Managed StringInstance Id - The SQL Managed Instance ID that this Managed Database will be associated with. Changing this forces a new resource to be created.
- location String
- Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- name String
- The name of the SQL Managed Instance. Changing this forces a new resource to be created.
- sql
Managed stringInstance Id - The SQL Managed Instance ID that this Managed Database will be associated with. Changing this forces a new resource to be created.
- location string
- Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- name string
- The name of the SQL Managed Instance. Changing this forces a new resource to be created.
- sql_
managed_ strinstance_ id - The SQL Managed Instance ID that this Managed Database will be associated with. Changing this forces a new resource to be created.
- location str
- Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- name str
- The name of the SQL Managed Instance. Changing this forces a new resource to be created.
- sql
Managed StringInstance Id - The SQL Managed Instance ID that this Managed Database will be associated with. Changing this forces a new resource to be created.
- location String
- Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- name String
- The name of the SQL Managed Instance. Changing this forces a new resource to be created.
Outputs
All input properties are implicitly available as output properties. Additionally, the ManagedDatabase resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing ManagedDatabase Resource
Get an existing ManagedDatabase resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ManagedDatabaseState, opts?: CustomResourceOptions): ManagedDatabase@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
location: Optional[str] = None,
name: Optional[str] = None,
sql_managed_instance_id: Optional[str] = None) -> ManagedDatabasefunc GetManagedDatabase(ctx *Context, name string, id IDInput, state *ManagedDatabaseState, opts ...ResourceOption) (*ManagedDatabase, error)public static ManagedDatabase Get(string name, Input<string> id, ManagedDatabaseState? state, CustomResourceOptions? opts = null)public static ManagedDatabase get(String name, Output<String> id, ManagedDatabaseState state, CustomResourceOptions options)resources: _: type: azure:sql:ManagedDatabase get: id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Location string
- Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- Name string
- The name of the SQL Managed Instance. Changing this forces a new resource to be created.
- Sql
Managed stringInstance Id - The SQL Managed Instance ID that this Managed Database will be associated with. Changing this forces a new resource to be created.
- Location string
- Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- Name string
- The name of the SQL Managed Instance. Changing this forces a new resource to be created.
- Sql
Managed stringInstance Id - The SQL Managed Instance ID that this Managed Database will be associated with. Changing this forces a new resource to be created.
- location String
- Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- name String
- The name of the SQL Managed Instance. Changing this forces a new resource to be created.
- sql
Managed StringInstance Id - The SQL Managed Instance ID that this Managed Database will be associated with. Changing this forces a new resource to be created.
- location string
- Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- name string
- The name of the SQL Managed Instance. Changing this forces a new resource to be created.
- sql
Managed stringInstance Id - The SQL Managed Instance ID that this Managed Database will be associated with. Changing this forces a new resource to be created.
- location str
- Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- name str
- The name of the SQL Managed Instance. Changing this forces a new resource to be created.
- sql_
managed_ strinstance_ id - The SQL Managed Instance ID that this Managed Database will be associated with. Changing this forces a new resource to be created.
- location String
- Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- name String
- The name of the SQL Managed Instance. Changing this forces a new resource to be created.
- sql
Managed StringInstance Id - The SQL Managed Instance ID that this Managed Database will be associated with. Changing this forces a new resource to be created.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.
We recommend using Azure Native.
published on Monday, Mar 9, 2026 by Pulumi
