Class ArmClient | Azure SDK for .NET

Publish date: 2024-06-23

The entry point for all ARM clients.

Inheritance

System.Object

ArmClient

Namespace: System.Dynamic.ExpandoObject
Assembly: Azure.ResourceManager.dll
Syntax
public class ArmClient

Constructors

ArmClient()

Initializes a new instance of the ArmClient class for mocking.

Declaration
protected ArmClient ();

ArmClient(TokenCredential, ArmClientOptions)

Initializes a new instance of the ArmClient class.

Declaration
public ArmClient (Azure.Core.TokenCredential credential, Azure.ResourceManager.ArmClientOptions options = null);
Parameters
Azure.Core.TokenCredential credential

A credential used to authenticate to an Azure Service.

ArmClientOptions options

The client parameters to use in these operations.

Exceptions
System.ArgumentNullException

If Azure.Core.TokenCredential is null.

ArmClient(TokenCredential, String, ArmClientOptions)

Initializes a new instance of the ArmClient class.

Declaration
public ArmClient (Azure.Core.TokenCredential credential, string defaultSubscriptionId, Azure.ResourceManager.ArmClientOptions options = null);
Parameters
Azure.Core.TokenCredential credential

A credential used to authenticate to an Azure Service.

System.String defaultSubscriptionId

The id of the default Azure subscription.

ArmClientOptions options

The client parameters to use in these operations.

Exceptions
System.ArgumentNullException

If Azure.Core.TokenCredential is null.

ArmClient(TokenCredential, String, Uri, ArmClientOptions)

Initializes a new instance of the ArmClient class.

Declaration
public ArmClient (Azure.Core.TokenCredential credential, string defaultSubscriptionId, Uri baseUri, Azure.ResourceManager.ArmClientOptions options = null);
Parameters
Azure.Core.TokenCredential credential

A credential used to authenticate to an Azure Service.

System.String defaultSubscriptionId

The id of the default Azure subscription.

System.Uri baseUri

The base URI of the service.

ArmClientOptions options

The client parameters to use in these operations.

Exceptions
System.ArgumentNullException

If Azure.Core.TokenCredential is null.

Properties

BaseUri

Gets the base URI of the service.

Declaration
protected internal Uri BaseUri { get; }
Property Value
System.Uri

DiagnosticOptions

Gets the diagnostic options used for this client.

Declaration
protected internal virtual Azure.Core.DiagnosticsOptions DiagnosticOptions { get; }
Property Value
Azure.Core.DiagnosticsOptions

Pipeline

Gets the HTTP pipeline.

Declaration
protected internal Azure.Core.Pipeline.HttpPipeline Pipeline { get; }
Property Value
Azure.Core.Pipeline.HttpPipeline

Methods

GetDataPolicyManifest(ResourceIdentifier)

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

Declaration
public virtual Azure.ResourceManager.Resources.DataPolicyManifest GetDataPolicyManifest (Azure.Core.ResourceIdentifier id);
Parameters
Azure.Core.ResourceIdentifier id

The resource ID of the resource to get.

Returns

GetDefaultSubscription(CancellationToken)

Gets the default subscription.

Declaration
public virtual Azure.ResourceManager.Resources.Subscription GetDefaultSubscription (System.Threading.CancellationToken cancellationToken = null);
Parameters
System.Threading.CancellationToken cancellationToken
Returns

GetDefaultSubscriptionAsync(CancellationToken)

Gets the default subscription.

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

Resource operations of the Subscription.

GetFeature(ResourceIdentifier)

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

Declaration
public virtual Azure.ResourceManager.Resources.Feature GetFeature (Azure.Core.ResourceIdentifier id);
Parameters
Azure.Core.ResourceIdentifier id

The resource ID of the resource to get.

Returns

GetGenericResource(ResourceIdentifier)

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

Declaration
public virtual Azure.ResourceManager.Resources.GenericResource GetGenericResource (Azure.Core.ResourceIdentifier id);
Parameters
Azure.Core.ResourceIdentifier id

The resource ID of the resource to get.

Returns

GetGenericResources()

