I
InsightNexus

Class TagResource | Azure SDK for .NET

Author

James Stevens

Published Feb 17, 2026

A Class representing a TagResource along with the instance operations that can be performed on it. If you have a Azure.Core.ResourceIdentifier you can construct a TagResourcefrom an instance of ArmClient using the GetTagResource method. Otherwise you can get one from its parent resource ArmResource using the GetTagResource method.

Inheritance

System.Object

TagResource

Inherited Members
Namespace: System.Dynamic.ExpandoObject
Assembly: Azure.ResourceManager.dll
Syntax
public class TagResource : Azure.ResourceManager.ArmResource

Constructors

TagResource()

Initializes a new instance of the TagResource class for mocking.

Declaration
protected TagResource ();

Fields

ResourceType

Gets the resource type for the operations.

Declaration
public static readonly Azure.Core.ResourceType ResourceType;
Field Value
Azure.Core.ResourceType

Properties

Data

Gets the data representing this Feature.

Declaration
public virtual Azure.ResourceManager.Resources.TagResourceData Data { get; }
Property Value
Exceptions
System.InvalidOperationException

Throws if there is no data loaded in the current instance.

HasData

Gets whether or not the current instance has data.

Declaration
public virtual bool HasData { get; }
Property Value
System.Boolean

Methods

CreateOrUpdate(WaitUntil, TagResourceData, CancellationToken)

This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. Request Path: /{scope}/providers/ Operation Id: Tags_CreateOrUpdateAtScope

Declaration
public virtual Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Resources.TagResource> CreateOrUpdate (Azure.WaitUntil waitUntil, Azure.ResourceManager.Resources.TagResourceData data, System.Threading.CancellationToken cancellationToken = null);
Parameters
Azure.WaitUntil waitUntil

"F:Azure.WaitUntil.Completed" if the method should wait to return until the long-running operation has completed on the service; "F:Azure.WaitUntil.Started" if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.

TagResourceData data

The TagResource to use.

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
Exceptions
System.ArgumentNullException

data is null.

CreateOrUpdateAsync(WaitUntil, TagResourceData, CancellationToken)

This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. Request Path: /{scope}/providers/ Operation Id: Tags_CreateOrUpdateAtScope

Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Resources.TagResource>> CreateOrUpdateAsync (Azure.WaitUntil waitUntil, Azure.ResourceManager.Resources.TagResourceData data, System.Threading.CancellationToken cancellationToken = null);
Parameters
Azure.WaitUntil waitUntil

"F:Azure.WaitUntil.Completed" if the method should wait to return until the long-running operation has completed on the service; "F:Azure.WaitUntil.Started" if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.

TagResourceData data

The TagResource to use.

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
Exceptions
System.ArgumentNullException

data is null.

CreateResourceIdentifier(String)

Generate the resource identifier of a TagResource instance.

Declaration
public static Azure.Core.ResourceIdentifier CreateResourceIdentifier (string scope);
Parameters
System.String scope
Returns
Azure.Core.ResourceIdentifier

Delete(WaitUntil, CancellationToken)

Deletes the entire set of tags on a resource or subscription. Request Path: /{scope}/providers/ Operation Id: Tags_DeleteAtScope

Declaration
public virtual Azure.ResourceManager.ArmOperation Delete (Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = null);
Parameters
Azure.WaitUntil waitUntil

"F:Azure.WaitUntil.Completed" if the method should wait to return until the long-running operation has completed on the service; "F:Azure.WaitUntil.Started" if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns

DeleteAsync(WaitUntil, CancellationToken)

Deletes the entire set of tags on a resource or subscription. Request Path: /{scope}/providers/ Operation Id: Tags_DeleteAtScope

Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation> DeleteAsync (Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = null);
Parameters
Azure.WaitUntil waitUntil

"F:Azure.WaitUntil.Completed" if the method should wait to return until the long-running operation has completed on the service; "F:Azure.WaitUntil.Started" if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns

Get(CancellationToken)

Gets the entire set of tags on a resource or subscription. Request Path: /{scope}/providers/ Operation Id: Tags_GetAtScope

Declaration
public virtual Azure.Response<Azure.ResourceManager.Resources.TagResource> Get (System.Threading.CancellationToken cancellationToken = null);
Parameters
System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns

GetAsync(CancellationToken)

Gets the entire set of tags on a resource or subscription. Request Path: /{scope}/providers/ Operation Id: Tags_GetAtScope

Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.ResourceManager.Resources.TagResource>> GetAsync (System.Threading.CancellationToken cancellationToken = null);
Parameters
System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
System.Threading.Tasks.Task<Azure.Response<TagResource>>

Update(PatchableTagResourceData, CancellationToken)

This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or name/value pairs. Request Path: /{scope}/providers/ Operation Id: Tags_UpdateAtScope

Declaration
public virtual Azure.Response<Azure.ResourceManager.Resources.TagResource> Update (Azure.ResourceManager.Resources.Models.PatchableTagResourceData data, System.Threading.CancellationToken cancellationToken = null);
Parameters
PatchableTagResourceData data

The PatchableTagResourceData to use.

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
Exceptions
System.ArgumentNullException

data is null.

UpdateAsync(PatchableTagResourceData, CancellationToken)

This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or name/value pairs. Request Path: /{scope}/providers/ Operation Id: Tags_UpdateAtScope

Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.ResourceManager.Resources.TagResource>> UpdateAsync (Azure.ResourceManager.Resources.Models.PatchableTagResourceData data, System.Threading.CancellationToken cancellationToken = null);
Parameters
PatchableTagResourceData data

The PatchableTagResourceData to use.

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
System.Threading.Tasks.Task<Azure.Response<TagResource>>
Exceptions
System.ArgumentNullException

data is null.