Table of Contents

Class TenantResource

Namespace
Azure.ResourceManager.Resources
Assembly
Azure.ResourceManager.dll

A class representing the operations that can be performed over a specific subscription.

public class TenantResource : ArmResource, IJsonModel<TenantData>, IPersistableModel<TenantData>
Inheritance
TenantResource
Implements
IJsonModel<TenantData>
IPersistableModel<TenantData>
Inherited Members

Constructors

TenantResource()

Initializes a new instance of the TenantResource class for mocking.

protected TenantResource()

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 TenantData Data { get; }

Property Value

TenantData

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

GetDataPolicyManifest(string, CancellationToken)

This operation retrieves the data policy manifest with the given policy mode.

  • Request Path/providers/Microsoft.Authorization/dataPolicyManifests/{policyMode}
  • Operation IdDataPolicyManifests_GetByPolicyMode
  • Default Api Version2020-09-01
  • ResourceDataPolicyManifestResource
public virtual Response<DataPolicyManifestResource> GetDataPolicyManifest(string policyMode, CancellationToken cancellationToken = default)

Parameters

policyMode string

The policy mode of the data policy manifest to get.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Response<DataPolicyManifestResource>

Exceptions

ArgumentNullException

policyMode is null.

ArgumentException

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

GetDataPolicyManifestAsync(string, CancellationToken)

This operation retrieves the data policy manifest with the given policy mode.

  • Request Path/providers/Microsoft.Authorization/dataPolicyManifests/{policyMode}
  • Operation IdDataPolicyManifests_GetByPolicyMode
  • Default Api Version2020-09-01
  • ResourceDataPolicyManifestResource
public virtual Task<Response<DataPolicyManifestResource>> GetDataPolicyManifestAsync(string policyMode, CancellationToken cancellationToken = default)

Parameters

policyMode string

The policy mode of the data policy manifest to get.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Task<Response<DataPolicyManifestResource>>

Exceptions

ArgumentNullException

policyMode is null.

ArgumentException

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

GetDataPolicyManifests()

Gets a collection of DataPolicyManifestResources in the Tenant.

public virtual DataPolicyManifestCollection GetDataPolicyManifests()

Returns

DataPolicyManifestCollection

An object representing collection of DataPolicyManifestResources and their operations over a DataPolicyManifestResource.

GetGenericResource(ResourceIdentifier, CancellationToken)

Gets a resource by ID.

  • Request Path/{resourceId}
  • Operation IdResources_GetById
public virtual Response<GenericResource> GetGenericResource(ResourceIdentifier resourceId, CancellationToken cancellationToken = default)

Parameters

resourceId ResourceIdentifier

The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Response<GenericResource>

Exceptions

ArgumentNullException

resourceId is null.

GetGenericResourceAsync(ResourceIdentifier, CancellationToken)

Gets a resource by ID.

  • Request Path/{resourceId}
  • Operation IdResources_GetById
public virtual Task<Response<GenericResource>> GetGenericResourceAsync(ResourceIdentifier resourceId, CancellationToken cancellationToken = default)

Parameters

resourceId ResourceIdentifier

The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Task<Response<GenericResource>>

Exceptions

ArgumentNullException

resourceId is null.

GetGenericResources()

Gets a collection of GenericResources in the Tenant.

public virtual GenericResourceCollection GetGenericResources()

Returns

GenericResourceCollection

An object representing collection of GenericResources and their operations over a GenericResource.