Gets a collection of GenericResources.

Declaration
public virtual Azure.ResourceManager.Resources.GenericResourceCollection GetGenericResources ();
Returns

GetManagementGroup(ResourceIdentifier)

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

Declaration
public virtual Azure.ResourceManager.Management.ManagementGroup GetManagementGroup (Azure.Core.ResourceIdentifier id);
Parameters
Azure.Core.ResourceIdentifier id

The resource ID of the resource to get.

Returns

GetManagementGroupPolicyDefinition(ResourceIdentifier)

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

Declaration
public virtual Azure.ResourceManager.Resources.ManagementGroupPolicyDefinition GetManagementGroupPolicyDefinition (Azure.Core.ResourceIdentifier id);
Parameters
Azure.Core.ResourceIdentifier id

The resource ID of the resource to get.

Returns

GetManagementGroupPolicySetDefinition(ResourceIdentifier)

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

Declaration
public virtual Azure.ResourceManager.Resources.ManagementGroupPolicySetDefinition GetManagementGroupPolicySetDefinition (Azure.Core.ResourceIdentifier id);
Parameters
Azure.Core.ResourceIdentifier id

The resource ID of the resource to get.

Returns

GetManagementGroups()

Gets the management group collection for this tenant.

Declaration
public virtual Azure.ResourceManager.Management.ManagementGroupCollection GetManagementGroups ();
Returns

GetManagementLock(ResourceIdentifier)

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

Declaration
public virtual Azure.ResourceManager.Resources.ManagementLock GetManagementLock (Azure.Core.ResourceIdentifier id);
Parameters
Azure.Core.ResourceIdentifier id

The resource ID of the resource to get.

Returns

GetPolicyAssignment(ResourceIdentifier)

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

Declaration
public virtual Azure.ResourceManager.Resources.PolicyAssignment GetPolicyAssignment (Azure.Core.ResourceIdentifier id);
Parameters
Azure.Core.ResourceIdentifier id

The resource ID of the resource to get.

Returns

GetPolicyExemption(ResourceIdentifier)

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

Declaration
public virtual Azure.ResourceManager.Resources.PolicyExemption GetPolicyExemption (Azure.Core.ResourceIdentifier id);
Parameters
Azure.Core.ResourceIdentifier id

The resource ID of the resource to get.

Returns

GetProvider(ResourceIdentifier)

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

Declaration
public virtual Azure.ResourceManager.Resources.Provider GetProvider (Azure.Core.ResourceIdentifier id);
Parameters
Azure.Core.ResourceIdentifier id

The resource ID of the resource to get.

Returns

GetResourceGroup(ResourceIdentifier)

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

Declaration
public virtual Azure.ResourceManager.Resources.ResourceGroup GetResourceGroup (Azure.Core.ResourceIdentifier id);
Parameters
Azure.Core.ResourceIdentifier id

The resource ID of the resource to get.

Returns

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

Declaration
public virtual Azure.ResourceManager.Resources.ResourceLink GetResourceLink (Azure.Core.ResourceIdentifier id);
Parameters
Azure.Core.ResourceIdentifier id

The resource ID of the resource to get.

Returns

GetSubscription(ResourceIdentifier)

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

Declaration
public virtual Azure.ResourceManager.Resources.Subscription GetSubscription (Azure.Core.ResourceIdentifier id);
Parameters
Azure.Core.ResourceIdentifier id

The resource ID of the resource to get.

Returns

GetSubscriptionPolicyDefinition(ResourceIdentifier)

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

Declaration
public virtual Azure.ResourceManager.Resources.SubscriptionPolicyDefinition GetSubscriptionPolicyDefinition (Azure.Core.ResourceIdentifier id);
Parameters
Azure.Core.ResourceIdentifier id

The resource ID of the resource to get.

Returns

GetSubscriptionPolicySetDefinition(ResourceIdentifier)

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

Declaration
public virtual Azure.ResourceManager.Resources.SubscriptionPolicySetDefinition GetSubscriptionPolicySetDefinition (Azure.Core.ResourceIdentifier id);
Parameters
Azure.Core.ResourceIdentifier id

