Table of Contents

Class ManagementGroupResource

Namespace
Azure.ResourceManager.ManagementGroups
Assembly
Azure.ResourceManager.dll

A Class representing a ManagementGroup along with the instance operations that can be performed on it.

public class ManagementGroupResource : ArmResource, IJsonModel<ManagementGroupData>, IPersistableModel<ManagementGroupData>
Inheritance
ManagementGroupResource
Implements
IPersistableModel<ManagementGroupData>
Inherited Members

Constructors

ManagementGroupResource()

Initializes a new instance of the ManagementGroupResource class for mocking.

protected ManagementGroupResource()

Fields

ResourceType

Gets the resource type for the operations.

public static readonly ResourceType ResourceType

Field Value

ResourceType

Properties

Data

Gets the data representing this Feature.

public virtual ManagementGroupData Data { get; }

Property Value

ManagementGroupData

Exceptions

InvalidOperationException

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

HasData

Gets whether or not the current instance has data.

public virtual bool HasData { get; }

Property Value

bool

Methods

CreateResourceIdentifier(string)

Generate the resource identifier of a ManagementGroupResource instance.

public static ResourceIdentifier CreateResourceIdentifier(string groupId)

Parameters

groupId string

The groupId.

Returns

ResourceIdentifier

Delete(WaitUntil, string, CancellationToken)

Delete management group. If a management group contains child resources, the request will fail.

  • Request Path/providers/Microsoft.Management/managementGroups/{groupId}
  • Operation IdManagementGroups_Delete
  • Default Api Version2021-04-01
  • ResourceManagementGroupResource
public virtual ArmOperation Delete(WaitUntil waitUntil, string cacheControl = null, CancellationToken cancellationToken = default)

Parameters

waitUntil WaitUntil

Azure.WaitUntil.Completed if the method should wait to return until the long-running operation has completed on the service; 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.

cacheControl string

Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.

cancellationToken CancellationToken

The cancellation token to use.

Returns

ArmOperation

DeleteAsync(WaitUntil, string, CancellationToken)

Delete management group. If a management group contains child resources, the request will fail.

  • Request Path/providers/Microsoft.Management/managementGroups/{groupId}
  • Operation IdManagementGroups_Delete
  • Default Api Version2021-04-01
  • ResourceManagementGroupResource
public virtual Task<ArmOperation> DeleteAsync(WaitUntil waitUntil, string cacheControl = null, CancellationToken cancellationToken = default)

Parameters

waitUntil WaitUntil

Azure.WaitUntil.Completed if the method should wait to return until the long-running operation has completed on the service; 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.

cacheControl string

Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Task<ArmOperation>

Get(ManagementGroupExpandType?, bool?, string, string, CancellationToken)

Get the details of the management group.

  • Request Path/providers/Microsoft.Management/managementGroups/{groupId}
  • Operation IdManagementGroups_Get
  • Default Api Version2021-04-01
  • ResourceManagementGroupResource
public virtual Response<ManagementGroupResource> Get(ManagementGroupExpandType? expand = null, bool? recurse = null, string filter = null, string cacheControl = null, CancellationToken cancellationToken = default)

Parameters

expand ManagementGroupExpandType?

The $expand=children query string parameter allows clients to request inclusion of children in the response payload. $expand=path includes the path from the root group to the current group. $expand=ancestors includes the ancestor Ids of the current group.

recurse bool?

The $recurse=true query string parameter allows clients to request inclusion of entire hierarchy in the response payload. Note that $expand=children must be passed up if $recurse is set to true.

filter string

A filter which allows the exclusion of subscriptions from results (i.e. '$filter=children.childType ne Subscription').

cacheControl string

Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Response<ManagementGroupResource>

GetAsync(ManagementGroupExpandType?, bool?, string, string, CancellationToken)

Get the details of the management group.

  • Request Path/providers/Microsoft.Management/managementGroups/{groupId}
  • Operation IdManagementGroups_Get
  • Default Api Version2021-04-01
  • ResourceManagementGroupResource
public virtual Task<Response<ManagementGroupResource>> GetAsync(ManagementGroupExpandType? expand = null, bool? recurse = null, string filter = null, string cacheControl = null, CancellationToken cancellationToken = default)

Parameters

expand ManagementGroupExpandType?

The $expand=children query string parameter allows clients to request inclusion of children in the response payload. $expand=path includes the path from the root group to the current group. $expand=ancestors includes the ancestor Ids of the current group.

recurse bool?

The $recurse=true query string parameter allows clients to request inclusion of entire hierarchy in the response payload. Note that $expand=children must be passed up if $recurse is set to true.

