AzureResourceManager Class

  • java.lang.Object
    • com.azure.resourcemanager.AzureResourceManager

public final class AzureResourceManager

The entry point for accessing resource management APIs in Azure.

Instantiating an Azure Client

AzureProfile profile = new AzureProfile(tenantId, subscriptionId, AzureEnvironment.AZURE);
 TokenCredential credential = new DefaultAzureCredentialBuilder()
     .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint())
     .build();
 AzureResourceManager azure = AzureResourceManager
     .authenticate(credential, profile)
     .withDefaultSubscription();

Method Summary

Modifier and Type Method and Description
AccessManagement accessManagement()

Gets entry point to authentication and authorization management in Azure.

ActionGroups actionGroups()

Gets entry point to managing action groups in Azure.

ActivityLogs activityLogs()

Gets entry point to listing activity log events in Azure.

AlertRules alertRules()

Gets entry point to managing alertRules in Azure.

AppServiceCertificateOrders appServiceCertificateOrders()

Gets entry point to managing certificates orders.

AppServiceCertificates appServiceCertificates()

Gets entry point to managing certificates.

AppServiceDomains appServiceDomains()

Gets entry point to managing domains.

AppServicePlans appServicePlans()

Gets entry point to managing app service plans.

ApplicationGateways applicationGateways()

Gets entry point to managing application gateways.

ApplicationSecurityGroups applicationSecurityGroups()

Gets entry point to managing express route circuits.

static Authenticated authenticate(TokenCredential credential, AzureProfile profile)

Authenticate to Azure using an Azure credential object.

static Authenticated authenticate(HttpPipeline httpPipeline, AzureProfile profile)

Authenticates API access using a RestClient instance.

AutoscaleSettings autoscaleSettings()

Gets entry point to managing Autoscale Settings in Azure.

AvailabilitySets availabilitySets()

Gets entry point to managing availability sets.

CdnProfiles cdnProfiles()

Gets entry point to managing cdn manager profiles.

ComputeSkus computeSkus()

Gets the compute service SKU management API entry point.

ComputeUsages computeUsages()

Gets entry point to managing compute resource usages.

static Configurable configure()

Configures the Azure client.

ContainerGroups containerGroups()

Gets entry point to managing Azure Container Instances.

Registries containerRegistries()

Gets entry point to managing Container Registries.

RegistryTaskRuns containerRegistryTaskRuns()

Gets entry point to managing Container Registry RegistryTask Runs.

RegistryTasks containerRegistryTasks()

Gets entry point to managing Container Registry RegistryTasks.

CosmosDBAccounts cosmosDBAccounts()

Gets entry point to managing Container Regsitries.

DdosProtectionPlans ddosProtectionPlans()

Gets entry point to managing DDoS protection plans.

Deployments deployments()

Gets entry point to managing deployments.

DiagnosticSettings diagnosticSettings()

Gets entry point to listing diagnostic settings in Azure.

DiskEncryptionSets diskEncryptionSets()

Gets entry point to disk encryption sets management.

Disks disks()

Gets entry point to managing managed disks.

DnsZones dnsZones()

Gets entry point to managing DNS zones.

EventHubDisasterRecoveryPairings eventHubDisasterRecoveryPairings()

Gets entry point to managing event hub namespace geo disaster recovery.

EventHubNamespaces eventHubNamespaces()

Gets entry point to managing event hub namespaces.

EventHubs eventHubs()

Gets entry point to managing event hubs.

ExpressRouteCircuits expressRouteCircuits()

Gets entry point to managing express route circuits.

ExpressRouteCrossConnections expressRouteCrossConnections()

Gets entry point to managing express route cross connections.

Features features()

Gets entry point to managing features.

FunctionApps functionApps()

Entry point to managing function apps.

Galleries galleries()

Gets entry point to managing compute galleries.

GalleryImageVersions galleryImageVersions()

Gets entry point to managing compute gallery image versions.

GalleryImages galleryImages()

Gets entry point to managing compute gallery images.

GenericResources genericResources()

Gets entry point to managing generic resources.

Subscription getCurrentSubscription()

Gets the currently selected subscription this client is authenticated to work with.