GetManagementGroup(string, 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> GetManagementGroup(string groupId, ManagementGroupExpandType? expand = null, bool? recurse = null, string filter = null, string cacheControl = null, CancellationToken cancellationToken = default)

Parameters

groupId string

Management Group ID.

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>

Exceptions

ArgumentNullException

groupId is null.

ArgumentException

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

GetManagementGroupAsync(string, 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>> GetManagementGroupAsync(string groupId, ManagementGroupExpandType? expand = null, bool? recurse = null, string filter = null, string cacheControl = null, CancellationToken cancellationToken = default)

Parameters

groupId string

Management Group ID.

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>>

Exceptions

ArgumentNullException

groupId is null.

ArgumentException

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

GetManagementGroups()

Gets a collection of ManagementGroupResources in the TenantResource.

public virtual ManagementGroupCollection GetManagementGroups()

Returns

ManagementGroupCollection

An object representing collection of ManagementGroupResources and their operations over a ManagementGroupResource.

GetSubscription(string, CancellationToken)

Gets details about a specified subscription.

  • Request Path/subscriptions/{subscriptionId}
  • Operation IdSubscriptions_Get
  • Default Api Version2022-12-01
  • ResourceSubscriptionResource
public virtual Response<SubscriptionResource> GetSubscription(string subscriptionId, CancellationToken cancellationToken = default)

Parameters

subscriptionId string

The ID of the target subscription.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Response<SubscriptionResource>

Exceptions

ArgumentNullException

subscriptionId is null.

ArgumentException

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

GetSubscriptionAsync(string, CancellationToken)

Gets details about a specified subscription.

  • Request Path/subscriptions/{subscriptionId}
  • Operation IdSubscriptions_Get
  • Default Api Version2022-12-01
  • ResourceSubscriptionResource
public virtual Task<Response<SubscriptionResource>> GetSubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default)

Parameters

subscriptionId string

The ID of the target subscription.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Task<Response<SubscriptionResource>>

Exceptions

ArgumentNullException

subscriptionId is null.

ArgumentException

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

GetSubscriptions()

Gets a collection of SubscriptionResources in the Tenant.

public virtual SubscriptionCollection GetSubscriptions()

Returns

SubscriptionCollection

An object representing collection of SubscriptionResources and their operations over a SubscriptionResource.

GetTenantPolicyDefinition(string, CancellationToken)

This operation retrieves the built-in policy definition with the given name.

  • Request Path/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}
  • Operation IdPolicyDefinitions_GetBuiltIn
  • Default Api Version2021-06-01
  • ResourceTenantPolicyDefinitionResource
public virtual Response<TenantPolicyDefinitionResource> GetTenantPolicyDefinition(string policyDefinitionName, CancellationToken cancellationToken = default)

Parameters

policyDefinitionName string

The name of the built-in policy definition to get.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Response<TenantPolicyDefinitionResource>

Exceptions

ArgumentNullException

policyDefinitionName is null.

ArgumentException

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

GetTenantPolicyDefinitionAsync(string, CancellationToken)

This operation retrieves the built-in policy definition with the given name.

  • Request Path/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}
  • Operation IdPolicyDefinitions_GetBuiltIn
  • Default Api Version2021-06-01
  • ResourceTenantPolicyDefinitionResource
public virtual Task<Response<TenantPolicyDefinitionResource>> GetTenantPolicyDefinitionAsync(string policyDefinitionName, CancellationToken cancellationToken = default)

Parameters

policyDefinitionName string

The name of the built-in policy definition to get.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Task<Response<TenantPolicyDefinitionResource>>

Exceptions

ArgumentNullException

policyDefinitionName is null.

ArgumentException

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

GetTenantPolicyDefinitions()

Gets a collection of TenantPolicyDefinitionResources in the Tenant.

public virtual TenantPolicyDefinitionCollection GetTenantPolicyDefinitions()

Returns

TenantPolicyDefinitionCollection

An object representing collection of TenantPolicyDefinitionResources and their operations over a TenantPolicyDefinitionResource.

GetTenantPolicySetDefinition(string, CancellationToken)

This operation retrieves the built-in policy set definition with the given name.

  • Request Path/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}
  • Operation IdPolicySetDefinitions_GetBuiltIn
  • Default Api Version2021-06-01
  • ResourceTenantPolicySetDefinitionResource