The resource ID of the resource to get.

Returns

GetSubscriptions()

Gets the Azure subscriptions.

Declaration
public virtual Azure.ResourceManager.Resources.SubscriptionCollection GetSubscriptions ();
Returns

GetTagResource(ResourceIdentifier)

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

Declaration
public virtual Azure.ResourceManager.Resources.TagResource GetTagResource (Azure.Core.ResourceIdentifier id);
Parameters
Azure.Core.ResourceIdentifier id

The resource ID of the resource to get.

Returns

GetTenantPolicyDefinition(ResourceIdentifier)

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

Declaration
public virtual Azure.ResourceManager.Resources.TenantPolicyDefinition GetTenantPolicyDefinition (Azure.Core.ResourceIdentifier id);
Parameters
Azure.Core.ResourceIdentifier id

The resource ID of the resource to get.

Returns

GetTenantPolicySetDefinition(ResourceIdentifier)

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

Declaration
public virtual Azure.ResourceManager.Resources.TenantPolicySetDefinition GetTenantPolicySetDefinition (Azure.Core.ResourceIdentifier id);
Parameters
Azure.Core.ResourceIdentifier id

The resource ID of the resource to get.

Returns

GetTenantProvider(String, String, CancellationToken)

Gets the specified resource provider at the tenant level.

Declaration
public virtual Azure.Response<Azure.ResourceManager.Resources.Models.ProviderInfo> GetTenantProvider (string resourceProviderNamespace, string expand = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
System.String resourceProviderNamespace

The namespace of the resource provider.

System.String expand

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

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
Exceptions
System.ArgumentNullException

resourceProviderNamespace is null.

GetTenantProviderAsync(String, String, CancellationToken)

Gets the specified resource provider at the tenant level.

Declaration
[System.Diagnostics.DebuggerStepThrough] public virtual System.Threading.Tasks.Task<Azure.Response<Azure.ResourceManager.Resources.Models.ProviderInfo>> GetTenantProviderAsync (string resourceProviderNamespace, string expand = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
System.String resourceProviderNamespace

The namespace of the resource provider.

System.String expand

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

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
Exceptions
System.ArgumentNullException

resourceProviderNamespace is null.

GetTenantProviders(Nullable<Int32>, String, CancellationToken)

Gets all resource providers for a subscription.

Declaration
public virtual Azure.Pageable<Azure.ResourceManager.Resources.Models.ProviderInfo> GetTenantProviders (Nullable<int> top = null, string expand = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
System.Nullable<System.Int32> top

The number of results to return. If null is passed returns all deployments.

System.String expand

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.

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns

GetTenantProvidersAsync(Nullable<Int32>, String, CancellationToken)

Gets all resource providers for a subscription.

Declaration
public virtual Azure.AsyncPageable<Azure.ResourceManager.Resources.Models.ProviderInfo> GetTenantProvidersAsync (Nullable<int> top = null, string expand = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
System.Nullable<System.Int32> top

The number of results to return. If null is passed returns all deployments.

System.String expand

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.

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns

GetTenants()

Gets the tenants.

Declaration
public virtual Azure.ResourceManager.Resources.TenantCollection GetTenants ();
Returns

TryGetApiVersion(ResourceType, String)

Gets the api version override if it has been set for the current client options.

Declaration
public bool TryGetApiVersion (Azure.Core.ResourceType resourceType, out string apiVersion);
Parameters
Azure.Core.ResourceType resourceType

The resource type to get the version for.

System.String apiVersion

The api version to variable to set.

Returns
System.Boolean

ncG1vNJzZmiZqqq%2Fpr%2FDpJuom6Njr627wWeaqKqVY8SqusOorqxmnprBcHDWnplonJ%2Bpu6bAjnqxrqqVY5%2Bmv86uqZydfZa7orPEq2ZqZmBjfW6uxK2YZ3Bflr2qe6CzrKudXoeytLvUq5qehZGjrqix0Wh4s62imnuTsdKorKublYKur63GnqlneaKikK21xKerZ6Ckork%3D