Identities identities()

Gets entry point to managing Managed Service Identity (MSI) identities.

KubernetesClusters kubernetesClusters()

Gets entry point to managing Kubernetes clusters.

LoadBalancers loadBalancers()

Gets entry point to managing load balancers.

LocalNetworkGateways localNetworkGateways()

Gets entry point to managing local network gateways.

ManagedHsms managedHsms()

Gets entry point to Managed Hardware Security Module management.

ManagementLocks managementLocks()

Gets entry point to managing locks.

MetricDefinitions metricDefinitions()

Gets entry point to listing metric definitions in Azure.

NetworkInterfaces networkInterfaces()

Gets entry point to managing network interfaces.

NetworkProfiles networkProfiles()

Gets entry point to network profiles management.

NetworkSecurityGroups networkSecurityGroups()

Gets entry point to managing network security groups.

NetworkUsages networkUsages()

Gets entry point to managing network resource usages.

NetworkWatchers networkWatchers()

Gets entry point to managing network watchers.

Networks networks()

Gets entry point to managing virtual networks.

PolicyAssignments policyAssignments()

Gets entry point to managing policy assignments.

PolicyDefinitions policyDefinitions()

Gets entry point to managing policy definitions.

PrivateDnsZones privateDnsZones()

Gets the private DNS zone management API entry point.

PrivateEndpoints privateEndpoints()

Gets entry point to private endpoints management.

Providers providers()

Gets entry point to managing resource providers.

PublicIpAddresses publicIpAddresses()

Gets entry point to managing public IP addresses.

PublicIpPrefixes publicIpPrefixes()

Gets entry point to managing public IP prefixes.

RedisCaches redisCaches()

Gets entry point to managing Redis Caches.

ResourceGroups resourceGroups()

Gets entry point to managing resource groups.

RouteFilters routeFilters()

Gets entry point to managing route filters.

RouteTables routeTables()

Gets entry point to managing route tables.

SearchServices searchServices()

Gets entry point to managing Search services.

ServiceBusNamespaces serviceBusNamespaces()

Gets entry point to managing Service Bus.

Snapshots snapshots()

Gets entry point to managing managed snapshots.

SpringServices springServices()

Gets the spring service management API entry point.

SqlServers sqlServers()

Gets entry point to managing Sql server.

StorageAccounts storageAccounts()

Entry point to managing storage accounts

BlobContainers storageBlobContainers()

Entry point to blob container management API.

BlobServices storageBlobServices()

Gets the blob service management API entry point.

ManagementPolicies storageManagementPolicies()

Gets the blob service management API entry point.

StorageSkus storageSkus()

Gets entry point to managing storage service SKUs.

Usages storageUsages()

Gets entry point to managing storage account usages.

String subscriptionId()

Gets the currently selected subscription ID this client is authenticated to work with.

Subscriptions subscriptions()

Gets entry point to managing subscriptions.

TagOperations tagOperations()

Gets entry point to tag management.

String tenantId()

Gets the currently selected tenant ID this client is authenticated to work with.

Tenants tenants()

Gets entry point to managing tenants.

TrafficManagerProfiles trafficManagerProfiles()

Gets entry point to managing traffic manager profiles.

Vaults vaults()

Gets entry point to managing key vaults.

VirtualMachineCustomImages virtualMachineCustomImages()

Gets entry point to managing virtual machine custom images.

VirtualMachineImages virtualMachineImages()

Gets entry point to managing virtual machine images.

VirtualMachineScaleSets virtualMachineScaleSets()

Gets entry point to managing virtual machine scale sets.

VirtualMachines virtualMachines()

Entry point to managing virtual machines.

VirtualNetworkGateways virtualNetworkGateways()

Gets entry point to managing virtual network gateways.

WebApps webApps()

Gets entry point to managing web apps.

Methods inherited from java.lang.Object

Method Details

accessManagement

public AccessManagement accessManagement()

Gets entry point to authentication and authorization management in Azure.

Returns:

entry point to authentication and authorization management in Azure

actionGroups

public ActionGroups actionGroups()

Gets entry point to managing action groups in Azure.

Returns:

entry point to managing action groups in Azure

