Table of Contents

Class ArmClient

Namespace
Azure.ResourceManager
Assembly
Azure.ResourceManager.dll

The entry point for all ARM clients.

public class ArmClient
Inheritance
ArmClient
Inherited Members

Constructors

ArmClient()

Initializes a new instance of the ArmClient class for mocking.

protected ArmClient()

ArmClient(TokenCredential)

Initializes a new instance of the ArmClient class.

public ArmClient(TokenCredential credential)

Parameters

credential TokenCredential

A credential used to authenticate to an Azure Service.

Exceptions

ArgumentNullException

If Azure.Core.TokenCredential is null.

ArmClient(TokenCredential, string)

Initializes a new instance of the ArmClient class.

public ArmClient(TokenCredential credential, string defaultSubscriptionId)

Parameters

credential TokenCredential

A credential used to authenticate to an Azure Service.

defaultSubscriptionId string

The id of the default Azure subscription.

Exceptions

ArgumentNullException

If Azure.Core.TokenCredential is null.

ArmClient(TokenCredential, string, ArmClientOptions)

Initializes a new instance of the ArmClient class.

public ArmClient(TokenCredential credential, string defaultSubscriptionId, ArmClientOptions options)

Parameters

credential TokenCredential

A credential used to authenticate to an Azure Service.

defaultSubscriptionId string

The id of the default Azure subscription.

options ArmClientOptions

The client parameters to use in these operations.

Exceptions

ArgumentNullException

If Azure.Core.TokenCredential is null.

Methods

GetDataPolicyManifestResource(ResourceIdentifier)

Gets an object representing a DataPolicyManifestResource along with the instance operations that can be performed on it but with no data. You can use CreateResourceIdentifier(string) to create a DataPolicyManifestResource Azure.Core.ResourceIdentifier from its components.

public virtual DataPolicyManifestResource GetDataPolicyManifestResource(ResourceIdentifier id)

Parameters

id ResourceIdentifier

The resource ID of the resource to get.

Returns

DataPolicyManifestResource

Returns a DataPolicyManifestResource object.

GetDefaultSubscription(CancellationToken)

Gets the default subscription.

