Package com.azure.resourcemanager
Class AzureResourceManager
java.lang.Object
com.azure.resourcemanager.AzureResourceManager
The entry point for accessing resource management APIs in Azure.
Instantiating an Azure Client
AzureProfile profile = new AzureProfile(tenantId, subscriptionId, AzureCloud.AZURE_PUBLIC_CLOUD);
TokenCredential credential = new DefaultAzureCredentialBuilder()
.authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint())
.build();
AzureResourceManager azure = AzureResourceManager
.authenticate(credential, profile)
.withDefaultSubscription();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceProvides authenticated access to a subset of Azure APIs that do not require a specific subscription.static interfaceThe interface allowing configurations to be made on the client. -
Method Summary
Modifier and TypeMethodDescriptionGets entry point to authentication and authorization management in Azure.Gets entry point to managing action groups in Azure.Gets entry point to listing activity log events in Azure.Gets entry point to managing alertRules in Azure.Gets entry point to managing application gateways.Gets entry point to managing express route circuits.Gets entry point to managing certificates orders.Gets entry point to managing certificates.Gets entry point to managing domains.Gets entry point to managing app service plans.authenticate(com.azure.core.credential.TokenCredential credential, com.azure.core.management.profile.AzureProfile profile) Authenticate to Azure using an Azure credential object.authenticate(com.azure.core.http.HttpPipeline httpPipeline, com.azure.core.management.profile.AzureProfile profile) Authenticates API access using a RestClient instance.Gets entry point to managing Autoscale Settings in Azure.Gets entry point to managing availability sets.Gets entry point to managing cdn manager profiles.Gets the compute service SKU management API entry point.Gets entry point to managing compute resource usages.Configures the Azure client.Gets entry point to managing Azure Container Instances.Gets entry point to managing Container Registries.Gets entry point to managing Container Registry RegistryTask Runs.Gets entry point to managing Container Registry RegistryTasks.Gets entry point to managing Container Regsitries.Gets entry point to managing DDoS protection plans.Gets entry point to managing deployments.Gets entry point to listing diagnostic settings in Azure.Gets entry point to disk encryption sets management.disks()Gets entry point to managing managed disks.dnsZones()Gets entry point to managing DNS zones.Gets entry point to managing event hub namespace geo disaster recovery.Gets entry point to managing event hub namespaces.Gets entry point to managing event hubs.Gets entry point to managing express route circuits.Gets entry point to managing express route cross connections.features()Gets entry point to managing features.Entry point to managing function apps.Gets entry point to managing compute galleries.Gets entry point to managing compute gallery images.Gets entry point to managing compute gallery image versions.Gets entry point to managing generic resources.Gets the currently selected subscription this client is authenticated to work with.Gets entry point to managing Managed Service Identity (MSI) identities.Gets entry point to managing Kubernetes clusters.Gets entry point to managing load balancers.Gets entry point to managing local network gateways.Gets entry point to Managed Hardware Security Module management.Gets entry point to managing locks.Gets entry point to listing metric definitions in Azure.Gets entry point to managing network interfaces.Gets entry point to network profiles management.networks()Gets entry point to managing virtual networks.Gets entry point to managing network security groups.Gets entry point to managing network resource usages.Gets entry point to managing network watchers.Gets entry point to managing policy assignments.Gets entry point to managing policy definitions.Gets the private DNS zone management API entry point.Gets entry point to private endpoints management.Gets entry point to managing resource providers.Gets entry point to managing public IP addresses.Gets entry point to managing public IP prefixes.Gets entry point to managing Redis Caches.Gets entry point to managing resource groups.Gets entry point to managing route filters.Gets entry point to managing route tables.Gets entry point to managing Search services.Gets entry point to managing Service Bus.Gets entry point to managing managed snapshots.Deprecated.azure-resourcemanager-appplatform has been deprecated and will no longer be maintained after 03/31/2025.Gets entry point to managing Sql server.Entry point to managing storage accountsEntry point to blob container management API.Gets the blob service management API entry point.Gets the blob service management API entry point.Gets entry point to managing storage service SKUs.Gets entry point to managing storage account usages.Gets the currently selected subscription ID this client is authenticated to work with.Gets entry point to managing subscriptions.Gets entry point to tag management.tenantId()Gets the currently selected tenant ID this client is authenticated to work with.tenants()Gets entry point to managing tenants.Gets entry point to managing traffic manager profiles.vaults()Gets entry point to managing key vaults.Gets entry point to managing virtual machine custom images.Gets entry point to managing virtual machine images.Entry point to managing virtual machines.Gets entry point to managing virtual machine scale sets.Gets entry point to managing virtual network gateways.webApps()Gets entry point to managing web apps.
-
Method Details
-
authenticate
public static AzureResourceManager.Authenticated authenticate(com.azure.core.credential.TokenCredential credential, com.azure.core.management.profile.AzureProfile profile) Authenticate to Azure using an Azure credential object.Code Samples
AzureProfile profile = new AzureProfile(tenantId, subscriptionId, AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); AzureResourceManager azure = AzureResourceManager .authenticate(credential, profile) .withDefaultSubscription();- Parameters:
credential- the credential objectprofile- the profile to use- Returns:
- the authenticated Azure client
-
authenticate
public static AzureResourceManager.Authenticated authenticate(com.azure.core.http.HttpPipeline httpPipeline, com.azure.core.management.profile.AzureProfile profile) Authenticates API access using a RestClient instance.- Parameters:
httpPipeline- theHttpPipelineconfigured with Azure authentication credential.profile- the profile used in Active Directory- Returns:
- authenticated Azure client
-
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.
-
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
-
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
-
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
-
subscriptions
Gets entry point to managing subscriptions.- Returns:
- entry point to managing subscriptions
-
tenants
Gets entry point to managing tenants.- Returns:
- entry point to managing tenants
-
resourceGroups
Gets entry point to managing resource groups.- Returns:
- entry point to managing resource groups
-
deployments
Gets entry point to managing deployments.- Returns:
- entry point to managing deployments
-
genericResources
Gets entry point to managing generic resources.- Returns:
- entry point to managing generic resources
-
features
Gets entry point to managing features.- Returns:
- entry point to managing features
-
providers
Gets entry point to managing resource providers.- Returns:
- entry point to managing resource providers
-
policyDefinitions
Gets entry point to managing policy definitions.- Returns:
- entry point to managing policy definitions.
-
policyAssignments
Gets entry point to managing policy assignments.- Returns:
- entry point to managing policy assignments.
-
managementLocks
Gets entry point to managing locks.- Returns:
- entry point to managing locks.
-
storageAccounts
Entry point to managing storage accountsCode 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
-
storageUsages
Gets entry point to managing storage account usages.- Returns:
- entry point to managing storage account usages
-
storageSkus
Gets entry point to managing storage service SKUs.- Returns:
- entry point to managing storage service SKUs
-
availabilitySets
Gets entry point to managing availability sets.- Returns:
- entry point to managing availability sets
-
networks
Gets entry point to managing virtual networks.- Returns:
- entry point to managing virtual networks
-
routeTables
Gets entry point to managing route tables.- Returns:
- entry point to managing route tables
-
loadBalancers
Gets entry point to managing load balancers.- Returns:
- entry point to managing load balancers
-
applicationGateways
Gets entry point to managing application gateways.- Returns:
- entry point to managing application gateways
-
networkSecurityGroups
Gets entry point to managing network security groups.- Returns:
- entry point to managing network security groups
-
networkUsages
Gets entry point to managing network resource usages.- Returns:
- entry point to managing network resource usages
-
networkWatchers
Gets entry point to managing network watchers.- Returns:
- entry point to managing network watchers
-
virtualNetworkGateways
Gets entry point to managing virtual network gateways.- Returns:
- entry point to managing virtual network gateways
-
localNetworkGateways
Gets entry point to managing local network gateways.- Returns:
- entry point to managing local network gateways
-
expressRouteCircuits
Gets entry point to managing express route circuits.- Returns:
- entry point to managing express route circuits
-
expressRouteCrossConnections
Gets entry point to managing express route cross connections.- Returns:
- entry point to managing express route cross connections
-
applicationSecurityGroups
Gets entry point to managing express route circuits.- Returns:
- entry point to managing express route circuits
-
routeFilters
Gets entry point to managing route filters.- Returns:
- entry point to managing route filters
-
ddosProtectionPlans
Gets entry point to managing DDoS protection plans.- Returns:
- entry point to managing DDoS protection plans
-
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
-
virtualMachineScaleSets
Gets entry point to managing virtual machine scale sets.- Returns:
- entry point to managing virtual machine scale sets.
-
virtualMachineImages
Gets entry point to managing virtual machine images.- Returns:
- entry point to managing virtual machine images
-
virtualMachineCustomImages
Gets entry point to managing virtual machine custom images.- Returns:
- entry point to managing virtual machine custom images
-
disks
Gets entry point to managing managed disks.- Returns:
- entry point to managing managed disks
-
snapshots
Gets entry point to managing managed snapshots.- Returns:
- entry point to managing managed snapshots
-
computeSkus
Gets the compute service SKU management API entry point.- Returns:
- the compute service SKU management API entry point
-
publicIpAddresses
Gets entry point to managing public IP addresses.- Returns:
- entry point to managing public IP addresses
-
publicIpPrefixes
Gets entry point to managing public IP prefixes.- Returns:
- entry point to managing public IP prefixes
-
networkInterfaces
Gets entry point to managing network interfaces.- Returns:
- entry point to managing network interfaces
-
computeUsages
Gets entry point to managing compute resource usages.- Returns:
- entry point to managing compute resource usages
-
vaults
Gets entry point to managing key vaults.- Returns:
- entry point to managing key vaults
-
trafficManagerProfiles
Gets entry point to managing traffic manager profiles.- Returns:
- entry point to managing traffic manager profiles.
-
redisCaches
Gets entry point to managing Redis Caches.- Returns:
- entry point to managing Redis Caches.
-
cdnProfiles
Gets entry point to managing cdn manager profiles.- Returns:
- entry point to managing cdn manager profiles.
-
dnsZones
Gets entry point to managing DNS zones.- Returns:
- entry point to managing DNS zones.
-
webApps
Gets entry point to managing web apps.- Returns:
- entry point to managing web apps.
-
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.
-
appServicePlans
Gets entry point to managing app service plans.- Returns:
- entry point to managing app service plans.
-
appServiceDomains
Gets entry point to managing domains.- Returns:
- entry point to managing domains.
-
appServiceCertificates
Gets entry point to managing certificates.- Returns:
- entry point to managing certificates.
-
appServiceCertificateOrders
Gets entry point to managing certificates orders.- Returns:
- entry point to managing certificates orders.
-
sqlServers
Gets entry point to managing Sql server.- Returns:
- entry point to managing Sql server.
-
serviceBusNamespaces
Gets entry point to managing Service Bus.- Returns:
- entry point to managing Service Bus.
-
kubernetesClusters
Gets entry point to managing Kubernetes clusters.- Returns:
- entry point to managing Kubernetes clusters.
-
containerGroups
Gets entry point to managing Azure Container Instances.- Returns:
- entry point to managing Azure Container Instances.
-
containerRegistries
Gets entry point to managing Container Registries.- Returns:
- entry point to managing Container Registries.
-
containerRegistryTasks
Gets entry point to managing Container Registry RegistryTasks.- Returns:
- entry point to managing Container Registry RegistryTasks.
-
containerRegistryTaskRuns
Gets entry point to managing Container Registry RegistryTask Runs.- Returns:
- entry point to managing Container Registry RegistryTask Runs.
-
cosmosDBAccounts
Gets entry point to managing Container Regsitries.- Returns:
- entry point to managing Container Regsitries.
-
searchServices
Gets entry point to managing Search services.- Returns:
- entry point to managing Search services.
-
identities
Gets entry point to managing Managed Service Identity (MSI) identities.- Returns:
- entry point to managing Managed Service Identity (MSI) identities.
-
accessManagement
Gets entry point to authentication and authorization management in Azure.- Returns:
- entry point to authentication and authorization management in Azure
-
activityLogs
Gets entry point to listing activity log events in Azure.- Returns:
- entry point to listing activity log events in Azure
-
metricDefinitions
Gets entry point to listing metric definitions in Azure.- Returns:
- entry point to listing metric definitions in Azure
-
diagnosticSettings
Gets entry point to listing diagnostic settings in Azure.- Returns:
- entry point to listing diagnostic settings in Azure
-
actionGroups
Gets entry point to managing action groups in Azure.- Returns:
- entry point to managing action groups in Azure
-
alertRules
Gets entry point to managing alertRules in Azure.- Returns:
- entry point to managing alertRules in Azure
-
autoscaleSettings
Gets entry point to managing Autoscale Settings in Azure.- Returns:
- entry point to managing Autoscale Settings in Azure
-
eventHubNamespaces
Gets entry point to managing event hub namespaces.- Returns:
- entry point to managing event hub namespaces.
-
eventHubs
Gets entry point to managing event hubs.- Returns:
- entry point to managing event hubs.
-
eventHubDisasterRecoveryPairings
Gets entry point to managing event hub namespace geo disaster recovery.- Returns:
- entry point to managing event hub namespace geo disaster recovery.
-
galleries
Gets entry point to managing compute galleries.- Returns:
- entry point to managing compute galleries.
-
galleryImages
Gets entry point to managing compute gallery images.- Returns:
- entry point to managing compute gallery images.
-
galleryImageVersions
Gets entry point to managing compute gallery image versions.- Returns:
- entry point to managing compute gallery image versions.
-
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
Gets the blob service management API entry point.- Returns:
- the blob service management API entry point
-
storageManagementPolicies
Gets the blob service management API entry point.- Returns:
- the blob service management API entry point
-
springServices
Deprecated.azure-resourcemanager-appplatform has been deprecated and will no longer be maintained after 03/31/2025.We recommend azure-resourcemanager-appcontainers and azure-resourcemanager-containerservice as the replacement libraries.
Refer to Azure Spring Apps retirement announcement for more retirement details and how to migrate to the new services.
Refer to our deprecation policy for more details.
Gets the spring service management API entry point.- Returns:
- the spring service management API entry point
-
privateDnsZones
Gets the private DNS zone management API entry point.- Returns:
- the private DNS zone management API entry point
-
privateEndpoints
Gets entry point to private endpoints management.- Returns:
- entry point to private endpoints management
-
tagOperations
Gets entry point to tag management.- Returns:
- entry point to tag management
-
networkProfiles
Gets entry point to network profiles management.- Returns:
- entry point to network profiles management
-
diskEncryptionSets
Gets entry point to disk encryption sets management.- Returns:
- entry point to disk encryption sets management
-
managedHsms
Gets entry point to Managed Hardware Security Module management.- Returns:
- entry point to Managed Hardware Security Module management
-