public virtual Response<TenantPolicySetDefinitionResource> GetTenantPolicySetDefinition(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<TenantPolicySetDefinitionResource>

Exceptions

ArgumentNullException

policySetDefinitionName is null.

ArgumentException

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

GetTenantPolicySetDefinitionAsync(string, CancellationToken)

This operation retrieves the built-in policy set definition with the given name.

  • Request Path/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}
  • Operation IdPolicySetDefinitions_GetBuiltIn
  • Default Api Version2021-06-01
  • ResourceTenantPolicySetDefinitionResource
public virtual Task<Response<TenantPolicySetDefinitionResource>> GetTenantPolicySetDefinitionAsync(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<TenantPolicySetDefinitionResource>>

Exceptions

ArgumentNullException

policySetDefinitionName is null.

ArgumentException

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

GetTenantPolicySetDefinitions()

Gets a collection of TenantPolicySetDefinitionResources in the Tenant.

public virtual TenantPolicySetDefinitionCollection GetTenantPolicySetDefinitions()

Returns

TenantPolicySetDefinitionCollection

An object representing collection of TenantPolicySetDefinitionResources and their operations over a TenantPolicySetDefinitionResource.

GetTenantResourceProvider(string, string, CancellationToken)

Gets the specified resource provider at the tenant level.

  • Request Path/providers/{resourceProviderNamespace}
  • Operation IdProviders_GetAtTenantScope
  • Default Api Version2022-09-01
public virtual Response<TenantResourceProvider> GetTenantResourceProvider(string resourceProviderNamespace, string expand = null, CancellationToken cancellationToken = default)

Parameters

resourceProviderNamespace string

The namespace of the resource provider.

expand string

The $expand query parameter. For example, to include property aliases in response, use $expand=resourceTypes/aliases.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Response<TenantResourceProvider>

Exceptions

ArgumentException

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

ArgumentNullException

resourceProviderNamespace is null.

GetTenantResourceProviderAsync(string, string, CancellationToken)

Gets the specified resource provider at the tenant level.

  • Request Path/providers/{resourceProviderNamespace}
  • Operation IdProviders_GetAtTenantScope
  • Default Api Version2022-09-01
public virtual Task<Response<TenantResourceProvider>> GetTenantResourceProviderAsync(string resourceProviderNamespace, string expand = null, CancellationToken cancellationToken = default)

Parameters

resourceProviderNamespace string

The namespace of the resource provider.

expand string

The $expand query parameter. For example, to include property aliases in response, use $expand=resourceTypes/aliases.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Task<Response<TenantResourceProvider>>

Exceptions

ArgumentException

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

ArgumentNullException

resourceProviderNamespace is null.

GetTenantResourceProviders(string, CancellationToken)

Gets all resource providers for the tenant.

  • Request Path/providers
  • Operation IdProviders_ListAtTenantScope
  • Default Api Version2022-09-01
  • ResourceResourceProviderResource
public virtual Pageable<TenantResourceProvider> GetTenantResourceProviders(string expand = null, CancellationToken cancellationToken = default)

Parameters

expand string

The properties to include in the results. For example, use &$expand=metadata in the query string to retrieve resource provider metadata. To include property aliases in response, use $expand=resourceTypes/aliases.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Pageable<TenantResourceProvider>

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

GetTenantResourceProvidersAsync(string, CancellationToken)

Gets all resource providers for the tenant.

  • Request Path/providers
  • Operation IdProviders_ListAtTenantScope
  • Default Api Version2022-09-01
  • ResourceResourceProviderResource
public virtual AsyncPageable<TenantResourceProvider> GetTenantResourceProvidersAsync(string expand = null, CancellationToken cancellationToken = default)

Parameters

expand string

The properties to include in the results. For example, use &$expand=metadata in the query string to retrieve resource provider metadata. To include property aliases in response, use $expand=resourceTypes/aliases.

cancellationToken CancellationToken

The cancellation token to use.

Returns

AsyncPageable<TenantResourceProvider>

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