AzureResourceManager Class
- java.
lang. Object - com.
azure. resourcemanager. AzureResourceManager
- com.
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 |
---|---|
Access |
accessManagement()
Gets entry point to authentication and authorization management in Azure. |
Action |
actionGroups()
Gets entry point to managing action groups in Azure. |
Activity |
activityLogs()
Gets entry point to listing activity log events in Azure. |
Alert |
alertRules()
Gets entry point to managing alert |
App |
appServiceCertificateOrders()
Gets entry point to managing certificates orders. |
App |
appServiceCertificates()
Gets entry point to managing certificates. |
App |
appServiceDomains()
Gets entry point to managing domains. |
App |
appServicePlans()
Gets entry point to managing app service plans. |
Application |
applicationGateways()
Gets entry point to managing application gateways. |
Application |
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 Rest |
Autoscale |
autoscaleSettings()
Gets entry point to managing Autoscale Settings in Azure. |
Availability |
availabilitySets()
Gets entry point to managing availability sets. |
Cdn |
cdnProfiles()
Gets entry point to managing cdn manager profiles. |
Compute |
computeSkus()
Gets the compute service SKU management API entry point. |
Compute |
computeUsages()
Gets entry point to managing compute resource usages. |
static Configurable |
configure()
Configures the Azure client. |
Container |
containerGroups()
Gets entry point to managing Azure Container Instances. |
Registries |
containerRegistries()
Gets entry point to managing Container Registries. |
Registry |
containerRegistryTaskRuns()
Gets entry point to managing Container Registry Registry |
Registry |
containerRegistryTasks()
Gets entry point to managing Container Registry Registry |
Cosmos |
cosmosDBAccounts()
Gets entry point to managing Container Regsitries. |
Ddos |
ddosProtectionPlans()
Gets entry point to managing DDoS protection plans. |
Deployments |
deployments()
Gets entry point to managing deployments. |
Diagnostic |
diagnosticSettings()
Gets entry point to listing diagnostic settings in Azure. |
Disk |
diskEncryptionSets()
Gets entry point to disk encryption sets management. |
Disks |
disks()
Gets entry point to managing managed disks. |
Dns |
dnsZones()
Gets entry point to managing DNS zones. |
Event |
eventHubDisasterRecoveryPairings()
Gets entry point to managing event hub namespace geo disaster recovery. |
Event |
eventHubNamespaces()
Gets entry point to managing event hub namespaces. |
Event |
eventHubs()
Gets entry point to managing event hubs. |
Express |
expressRouteCircuits()
Gets entry point to managing express route circuits. |
Express |
expressRouteCrossConnections()
Gets entry point to managing express route cross connections. |
Features |
features()
Gets entry point to managing features. |
Function |
functionApps()
Entry point to managing function apps. |
Galleries |
galleries()
Gets entry point to managing compute galleries. |
Gallery |
galleryImageVersions()
Gets entry point to managing compute gallery image versions. |
Gallery |
galleryImages()
Gets entry point to managing compute gallery images. |
Generic |
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. |
Kubernetes |
kubernetesClusters()
Gets entry point to managing Kubernetes clusters. |
Load |
loadBalancers()
Gets entry point to managing load balancers. |
Local |
localNetworkGateways()
Gets entry point to managing local network gateways. |
Managed |
managedHsms()
Gets entry point to Managed Hardware Security Module management. |
Management |
managementLocks()
Gets entry point to managing locks. |
Metric |
metricDefinitions()
Gets entry point to listing metric definitions in Azure. |
Network |
networkInterfaces()
Gets entry point to managing network interfaces. |
Network |
networkProfiles()
Gets entry point to network profiles management. |
Network |
networkSecurityGroups()
Gets entry point to managing network security groups. |
Network |
networkUsages()
Gets entry point to managing network resource usages. |
Network |
networkWatchers()
Gets entry point to managing network watchers. |
Networks |
networks()
Gets entry point to managing virtual networks. |
Policy |
policyAssignments()
Gets entry point to managing policy assignments. |
Policy |
policyDefinitions()
Gets entry point to managing policy definitions. |
Private |
privateDnsZones()
Gets the private DNS zone management API entry point. |
Private |
privateEndpoints()
Gets entry point to private endpoints management. |
Providers |
providers()
Gets entry point to managing resource providers. |
Public |
publicIpAddresses()
Gets entry point to managing public IP addresses. |
Public |
publicIpPrefixes()
Gets entry point to managing public IP prefixes. |
Redis |
redisCaches()
Gets entry point to managing Redis Caches. |
Resource |
resourceGroups()
Gets entry point to managing resource groups. |
Route |
routeFilters()
Gets entry point to managing route filters. |
Route |
routeTables()
Gets entry point to managing route tables. |
Search |
searchServices()
Gets entry point to managing Search services. |
Service |
serviceBusNamespaces()
Gets entry point to managing Service Bus. |
Snapshots |
snapshots()
Gets entry point to managing managed snapshots. |
Spring |
springServices()
Gets the spring service management API entry point. |
Sql |
sqlServers()
Gets entry point to managing Sql server. |
Storage |
storageAccounts()
Entry point to managing storage accounts |
Blob |
storageBlobContainers()
Entry point to blob container management API. |
Blob |
storageBlobServices()
Gets the blob service management API entry point. |
Management |
storageManagementPolicies()
Gets the blob service management API entry point. |
Storage |
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. |
Tag |
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. |
Traffic |
trafficManagerProfiles()
Gets entry point to managing traffic manager profiles. |
Vaults |
vaults()
Gets entry point to managing key vaults. |
Virtual |
virtualMachineCustomImages()
Gets entry point to managing virtual machine custom images. |
Virtual |
virtualMachineImages()
Gets entry point to managing virtual machine images. |
Virtual |
virtualMachineScaleSets()
Gets entry point to managing virtual machine scale sets. |
Virtual |
virtualMachines()
Entry point to managing virtual machines. |
Virtual |
virtualNetworkGateways()
Gets entry point to managing virtual network gateways. |
Web |
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:
actionGroups
public ActionGroups actionGroups()
Gets entry point to managing action groups in Azure.
Returns:
activityLogs
public ActivityLogs activityLogs()
Gets entry point to listing activity log events in Azure.
Returns:
alertRules
public AlertRules alertRules()
Gets entry point to managing alertRules in Azure.
Returns:
appServiceCertificateOrders
public AppServiceCertificateOrders appServiceCertificateOrders()
Gets entry point to managing certificates orders.
Returns:
appServiceCertificates
public AppServiceCertificates appServiceCertificates()
Gets entry point to managing certificates.
Returns:
appServiceDomains
public AppServiceDomains appServiceDomains()
Gets entry point to managing domains.
Returns:
appServicePlans
public AppServicePlans appServicePlans()
Gets entry point to managing app service plans.
Returns:
applicationGateways
public ApplicationGateways applicationGateways()
Gets entry point to managing application gateways.
Returns:
applicationSecurityGroups
public ApplicationSecurityGroups applicationSecurityGroups()
Gets entry point to managing express route circuits.
Returns:
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:
Returns:
authenticate
public static AzureResourceManager.Authenticated authenticate(HttpPipeline httpPipeline, AzureProfile profile)
Authenticates API access using a RestClient instance.
Parameters:
Returns:
autoscaleSettings
public AutoscaleSettings autoscaleSettings()
Gets entry point to managing Autoscale Settings in Azure.
Returns:
availabilitySets
public AvailabilitySets availabilitySets()
Gets entry point to managing availability sets.
Returns:
cdnProfiles
public CdnProfiles cdnProfiles()
Gets entry point to managing cdn manager profiles.
Returns:
computeSkus
public ComputeSkus computeSkus()
Gets the compute service SKU management API entry point.
Returns:
computeUsages
public ComputeUsages computeUsages()
Gets entry point to managing compute resource usages.
Returns:
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:
containerGroups
public ContainerGroups containerGroups()
Gets entry point to managing Azure Container Instances.
Returns:
containerRegistries
public Registries containerRegistries()
Gets entry point to managing Container Registries.
Returns:
containerRegistryTaskRuns
public RegistryTaskRuns containerRegistryTaskRuns()
Gets entry point to managing Container Registry RegistryTask Runs.
Returns:
containerRegistryTasks
public RegistryTasks containerRegistryTasks()
Gets entry point to managing Container Registry RegistryTasks.
Returns:
cosmosDBAccounts
public CosmosDBAccounts cosmosDBAccounts()
Gets entry point to managing Container Regsitries.
Returns:
ddosProtectionPlans
public DdosProtectionPlans ddosProtectionPlans()
Gets entry point to managing DDoS protection plans.
Returns:
deployments
public Deployments deployments()
Gets entry point to managing deployments.
Returns:
diagnosticSettings
public DiagnosticSettings diagnosticSettings()
Gets entry point to listing diagnostic settings in Azure.
Returns:
diskEncryptionSets
public DiskEncryptionSets diskEncryptionSets()
Gets entry point to disk encryption sets management.
Returns:
disks
public Disks disks()
Gets entry point to managing managed disks.
Returns:
dnsZones
public DnsZones dnsZones()
Gets entry point to managing DNS zones.
Returns:
eventHubDisasterRecoveryPairings
public EventHubDisasterRecoveryPairings eventHubDisasterRecoveryPairings()
Gets entry point to managing event hub namespace geo disaster recovery.
Returns:
eventHubNamespaces
public EventHubNamespaces eventHubNamespaces()
Gets entry point to managing event hub namespaces.
Returns:
eventHubs
public EventHubs eventHubs()
Gets entry point to managing event hubs.
Returns:
expressRouteCircuits
public ExpressRouteCircuits expressRouteCircuits()
Gets entry point to managing express route circuits.
Returns:
expressRouteCrossConnections
public ExpressRouteCrossConnections expressRouteCrossConnections()
Gets entry point to managing express route cross connections.
Returns:
features
public Features features()
Gets entry point to managing features.
Returns:
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:
galleries
public Galleries galleries()
Gets entry point to managing compute galleries.
Returns:
galleryImageVersions
public GalleryImageVersions galleryImageVersions()
Gets entry point to managing compute gallery image versions.
Returns:
galleryImages
public GalleryImages galleryImages()
Gets entry point to managing compute gallery images.
Returns:
genericResources
public GenericResources genericResources()
Gets entry point to managing generic resources.
Returns:
getCurrentSubscription
public Subscription getCurrentSubscription()
Gets the currently selected subscription this client is authenticated to work with.
Returns:
identities
public Identities identities()
Gets entry point to managing Managed Service Identity (MSI) identities.
Returns:
kubernetesClusters
public KubernetesClusters kubernetesClusters()
Gets entry point to managing Kubernetes clusters.
Returns:
loadBalancers
public LoadBalancers loadBalancers()
Gets entry point to managing load balancers.
Returns:
localNetworkGateways
public LocalNetworkGateways localNetworkGateways()
Gets entry point to managing local network gateways.
Returns:
managedHsms
public ManagedHsms managedHsms()
Gets entry point to Managed Hardware Security Module management.
Returns:
managementLocks
public ManagementLocks managementLocks()
Gets entry point to managing locks.
Returns:
metricDefinitions
public MetricDefinitions metricDefinitions()
Gets entry point to listing metric definitions in Azure.
Returns:
networkInterfaces
public NetworkInterfaces networkInterfaces()
Gets entry point to managing network interfaces.
Returns:
networkProfiles
public NetworkProfiles networkProfiles()
Gets entry point to network profiles management.
Returns:
networkSecurityGroups
public NetworkSecurityGroups networkSecurityGroups()
Gets entry point to managing network security groups.
Returns:
networkUsages
public NetworkUsages networkUsages()
Gets entry point to managing network resource usages.
Returns:
networkWatchers
public NetworkWatchers networkWatchers()
Gets entry point to managing network watchers.
Returns:
networks
public Networks networks()
Gets entry point to managing virtual networks.
Returns:
policyAssignments
public PolicyAssignments policyAssignments()
Gets entry point to managing policy assignments.
Returns:
policyDefinitions
public PolicyDefinitions policyDefinitions()
Gets entry point to managing policy definitions.
Returns:
privateDnsZones
public PrivateDnsZones privateDnsZones()
Gets the private DNS zone management API entry point.
Returns:
privateEndpoints
public PrivateEndpoints privateEndpoints()
Gets entry point to private endpoints management.
Returns:
providers
public Providers providers()
Gets entry point to managing resource providers.
Returns:
publicIpAddresses
public PublicIpAddresses publicIpAddresses()
Gets entry point to managing public IP addresses.
Returns:
publicIpPrefixes
public PublicIpPrefixes publicIpPrefixes()
Gets entry point to managing public IP prefixes.
Returns:
redisCaches
public RedisCaches redisCaches()
Gets entry point to managing Redis Caches.
Returns:
resourceGroups
public ResourceGroups resourceGroups()
Gets entry point to managing resource groups.
Returns:
routeFilters
public RouteFilters routeFilters()
Gets entry point to managing route filters.
Returns:
routeTables
public RouteTables routeTables()
Gets entry point to managing route tables.
Returns:
searchServices
public SearchServices searchServices()
Gets entry point to managing Search services.
Returns:
serviceBusNamespaces
public ServiceBusNamespaces serviceBusNamespaces()
Gets entry point to managing Service Bus.
Returns:
snapshots
public Snapshots snapshots()
Gets entry point to managing managed snapshots.
Returns:
springServices
public SpringServices springServices()
Gets the spring service management API entry point.
Returns:
sqlServers
public SqlServers sqlServers()
Gets entry point to managing Sql server.
Returns:
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:
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:
storageBlobServices
public BlobServices storageBlobServices()
Gets the blob service management API entry point.
Returns:
storageManagementPolicies
public ManagementPolicies storageManagementPolicies()
Gets the blob service management API entry point.
Returns:
storageSkus
public StorageSkus storageSkus()
Gets entry point to managing storage service SKUs.
Returns:
storageUsages
public Usages storageUsages()
Gets entry point to managing storage account usages.
Returns:
subscriptionId
public String subscriptionId()
Gets the currently selected subscription ID this client is authenticated to work with.
Returns:
subscriptions
public Subscriptions subscriptions()
Gets entry point to managing subscriptions.
Returns:
tagOperations
public TagOperations tagOperations()
Gets entry point to tag management.
Returns:
tenantId
public String tenantId()
Gets the currently selected tenant ID this client is authenticated to work with.
Returns:
tenants
public Tenants tenants()
Gets entry point to managing tenants.
Returns:
trafficManagerProfiles
public TrafficManagerProfiles trafficManagerProfiles()
Gets entry point to managing traffic manager profiles.
Returns:
vaults
public Vaults vaults()
Gets entry point to managing key vaults.
Returns:
virtualMachineCustomImages
public VirtualMachineCustomImages virtualMachineCustomImages()
Gets entry point to managing virtual machine custom images.
Returns:
virtualMachineImages
public VirtualMachineImages virtualMachineImages()
Gets entry point to managing virtual machine images.
Returns:
virtualMachineScaleSets
public VirtualMachineScaleSets virtualMachineScaleSets()
Gets entry point to managing virtual machine scale sets.
Returns:
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:
virtualNetworkGateways
public VirtualNetworkGateways virtualNetworkGateways()
Gets entry point to managing virtual network gateways.
Returns:
webApps
public WebApps webApps()
Gets entry point to managing web apps.
Returns:
Applies to
Azure SDK for Java