activityLogs

public ActivityLogs activityLogs()

Gets entry point to listing activity log events in Azure.

Returns:

entry point to listing activity log events in Azure

alertRules

public AlertRules alertRules()

Gets entry point to managing alertRules in Azure.

Returns:

entry point to managing alertRules in Azure

appServiceCertificateOrders

public AppServiceCertificateOrders appServiceCertificateOrders()

Gets entry point to managing certificates orders.

Returns:

entry point to managing certificates orders.

appServiceCertificates

public AppServiceCertificates appServiceCertificates()

Gets entry point to managing certificates.

Returns:

entry point to managing certificates.

appServiceDomains

public AppServiceDomains appServiceDomains()

Gets entry point to managing domains.

Returns:

entry point to managing domains.

appServicePlans

public AppServicePlans appServicePlans()

Gets entry point to managing app service plans.

Returns:

entry point to managing app service plans.

applicationGateways

public ApplicationGateways applicationGateways()

Gets entry point to managing application gateways.

Returns:

entry point to managing application gateways

applicationSecurityGroups

public ApplicationSecurityGroups applicationSecurityGroups()

Gets entry point to managing express route circuits.

Returns:

entry point to managing express route circuits

authenticate

public static AzureResourceManager.Authenticated authenticate(TokenCredential credential, AzureProfile profile)

Authenticate to Azure using an Azure credential object.

Code Samples

AzureProfile profile = new AzureProfile(tenantId, subscriptionId, AzureEnvironment.AZURE);
 TokenCredential credential = new DefaultAzureCredentialBuilder()
     .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint())
     .build();
 AzureResourceManager azure = AzureResourceManager
     .authenticate(credential, profile)
     .withDefaultSubscription();

Parameters:

credential - the credential object
profile - the profile to use

Returns:

the authenticated Azure client

authenticate

public static AzureResourceManager.Authenticated authenticate(HttpPipeline httpPipeline, AzureProfile profile)

Authenticates API access using a RestClient instance.

Parameters:

httpPipeline - the HttpPipeline configured with Azure authentication credential.
profile - the profile used in Active Directory

Returns:

authenticated Azure client

autoscaleSettings

public AutoscaleSettings autoscaleSettings()

Gets entry point to managing Autoscale Settings in Azure.

Returns:

entry point to managing Autoscale Settings in Azure

availabilitySets

public AvailabilitySets availabilitySets()

Gets entry point to managing availability sets.

Returns:

entry point to managing availability sets

cdnProfiles

public CdnProfiles cdnProfiles()

Gets entry point to managing cdn manager profiles.

Returns:

entry point to managing cdn manager profiles.

computeSkus

public ComputeSkus computeSkus()

Gets the compute service SKU management API entry point.

Returns:

the compute service SKU management API entry point

computeUsages

public ComputeUsages computeUsages()

Gets entry point to managing compute resource usages.

Returns:

entry point to managing compute resource usages

configure

public static AzureResourceManager.Configurable configure()

Configures the Azure client.

Code Samples

AzureResourceManager azure = AzureResourceManager
     .configure()
     .withLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)
     .withPolicy(customPolicy)
     .withRetryPolicy(customRetryPolicy)
     .withHttpClient(httpClient)
     //...

Returns:

an interface allow configurations on the client.

containerGroups

public ContainerGroups containerGroups()

Gets entry point to managing Azure Container Instances.

Returns:

entry point to managing Azure Container Instances.

containerRegistries

public Registries containerRegistries()

Gets entry point to managing Container Registries.

Returns:

entry point to managing Container Registries.

containerRegistryTaskRuns

public RegistryTaskRuns containerRegistryTaskRuns()

Gets entry point to managing Container Registry RegistryTask Runs.

Returns:

entry point to managing Container Registry RegistryTask Runs.

containerRegistryTasks

public RegistryTasks containerRegistryTasks()

Gets entry point to managing Container Registry RegistryTasks.

Returns:

entry point to managing Container Registry RegistryTasks.

cosmosDBAccounts

public CosmosDBAccounts cosmosDBAccounts()

Gets entry point to managing Container Regsitries.

Returns:

entry point to managing Container Regsitries.