filter string

A filter which allows the exclusion of subscriptions from results (i.e. '$filter=children.childType ne Subscription').

cacheControl string

Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Task<Response<ManagementGroupResource>>

GetDescendants(string, int?, CancellationToken)

List all entities that descend from a management group.

  • Request Path/providers/Microsoft.Management/managementGroups/{groupId}/descendants
  • Operation IdManagementGroups_GetDescendants
  • Default Api Version2021-04-01
  • ResourceManagementGroupResource
public virtual Pageable<DescendantData> GetDescendants(string skipToken = null, int? top = null, CancellationToken cancellationToken = default)

Parameters

skipToken string

Page continuation token is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a token parameter that specifies a starting point to use for subsequent calls.

top int?

Number of elements to return when retrieving results. Passing this in will override $skipToken.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Pageable<DescendantData>

A collection of DescendantData that may take multiple service requests to iterate over.

GetDescendantsAsync(string, int?, CancellationToken)

List all entities that descend from a management group.

  • Request Path/providers/Microsoft.Management/managementGroups/{groupId}/descendants
  • Operation IdManagementGroups_GetDescendants
  • Default Api Version2021-04-01
  • ResourceManagementGroupResource
public virtual AsyncPageable<DescendantData> GetDescendantsAsync(string skipToken = null, int? top = null, CancellationToken cancellationToken = default)

Parameters

skipToken string

Page continuation token is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a token parameter that specifies a starting point to use for subsequent calls.

top int?

Number of elements to return when retrieving results. Passing this in will override $skipToken.

cancellationToken CancellationToken

The cancellation token to use.

Returns

AsyncPageable<DescendantData>

An async collection of DescendantData that may take multiple service requests to iterate over.

GetManagementGroupPolicyDefinition(string, CancellationToken)

This operation retrieves the policy definition in the given management group with the given name.

  • Request Path/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}
  • Operation IdPolicyDefinitions_GetAtManagementGroup
  • Default Api Version2021-06-01
  • ResourceManagementGroupPolicyDefinitionResource
public virtual Response<ManagementGroupPolicyDefinitionResource> GetManagementGroupPolicyDefinition(string policyDefinitionName, CancellationToken cancellationToken = default)

Parameters

policyDefinitionName string

The name of the policy definition to get.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Response<ManagementGroupPolicyDefinitionResource>

Exceptions

ArgumentNullException

policyDefinitionName is null.

ArgumentException

policyDefinitionName is an empty string, and was expected to be non-empty.

GetManagementGroupPolicyDefinitionAsync(string, CancellationToken)

This operation retrieves the policy definition in the given management group with the given name.

  • Request Path/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}
  • Operation IdPolicyDefinitions_GetAtManagementGroup
  • Default Api Version2021-06-01
  • ResourceManagementGroupPolicyDefinitionResource
public virtual Task<Response<ManagementGroupPolicyDefinitionResource>> GetManagementGroupPolicyDefinitionAsync(string policyDefinitionName, CancellationToken cancellationToken = default)

Parameters

policyDefinitionName string

The name of the policy definition to get.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Task<Response<ManagementGroupPolicyDefinitionResource>>

Exceptions

ArgumentNullException

policyDefinitionName is null.

ArgumentException

policyDefinitionName is an empty string, and was expected to be non-empty.

GetManagementGroupPolicyDefinitions()

Gets a collection of ManagementGroupPolicyDefinitionResources in the ManagementGroupResource.

public virtual ManagementGroupPolicyDefinitionCollection GetManagementGroupPolicyDefinitions()

Returns

ManagementGroupPolicyDefinitionCollection

An object representing collection of ManagementGroupPolicyDefinitionResources and their operations over a ManagementGroupPolicyDefinitionResource.

GetManagementGroupPolicySetDefinition(string, CancellationToken)

This operation retrieves the policy set definition in the given management group with the given name.

  • Request Path/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}
  • Operation IdPolicySetDefinitions_GetAtManagementGroup
  • Default Api Version2021-06-01
  • ResourceManagementGroupPolicySetDefinitionResource
public virtual Response<ManagementGroupPolicySetDefinitionResource> GetManagementGroupPolicySetDefinition(string policySetDefinitionName, CancellationToken cancellationToken = default)

Parameters

policySetDefinitionName string

The name of the policy set definition to get.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Response<ManagementGroupPolicySetDefinitionResource>

Exceptions

ArgumentNullException

policySetDefinitionName is null.

ArgumentException

policySetDefinitionName is an empty string, and was expected to be non-empty.

