Namespace: microsoft.graph.managedTenants
Important
APIs under the /beta
version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Update the properties of a tenantTag object.
This API is available in the following national cloud deployments.
Global service |
US Government L4 |
US Government L5 (DOD) |
China operated by 21Vianet |
✅ |
❌ |
❌ |
❌ |
Permissions
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
Permission type |
Least privileged permissions |
Higher privileged permissions |
Delegated (work or school account) |
ManagedTenants.ReadWrite.All |
Not available. |
Delegated (personal Microsoft account) |
Not supported. |
Not supported. |
Application |
Not supported. |
Not supported. |
HTTP request
PATCH /tenantRelationships/managedTenants/tenantTags/{tenantTagId}
Request body
In the request body, supply the values for relevant tenantTag fields that should be updated. Existing properties that are not included in the request body will maintain their previous values or be recalculated based on changes to other property values. For best performance, don't include existing values that haven't changed.
Following properties can be updated:
Property |
Type |
Description |
displayName |
String |
The display name for the tenant tag. |
description |
String |
The description for the tenant tag. |
tenants |
microsoft.graph.managedTenants.tenantInfo collection |
The collection of managed tenants associated with the tenant tag. |
Response
If successful, this method returns a 200 OK
response code and an updated tenantTag object in the response body.
Examples
Request
PATCH https://graph.microsoft.com/beta/tenantRelationships/managedTenants/tenantTags/{tenantTagId}
Content-Type: application/json
{
"displayName": "Onboarding",
"description": "Tenants that we are currently onboarding"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models.ManagedTenants;
var requestBody = new TenantTag
{
DisplayName = "Onboarding",
Description = "Tenants that we are currently onboarding",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.TenantRelationships.ManagedTenants.TenantTags["{tenantTag-id}"].PatchAsync(requestBody);
mgc-beta tenant-relationships managed-tenants tenant-tags patch --tenant-tag-id {tenantTag-id} --body '{\
"displayName": "Onboarding",\
"description": "Tenants that we are currently onboarding"\
}\
'
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodelsmanagedtenants "github.com/microsoftgraph/msgraph-beta-sdk-go/models/managedtenants"
//other-imports
)
requestBody := graphmodelsmanagedtenants.NewTenantTag()
displayName := "Onboarding"
requestBody.SetDisplayName(&displayName)
description := "Tenants that we are currently onboarding"
requestBody.SetDescription(&description)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
tenantTags, err := graphClient.TenantRelationships().ManagedTenants().TenantTags().ByTenantTagId("tenantTag-id").Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.models.managedtenants.TenantTag tenantTag = new com.microsoft.graph.beta.models.managedtenants.TenantTag();
tenantTag.setDisplayName("Onboarding");
tenantTag.setDescription("Tenants that we are currently onboarding");
com.microsoft.graph.models.managedtenants.TenantTag result = graphClient.tenantRelationships().managedTenants().tenantTags().byTenantTagId("{tenantTag-id}").patch(tenantTag);
const options = {
authProvider,
};
const client = Client.init(options);
const tenantTag = {
displayName: 'Onboarding',
description: 'Tenants that we are currently onboarding'
};
await client.api('/tenantRelationships/managedTenants/tenantTags/{tenantTagId}')
.version('beta')
.update(tenantTag);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\ManagedTenants\TenantTag;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new TenantTag();
$requestBody->setDisplayName('Onboarding');
$requestBody->setDescription('Tenants that we are currently onboarding');
$result = $graphServiceClient->tenantRelationships()->managedTenants()->tenantTags()->byTenantTagId('tenantTag-id')->patch($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.ManagedTenants
$params = @{
displayName = "Onboarding"
description = "Tenants that we are currently onboarding"
}
Update-MgBetaTenantRelationshipManagedTenantTag -TenantTagId $tenantTagId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.managed_tenants.tenant_tag import TenantTag
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = TenantTag(
display_name = "Onboarding",
description = "Tenants that we are currently onboarding",
)
result = await graph_client.tenant_relationships.managed_tenants.tenant_tags.by_tenant_tag_id('tenantTag-id').patch(request_body)
Response
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#tenantTags/$entity",
"id": "913391c0-5466-42b4-900d-0a7501399cb0",
"displayName": "Onboarding",
"description": "Tenants that we are currently onboarding",
"tenantIds": [
{
"tenantId": "38227791-a88b-4fcc-81c5-58cf77668320"
}
],
"isDeleted": null,
"createdDateTime": "2021-06-16T20:36:31.086644Z",
"createdByUserId": "9bf6a5ad-aecb-4194-a16b-38e02702a602",
"lastActionDateTime": "2021-07-11T18:54:44.5262828Z",
"lastActionByUserId": "cad28f13-0158-43c5-9c59-952f2caa62c0"
}