ddosProtectionPlans

public DdosProtectionPlans ddosProtectionPlans()

Gets entry point to managing DDoS protection plans.

Returns:

entry point to managing DDoS protection plans

deployments

public Deployments deployments()

Gets entry point to managing deployments.

Returns:

entry point to managing deployments

diagnosticSettings

public DiagnosticSettings diagnosticSettings()

Gets entry point to listing diagnostic settings in Azure.

Returns:

entry point to listing diagnostic settings in Azure

diskEncryptionSets

public DiskEncryptionSets diskEncryptionSets()

Gets entry point to disk encryption sets management.

Returns:

entry point to disk encryption sets management

disks

public Disks disks()

Gets entry point to managing managed disks.

Returns:

entry point to managing managed disks

dnsZones

public DnsZones dnsZones()

Gets entry point to managing DNS zones.

Returns:

entry point to managing DNS zones.

eventHubDisasterRecoveryPairings

public EventHubDisasterRecoveryPairings eventHubDisasterRecoveryPairings()

Gets entry point to managing event hub namespace geo disaster recovery.

Returns:

entry point to managing event hub namespace geo disaster recovery.

eventHubNamespaces

public EventHubNamespaces eventHubNamespaces()

Gets entry point to managing event hub namespaces.

Returns:

entry point to managing event hub namespaces.

eventHubs

public EventHubs eventHubs()

Gets entry point to managing event hubs.

Returns:

entry point to managing event hubs.

expressRouteCircuits

public ExpressRouteCircuits expressRouteCircuits()

Gets entry point to managing express route circuits.

Returns:

entry point to managing express route circuits

expressRouteCrossConnections

public ExpressRouteCrossConnections expressRouteCrossConnections()

Gets entry point to managing express route cross connections.

Returns:

entry point to managing express route cross connections

features

public Features features()

Gets entry point to managing features.

Returns:

entry point to managing features

functionApps

public FunctionApps functionApps()

Entry point to managing function apps.

Code Samples

Create an Azure Function App

Creatable<StorageAccount> creatableStorageAccount = azure.storageAccounts()
     .define("<storage-account-name>")
     .withRegion(Region.US_EAST)
     .withExistingResourceGroup(resourceGroupName)
     .withGeneralPurposeAccountKindV2()
     .withSku(StorageAccountSkuType.STANDARD_LRS);
 Creatable<AppServicePlan> creatableAppServicePlan = azure.appServicePlans()
     .define("<app-service-plan-name>")
     .withRegion(Region.US_EAST)
     .withExistingResourceGroup(resourceGroupName)
     .withPricingTier(PricingTier.STANDARD_S1)
     .withOperatingSystem(OperatingSystem.LINUX);
 FunctionApp linuxFunctionApp = azure.functionApps().define("<function-app-name>")
     .withRegion(Region.US_EAST)
     .withExistingResourceGroup(resourceGroupName)
     .withNewLinuxAppServicePlan(creatableAppServicePlan)
     .withBuiltInImage(FunctionRuntimeStack.JAVA_8)
     .withNewStorageAccount(creatableStorageAccount)
     .withHttpsOnly(true)
     .withAppSetting("WEBSITE_RUN_FROM_PACKAGE", "<function-app-package-url>")
     .create();

Returns:

entry point to managing function apps.

galleries

public Galleries galleries()

Gets entry point to managing compute galleries.

Returns:

entry point to managing compute galleries.

galleryImageVersions

public GalleryImageVersions galleryImageVersions()

Gets entry point to managing compute gallery image versions.

Returns:

entry point to managing compute gallery image versions.

galleryImages

public GalleryImages galleryImages()

Gets entry point to managing compute gallery images.

Returns:

entry point to managing compute gallery images.

genericResources

public GenericResources genericResources()

Gets entry point to managing generic resources.

Returns:

entry point to managing generic resources

getCurrentSubscription

public Subscription getCurrentSubscription()

Gets the currently selected subscription this client is authenticated to work with.

Returns:

the currently selected subscription this client is authenticated to work with

identities

public Identities identities()

Gets entry point to managing Managed Service Identity (MSI) identities.

Returns:

