We recommend using Azure Native.
azure.sql.ManagedInstanceActiveDirectoryAdministrator
Explore with Pulumi AI
Allows you to set a user or group as the AD administrator for an Azure SQL Managed Instance.
Note: The
azure.sql.ManagedInstanceActiveDirectoryAdministrator
resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use theazure.mssql.ManagedInstanceActiveDirectoryAdministrator
resource instead.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "rg-example",
location: "West Europe",
});
const exampleManagedInstance = new azure.sql.ManagedInstance("example", {
name: "managedsqlinstance",
resourceGroupName: example.name,
location: example.location,
administratorLogin: "mradministrator",
administratorLoginPassword: "thisIsDog11",
licenseType: "BasePrice",
subnetId: exampleAzurermSubnet.id,
skuName: "GP_Gen5",
vcores: 4,
storageSizeInGb: 32,
}, {
dependsOn: [
exampleAzurermSubnetNetworkSecurityGroupAssociation,
exampleAzurermSubnetRouteTableAssociation,
],
});
const current = azure.core.getClientConfig({});
const exampleManagedInstanceActiveDirectoryAdministrator = new azure.sql.ManagedInstanceActiveDirectoryAdministrator("example", {
managedInstanceName: exampleManagedInstance.name,
resourceGroupName: example.name,
login: "sqladmin",
tenantId: current.then(current => current.tenantId),
objectId: current.then(current => current.objectId),
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="rg-example",
location="West Europe")
example_managed_instance = azure.sql.ManagedInstance("example",
name="managedsqlinstance",
resource_group_name=example.name,
location=example.location,
administrator_login="mradministrator",
administrator_login_password="thisIsDog11",
license_type="BasePrice",
subnet_id=example_azurerm_subnet["id"],
sku_name="GP_Gen5",
vcores=4,
storage_size_in_gb=32,
opts=pulumi.ResourceOptions(depends_on=[
example_azurerm_subnet_network_security_group_association,
example_azurerm_subnet_route_table_association,
]))
current = azure.core.get_client_config()
example_managed_instance_active_directory_administrator = azure.sql.ManagedInstanceActiveDirectoryAdministrator("example",
managed_instance_name=example_managed_instance.name,
resource_group_name=example.name,
login="sqladmin",
tenant_id=current.tenant_id,
object_id=current.object_id)
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sql"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
Name: pulumi.String("rg-example"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
exampleManagedInstance, err := sql.NewManagedInstance(ctx, "example", &sql.ManagedInstanceArgs{
Name: pulumi.String("managedsqlinstance"),
ResourceGroupName: example.Name,
Location: example.Location,
AdministratorLogin: pulumi.String("mradministrator"),
AdministratorLoginPassword: pulumi.String("thisIsDog11"),
LicenseType: pulumi.String("BasePrice"),
SubnetId: pulumi.Any(exampleAzurermSubnet.Id),
SkuName: pulumi.String("GP_Gen5"),
Vcores: pulumi.Int(4),
StorageSizeInGb: pulumi.Int(32),
}, pulumi.DependsOn([]pulumi.Resource{
exampleAzurermSubnetNetworkSecurityGroupAssociation,
exampleAzurermSubnetRouteTableAssociation,
}))
if err != nil {
return err
}
current, err := core.GetClientConfig(ctx, nil, nil)
if err != nil {
return err
}
_, err = sql.NewManagedInstanceActiveDirectoryAdministrator(ctx, "example", &sql.ManagedInstanceActiveDirectoryAdministratorArgs{
ManagedInstanceName: exampleManagedInstance.Name,
ResourceGroupName: example.Name,
Login: pulumi.String("sqladmin"),
TenantId: pulumi.String(current.TenantId),
ObjectId: pulumi.String(current.ObjectId),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = new Azure.Core.ResourceGroup("example", new()
{
Name = "rg-example",
Location = "West Europe",
});
var exampleManagedInstance = new Azure.Sql.ManagedInstance("example", new()
{
Name = "managedsqlinstance",
ResourceGroupName = example.Name,
Location = example.Location,
AdministratorLogin = "mradministrator",
AdministratorLoginPassword = "thisIsDog11",
LicenseType = "BasePrice",
SubnetId = exampleAzurermSubnet.Id,
SkuName = "GP_Gen5",
Vcores = 4,
StorageSizeInGb = 32,
}, new CustomResourceOptions
{
DependsOn =
{
exampleAzurermSubnetNetworkSecurityGroupAssociation,
exampleAzurermSubnetRouteTableAssociation,
},
});
var current = Azure.Core.GetClientConfig.Invoke();
var exampleManagedInstanceActiveDirectoryAdministrator = new Azure.Sql.ManagedInstanceActiveDirectoryAdministrator("example", new()
{
ManagedInstanceName = exampleManagedInstance.Name,
ResourceGroupName = example.Name,
Login = "sqladmin",
TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId),
ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.sql.ManagedInstance;
import com.pulumi.azure.sql.ManagedInstanceArgs;
import com.pulumi.azure.core.CoreFunctions;
import com.pulumi.azure.sql.ManagedInstanceActiveDirectoryAdministrator;
import com.pulumi.azure.sql.ManagedInstanceActiveDirectoryAdministratorArgs;
import com.pulumi.resources.CustomResourceOptions;
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) {
var example = new ResourceGroup("example", ResourceGroupArgs.builder()
.name("rg-example")
.location("West Europe")
.build());
var exampleManagedInstance = new ManagedInstance("exampleManagedInstance", ManagedInstanceArgs.builder()
.name("managedsqlinstance")
.resourceGroupName(example.name())
.location(example.location())
.administratorLogin("mradministrator")
.administratorLoginPassword("thisIsDog11")
.licenseType("BasePrice")
.subnetId(exampleAzurermSubnet.id())
.skuName("GP_Gen5")
.vcores(4)
.storageSizeInGb(32)
.build(), CustomResourceOptions.builder()
.dependsOn(
exampleAzurermSubnetNetworkSecurityGroupAssociation,
exampleAzurermSubnetRouteTableAssociation)
.build());
final var current = CoreFunctions.getClientConfig();
var exampleManagedInstanceActiveDirectoryAdministrator = new ManagedInstanceActiveDirectoryAdministrator("exampleManagedInstanceActiveDirectoryAdministrator", ManagedInstanceActiveDirectoryAdministratorArgs.builder()
.managedInstanceName(exampleManagedInstance.name())
.resourceGroupName(example.name())
.login("sqladmin")
.tenantId(current.applyValue(getClientConfigResult -> getClientConfigResult.tenantId()))
.objectId(current.applyValue(getClientConfigResult -> getClientConfigResult.objectId()))
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: rg-example
location: West Europe
exampleManagedInstance:
type: azure:sql:ManagedInstance
name: example
properties:
name: managedsqlinstance
resourceGroupName: ${example.name}
location: ${example.location}
administratorLogin: mradministrator
administratorLoginPassword: thisIsDog11
licenseType: BasePrice
subnetId: ${exampleAzurermSubnet.id}
skuName: GP_Gen5
vcores: 4
storageSizeInGb: 32
options:
dependson:
- ${exampleAzurermSubnetNetworkSecurityGroupAssociation}
- ${exampleAzurermSubnetRouteTableAssociation}
exampleManagedInstanceActiveDirectoryAdministrator:
type: azure:sql:ManagedInstanceActiveDirectoryAdministrator
name: example
properties:
managedInstanceName: ${exampleManagedInstance.name}
resourceGroupName: ${example.name}
login: sqladmin
tenantId: ${current.tenantId}
objectId: ${current.objectId}
variables:
current:
fn::invoke:
Function: azure:core:getClientConfig
Arguments: {}
Create ManagedInstanceActiveDirectoryAdministrator Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ManagedInstanceActiveDirectoryAdministrator(name: string, args: ManagedInstanceActiveDirectoryAdministratorArgs, opts?: CustomResourceOptions);
@overload
def ManagedInstanceActiveDirectoryAdministrator(resource_name: str,
args: ManagedInstanceActiveDirectoryAdministratorArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ManagedInstanceActiveDirectoryAdministrator(resource_name: str,
opts: Optional[ResourceOptions] = None,
login: Optional[str] = None,
managed_instance_name: Optional[str] = None,
object_id: Optional[str] = None,
resource_group_name: Optional[str] = None,
tenant_id: Optional[str] = None,
azuread_authentication_only: Optional[bool] = None)
func NewManagedInstanceActiveDirectoryAdministrator(ctx *Context, name string, args ManagedInstanceActiveDirectoryAdministratorArgs, opts ...ResourceOption) (*ManagedInstanceActiveDirectoryAdministrator, error)
public ManagedInstanceActiveDirectoryAdministrator(string name, ManagedInstanceActiveDirectoryAdministratorArgs args, CustomResourceOptions? opts = null)
public ManagedInstanceActiveDirectoryAdministrator(String name, ManagedInstanceActiveDirectoryAdministratorArgs args)
public ManagedInstanceActiveDirectoryAdministrator(String name, ManagedInstanceActiveDirectoryAdministratorArgs args, CustomResourceOptions options)
type: azure:sql:ManagedInstanceActiveDirectoryAdministrator
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 ManagedInstanceActiveDirectoryAdministratorArgs
- 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 ManagedInstanceActiveDirectoryAdministratorArgs
- 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 ManagedInstanceActiveDirectoryAdministratorArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ManagedInstanceActiveDirectoryAdministratorArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ManagedInstanceActiveDirectoryAdministratorArgs
- 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 azureManagedInstanceActiveDirectoryAdministratorResource = new Azure.Sql.ManagedInstanceActiveDirectoryAdministrator("azureManagedInstanceActiveDirectoryAdministratorResource", new()
{
Login = "string",
ManagedInstanceName = "string",
ObjectId = "string",
ResourceGroupName = "string",
TenantId = "string",
AzureadAuthenticationOnly = false,
});
example, err := sql.NewManagedInstanceActiveDirectoryAdministrator(ctx, "azureManagedInstanceActiveDirectoryAdministratorResource", &sql.ManagedInstanceActiveDirectoryAdministratorArgs{
Login: pulumi.String("string"),
ManagedInstanceName: pulumi.String("string"),
ObjectId: pulumi.String("string"),
ResourceGroupName: pulumi.String("string"),
TenantId: pulumi.String("string"),
AzureadAuthenticationOnly: pulumi.Bool(false),
})
var azureManagedInstanceActiveDirectoryAdministratorResource = new ManagedInstanceActiveDirectoryAdministrator("azureManagedInstanceActiveDirectoryAdministratorResource", ManagedInstanceActiveDirectoryAdministratorArgs.builder()
.login("string")
.managedInstanceName("string")
.objectId("string")
.resourceGroupName("string")
.tenantId("string")
.azureadAuthenticationOnly(false)
.build());
azure_managed_instance_active_directory_administrator_resource = azure.sql.ManagedInstanceActiveDirectoryAdministrator("azureManagedInstanceActiveDirectoryAdministratorResource",
login="string",
managed_instance_name="string",
object_id="string",
resource_group_name="string",
tenant_id="string",
azuread_authentication_only=False)
const azureManagedInstanceActiveDirectoryAdministratorResource = new azure.sql.ManagedInstanceActiveDirectoryAdministrator("azureManagedInstanceActiveDirectoryAdministratorResource", {
login: "string",
managedInstanceName: "string",
objectId: "string",
resourceGroupName: "string",
tenantId: "string",
azureadAuthenticationOnly: false,
});
type: azure:sql:ManagedInstanceActiveDirectoryAdministrator
properties:
azureadAuthenticationOnly: false
login: string
managedInstanceName: string
objectId: string
resourceGroupName: string
tenantId: string
ManagedInstanceActiveDirectoryAdministrator Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The ManagedInstanceActiveDirectoryAdministrator resource accepts the following input properties:
- Login string
- The login name of the principal to set as the Managed Instance administrator
- Managed
Instance stringName - The name of the SQL Managed Instance on which to set the administrator. Changing this forces a new resource to be created.
- Object
Id string - The ID of the principal to set as the Managed Instance administrator
- Resource
Group stringName - The name of the resource group for the SQL Managed Instance. Changing this forces a new resource to be created.
- Tenant
Id string - The Azure Tenant ID
- Azuread
Authentication boolOnly - Specifies whether only AD Users and administrators can be used to login (
true
) or also local database users (false
). Defaults tofalse
.
- Login string
- The login name of the principal to set as the Managed Instance administrator
- Managed
Instance stringName - The name of the SQL Managed Instance on which to set the administrator. Changing this forces a new resource to be created.
- Object
Id string - The ID of the principal to set as the Managed Instance administrator
- Resource
Group stringName - The name of the resource group for the SQL Managed Instance. Changing this forces a new resource to be created.
- Tenant
Id string - The Azure Tenant ID
- Azuread
Authentication boolOnly - Specifies whether only AD Users and administrators can be used to login (
true
) or also local database users (false
). Defaults tofalse
.
- login String
- The login name of the principal to set as the Managed Instance administrator
- managed
Instance StringName - The name of the SQL Managed Instance on which to set the administrator. Changing this forces a new resource to be created.
- object
Id String - The ID of the principal to set as the Managed Instance administrator
- resource
Group StringName - The name of the resource group for the SQL Managed Instance. Changing this forces a new resource to be created.
- tenant
Id String - The Azure Tenant ID
- azuread
Authentication BooleanOnly - Specifies whether only AD Users and administrators can be used to login (
true
) or also local database users (false
). Defaults tofalse
.
- login string
- The login name of the principal to set as the Managed Instance administrator
- managed
Instance stringName - The name of the SQL Managed Instance on which to set the administrator. Changing this forces a new resource to be created.
- object
Id string - The ID of the principal to set as the Managed Instance administrator
- resource
Group stringName - The name of the resource group for the SQL Managed Instance. Changing this forces a new resource to be created.
- tenant
Id string - The Azure Tenant ID
- azuread
Authentication booleanOnly - Specifies whether only AD Users and administrators can be used to login (
true
) or also local database users (false
). Defaults tofalse
.
- login str
- The login name of the principal to set as the Managed Instance administrator
- managed_
instance_ strname - The name of the SQL Managed Instance on which to set the administrator. Changing this forces a new resource to be created.
- object_
id str - The ID of the principal to set as the Managed Instance administrator
- resource_
group_ strname - The name of the resource group for the SQL Managed Instance. Changing this forces a new resource to be created.
- tenant_
id str - The Azure Tenant ID
- azuread_
authentication_ boolonly - Specifies whether only AD Users and administrators can be used to login (
true
) or also local database users (false
). Defaults tofalse
.
- login String
- The login name of the principal to set as the Managed Instance administrator
- managed
Instance StringName - The name of the SQL Managed Instance on which to set the administrator. Changing this forces a new resource to be created.
- object
Id String - The ID of the principal to set as the Managed Instance administrator
- resource
Group StringName - The name of the resource group for the SQL Managed Instance. Changing this forces a new resource to be created.
- tenant
Id String - The Azure Tenant ID
- azuread
Authentication BooleanOnly - Specifies whether only AD Users and administrators can be used to login (
true
) or also local database users (false
). Defaults tofalse
.
Outputs
All input properties are implicitly available as output properties. Additionally, the ManagedInstanceActiveDirectoryAdministrator 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 ManagedInstanceActiveDirectoryAdministrator Resource
Get an existing ManagedInstanceActiveDirectoryAdministrator 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?: ManagedInstanceActiveDirectoryAdministratorState, opts?: CustomResourceOptions): ManagedInstanceActiveDirectoryAdministrator
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
azuread_authentication_only: Optional[bool] = None,
login: Optional[str] = None,
managed_instance_name: Optional[str] = None,
object_id: Optional[str] = None,
resource_group_name: Optional[str] = None,
tenant_id: Optional[str] = None) -> ManagedInstanceActiveDirectoryAdministrator
func GetManagedInstanceActiveDirectoryAdministrator(ctx *Context, name string, id IDInput, state *ManagedInstanceActiveDirectoryAdministratorState, opts ...ResourceOption) (*ManagedInstanceActiveDirectoryAdministrator, error)
public static ManagedInstanceActiveDirectoryAdministrator Get(string name, Input<string> id, ManagedInstanceActiveDirectoryAdministratorState? state, CustomResourceOptions? opts = null)
public static ManagedInstanceActiveDirectoryAdministrator get(String name, Output<String> id, ManagedInstanceActiveDirectoryAdministratorState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- Azuread
Authentication boolOnly - Specifies whether only AD Users and administrators can be used to login (
true
) or also local database users (false
). Defaults tofalse
. - Login string
- The login name of the principal to set as the Managed Instance administrator
- Managed
Instance stringName - The name of the SQL Managed Instance on which to set the administrator. Changing this forces a new resource to be created.
- Object
Id string - The ID of the principal to set as the Managed Instance administrator
- Resource
Group stringName - The name of the resource group for the SQL Managed Instance. Changing this forces a new resource to be created.
- Tenant
Id string - The Azure Tenant ID
- Azuread
Authentication boolOnly - Specifies whether only AD Users and administrators can be used to login (
true
) or also local database users (false
). Defaults tofalse
. - Login string
- The login name of the principal to set as the Managed Instance administrator
- Managed
Instance stringName - The name of the SQL Managed Instance on which to set the administrator. Changing this forces a new resource to be created.
- Object
Id string - The ID of the principal to set as the Managed Instance administrator
- Resource
Group stringName - The name of the resource group for the SQL Managed Instance. Changing this forces a new resource to be created.
- Tenant
Id string - The Azure Tenant ID
- azuread
Authentication BooleanOnly - Specifies whether only AD Users and administrators can be used to login (
true
) or also local database users (false
). Defaults tofalse
. - login String
- The login name of the principal to set as the Managed Instance administrator
- managed
Instance StringName - The name of the SQL Managed Instance on which to set the administrator. Changing this forces a new resource to be created.
- object
Id String - The ID of the principal to set as the Managed Instance administrator
- resource
Group StringName - The name of the resource group for the SQL Managed Instance. Changing this forces a new resource to be created.
- tenant
Id String - The Azure Tenant ID
- azuread
Authentication booleanOnly - Specifies whether only AD Users and administrators can be used to login (
true
) or also local database users (false
). Defaults tofalse
. - login string
- The login name of the principal to set as the Managed Instance administrator
- managed
Instance stringName - The name of the SQL Managed Instance on which to set the administrator. Changing this forces a new resource to be created.
- object
Id string - The ID of the principal to set as the Managed Instance administrator
- resource
Group stringName - The name of the resource group for the SQL Managed Instance. Changing this forces a new resource to be created.
- tenant
Id string - The Azure Tenant ID
- azuread_
authentication_ boolonly - Specifies whether only AD Users and administrators can be used to login (
true
) or also local database users (false
). Defaults tofalse
. - login str
- The login name of the principal to set as the Managed Instance administrator
- managed_
instance_ strname - The name of the SQL Managed Instance on which to set the administrator. Changing this forces a new resource to be created.
- object_
id str - The ID of the principal to set as the Managed Instance administrator
- resource_
group_ strname - The name of the resource group for the SQL Managed Instance. Changing this forces a new resource to be created.
- tenant_
id str - The Azure Tenant ID
- azuread
Authentication BooleanOnly - Specifies whether only AD Users and administrators can be used to login (
true
) or also local database users (false
). Defaults tofalse
. - login String
- The login name of the principal to set as the Managed Instance administrator
- managed
Instance StringName - The name of the SQL Managed Instance on which to set the administrator. Changing this forces a new resource to be created.
- object
Id String - The ID of the principal to set as the Managed Instance administrator
- resource
Group StringName - The name of the resource group for the SQL Managed Instance. Changing this forces a new resource to be created.
- tenant
Id String - The Azure Tenant ID
Import
A SQL Active Directory Administrator can be imported using the resource id
, e.g.
$ pulumi import azure:sql/managedInstanceActiveDirectoryAdministrator:ManagedInstanceActiveDirectoryAdministrator administrator /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.Sql/managedInstances/mymanagedinstance/administrators/activeDirectory
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurerm
Terraform Provider.