Hiermee maakt of werkt u een beheerder van een beheerd exemplaar bij.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/ActiveDirectory?api-version=2025-01-01
URI-parameters
| Name |
In |
Vereist |
Type |
Description |
|
administratorName
|
path |
True
|
AdministratorName
|
|
|
managedInstanceName
|
path |
True
|
string
|
De naam van het beheerde exemplaar.
|
|
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
De naam van de resourcegroep. De naam is hoofdletterongevoelig.
|
|
subscriptionId
|
path |
True
|
string
(uuid)
|
De id van het doelabonnement. De waarde moet een UUID zijn.
|
|
api-version
|
query |
True
|
string
minLength: 1
|
De API-versie die voor deze bewerking moet worden gebruikt.
|
Aanvraagbody
| Name |
Vereist |
Type |
Description |
|
properties.administratorType
|
True
|
ManagedInstanceAdministratorType
|
Type van de beheerder van het beheerde exemplaar.
|
|
properties.login
|
True
|
string
|
Aanmeldingsnaam van de beheerder van het beheerde exemplaar.
|
|
properties.sid
|
True
|
string
(uuid)
|
SID (object-id) van de beheerder van het beheerde exemplaar.
|
|
properties.tenantId
|
|
string
(uuid)
|
Tenant-id van de beheerder van het beheerde exemplaar.
|
Antwoorden
| Name |
Type |
Description |
|
200 OK
|
ManagedInstanceAdministrator
|
De updateoperatie van de bron 'ManagedInstanceAdministrator' is geslaagd
|
|
201 Created
|
ManagedInstanceAdministrator
|
Resource 'ManagedInstanceAdministrator' aanmaakoperatie geslaagd
Kopteksten
- Location: string
- Retry-After: integer
|
|
202 Accepted
|
|
Resourcebewerking geaccepteerd.
Kopteksten
- Location: string
- Retry-After: integer
|
|
Other Status Codes
|
ErrorResponse
|
Een onverwachte foutreactie.
|
Beveiliging
azure_auth
OAuth2-stroom voor Azure Active Directory.
Type:
oauth2
Stroom:
implicit
Autorisatie-URL:
https://login.microsoftonline.com/common/oauth2/authorize
Bereiken
| Name |
Description |
|
user_impersonation
|
Uw gebruikersaccount imiteren
|
Voorbeelden
Create administrator of managed instance
Voorbeeldaanvraag
PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/managedInstance/administrators/ActiveDirectory?api-version=2025-01-01
{
"properties": {
"administratorType": "ActiveDirectory",
"login": "bob@contoso.com",
"sid": "44444444-3333-2222-1111-000000000000",
"tenantId": "55555555-4444-3333-2222-111111111111"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.sql import SqlManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-sql
# USAGE
python managed_instance_administrator_create.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SqlManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.managed_instance_administrators.begin_create_or_update(
resource_group_name="Default-SQL-SouthEastAsia",
managed_instance_name="managedInstance",
administrator_name="ActiveDirectory",
parameters={
"properties": {
"administratorType": "ActiveDirectory",
"login": "bob@contoso.com",
"sid": "44444444-3333-2222-1111-000000000000",
"tenantId": "55555555-4444-3333-2222-111111111111",
}
},
).result()
print(response)
# x-ms-original-file: 2025-01-01/ManagedInstanceAdministratorCreate.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SqlManagementClient } = require("@azure/arm-sql");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a managed instance administrator.
*
* @summary creates or updates a managed instance administrator.
* x-ms-original-file: 2025-01-01/ManagedInstanceAdministratorCreate.json
*/
async function createAdministratorOfManagedInstance() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-1111-2222-3333-444444444444";
const client = new SqlManagementClient(credential, subscriptionId);
const result = await client.managedInstanceAdministrators.createOrUpdate(
"Default-SQL-SouthEastAsia",
"managedInstance",
"ActiveDirectory",
{
administratorType: "ActiveDirectory",
login: "bob@contoso.com",
sid: "44444444-3333-2222-1111-000000000000",
tenantId: "55555555-4444-3333-2222-111111111111",
},
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Sql.Models;
using Azure.ResourceManager.Sql;
// Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceAdministratorCreate.json
// this example is just showing the usage of "ManagedInstanceAdministrators_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ManagedInstanceAdministratorResource created on azure
// for more information of creating ManagedInstanceAdministratorResource, please refer to the document of ManagedInstanceAdministratorResource
string subscriptionId = "00000000-1111-2222-3333-444444444444";
string resourceGroupName = "Default-SQL-SouthEastAsia";
string managedInstanceName = "managedInstance";
SqlAdministratorName administratorName = SqlAdministratorName.ActiveDirectory;
ResourceIdentifier managedInstanceAdministratorResourceId = ManagedInstanceAdministratorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, managedInstanceName, administratorName);
ManagedInstanceAdministratorResource managedInstanceAdministrator = client.GetManagedInstanceAdministratorResource(managedInstanceAdministratorResourceId);
// invoke the operation
ManagedInstanceAdministratorData data = new ManagedInstanceAdministratorData
{
AdministratorType = ManagedInstanceAdministratorType.ActiveDirectory,
Login = "bob@contoso.com",
Sid = Guid.Parse("44444444-3333-2222-1111-000000000000"),
TenantId = Guid.Parse("55555555-4444-3333-2222-111111111111"),
};
ArmOperation<ManagedInstanceAdministratorResource> lro = await managedInstanceAdministrator.UpdateAsync(WaitUntil.Completed, data);
ManagedInstanceAdministratorResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ManagedInstanceAdministratorData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Voorbeeldrespons
{
"name": "ActiveDirectory",
"type": "Microsoft.Sql/managedInstances/administrators",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/managedInstance/administrators/ActiveDirectory",
"properties": {
"administratorType": "ActiveDirectory",
"login": "bob@contoso.com",
"sid": "44444444-3333-2222-1111-000000000000",
"tenantId": "55555555-4444-3333-2222-111111111111"
}
}
{
"name": "ActiveDirectory",
"type": "Microsoft.Sql/managedInstances/administrators",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/managedInstance/administrators/ActiveDirectory",
"properties": {
"administratorType": "ActiveDirectory",
"login": "bob@contoso.com",
"sid": "44444444-3333-2222-1111-000000000000",
"tenantId": "55555555-4444-3333-2222-111111111111"
}
}
Update administrator of managed instance
Voorbeeldaanvraag
PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/managedInstance/administrators/ActiveDirectory?api-version=2025-01-01
{
"properties": {
"administratorType": "ActiveDirectory",
"login": "bob@contoso.com",
"sid": "44444444-3333-2222-1111-000000000000",
"tenantId": "55555555-4444-3333-2222-111111111111"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.sql import SqlManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-sql
# USAGE
python managed_instance_administrator_update.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SqlManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.managed_instance_administrators.begin_create_or_update(
resource_group_name="Default-SQL-SouthEastAsia",
managed_instance_name="managedInstance",
administrator_name="ActiveDirectory",
parameters={
"properties": {
"administratorType": "ActiveDirectory",
"login": "bob@contoso.com",
"sid": "44444444-3333-2222-1111-000000000000",
"tenantId": "55555555-4444-3333-2222-111111111111",
}
},
).result()
print(response)
# x-ms-original-file: 2025-01-01/ManagedInstanceAdministratorUpdate.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SqlManagementClient } = require("@azure/arm-sql");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a managed instance administrator.
*
* @summary creates or updates a managed instance administrator.
* x-ms-original-file: 2025-01-01/ManagedInstanceAdministratorUpdate.json
*/
async function updateAdministratorOfManagedInstance() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-1111-2222-3333-444444444444";
const client = new SqlManagementClient(credential, subscriptionId);
const result = await client.managedInstanceAdministrators.createOrUpdate(
"Default-SQL-SouthEastAsia",
"managedInstance",
"ActiveDirectory",
{
administratorType: "ActiveDirectory",
login: "bob@contoso.com",
sid: "44444444-3333-2222-1111-000000000000",
tenantId: "55555555-4444-3333-2222-111111111111",
},
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Sql.Models;
using Azure.ResourceManager.Sql;
// Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceAdministratorUpdate.json
// this example is just showing the usage of "ManagedInstanceAdministrators_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ManagedInstanceAdministratorResource created on azure
// for more information of creating ManagedInstanceAdministratorResource, please refer to the document of ManagedInstanceAdministratorResource
string subscriptionId = "00000000-1111-2222-3333-444444444444";
string resourceGroupName = "Default-SQL-SouthEastAsia";
string managedInstanceName = "managedInstance";
SqlAdministratorName administratorName = SqlAdministratorName.ActiveDirectory;
ResourceIdentifier managedInstanceAdministratorResourceId = ManagedInstanceAdministratorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, managedInstanceName, administratorName);
ManagedInstanceAdministratorResource managedInstanceAdministrator = client.GetManagedInstanceAdministratorResource(managedInstanceAdministratorResourceId);
// invoke the operation
ManagedInstanceAdministratorData data = new ManagedInstanceAdministratorData
{
AdministratorType = ManagedInstanceAdministratorType.ActiveDirectory,
Login = "bob@contoso.com",
Sid = Guid.Parse("44444444-3333-2222-1111-000000000000"),
TenantId = Guid.Parse("55555555-4444-3333-2222-111111111111"),
};
ArmOperation<ManagedInstanceAdministratorResource> lro = await managedInstanceAdministrator.UpdateAsync(WaitUntil.Completed, data);
ManagedInstanceAdministratorResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ManagedInstanceAdministratorData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Voorbeeldrespons
{
"name": "ActiveDirectory",
"type": "Microsoft.Sql/managedInstances/administrators",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/managedInstance/administrators/ActiveDirectory",
"properties": {
"administratorType": "ActiveDirectory",
"login": "bob@contoso.com",
"sid": "44444444-3333-2222-1111-000000000000",
"tenantId": "55555555-4444-3333-2222-111111111111"
}
}
{
"name": "ActiveDirectory",
"type": "Microsoft.Sql/managedInstances/administrators",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/managedInstance/administrators/ActiveDirectory",
"properties": {
"administratorType": "ActiveDirectory",
"login": "bob@contoso.com",
"sid": "44444444-3333-2222-1111-000000000000",
"tenantId": "55555555-4444-3333-2222-111111111111"
}
}
Definities
AdministratorName
Opsomming
| Waarde |
Description |
|
ActiveDirectory
|
Active Directory
|
createdByType
Opsomming
Het type identiteit waarmee de resource is gemaakt.
| Waarde |
Description |
|
User
|
|
|
Application
|
|
|
ManagedIdentity
|
|
|
Key
|
|
ErrorAdditionalInfo
Object
Aanvullende informatie over de resourcebeheerfout.
| Name |
Type |
Description |
|
info
|
object
|
De aanvullende informatie.
|
|
type
|
string
|
Het extra informatietype.
|
ErrorDetail
Object
De foutdetails.
| Name |
Type |
Description |
|
additionalInfo
|
ErrorAdditionalInfo[]
|
De fout bevat aanvullende informatie.
|
|
code
|
string
|
De foutcode.
|
|
details
|
ErrorDetail[]
|
De foutdetails.
|
|
message
|
string
|
Het foutbericht.
|
|
target
|
string
|
Het foutdoelwit.
|
ErrorResponse
Object
Foutreactie
| Name |
Type |
Description |
|
error
|
ErrorDetail
|
Het foutobject.
|
ManagedInstanceAdministrator
Object
Een Azure SQL managed instance administrator.
| Name |
Type |
Description |
|
id
|
string
(arm-id)
|
Volledig gekwalificeerde resource-id voor de resource. Bijvoorbeeld /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceType}/{resourceName}"
|
|
name
|
string
|
De naam van de resource
|
|
properties.administratorType
|
ManagedInstanceAdministratorType
|
Type van de beheerder van het beheerde exemplaar.
|
|
properties.login
|
string
|
Aanmeldingsnaam van de beheerder van het beheerde exemplaar.
|
|
properties.sid
|
string
(uuid)
|
SID (object-id) van de beheerder van het beheerde exemplaar.
|
|
properties.tenantId
|
string
(uuid)
|
Tenant-id van de beheerder van het beheerde exemplaar.
|
|
systemData
|
systemData
|
Azure Resource Manager metadata met creationBy en modifiedBy informatie.
|
|
type
|
string
|
Het type bron. Bijvoorbeeld: "Microsoft. Compute/virtualMachines" of "Microsoft. Opslag/opslagAccounts"
|
ManagedInstanceAdministratorType
Opsomming
Type van de beheerder van het beheerde exemplaar.
| Waarde |
Description |
|
ActiveDirectory
|
Active Directory
|
systemData
Object
Metagegevens met betrekking tot het maken en de laatste wijziging van de resource.
| Name |
Type |
Description |
|
createdAt
|
string
(date-time)
|
De tijdstempel van het maken van resources (UTC).
|
|
createdBy
|
string
|
De identiteit waarmee de resource is gemaakt.
|
|
createdByType
|
createdByType
|
Het type identiteit waarmee de resource is gemaakt.
|
|
lastModifiedAt
|
string
(date-time)
|
Het tijdstempel van de laatste wijziging van de resource (UTC)
|
|
lastModifiedBy
|
string
|
De identiteit die de resource voor het laatst heeft gewijzigd.
|
|
lastModifiedByType
|
createdByType
|
Het type identiteit dat de resource voor het laatst heeft gewijzigd.
|