entry point to managing Managed Service Identity (MSI) identities.

kubernetesClusters

public KubernetesClusters kubernetesClusters()

Gets entry point to managing Kubernetes clusters.

Returns:

entry point to managing Kubernetes clusters.

loadBalancers

public LoadBalancers loadBalancers()

Gets entry point to managing load balancers.

Returns:

entry point to managing load balancers

localNetworkGateways

public LocalNetworkGateways localNetworkGateways()

Gets entry point to managing local network gateways.

Returns:

entry point to managing local network gateways

managedHsms

public ManagedHsms managedHsms()

Gets entry point to Managed Hardware Security Module management.

Returns:

entry point to Managed Hardware Security Module management

managementLocks

public ManagementLocks managementLocks()

Gets entry point to managing locks.

Returns:

entry point to managing locks.

metricDefinitions

public MetricDefinitions metricDefinitions()

Gets entry point to listing metric definitions in Azure.

Returns:

entry point to listing metric definitions in Azure

networkInterfaces

public NetworkInterfaces networkInterfaces()

Gets entry point to managing network interfaces.

Returns:

entry point to managing network interfaces

networkProfiles

public NetworkProfiles networkProfiles()

Gets entry point to network profiles management.

Returns:

entry point to network profiles management

networkSecurityGroups

public NetworkSecurityGroups networkSecurityGroups()

Gets entry point to managing network security groups.

Returns:

entry point to managing network security groups

networkUsages

public NetworkUsages networkUsages()

Gets entry point to managing network resource usages.

Returns:

entry point to managing network resource usages

networkWatchers

public NetworkWatchers networkWatchers()

Gets entry point to managing network watchers.

Returns:

entry point to managing network watchers

networks

public Networks networks()

Gets entry point to managing virtual networks.

Returns:

entry point to managing virtual networks

policyAssignments

public PolicyAssignments policyAssignments()

Gets entry point to managing policy assignments.

Returns:

entry point to managing policy assignments.

policyDefinitions

public PolicyDefinitions policyDefinitions()

Gets entry point to managing policy definitions.

Returns:

entry point to managing policy definitions.

privateDnsZones

public PrivateDnsZones privateDnsZones()

Gets the private DNS zone management API entry point.

Returns:

the private DNS zone management API entry point

privateEndpoints

public PrivateEndpoints privateEndpoints()

Gets entry point to private endpoints management.

Returns:

entry point to private endpoints management

providers

public Providers providers()

Gets entry point to managing resource providers.

Returns:

entry point to managing resource providers

publicIpAddresses

public PublicIpAddresses publicIpAddresses()

Gets entry point to managing public IP addresses.

Returns:

entry point to managing public IP addresses

publicIpPrefixes

public PublicIpPrefixes publicIpPrefixes()

Gets entry point to managing public IP prefixes.

Returns:

entry point to managing public IP prefixes

redisCaches

public RedisCaches redisCaches()

Gets entry point to managing Redis Caches.

Returns:

entry point to managing Redis Caches.

resourceGroups

public ResourceGroups resourceGroups()

Gets entry point to managing resource groups.

Returns:

entry point to managing resource groups

routeFilters

public RouteFilters routeFilters()

Gets entry point to managing route filters.

Returns:

entry point to managing route filters

routeTables

public RouteTables routeTables()

Gets entry point to managing route tables.

Returns:

entry point to managing route tables

searchServices

public SearchServices searchServices()

Gets entry point to managing Search services.

Returns:

entry point to managing Search services.

serviceBusNamespaces

public ServiceBusNamespaces serviceBusNamespaces()

Gets entry point to managing Service Bus.

Returns:

entry point to managing Service Bus.

snapshots

public Snapshots snapshots()

Gets entry point to managing managed snapshots.

Returns:

entry point to managing managed snapshots

springServices

public SpringServices springServices()

Gets the spring service management API entry point.

Returns:

the spring service management API entry point

sqlServers

public SqlServers sqlServers()

Gets entry point to managing Sql server.

Returns:

entry point to managing Sql server.

storageAccounts

public StorageAccounts storageAccounts()

Entry point to managing storage accounts

Code Samples

Create an Azure Storage Account