GetManagementGroupPolicySetDefinitionAsync(string, CancellationToken)

This operation retrieves the policy set definition in the given management group with the given name.

  • Request Path/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}
  • Operation IdPolicySetDefinitions_GetAtManagementGroup
  • Default Api Version2021-06-01
  • ResourceManagementGroupPolicySetDefinitionResource
public virtual Task<Response<ManagementGroupPolicySetDefinitionResource>> GetManagementGroupPolicySetDefinitionAsync(string policySetDefinitionName, CancellationToken cancellationToken = default)

Parameters

policySetDefinitionName string

The name of the policy set definition to get.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Task<Response<ManagementGroupPolicySetDefinitionResource>>

Exceptions

ArgumentNullException

policySetDefinitionName is null.

ArgumentException

policySetDefinitionName is an empty string, and was expected to be non-empty.

GetManagementGroupPolicySetDefinitions()

Gets a collection of ManagementGroupPolicySetDefinitionResources in the ManagementGroupResource.

public virtual ManagementGroupPolicySetDefinitionCollection GetManagementGroupPolicySetDefinitions()

Returns

ManagementGroupPolicySetDefinitionCollection

An object representing collection of ManagementGroupPolicySetDefinitionResources and their operations over a ManagementGroupPolicySetDefinitionResource.

GetManagementGroupSubscription(string, string, CancellationToken)

Retrieves details about given subscription which is associated with the management group.

  • Request Path/providers/Microsoft.Management/managementGroups/{groupId}/subscriptions/{subscriptionId}
  • Operation IdManagementGroupSubscriptions_GetSubscription
  • Default Api Version2021-04-01
  • ResourceManagementGroupSubscriptionResource
public virtual Response<ManagementGroupSubscriptionResource> GetManagementGroupSubscription(string subscriptionId, string cacheControl = null, CancellationToken cancellationToken = default)

Parameters

subscriptionId string

Subscription ID.

cacheControl string

Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Response<ManagementGroupSubscriptionResource>

Exceptions

ArgumentNullException

subscriptionId is null.

ArgumentException

subscriptionId is an empty string, and was expected to be non-empty.

GetManagementGroupSubscriptionAsync(string, string, CancellationToken)

Retrieves details about given subscription which is associated with the management group.

  • Request Path/providers/Microsoft.Management/managementGroups/{groupId}/subscriptions/{subscriptionId}
  • Operation IdManagementGroupSubscriptions_GetSubscription
  • Default Api Version2021-04-01
  • ResourceManagementGroupSubscriptionResource
public virtual Task<Response<ManagementGroupSubscriptionResource>> GetManagementGroupSubscriptionAsync(string subscriptionId, string cacheControl = null, CancellationToken cancellationToken = default)

Parameters

subscriptionId string

Subscription ID.

cacheControl string

Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Task<Response<ManagementGroupSubscriptionResource>>

Exceptions

ArgumentNullException

subscriptionId is null.

ArgumentException

subscriptionId is an empty string, and was expected to be non-empty.

GetManagementGroupSubscriptions()

Gets a collection of ManagementGroupSubscriptionResources in the ManagementGroup.

public virtual ManagementGroupSubscriptionCollection GetManagementGroupSubscriptions()

Returns

ManagementGroupSubscriptionCollection

An object representing collection of ManagementGroupSubscriptionResources and their operations over a ManagementGroupSubscriptionResource.

Update(ManagementGroupPatch, string, CancellationToken)

Update a management group.

  • Request Path/providers/Microsoft.Management/managementGroups/{groupId}
  • Operation IdManagementGroups_Update
  • Default Api Version2021-04-01
  • ResourceManagementGroupResource
public virtual Response<ManagementGroupResource> Update(ManagementGroupPatch patch, string cacheControl = null, CancellationToken cancellationToken = default)

Parameters

patch ManagementGroupPatch

Management group patch parameters.

cacheControl string

Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Response<ManagementGroupResource>

Exceptions

ArgumentNullException

patch is null.

UpdateAsync(ManagementGroupPatch, string, CancellationToken)

Update a management group.

  • Request Path/providers/Microsoft.Management/managementGroups/{groupId}
  • Operation IdManagementGroups_Update
  • Default Api Version2021-04-01
  • ResourceManagementGroupResource
public virtual Task<Response<ManagementGroupResource>> UpdateAsync(ManagementGroupPatch patch, string cacheControl = null, CancellationToken cancellationToken = default)

Parameters

patch ManagementGroupPatch

Management group patch parameters.

cacheControl string

Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Task<Response<ManagementGroupResource>>

Exceptions

ArgumentNullException

patch is null.