public virtual SubscriptionResource GetDefaultSubscription(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

SubscriptionResource

Resource operations of the Subscription.

GetDefaultSubscriptionAsync(CancellationToken)

Gets the default subscription.

public virtual Task<SubscriptionResource> GetDefaultSubscriptionAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task<SubscriptionResource>

Resource operations of the Subscription.

GetFeatureResource(ResourceIdentifier)

Gets an object representing a FeatureResource along with the instance operations that can be performed on it but with no data. You can use CreateResourceIdentifier(string, string, string) to create a FeatureResource Azure.Core.ResourceIdentifier from its components.

public virtual FeatureResource GetFeatureResource(ResourceIdentifier id)

Parameters

id ResourceIdentifier

The resource ID of the resource to get.

Returns

FeatureResource

Returns a FeatureResource object.

GetGenericResource(ResourceIdentifier)

Gets an object representing a GenericResource along with the instance operations that can be performed on it but with no data.

public virtual GenericResource GetGenericResource(ResourceIdentifier id)

Parameters

id ResourceIdentifier

The resource ID of the resource to get.

Returns

GenericResource

Returns a GenericResource object.

GetGenericResources()

Gets a collection of GenericResources.

public virtual GenericResourceCollection GetGenericResources()

Returns

GenericResourceCollection

An object representing collection of GenericResources and their operations.

GetManagementGroupPolicyDefinitionResource(ResourceIdentifier)

Gets an object representing a ManagementGroupPolicyDefinitionResource along with the instance operations that can be performed on it but with no data. You can use CreateResourceIdentifier(string, string) to create a ManagementGroupPolicyDefinitionResource Azure.Core.ResourceIdentifier from its components.

public virtual ManagementGroupPolicyDefinitionResource GetManagementGroupPolicyDefinitionResource(ResourceIdentifier id)

Parameters

id ResourceIdentifier

The resource ID of the resource to get.

Returns

ManagementGroupPolicyDefinitionResource

Returns a ManagementGroupPolicyDefinitionResource object.

GetManagementGroupPolicySetDefinitionResource(ResourceIdentifier)

Gets an object representing a ManagementGroupPolicySetDefinitionResource along with the instance operations that can be performed on it but with no data. You can use CreateResourceIdentifier(string, string) to create a ManagementGroupPolicySetDefinitionResource Azure.Core.ResourceIdentifier from its components.

public virtual ManagementGroupPolicySetDefinitionResource GetManagementGroupPolicySetDefinitionResource(ResourceIdentifier id)

Parameters

id ResourceIdentifier

The resource ID of the resource to get.

Returns

ManagementGroupPolicySetDefinitionResource

Returns a ManagementGroupPolicySetDefinitionResource object.

GetManagementGroupResource(ResourceIdentifier)

Gets an object representing a ManagementGroupResource along with the instance operations that can be performed on it but with no data. You can use CreateResourceIdentifier(string) to create a ManagementGroupResource Azure.Core.ResourceIdentifier from its components.

public virtual ManagementGroupResource GetManagementGroupResource(ResourceIdentifier id)

Parameters

id ResourceIdentifier

The resource ID of the resource to get.

Returns

ManagementGroupResource

Returns a ManagementGroupResource object.

GetManagementGroupSubscriptionResource(ResourceIdentifier)

Gets an object representing a ManagementGroupSubscriptionResource along with the instance operations that can be performed on it but with no data. You can use CreateResourceIdentifier(string, string) to create a ManagementGroupSubscriptionResource Azure.Core.ResourceIdentifier from its components.

public virtual ManagementGroupSubscriptionResource GetManagementGroupSubscriptionResource(ResourceIdentifier id)

Parameters

id ResourceIdentifier

The resource ID of the resource to get.

Returns

ManagementGroupSubscriptionResource

Returns a ManagementGroupSubscriptionResource object.

GetManagementGroups()

Gets the management group collection for this tenant.

public virtual ManagementGroupCollection GetManagementGroups()

Returns

ManagementGroupCollection

A collection of the management groups.

GetManagementLockResource(ResourceIdentifier)

Gets an object representing a ManagementLockResource along with the instance operations that can be performed on it but with no data. You can use CreateResourceIdentifier(string, string) to create a ManagementLockResource Azure.Core.ResourceIdentifier from its components.

public virtual ManagementLockResource GetManagementLockResource(ResourceIdentifier id)

Parameters

id ResourceIdentifier

The resource ID of the resource to get.

Returns

ManagementLockResource

Returns a ManagementLockResource object.

GetPolicyAssignmentResource(ResourceIdentifier)

Gets an object representing a PolicyAssignmentResource along with the instance operations that can be performed on it but with no data. You can use CreateResourceIdentifier(string, string) to create a PolicyAssignmentResource Azure.Core.ResourceIdentifier from its components.

public virtual PolicyAssignmentResource GetPolicyAssignmentResource(ResourceIdentifier id)

Parameters

id ResourceIdentifier

The resource ID of the resource to get.

Returns

PolicyAssignmentResource

Returns a PolicyAssignmentResource object.

GetResourceGroupResource(ResourceIdentifier)

Gets an object representing a ResourceGroupResource along with the instance operations that can be performed on it but with no data. You can use CreateResourceIdentifier(string, string) to create a ResourceGroupResource Azure.Core.ResourceIdentifier from its components.

public virtual ResourceGroupResource GetResourceGroupResource(ResourceIdentifier id)

Parameters

id ResourceIdentifier

The resource ID of the resource to get.

Returns

ResourceGroupResource

Returns a ResourceGroupResource object.

GetResourceProviderResource(ResourceIdentifier)

Gets an object representing a ResourceProviderResource along with the instance operations that can be performed on it but with no data. You can use CreateResourceIdentifier(string, string) to create a ResourceProviderResource Azure.Core.ResourceIdentifier from its components.

public virtual ResourceProviderResource GetResourceProviderResource(ResourceIdentifier id)

Parameters

id ResourceIdentifier

The resource ID of the resource to get.

Returns

ResourceProviderResource

Returns a ResourceProviderResource object.

GetSubscriptionPolicyDefinitionResource(ResourceIdentifier)

Gets an object representing a SubscriptionPolicyDefinitionResource along with the instance operations that can be performed on it but with no data. You can use CreateResourceIdentifier(string, string) to create a SubscriptionPolicyDefinitionResource Azure.Core.ResourceIdentifier from its components.

public virtual SubscriptionPolicyDefinitionResource GetSubscriptionPolicyDefinitionResource(ResourceIdentifier id)

Parameters

id ResourceIdentifier

The resource ID of the resource to get.

Returns

SubscriptionPolicyDefinitionResource

Returns a SubscriptionPolicyDefinitionResource object.

GetSubscriptionPolicySetDefinitionResource(ResourceIdentifier)

Gets an object representing a SubscriptionPolicySetDefinitionResource along with the instance operations that can be performed on it but with no data. You can use CreateResourceIdentifier(string, string) to create a SubscriptionPolicySetDefinitionResource Azure.Core.ResourceIdentifier from its components.

public virtual SubscriptionPolicySetDefinitionResource GetSubscriptionPolicySetDefinitionResource(ResourceIdentifier id)

Parameters

id ResourceIdentifier

The resource ID of the resource to get.

Returns

SubscriptionPolicySetDefinitionResource

Returns a SubscriptionPolicySetDefinitionResource object.

GetSubscriptionResource(ResourceIdentifier)

Gets an object representing a SubscriptionResource along with the instance operations that can be performed on it but with no data. You can use CreateResourceIdentifier(string) to create a SubscriptionResource Azure.Core.ResourceIdentifier from its components.

public virtual SubscriptionResource GetSubscriptionResource(ResourceIdentifier id)

Parameters

id ResourceIdentifier

The resource ID of the resource to get.

Returns

SubscriptionResource

Returns a SubscriptionResource object.

GetSubscriptions()

Gets the Azure subscriptions.

public virtual SubscriptionCollection GetSubscriptions()

Returns

SubscriptionCollection

Subscription collection.

GetTagResource(ResourceIdentifier)

Gets an object representing a TagResource along with the instance operations that can be performed on it but with no data. You can use CreateResourceIdentifier(string) to create a TagResource Azure.Core.ResourceIdentifier from its components.

public virtual TagResource GetTagResource(ResourceIdentifier id)

Parameters

id ResourceIdentifier

The resource ID of the resource to get.

Returns

TagResource

Returns a TagResource object.

GetTenantPolicyDefinitionResource(ResourceIdentifier)

Gets an object representing a TenantPolicyDefinitionResource along with the instance operations that can be performed on it but with no data. You can use CreateResourceIdentifier(string) to create a TenantPolicyDefinitionResource Azure.Core.ResourceIdentifier from its components.

public virtual TenantPolicyDefinitionResource GetTenantPolicyDefinitionResource(ResourceIdentifier id)

Parameters

id ResourceIdentifier

The resource ID of the resource to get.

Returns

TenantPolicyDefinitionResource

Returns a TenantPolicyDefinitionResource object.

GetTenantPolicySetDefinitionResource(ResourceIdentifier)

Gets an object representing a TenantPolicySetDefinitionResource along with the instance operations that can be performed on it but with no data. You can use CreateResourceIdentifier(string) to create a TenantPolicySetDefinitionResource Azure.Core.ResourceIdentifier from its components.

public virtual TenantPolicySetDefinitionResource GetTenantPolicySetDefinitionResource(ResourceIdentifier id)

Parameters

id ResourceIdentifier

The resource ID of the resource to get.

Returns

TenantPolicySetDefinitionResource

Returns a TenantPolicySetDefinitionResource object.

GetTenantResourceProvider(string, string, CancellationToken)

Gets the specified resource provider at the tenant level.

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

ArgumentNullException

resourceProviderNamespace is null.

GetTenantResourceProviderAsync(string, string, CancellationToken)

Gets the specified resource provider at the tenant level.

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

ArgumentNullException

resourceProviderNamespace is null.

GetTenantResourceProviders(string, CancellationToken)

Gets all resource providers for a subscription.

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>

GetTenantResourceProvidersAsync(string, CancellationToken)

Gets all resource providers for a subscription.

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>

GetTenants()

Gets the tenants.

public virtual TenantCollection GetTenants()

Returns

TenantCollection

Tenant collection.