azure.storageAccounts().define("<storage-account-name>")
     .withRegion(Region.US_EAST)
     .withNewResourceGroup(resourceGroupName)
     .withSku(StorageAccountSkuType.STANDARD_LRS)
     .withGeneralPurposeAccountKindV2()
     .withOnlyHttpsTraffic()
     //...
     .create();

Returns:

entry point to managing storage accounts

storageBlobContainers

public BlobContainers storageBlobContainers()

Entry point to blob container management API.

Code Samples

Create a Blob Container

azure.storageBlobContainers()
     .defineContainer("container")
     .withExistingStorageAccount(storageAccount)
     .withPublicAccess(PublicAccess.NONE)
     //...
     .create();

Returns:

the blob container management API entry point

storageBlobServices

public BlobServices storageBlobServices()

Gets the blob service management API entry point.

Returns:

the blob service management API entry point

storageManagementPolicies

public ManagementPolicies storageManagementPolicies()

Gets the blob service management API entry point.

Returns:

the blob service management API entry point

storageSkus

public StorageSkus storageSkus()

Gets entry point to managing storage service SKUs.

Returns:

entry point to managing storage service SKUs

storageUsages

public Usages storageUsages()

Gets entry point to managing storage account usages.

Returns:

entry point to managing storage account usages

subscriptionId

public String subscriptionId()

Gets the currently selected subscription ID this client is authenticated to work with.

Returns:

the currently selected subscription ID this client is authenticated to work with

subscriptions

public Subscriptions subscriptions()

Gets entry point to managing subscriptions.

Returns:

entry point to managing subscriptions

tagOperations

public TagOperations tagOperations()

Gets entry point to tag management.

Returns:

entry point to tag management

tenantId

public String tenantId()

Gets the currently selected tenant ID this client is authenticated to work with.

Returns:

the currently selected tenant ID this client is authenticated to work with

tenants

public Tenants tenants()

Gets entry point to managing tenants.

Returns:

entry point to managing tenants

trafficManagerProfiles

public TrafficManagerProfiles trafficManagerProfiles()

Gets entry point to managing traffic manager profiles.

Returns:

entry point to managing traffic manager profiles.

vaults

public Vaults vaults()

Gets entry point to managing key vaults.

Returns:

entry point to managing key vaults

virtualMachineCustomImages

public VirtualMachineCustomImages virtualMachineCustomImages()

Gets entry point to managing virtual machine custom images.

Returns:

entry point to managing virtual machine custom images

virtualMachineImages

public VirtualMachineImages virtualMachineImages()

Gets entry point to managing virtual machine images.

Returns:

entry point to managing virtual machine images

virtualMachineScaleSets

public VirtualMachineScaleSets virtualMachineScaleSets()

Gets entry point to managing virtual machine scale sets.

Returns:

entry point to managing virtual machine scale sets.

virtualMachines

public VirtualMachines virtualMachines()

Entry point to managing virtual machines.

Code Samples

Create a Virtual Machine instance.

VirtualMachine linuxVM = azure.virtualMachines()
     .define(linuxVMName)
     .withRegion(region)
     .withNewResourceGroup(resourceGroupName)
     .withNewPrimaryNetwork("10.0.0.0/28")
     .withPrimaryPrivateIPAddressDynamic()
     .withoutPrimaryPublicIPAddress()
     .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_20_04_LTS_GEN2)
     .withRootUsername(userName)
     .withSsh(sshPublicKey)
     .withNewDataDisk(10)
     .withExistingDataDisk(dataDisk)
     .withSize(VirtualMachineSizeTypes.STANDARD_DS1_V2)
     .create();

Restart Virtual Machine instance.

azure.virtualMachines().listByResourceGroupAsync(resourceGroupName)
     .flatMap(VirtualMachine::restartAsync)
     //...

Returns:

entry point to managing virtual machines

virtualNetworkGateways

public VirtualNetworkGateways virtualNetworkGateways()

Gets entry point to managing virtual network gateways.

Returns:

entry point to managing virtual network gateways

webApps

public WebApps webApps()

Gets entry point to managing web apps.

Returns:

entry point to managing web apps.

Applies to