Skip to content

Latest commit

History

579 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Build StatusBuild Status

Azure Management Libraries for Java

This README is based on the released stable version (1.27.2). If you are looking for other releases, see More Information.

The Azure Management Libraries for Java is a higher-level, object-oriented API for managing Azure resources, that is optimized for ease of use, succinctness and consistency.

If you are looking for Java client libraries for consuming (rather than managing) individual Azure services (e.g. storage blob upload, JDBC, messaging, etc), please see https://docs.microsoft.com/en-us/java/azure/java-sdk-azure-install.

Table of contents

Feature Availability and Road Map

🚩 as of Version 1.27.2

Service | featureAvailable as GAAvailable as PreviewComing soon
ComputeVirtual machines and VM extensions
Virtual machine scale sets
Managed disks
Azure container service (AKS) + registry + instances
Availability Zones
More Availability Zones and MSI features
StorageStorage accounts
Encryption (deprecated)
Encryption (Blob)
Encryption (File)
SQL DatabaseDatabases
Firewalls and virtual network
Elastic pools
Import, export, recover and restore dbs
Failover groups and replication links
DNS aliasing and metrics
Sync groups
Encryption protectors
More features
NetworkingVirtual networks
Network interfaces
IP addresses
Routing table
Network security groups
Load balancers
Application gateways
DNS
Traffic managers
Network peering
Virtual Network Gateway
Network watchers
Express Route
Application Security Groups
More application gateway features
More servicesResource Manager
Key Vault
Redis
CDN
Batch
Service bus
Graph RBAC
Web apps
Function Apps
Cosmos DB
Monitor
Batch AI
Search
Event Hub
Data Lake
More Monitor features
Logic Apps
Event Grid
FundamentalsAuthentication - core
Async methods
Managed Service Identity

Preview features are marked with the @Beta annotation at the class or interface or method level in libraries. These features are subject to change. They can be modified in any way, or even removed, in the future.

Code snippets and samples

Azure Authentication

The Azure class is the simplest entry point for creating and interacting with Azure resources.

Azure azure = Azure.authenticate(credFile).withDefaultSubscription();

To learn more about authentication in the Azure Libraries for Java, see AUTH.md.

Virtual Machines

Create a Virtual Machine

You can create a virtual machine instance by using a define() … create() method chain.

System.out.println("Creating a Linux VM");
VirtualMachinelinuxVM = azure.virtualMachines().define("myLinuxVM")
.withRegion(Region.US_EAST)
.withNewResourceGroup(rgName)
.withNewPrimaryNetwork("10.0.0.0/28")
.withPrimaryPrivateIPAddressDynamic()
.withNewPrimaryPublicIPAddress("mylinuxvmdns")
.withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS)
.withRootUsername("tirekicker")
.withSsh(sshKey)
.withSize(VirtualMachineSizeTypes.STANDARD_D3_V2)
.create();
System.out.println("Created a Linux VM: " + linuxVM.id());

Update a Virtual Machine

You can update a virtual machine instance by using an update() … apply() method chain.

linuxVM.update()
.withNewDataDisk(20, lun, CachingTypes.READ_WRITE)
.apply();

Create a Virtual Machine Scale Set

You can create a virtual machine scale set instance by using a define() … create() method chain.

VirtualMachineScaleSetvirtualMachineScaleSet = azure.virtualMachineScaleSets().define(vmssName)
.withRegion(Region.US_EAST)
.withExistingResourceGroup(rgName)
.withSku(VirtualMachineScaleSetSkuTypes.STANDARD_D3_V2)
.withExistingPrimaryNetworkSubnet(network, "Front-end")
.withPrimaryInternetFacingLoadBalancer(loadBalancer1)
.withPrimaryInternetFacingLoadBalancerBackends(backendPoolName1, backendPoolName2)
.withPrimaryInternetFacingLoadBalancerInboundNatPools(natPool50XXto22, natPool60XXto23)
.withoutPrimaryInternalLoadBalancer()
.withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS)
.withRootUsername(userName)
.withSsh(sshKey)
.withNewDataDisk(100)
.withNewDataDisk(100, 1, CachingTypes.READ_WRITE)
.withNewDataDisk(100, 2, CachingTypes.READ_WRITE, StorageAccountTypes.STANDARD_LRS)
.withCapacity(3)
.create();

Ready-to-run code samples for virtual machines

ServiceManagement Scenario
Virtual Machines
Virtual Machines - parallel execution
Virtual Machine Scale Sets

Networking

Create a virtual network

You can create a virtual network by using a define() … create() method chain.

Networknetwork = networks.define("mynetwork")
.withRegion(Region.US_EAST)
.withNewResourceGroup()
.withAddressSpace("10.0.0.0/28")
.withSubnet("subnet1", "10.0.0.0/29")
.withSubnet("subnet2", "10.0.0.8/29")
.create();

Create a network security group

You can create a network security group instance by using a define() … create() method chain.

NetworkSecurityGroupfrontEndNSG = azure.networkSecurityGroups().define(frontEndNSGName)
.withRegion(Region.US_EAST)
.withNewResourceGroup(rgName)
.defineRule("ALLOW-SSH")
.allowInbound()
.fromAnyAddress()
.fromAnyPort()
.toAnyAddress()
.toPort(22)
.withProtocol(SecurityRuleProtocol.TCP)
.withPriority(100)
.withDescription("Allow SSH")
.attach()
.defineRule("ALLOW-HTTP")
.allowInbound()
.fromAnyAddress()
.fromAnyPort()
.toAnyAddress()
.toPort(80)
.withProtocol(SecurityRuleProtocol.TCP)
.withPriority(101)
.withDescription("Allow HTTP")
.attach()
.create();

Create an Application Gateway

You can create a application gateway instance by using a define() … create() method chain.

ApplicationGatewayapplicationGateway = azure.applicationGateways().define("myFirstAppGateway")
.withRegion(Region.US_EAST)
.withExistingResourceGroup(resourceGroup)
// Request routing rule for HTTP from public 80 to public 8080
.defineRequestRoutingRule("HTTP-80-to-8080")
.fromPublicFrontend()
.fromFrontendHttpPort(80)
.toBackendHttpPort(8080)
.toBackendIPAddress("11.1.1.1")
.toBackendIPAddress("11.1.1.2")
.toBackendIPAddress("11.1.1.3")
.toBackendIPAddress("11.1.1.4")
.attach()
.withExistingPublicIPAddress(publicIpAddress)
.create();

Ready-to-run code samples for networking

ServiceManagement Scenario
Networking
DNS
Traffic Manager
Application Gateway
Express Route

Application Services

Create a Web App

You can create a Web App instance by using a define() … create() method chain.

WebAppwebApp = azure.webApps()
.define(appName)
.withRegion(Region.US_WEST)
.withNewResourceGroup(rgName)
.withNewWindowsPlan(PricingTier.STANDARD_S1)
.create();

Ready-to-run code samples for Application Services

ServiceManagement Scenario
Web Apps on Windows
Web Apps on Linux
Functions

Databases and Storage

Create a Cosmos DB with CosmosDB Programming Model

You can create a Cosmos DB account by using a define() … create() method chain.

CosmosAccountcosmosDBAccount = azure.cosmosDBAccounts().define(cosmosDBName)
.withRegion(Region.US_EAST)
.withNewResourceGroup(rgName)
.withKind(DatabaseAccountKind.GLOBAL_DOCUMENT_DB)
.withSessionConsistency()
.withWriteReplication(Region.US_WEST)
.withReadReplication(Region.US_CENTRAL)
.create()

Create a SQL Database

You can create a SQL server instance by using a define() … create() method chain.

SqlServersqlServer = azure.sqlServers().define(sqlServerName)
.withRegion(Region.US_EAST)
.withNewResourceGroup(rgName)
.withAdministratorLogin("adminlogin123")
.withAdministratorPassword("myS3cureP@ssword")
.withNewFirewallRule("10.0.0.1")
.withNewFirewallRule("10.2.0.1", "10.2.0.10")
.create();

Then, you can create a SQL database instance by using a define() … create() method chain.

SqlDatabasedatabase = sqlServer.databases().define("myNewDatabase")
...
.create();

Ready-to-run code samples for databases

ServiceManagement Scenario
Storage
SQL Database
Cosmos DB

Other code samples

ServiceManagement Scenario
Active Directory
Container Service
Container Registry and
Container Instances
Service Bus
Resource Groups
Redis Cache
Key Vault
Monitor
CDN
Batch
Batch AI
Search
Event Hub

Download

Latest stable release

If you are using released builds from 1.27.2, add the following to your POM file:

<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure</artifactId>
<version>1.27.2</version>
</dependency>

Latest snapshots

If you are using snapshots builds for this repo, add the following repository and dependency to your POM file:

 <repositories>
<repository>
<id>ossrh</id>
<name>Sonatype Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<layout>default</layout>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure</artifactId>
<version>1.27.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-client-runtime</artifactId>
<version>1.6.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-client-authentication</artifactId>
<version>1.6.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.microsoft.rest</groupId>
<artifactId>client-runtime</artifactId>
<version>1.6.5-SNAPSHOT</version>
</dependency>

Prerequisites

Upgrading from older versions

If you are migrating your code from 1.27.0 to 1.27.2, you can use these release notes for preparing your code for 1.27.2 from 1.27.0.

In general, Azure Libraries for Java follow semantic versioning, so user code should continue working in a compatible fashion between minor versions of the same major version release train, with the following caveats:

  • methods and types annotated with @Beta are not considered "generally available" and their design and functionality may change arbitrarily (including removal) in any future minor release of the libraries. To help identify such @Beta breaking changes from one minor release to the next and see how to mitigate them, see the above mentioned release notes for each release.

  • occasionally the naming and structure of "fluent" interface definitions (i.e. the ones whose names start with With*) may change between minor versions, as long as that change does not affect the fluent "flow" (the chaining of the methods in a definition or update chain).

  • the *Inner types and their methods may occasionally change their naming and structure between minor versions in breaking ways. User code should generally avoid making a reference to those types though, unless their functionality is not yet exposed by the "fluent" API.

Help and Issues

If you encounter any bugs with these libraries, please file issues via Issues or checkout StackOverflow for Azure Java SDK.

Contribute Code

If you would like to become an active contributor to this project please follow the instructions provided in Microsoft Azure Projects Contribution Guidelines.

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

More Information

Previous Releases and Corresponding Repo Branches

VersionSHA1Remarks
1.27.21.27.2Tagged release for 1.27.2 version of Azure management libraries
1.27.01.27.0Tagged release for 1.27.0 version of Azure management libraries
1.26.01.26.0Tagged release for 1.26.0 version of Azure management libraries
1.25.01.25.0Tagged release for 1.25.0 version of Azure management libraries
1.24.21.24.2Tagged release for 1.24.2 version of Azure management libraries
1.24.11.24.1Tagged release for 1.24.1 version of Azure management libraries
1.24.01.24.0Tagged release for 1.24.0 version of Azure management libraries
1.23.01.23.0Tagged release for 1.23.0 version of Azure management libraries
1.22.01.22.0Tagged release for 1.22.0 version of Azure management libraries
1.21.01.21.0Tagged release for 1.21.0 version of Azure management libraries
1.20.11.20.1Tagged release for 1.20.1 version of Azure management libraries
1.20.01.20.0Tagged release for 1.20.0 version of Azure management libraries
1.19.01.19.0Tagged release for 1.19.0 version of Azure management libraries
1.18.01.18.0Tagged release for 1.18.0 version of Azure management libraries
1.17.01.17.0Tagged release for 1.17.0 version of Azure management libraries
1.16.01.16.0Tagged release for 1.16.0 version of Azure management libraries
1.15.11.15.1Tagged release for 1.15.1 version of Azure management libraries
1.15.01.15.0Tagged release for 1.15.0 version of Azure management libraries
1.14.01.14.0Tagged release for 1.14.0 version of Azure management libraries
1.13.01.13.0Tagged release for 1.13.0 version of Azure management libraries
1.12.01.12.0Tagged release for 1.12.0 version of Azure management libraries
1.11.01.11.0Tagged release for 1.11.0 version of Azure management libraries
1.10.01.10.0Tagged release for 1.10.0 version of Azure management libraries
1.9.01.9.0Tagged release for 1.9.0 version of Azure management libraries
1.8.01.8.0Tagged release for 1.8.0 version of Azure management libraries
1.7.01.7.0Tagged release for 1.7.0 version of Azure management libraries
1.6.01.6.0Tagged release for 1.6.0 version of Azure management libraries
1.5.11.5.1Tagged release for 1.5.1 version of Azure management libraries
1.4.01.4.0Tagged release for 1.4.0 version of Azure management libraries
1.3.01.3.0Tagged release for 1.3.0 version of Azure management libraries
1.2.11.2.1Tagged release for 1.2.1 version of Azure management libraries
1.1.01.1.0Tagged release for 1.1.0 version of Azure management libraries
1.0.01.0.0Tagged release for 1.0.0 version of Azure management libraries
1.0.0-beta51.0.0-beta5Tagged release for 1.0.0-beta5 version of Azure management libraries
1.0.0-beta4.11.0.0-beta4.1Tagged release for 1.0.0-beta4.1 version of Azure management libraries
1.0.0-beta31.0.0-beta3Tagged release for 1.0.0-beta3 version of Azure management libraries
1.0.0-beta21.0.0-beta2Tagged release for 1.0.0-beta2 version of Azure management libraries
1.0.0-beta11.0.0-beta1Maintenance branch for AutoRest generated raw clients
1.0.0-beta1+fixes1.0.0-beta1+fixesStable build for AutoRest generated raw clients
0.9.x-SNAPSHOTS0.9Maintenance branch for service management libraries
0.9.30.9.3Latest release for service management libraries

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

About

Azure Management Libraries for Java

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
GitHub - Azure-Fluent/azure-libraries-for-java: Azure Management Libraries for Java · GitHub
Skip to content

Latest commit

History

579 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Build StatusBuild Status

Azure Management Libraries for Java

This README is based on the released stable version (1.27.2). If you are looking for other releases, see More Information.

The Azure Management Libraries for Java is a higher-level, object-oriented API for managing Azure resources, that is optimized for ease of use, succinctness and consistency.

If you are looking for Java client libraries for consuming (rather than managing) individual Azure services (e.g. storage blob upload, JDBC, messaging, etc), please see https://docs.microsoft.com/en-us/java/azure/java-sdk-azure-install.

Table of contents

Feature Availability and Road Map

🚩 as of Version 1.27.2

Service | featureAvailable as GAAvailable as PreviewComing soon
ComputeVirtual machines and VM extensions
Virtual machine scale sets
Managed disks
Azure container service (AKS) + registry + instances
Availability Zones
More Availability Zones and MSI features
StorageStorage accounts
Encryption (deprecated)
Encryption (Blob)
Encryption (File)
SQL DatabaseDatabases
Firewalls and virtual network
Elastic pools
Import, export, recover and restore dbs
Failover groups and replication links
DNS aliasing and metrics
Sync groups
Encryption protectors
More features
NetworkingVirtual networks
Network interfaces
IP addresses
Routing table
Network security groups
Load balancers
Application gateways
DNS
Traffic managers
Network peering
Virtual Network Gateway
Network watchers
Express Route
Application Security Groups
More application gateway features
More servicesResource Manager
Key Vault
Redis
CDN
Batch
Service bus
Graph RBAC
Web apps
Function Apps
Cosmos DB
Monitor
Batch AI
Search
Event Hub
Data Lake
More Monitor features
Logic Apps
Event Grid
FundamentalsAuthentication - core
Async methods
Managed Service Identity

Preview features are marked with the @Beta annotation at the class or interface or method level in libraries. These features are subject to change. They can be modified in any way, or even removed, in the future.

Code snippets and samples

Azure Authentication

The Azure class is the simplest entry point for creating and interacting with Azure resources.

Azure azure = Azure.authenticate(credFile).withDefaultSubscription();

To learn more about authentication in the Azure Libraries for Java, see AUTH.md.

Virtual Machines

Create a Virtual Machine

You can create a virtual machine instance by using a define() … create() method chain.

System.out.println("Creating a Linux VM");
VirtualMachinelinuxVM = azure.virtualMachines().define("myLinuxVM")
.withRegion(Region.US_EAST)
.withNewResourceGroup(rgName)
.withNewPrimaryNetwork("10.0.0.0/28")
.withPrimaryPrivateIPAddressDynamic()
.withNewPrimaryPublicIPAddress("mylinuxvmdns")
.withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS)
.withRootUsername("tirekicker")
.withSsh(sshKey)
.withSize(VirtualMachineSizeTypes.STANDARD_D3_V2)
.create();
System.out.println("Created a Linux VM: " + linuxVM.id());

Update a Virtual Machine

You can update a virtual machine instance by using an update() … apply() method chain.

linuxVM.update()
.withNewDataDisk(20, lun, CachingTypes.READ_WRITE)
.apply();

Create a Virtual Machine Scale Set

You can create a virtual machine scale set instance by using a define() … create() method chain.

VirtualMachineScaleSetvirtualMachineScaleSet = azure.virtualMachineScaleSets().define(vmssName)
.withRegion(Region.US_EAST)
.withExistingResourceGroup(rgName)
.withSku(VirtualMachineScaleSetSkuTypes.STANDARD_D3_V2)
.withExistingPrimaryNetworkSubnet(network, "Front-end")
.withPrimaryInternetFacingLoadBalancer(loadBalancer1)
.withPrimaryInternetFacingLoadBalancerBackends(backendPoolName1, backendPoolName2)
.withPrimaryInternetFacingLoadBalancerInboundNatPools(natPool50XXto22, natPool60XXto23)
.withoutPrimaryInternalLoadBalancer()
.withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS)
.withRootUsername(userName)
.withSsh(sshKey)
.withNewDataDisk(100)
.withNewDataDisk(100, 1, CachingTypes.READ_WRITE)
.withNewDataDisk(100, 2, CachingTypes.READ_WRITE, StorageAccountTypes.STANDARD_LRS)
.withCapacity(3)
.create();

Ready-to-run code samples for virtual machines

ServiceManagement Scenario
Virtual Machines
Virtual Machines - parallel execution
Virtual Machine Scale Sets

Networking

Create a virtual network

You can create a virtual network by using a define() … create() method chain.

Networknetwork = networks.define("mynetwork")
.withRegion(Region.US_EAST)
.withNewResourceGroup()
.withAddressSpace("10.0.0.0/28")
.withSubnet("subnet1", "10.0.0.0/29")
.withSubnet("subnet2", "10.0.0.8/29")
.create();

Create a network security group

You can create a network security group instance by using a define() … create() method chain.

NetworkSecurityGroupfrontEndNSG = azure.networkSecurityGroups().define(frontEndNSGName)
.withRegion(Region.US_EAST)
.withNewResourceGroup(rgName)
.defineRule("ALLOW-SSH")
.allowInbound()
.fromAnyAddress()
.fromAnyPort()
.toAnyAddress()
.toPort(22)
.withProtocol(SecurityRuleProtocol.TCP)
.withPriority(100)
.withDescription("Allow SSH")
.attach()
.defineRule("ALLOW-HTTP")
.allowInbound()
.fromAnyAddress()
.fromAnyPort()
.toAnyAddress()
.toPort(80)
.withProtocol(SecurityRuleProtocol.TCP)
.withPriority(101)
.withDescription("Allow HTTP")
.attach()
.create();

Create an Application Gateway

You can create a application gateway instance by using a define() … create() method chain.

ApplicationGatewayapplicationGateway = azure.applicationGateways().define("myFirstAppGateway")
.withRegion(Region.US_EAST)
.withExistingResourceGroup(resourceGroup)
// Request routing rule for HTTP from public 80 to public 8080
.defineRequestRoutingRule("HTTP-80-to-8080")
.fromPublicFrontend()
.fromFrontendHttpPort(80)
.toBackendHttpPort(8080)
.toBackendIPAddress("11.1.1.1")
.toBackendIPAddress("11.1.1.2")
.toBackendIPAddress("11.1.1.3")
.toBackendIPAddress("11.1.1.4")
.attach()
.withExistingPublicIPAddress(publicIpAddress)
.create();

Ready-to-run code samples for networking

ServiceManagement Scenario
Networking
DNS
Traffic Manager
Application Gateway
Express Route

Application Services

Create a Web App

You can create a Web App instance by using a define() … create() method chain.

WebAppwebApp = azure.webApps()
.define(appName)
.withRegion(Region.US_WEST)
.withNewResourceGroup(rgName)
.withNewWindowsPlan(PricingTier.STANDARD_S1)
.create();

Ready-to-run code samples for Application Services

ServiceManagement Scenario
Web Apps on Windows
Web Apps on Linux
Functions

Databases and Storage

Create a Cosmos DB with CosmosDB Programming Model

You can create a Cosmos DB account by using a define() … create() method chain.

CosmosAccountcosmosDBAccount = azure.cosmosDBAccounts().define(cosmosDBName)
.withRegion(Region.US_EAST)
.withNewResourceGroup(rgName)
.withKind(DatabaseAccountKind.GLOBAL_DOCUMENT_DB)
.withSessionConsistency()
.withWriteReplication(Region.US_WEST)
.withReadReplication(Region.US_CENTRAL)
.create()

Create a SQL Database

You can create a SQL server instance by using a define() … create() method chain.

SqlServersqlServer = azure.sqlServers().define(sqlServerName)
.withRegion(Region.US_EAST)
.withNewResourceGroup(rgName)
.withAdministratorLogin("adminlogin123")
.withAdministratorPassword("myS3cureP@ssword")
.withNewFirewallRule("10.0.0.1")
.withNewFirewallRule("10.2.0.1", "10.2.0.10")
.create();

Then, you can create a SQL database instance by using a define() … create() method chain.

SqlDatabasedatabase = sqlServer.databases().define("myNewDatabase")
...
.create();

Ready-to-run code samples for databases

ServiceManagement Scenario
Storage
SQL Database
Cosmos DB

Other code samples

ServiceManagement Scenario
Active Directory
Container Service
Container Registry and
Container Instances
Service Bus
Resource Groups
Redis Cache
Key Vault
Monitor
CDN
Batch
Batch AI
Search
Event Hub

Download

Latest stable release

If you are using released builds from 1.27.2, add the following to your POM file:

<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure</artifactId>
<version>1.27.2</version>
</dependency>

Latest snapshots

If you are using snapshots builds for this repo, add the following repository and dependency to your POM file:

 <repositories>
<repository>
<id>ossrh</id>
<name>Sonatype Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<layout>default</layout>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure</artifactId>
<version>1.27.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-client-runtime</artifactId>
<version>1.6.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-client-authentication</artifactId>
<version>1.6.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.microsoft.rest</groupId>
<artifactId>client-runtime</artifactId>
<version>1.6.5-SNAPSHOT</version>
</dependency>

Prerequisites

Upgrading from older versions

If you are migrating your code from 1.27.0 to 1.27.2, you can use these release notes for preparing your code for 1.27.2 from 1.27.0.

In general, Azure Libraries for Java follow semantic versioning, so user code should continue working in a compatible fashion between minor versions of the same major version release train, with the following caveats:

  • methods and types annotated with @Beta are not considered "generally available" and their design and functionality may change arbitrarily (including removal) in any future minor release of the libraries. To help identify such @Beta breaking changes from one minor release to the next and see how to mitigate them, see the above mentioned release notes for each release.

  • occasionally the naming and structure of "fluent" interface definitions (i.e. the ones whose names start with With*) may change between minor versions, as long as that change does not affect the fluent "flow" (the chaining of the methods in a definition or update chain).

  • the *Inner types and their methods may occasionally change their naming and structure between minor versions in breaking ways. User code should generally avoid making a reference to those types though, unless their functionality is not yet exposed by the "fluent" API.

Help and Issues

If you encounter any bugs with these libraries, please file issues via Issues or checkout StackOverflow for Azure Java SDK.

Contribute Code

If you would like to become an active contributor to this project please follow the instructions provided in Microsoft Azure Projects Contribution Guidelines.

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

More Information

Previous Releases and Corresponding Repo Branches

VersionSHA1Remarks
1.27.21.27.2Tagged release for 1.27.2 version of Azure management libraries
1.27.01.27.0Tagged release for 1.27.0 version of Azure management libraries
1.26.01.26.0Tagged release for 1.26.0 version of Azure management libraries
1.25.01.25.0Tagged release for 1.25.0 version of Azure management libraries
1.24.21.24.2Tagged release for 1.24.2 version of Azure management libraries
1.24.11.24.1Tagged release for 1.24.1 version of Azure management libraries
1.24.01.24.0Tagged release for 1.24.0 version of Azure management libraries
1.23.01.23.0Tagged release for 1.23.0 version of Azure management libraries
1.22.01.22.0Tagged release for 1.22.0 version of Azure management libraries
1.21.01.21.0Tagged release for 1.21.0 version of Azure management libraries
1.20.11.20.1Tagged release for 1.20.1 version of Azure management libraries
1.20.01.20.0Tagged release for 1.20.0 version of Azure management libraries
1.19.01.19.0Tagged release for 1.19.0 version of Azure management libraries
1.18.01.18.0Tagged release for 1.18.0 version of Azure management libraries
1.17.01.17.0Tagged release for 1.17.0 version of Azure management libraries
1.16.01.16.0Tagged release for 1.16.0 version of Azure management libraries
1.15.11.15.1Tagged release for 1.15.1 version of Azure management libraries
1.15.01.15.0Tagged release for 1.15.0 version of Azure management libraries
1.14.01.14.0Tagged release for 1.14.0 version of Azure management libraries
1.13.01.13.0Tagged release for 1.13.0 version of Azure management libraries
1.12.01.12.0Tagged release for 1.12.0 version of Azure management libraries
1.11.01.11.0Tagged release for 1.11.0 version of Azure management libraries
1.10.01.10.0Tagged release for 1.10.0 version of Azure management libraries
1.9.01.9.0Tagged release for 1.9.0 version of Azure management libraries
1.8.01.8.0Tagged release for 1.8.0 version of Azure management libraries
1.7.01.7.0Tagged release for 1.7.0 version of Azure management libraries
1.6.01.6.0Tagged release for 1.6.0 version of Azure management libraries
1.5.11.5.1Tagged release for 1.5.1 version of Azure management libraries
1.4.01.4.0Tagged release for 1.4.0 version of Azure management libraries
1.3.01.3.0Tagged release for 1.3.0 version of Azure management libraries
1.2.11.2.1Tagged release for 1.2.1 version of Azure management libraries
1.1.01.1.0Tagged release for 1.1.0 version of Azure management libraries
1.0.01.0.0Tagged release for 1.0.0 version of Azure management libraries
1.0.0-beta51.0.0-beta5Tagged release for 1.0.0-beta5 version of Azure management libraries
1.0.0-beta4.11.0.0-beta4.1Tagged release for 1.0.0-beta4.1 version of Azure management libraries
1.0.0-beta31.0.0-beta3Tagged release for 1.0.0-beta3 version of Azure management libraries
1.0.0-beta21.0.0-beta2Tagged release for 1.0.0-beta2 version of Azure management libraries
1.0.0-beta11.0.0-beta1Maintenance branch for AutoRest generated raw clients
1.0.0-beta1+fixes1.0.0-beta1+fixesStable build for AutoRest generated raw clients
0.9.x-SNAPSHOTS0.9Maintenance branch for service management libraries
0.9.30.9.3Latest release for service management libraries

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

About

Azure Management Libraries for Java

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - Azure-Fluent/azure-libraries-for-java: Azure Management Libraries for Java · GitHub
Skip to content

Latest commit

History

579 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Build StatusBuild Status

Azure Management Libraries for Java

This README is based on the released stable version (1.27.2). If you are looking for other releases, see More Information.

The Azure Management Libraries for Java is a higher-level, object-oriented API for managing Azure resources, that is optimized for ease of use, succinctness and consistency.

If you are looking for Java client libraries for consuming (rather than managing) individual Azure services (e.g. storage blob upload, JDBC, messaging, etc), please see https://docs.microsoft.com/en-us/java/azure/java-sdk-azure-install.

Table of contents

Feature Availability and Road Map

🚩 as of Version 1.27.2

Service | featureAvailable as GAAvailable as PreviewComing soon
ComputeVirtual machines and VM extensions
Virtual machine scale sets
Managed disks
Azure container service (AKS) + registry + instances
Availability Zones
More Availability Zones and MSI features
StorageStorage accounts
Encryption (deprecated)
Encryption (Blob)
Encryption (File)
SQL DatabaseDatabases
Firewalls and virtual network
Elastic pools
Import, export, recover and restore dbs
Failover groups and replication links
DNS aliasing and metrics
Sync groups
Encryption protectors
More features
NetworkingVirtual networks
Network interfaces
IP addresses
Routing table
Network security groups
Load balancers
Application gateways
DNS
Traffic managers
Network peering
Virtual Network Gateway
Network watchers
Express Route
Application Security Groups
More application gateway features
More servicesResource Manager
Key Vault
Redis
CDN
Batch
Service bus
Graph RBAC
Web apps
Function Apps
Cosmos DB
Monitor
Batch AI
Search
Event Hub
Data Lake
More Monitor features
Logic Apps
Event Grid
FundamentalsAuthentication - core
Async methods
Managed Service Identity

Preview features are marked with the @Beta annotation at the class or interface or method level in libraries. These features are subject to change. They can be modified in any way, or even removed, in the future.

Code snippets and samples

Azure Authentication

The Azure class is the simplest entry point for creating and interacting with Azure resources.

Azure azure = Azure.authenticate(credFile).withDefaultSubscription();

To learn more about authentication in the Azure Libraries for Java, see AUTH.md.

Virtual Machines

Create a Virtual Machine

You can create a virtual machine instance by using a define() … create() method chain.

System.out.println("Creating a Linux VM");
VirtualMachinelinuxVM = azure.virtualMachines().define("myLinuxVM")
.withRegion(Region.US_EAST)
.withNewResourceGroup(rgName)
.withNewPrimaryNetwork("10.0.0.0/28")
.withPrimaryPrivateIPAddressDynamic()
.withNewPrimaryPublicIPAddress("mylinuxvmdns")
.withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS)
.withRootUsername("tirekicker")
.withSsh(sshKey)
.withSize(VirtualMachineSizeTypes.STANDARD_D3_V2)
.create();
System.out.println("Created a Linux VM: " + linuxVM.id());

Update a Virtual Machine

You can update a virtual machine instance by using an update() … apply() method chain.

linuxVM.update()
.withNewDataDisk(20, lun, CachingTypes.READ_WRITE)
.apply();

Create a Virtual Machine Scale Set

You can create a virtual machine scale set instance by using a define() … create() method chain.

VirtualMachineScaleSetvirtualMachineScaleSet = azure.virtualMachineScaleSets().define(vmssName)
.withRegion(Region.US_EAST)
.withExistingResourceGroup(rgName)
.withSku(VirtualMachineScaleSetSkuTypes.STANDARD_D3_V2)
.withExistingPrimaryNetworkSubnet(network, "Front-end")
.withPrimaryInternetFacingLoadBalancer(loadBalancer1)
.withPrimaryInternetFacingLoadBalancerBackends(backendPoolName1, backendPoolName2)
.withPrimaryInternetFacingLoadBalancerInboundNatPools(natPool50XXto22, natPool60XXto23)
.withoutPrimaryInternalLoadBalancer()
.withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS)
.withRootUsername(userName)
.withSsh(sshKey)
.withNewDataDisk(100)
.withNewDataDisk(100, 1, CachingTypes.READ_WRITE)
.withNewDataDisk(100, 2, CachingTypes.READ_WRITE, StorageAccountTypes.STANDARD_LRS)
.withCapacity(3)
.create();

Ready-to-run code samples for virtual machines

ServiceManagement Scenario
Virtual Machines
Virtual Machines - parallel execution
Virtual Machine Scale Sets

Networking

Create a virtual network

You can create a virtual network by using a define() … create() method chain.

Networknetwork = networks.define("mynetwork")
.withRegion(Region.US_EAST)
.withNewResourceGroup()
.withAddressSpace("10.0.0.0/28")
.withSubnet("subnet1", "10.0.0.0/29")
.withSubnet("subnet2", "10.0.0.8/29")
.create();

Create a network security group

You can create a network security group instance by using a define() … create() method chain.

NetworkSecurityGroupfrontEndNSG = azure.networkSecurityGroups().define(frontEndNSGName)
.withRegion(Region.US_EAST)
.withNewResourceGroup(rgName)
.defineRule("ALLOW-SSH")
.allowInbound()
.fromAnyAddress()
.fromAnyPort()
.toAnyAddress()
.toPort(22)
.withProtocol(SecurityRuleProtocol.TCP)
.withPriority(100)
.withDescription("Allow SSH")
.attach()
.defineRule("ALLOW-HTTP")
.allowInbound()
.fromAnyAddress()
.fromAnyPort()
.toAnyAddress()
.toPort(80)
.withProtocol(SecurityRuleProtocol.TCP)
.withPriority(101)
.withDescription("Allow HTTP")
.attach()
.create();

Create an Application Gateway

You can create a application gateway instance by using a define() … create() method chain.

ApplicationGatewayapplicationGateway = azure.applicationGateways().define("myFirstAppGateway")
.withRegion(Region.US_EAST)
.withExistingResourceGroup(resourceGroup)
// Request routing rule for HTTP from public 80 to public 8080
.defineRequestRoutingRule("HTTP-80-to-8080")
.fromPublicFrontend()
.fromFrontendHttpPort(80)
.toBackendHttpPort(8080)
.toBackendIPAddress("11.1.1.1")
.toBackendIPAddress("11.1.1.2")
.toBackendIPAddress("11.1.1.3")
.toBackendIPAddress("11.1.1.4")
.attach()
.withExistingPublicIPAddress(publicIpAddress)
.create();

Ready-to-run code samples for networking

ServiceManagement Scenario
Networking
DNS
Traffic Manager
Application Gateway
Express Route

Application Services

Create a Web App

You can create a Web App instance by using a define() … create() method chain.

WebAppwebApp = azure.webApps()
.define(appName)
.withRegion(Region.US_WEST)
.withNewResourceGroup(rgName)
.withNewWindowsPlan(PricingTier.STANDARD_S1)
.create();

Ready-to-run code samples for Application Services

ServiceManagement Scenario
Web Apps on Windows
Web Apps on Linux
Functions

Databases and Storage

Create a Cosmos DB with CosmosDB Programming Model

You can create a Cosmos DB account by using a define() … create() method chain.

CosmosAccountcosmosDBAccount = azure.cosmosDBAccounts().define(cosmosDBName)
.withRegion(Region.US_EAST)
.withNewResourceGroup(rgName)
.withKind(DatabaseAccountKind.GLOBAL_DOCUMENT_DB)
.withSessionConsistency()
.withWriteReplication(Region.US_WEST)
.withReadReplication(Region.US_CENTRAL)
.create()

Create a SQL Database

You can create a SQL server instance by using a define() … create() method chain.

SqlServersqlServer = azure.sqlServers().define(sqlServerName)
.withRegion(Region.US_EAST)
.withNewResourceGroup(rgName)
.withAdministratorLogin("adminlogin123")
.withAdministratorPassword("myS3cureP@ssword")
.withNewFirewallRule("10.0.0.1")
.withNewFirewallRule("10.2.0.1", "10.2.0.10")
.create();

Then, you can create a SQL database instance by using a define() … create() method chain.

SqlDatabasedatabase = sqlServer.databases().define("myNewDatabase")
...
.create();

Ready-to-run code samples for databases

ServiceManagement Scenario
Storage
SQL Database
Cosmos DB

Other code samples

ServiceManagement Scenario
Active Directory
Container Service
Container Registry and
Container Instances
Service Bus
Resource Groups
Redis Cache
Key Vault
Monitor
CDN
Batch
Batch AI
Search
Event Hub

Download

Latest stable release

If you are using released builds from 1.27.2, add the following to your POM file:

<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure</artifactId>
<version>1.27.2</version>
</dependency>

Latest snapshots

If you are using snapshots builds for this repo, add the following repository and dependency to your POM file:

 <repositories>
<repository>
<id>ossrh</id>
<name>Sonatype Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<layout>default</layout>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure</artifactId>
<version>1.27.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-client-runtime</artifactId>
<version>1.6.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-client-authentication</artifactId>
<version>1.6.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.microsoft.rest</groupId>
<artifactId>client-runtime</artifactId>
<version>1.6.5-SNAPSHOT</version>
</dependency>

Prerequisites

Upgrading from older versions

If you are migrating your code from 1.27.0 to 1.27.2, you can use these release notes for preparing your code for 1.27.2 from 1.27.0.

In general, Azure Libraries for Java follow semantic versioning, so user code should continue working in a compatible fashion between minor versions of the same major version release train, with the following caveats:

  • methods and types annotated with @Beta are not considered "generally available" and their design and functionality may change arbitrarily (including removal) in any future minor release of the libraries. To help identify such @Beta breaking changes from one minor release to the next and see how to mitigate them, see the above mentioned release notes for each release.

  • occasionally the naming and structure of "fluent" interface definitions (i.e. the ones whose names start with With*) may change between minor versions, as long as that change does not affect the fluent "flow" (the chaining of the methods in a definition or update chain).

  • the *Inner types and their methods may occasionally change their naming and structure between minor versions in breaking ways. User code should generally avoid making a reference to those types though, unless their functionality is not yet exposed by the "fluent" API.

Help and Issues

If you encounter any bugs with these libraries, please file issues via Issues or checkout StackOverflow for Azure Java SDK.

Contribute Code

If you would like to become an active contributor to this project please follow the instructions provided in Microsoft Azure Projects Contribution Guidelines.

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

More Information

Previous Releases and Corresponding Repo Branches

VersionSHA1Remarks
1.27.21.27.2Tagged release for 1.27.2 version of Azure management libraries
1.27.01.27.0Tagged release for 1.27.0 version of Azure management libraries
1.26.01.26.0Tagged release for 1.26.0 version of Azure management libraries
1.25.01.25.0Tagged release for 1.25.0 version of Azure management libraries
1.24.21.24.2Tagged release for 1.24.2 version of Azure management libraries
1.24.11.24.1Tagged release for 1.24.1 version of Azure management libraries
1.24.01.24.0Tagged release for 1.24.0 version of Azure management libraries
1.23.01.23.0Tagged release for 1.23.0 version of Azure management libraries
1.22.01.22.0Tagged release for 1.22.0 version of Azure management libraries
1.21.01.21.0Tagged release for 1.21.0 version of Azure management libraries
1.20.11.20.1Tagged release for 1.20.1 version of Azure management libraries
1.20.01.20.0Tagged release for 1.20.0 version of Azure management libraries
1.19.01.19.0Tagged release for 1.19.0 version of Azure management libraries
1.18.01.18.0Tagged release for 1.18.0 version of Azure management libraries
1.17.01.17.0Tagged release for 1.17.0 version of Azure management libraries
1.16.01.16.0Tagged release for 1.16.0 version of Azure management libraries
1.15.11.15.1Tagged release for 1.15.1 version of Azure management libraries
1.15.01.15.0Tagged release for 1.15.0 version of Azure management libraries
1.14.01.14.0Tagged release for 1.14.0 version of Azure management libraries
1.13.01.13.0Tagged release for 1.13.0 version of Azure management libraries
1.12.01.12.0Tagged release for 1.12.0 version of Azure management libraries
1.11.01.11.0Tagged release for 1.11.0 version of Azure management libraries
1.10.01.10.0Tagged release for 1.10.0 version of Azure management libraries
1.9.01.9.0Tagged release for 1.9.0 version of Azure management libraries
1.8.01.8.0Tagged release for 1.8.0 version of Azure management libraries
1.7.01.7.0Tagged release for 1.7.0 version of Azure management libraries
1.6.01.6.0Tagged release for 1.6.0 version of Azure management libraries
1.5.11.5.1Tagged release for 1.5.1 version of Azure management libraries
1.4.01.4.0Tagged release for 1.4.0 version of Azure management libraries
1.3.01.3.0Tagged release for 1.3.0 version of Azure management libraries
1.2.11.2.1Tagged release for 1.2.1 version of Azure management libraries
1.1.01.1.0Tagged release for 1.1.0 version of Azure management libraries
1.0.01.0.0Tagged release for 1.0.0 version of Azure management libraries
1.0.0-beta51.0.0-beta5Tagged release for 1.0.0-beta5 version of Azure management libraries
1.0.0-beta4.11.0.0-beta4.1Tagged release for 1.0.0-beta4.1 version of Azure management libraries
1.0.0-beta31.0.0-beta3Tagged release for 1.0.0-beta3 version of Azure management libraries
1.0.0-beta21.0.0-beta2Tagged release for 1.0.0-beta2 version of Azure management libraries
1.0.0-beta11.0.0-beta1Maintenance branch for AutoRest generated raw clients
1.0.0-beta1+fixes1.0.0-beta1+fixesStable build for AutoRest generated raw clients
0.9.x-SNAPSHOTS0.9Maintenance branch for service management libraries
0.9.30.9.3Latest release for service management libraries

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

About

Azure Management Libraries for Java

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - Azure-Fluent/azure-libraries-for-java: Azure Management Libraries for Java · GitHub
Skip to content

Latest commit

History

579 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Build StatusBuild Status

Azure Management Libraries for Java

This README is based on the released stable version (1.27.2). If you are looking for other releases, see More Information.

The Azure Management Libraries for Java is a higher-level, object-oriented API for managing Azure resources, that is optimized for ease of use, succinctness and consistency.

If you are looking for Java client libraries for consuming (rather than managing) individual Azure services (e.g. storage blob upload, JDBC, messaging, etc), please see https://docs.microsoft.com/en-us/java/azure/java-sdk-azure-install.

Table of contents

Feature Availability and Road Map

🚩 as of Version 1.27.2

Service | featureAvailable as GAAvailable as PreviewComing soon
ComputeVirtual machines and VM extensions
Virtual machine scale sets
Managed disks
Azure container service (AKS) + registry + instances
Availability Zones
More Availability Zones and MSI features
StorageStorage accounts
Encryption (deprecated)
Encryption (Blob)
Encryption (File)
SQL DatabaseDatabases
Firewalls and virtual network
Elastic pools
Import, export, recover and restore dbs
Failover groups and replication links
DNS aliasing and metrics
Sync groups
Encryption protectors
More features
NetworkingVirtual networks
Network interfaces
IP addresses
Routing table
Network security groups
Load balancers
Application gateways
DNS
Traffic managers
Network peering
Virtual Network Gateway
Network watchers
Express Route
Application Security Groups
More application gateway features
More servicesResource Manager
Key Vault
Redis
CDN
Batch
Service bus
Graph RBAC
Web apps
Function Apps
Cosmos DB
Monitor
Batch AI
Search
Event Hub
Data Lake
More Monitor features
Logic Apps
Event Grid
FundamentalsAuthentication - core
Async methods
Managed Service Identity

Preview features are marked with the @Beta annotation at the class or interface or method level in libraries. These features are subject to change. They can be modified in any way, or even removed, in the future.

Code snippets and samples

Azure Authentication

The Azure class is the simplest entry point for creating and interacting with Azure resources.

Azure azure = Azure.authenticate(credFile).withDefaultSubscription();

To learn more about authentication in the Azure Libraries for Java, see AUTH.md.

Virtual Machines

Create a Virtual Machine

You can create a virtual machine instance by using a define() … create() method chain.

System.out.println("Creating a Linux VM");
VirtualMachinelinuxVM = azure.virtualMachines().define("myLinuxVM")
.withRegion(Region.US_EAST)
.withNewResourceGroup(rgName)
.withNewPrimaryNetwork("10.0.0.0/28")
.withPrimaryPrivateIPAddressDynamic()
.withNewPrimaryPublicIPAddress("mylinuxvmdns")
.withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS)
.withRootUsername("tirekicker")
.withSsh(sshKey)
.withSize(VirtualMachineSizeTypes.STANDARD_D3_V2)
.create();
System.out.println("Created a Linux VM: " + linuxVM.id());

Update a Virtual Machine

You can update a virtual machine instance by using an update() … apply() method chain.

linuxVM.update()
.withNewDataDisk(20, lun, CachingTypes.READ_WRITE)
.apply();

Create a Virtual Machine Scale Set

You can create a virtual machine scale set instance by using a define() … create() method chain.

VirtualMachineScaleSetvirtualMachineScaleSet = azure.virtualMachineScaleSets().define(vmssName)
.withRegion(Region.US_EAST)
.withExistingResourceGroup(rgName)
.withSku(VirtualMachineScaleSetSkuTypes.STANDARD_D3_V2)
.withExistingPrimaryNetworkSubnet(network, "Front-end")
.withPrimaryInternetFacingLoadBalancer(loadBalancer1)
.withPrimaryInternetFacingLoadBalancerBackends(backendPoolName1, backendPoolName2)
.withPrimaryInternetFacingLoadBalancerInboundNatPools(natPool50XXto22, natPool60XXto23)
.withoutPrimaryInternalLoadBalancer()
.withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS)
.withRootUsername(userName)
.withSsh(sshKey)
.withNewDataDisk(100)
.withNewDataDisk(100, 1, CachingTypes.READ_WRITE)
.withNewDataDisk(100, 2, CachingTypes.READ_WRITE, StorageAccountTypes.STANDARD_LRS)
.withCapacity(3)
.create();

Ready-to-run code samples for virtual machines

ServiceManagement Scenario
Virtual Machines
Virtual Machines - parallel execution
Virtual Machine Scale Sets

Networking

Create a virtual network

You can create a virtual network by using a define() … create() method chain.

Networknetwork = networks.define("mynetwork")
.withRegion(Region.US_EAST)
.withNewResourceGroup()
.withAddressSpace("10.0.0.0/28")
.withSubnet("subnet1", "10.0.0.0/29")
.withSubnet("subnet2", "10.0.0.8/29")
.create();

Create a network security group

You can create a network security group instance by using a define() … create() method chain.

NetworkSecurityGroupfrontEndNSG = azure.networkSecurityGroups().define(frontEndNSGName)
.withRegion(Region.US_EAST)
.withNewResourceGroup(rgName)
.defineRule("ALLOW-SSH")
.allowInbound()
.fromAnyAddress()
.fromAnyPort()
.toAnyAddress()
.toPort(22)
.withProtocol(SecurityRuleProtocol.TCP)
.withPriority(100)
.withDescription("Allow SSH")
.attach()
.defineRule("ALLOW-HTTP")
.allowInbound()
.fromAnyAddress()
.fromAnyPort()
.toAnyAddress()
.toPort(80)
.withProtocol(SecurityRuleProtocol.TCP)
.withPriority(101)
.withDescription("Allow HTTP")
.attach()
.create();

Create an Application Gateway

You can create a application gateway instance by using a define() … create() method chain.

ApplicationGatewayapplicationGateway = azure.applicationGateways().define("myFirstAppGateway")
.withRegion(Region.US_EAST)
.withExistingResourceGroup(resourceGroup)
// Request routing rule for HTTP from public 80 to public 8080
.defineRequestRoutingRule("HTTP-80-to-8080")
.fromPublicFrontend()
.fromFrontendHttpPort(80)
.toBackendHttpPort(8080)
.toBackendIPAddress("11.1.1.1")
.toBackendIPAddress("11.1.1.2")
.toBackendIPAddress("11.1.1.3")
.toBackendIPAddress("11.1.1.4")
.attach()
.withExistingPublicIPAddress(publicIpAddress)
.create();

Ready-to-run code samples for networking

ServiceManagement Scenario
Networking
DNS
Traffic Manager
Application Gateway
Express Route

Application Services

Create a Web App

You can create a Web App instance by using a define() … create() method chain.

WebAppwebApp = azure.webApps()
.define(appName)
.withRegion(Region.US_WEST)
.withNewResourceGroup(rgName)
.withNewWindowsPlan(PricingTier.STANDARD_S1)
.create();

Ready-to-run code samples for Application Services

ServiceManagement Scenario
Web Apps on Windows
Web Apps on Linux
Functions

Databases and Storage

Create a Cosmos DB with CosmosDB Programming Model

You can create a Cosmos DB account by using a define() … create() method chain.

CosmosAccountcosmosDBAccount = azure.cosmosDBAccounts().define(cosmosDBName)
.withRegion(Region.US_EAST)
.withNewResourceGroup(rgName)
.withKind(DatabaseAccountKind.GLOBAL_DOCUMENT_DB)
.withSessionConsistency()
.withWriteReplication(Region.US_WEST)
.withReadReplication(Region.US_CENTRAL)
.create()

Create a SQL Database

You can create a SQL server instance by using a define() … create() method chain.

SqlServersqlServer = azure.sqlServers().define(sqlServerName)
.withRegion(Region.US_EAST)
.withNewResourceGroup(rgName)
.withAdministratorLogin("adminlogin123")
.withAdministratorPassword("myS3cureP@ssword")
.withNewFirewallRule("10.0.0.1")
.withNewFirewallRule("10.2.0.1", "10.2.0.10")
.create();

Then, you can create a SQL database instance by using a define() … create() method chain.

SqlDatabasedatabase = sqlServer.databases().define("myNewDatabase")
...
.create();

Ready-to-run code samples for databases

ServiceManagement Scenario
Storage
SQL Database
Cosmos DB

Other code samples

ServiceManagement Scenario
Active Directory
Container Service
Container Registry and
Container Instances
Service Bus
Resource Groups
Redis Cache
Key Vault
Monitor
CDN
Batch
Batch AI
Search
Event Hub

Download

Latest stable release

If you are using released builds from 1.27.2, add the following to your POM file:

<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure</artifactId>
<version>1.27.2</version>
</dependency>

Latest snapshots

If you are using snapshots builds for this repo, add the following repository and dependency to your POM file:

 <repositories>
<repository>
<id>ossrh</id>
<name>Sonatype Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<layout>default</layout>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure</artifactId>
<version>1.27.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-client-runtime</artifactId>
<version>1.6.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-client-authentication</artifactId>
<version>1.6.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.microsoft.rest</groupId>
<artifactId>client-runtime</artifactId>
<version>1.6.5-SNAPSHOT</version>
</dependency>

Prerequisites

Upgrading from older versions

If you are migrating your code from 1.27.0 to 1.27.2, you can use these release notes for preparing your code for 1.27.2 from 1.27.0.

In general, Azure Libraries for Java follow semantic versioning, so user code should continue working in a compatible fashion between minor versions of the same major version release train, with the following caveats:

  • methods and types annotated with @Beta are not considered "generally available" and their design and functionality may change arbitrarily (including removal) in any future minor release of the libraries. To help identify such @Beta breaking changes from one minor release to the next and see how to mitigate them, see the above mentioned release notes for each release.

  • occasionally the naming and structure of "fluent" interface definitions (i.e. the ones whose names start with With*) may change between minor versions, as long as that change does not affect the fluent "flow" (the chaining of the methods in a definition or update chain).

  • the *Inner types and their methods may occasionally change their naming and structure between minor versions in breaking ways. User code should generally avoid making a reference to those types though, unless their functionality is not yet exposed by the "fluent" API.

Help and Issues

If you encounter any bugs with these libraries, please file issues via Issues or checkout StackOverflow for Azure Java SDK.

Contribute Code

If you would like to become an active contributor to this project please follow the instructions provided in Microsoft Azure Projects Contribution Guidelines.

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

More Information

Previous Releases and Corresponding Repo Branches

VersionSHA1Remarks
1.27.21.27.2Tagged release for 1.27.2 version of Azure management libraries
1.27.01.27.0Tagged release for 1.27.0 version of Azure management libraries
1.26.01.26.0Tagged release for 1.26.0 version of Azure management libraries
1.25.01.25.0Tagged release for 1.25.0 version of Azure management libraries
1.24.21.24.2Tagged release for 1.24.2 version of Azure management libraries
1.24.11.24.1Tagged release for 1.24.1 version of Azure management libraries
1.24.01.24.0Tagged release for 1.24.0 version of Azure management libraries
1.23.01.23.0Tagged release for 1.23.0 version of Azure management libraries
1.22.01.22.0Tagged release for 1.22.0 version of Azure management libraries
1.21.01.21.0Tagged release for 1.21.0 version of Azure management libraries
1.20.11.20.1Tagged release for 1.20.1 version of Azure management libraries
1.20.01.20.0Tagged release for 1.20.0 version of Azure management libraries
1.19.01.19.0Tagged release for 1.19.0 version of Azure management libraries
1.18.01.18.0Tagged release for 1.18.0 version of Azure management libraries
1.17.01.17.0Tagged release for 1.17.0 version of Azure management libraries
1.16.01.16.0Tagged release for 1.16.0 version of Azure management libraries
1.15.11.15.1Tagged release for 1.15.1 version of Azure management libraries
1.15.01.15.0Tagged release for 1.15.0 version of Azure management libraries
1.14.01.14.0Tagged release for 1.14.0 version of Azure management libraries
1.13.01.13.0Tagged release for 1.13.0 version of Azure management libraries
1.12.01.12.0Tagged release for 1.12.0 version of Azure management libraries
1.11.01.11.0Tagged release for 1.11.0 version of Azure management libraries
1.10.01.10.0Tagged release for 1.10.0 version of Azure management libraries
1.9.01.9.0Tagged release for 1.9.0 version of Azure management libraries
1.8.01.8.0Tagged release for 1.8.0 version of Azure management libraries
1.7.01.7.0Tagged release for 1.7.0 version of Azure management libraries
1.6.01.6.0Tagged release for 1.6.0 version of Azure management libraries
1.5.11.5.1Tagged release for 1.5.1 version of Azure management libraries
1.4.01.4.0Tagged release for 1.4.0 version of Azure management libraries
1.3.01.3.0Tagged release for 1.3.0 version of Azure management libraries
1.2.11.2.1Tagged release for 1.2.1 version of Azure management libraries
1.1.01.1.0Tagged release for 1.1.0 version of Azure management libraries
1.0.01.0.0Tagged release for 1.0.0 version of Azure management libraries
1.0.0-beta51.0.0-beta5Tagged release for 1.0.0-beta5 version of Azure management libraries
1.0.0-beta4.11.0.0-beta4.1Tagged release for 1.0.0-beta4.1 version of Azure management libraries
1.0.0-beta31.0.0-beta3Tagged release for 1.0.0-beta3 version of Azure management libraries
1.0.0-beta21.0.0-beta2Tagged release for 1.0.0-beta2 version of Azure management libraries
1.0.0-beta11.0.0-beta1Maintenance branch for AutoRest generated raw clients
1.0.0-beta1+fixes1.0.0-beta1+fixesStable build for AutoRest generated raw clients
0.9.x-SNAPSHOTS0.9Maintenance branch for service management libraries
0.9.30.9.3Latest release for service management libraries

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

About

Azure Management Libraries for Java

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' GitHub - Azure-Fluent/azure-libraries-for-java: Azure Management Libraries for Java · GitHub
Skip to content

Latest commit

History

579 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Build StatusBuild Status

Azure Management Libraries for Java

This README is based on the released stable version (1.27.2). If you are looking for other releases, see More Information.

The Azure Management Libraries for Java is a higher-level, object-oriented API for managing Azure resources, that is optimized for ease of use, succinctness and consistency.

If you are looking for Java client libraries for consuming (rather than managing) individual Azure services (e.g. storage blob upload, JDBC, messaging, etc), please see https://docs.microsoft.com/en-us/java/azure/java-sdk-azure-install.

Table of contents

Feature Availability and Road Map

🚩 as of Version 1.27.2

Service | featureAvailable as GAAvailable as PreviewComing soon
ComputeVirtual machines and VM extensions
Virtual machine scale sets
Managed disks
Azure container service (AKS) + registry + instances
Availability Zones
More Availability Zones and MSI features
StorageStorage accounts
Encryption (deprecated)
Encryption (Blob)
Encryption (File)
SQL DatabaseDatabases
Firewalls and virtual network
Elastic pools
Import, export, recover and restore dbs
Failover groups and replication links
DNS aliasing and metrics
Sync groups
Encryption protectors
More features
NetworkingVirtual networks
Network interfaces
IP addresses
Routing table
Network security groups
Load balancers
Application gateways
DNS
Traffic managers
Network peering
Virtual Network Gateway
Network watchers
Express Route
Application Security Groups
More application gateway features
More servicesResource Manager
Key Vault
Redis
CDN
Batch
Service bus
Graph RBAC
Web apps
Function Apps
Cosmos DB
Monitor
Batch AI
Search
Event Hub
Data Lake
More Monitor features
Logic Apps
Event Grid
FundamentalsAuthentication - core
Async methods
Managed Service Identity

Preview features are marked with the @Beta annotation at the class or interface or method level in libraries. These features are subject to change. They can be modified in any way, or even removed, in the future.

Code snippets and samples

Azure Authentication

The Azure class is the simplest entry point for creating and interacting with Azure resources.

Azure azure = Azure.authenticate(credFile).withDefaultSubscription();

To learn more about authentication in the Azure Libraries for Java, see AUTH.md.

Virtual Machines

Create a Virtual Machine

You can create a virtual machine instance by using a define() … create() method chain.

System.out.println("Creating a Linux VM");
VirtualMachinelinuxVM = azure.virtualMachines().define("myLinuxVM")
.withRegion(Region.US_EAST)
.withNewResourceGroup(rgName)
.withNewPrimaryNetwork("10.0.0.0/28")
.withPrimaryPrivateIPAddressDynamic()
.withNewPrimaryPublicIPAddress("mylinuxvmdns")
.withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS)
.withRootUsername("tirekicker")
.withSsh(sshKey)
.withSize(VirtualMachineSizeTypes.STANDARD_D3_V2)
.create();
System.out.println("Created a Linux VM: " + linuxVM.id());

Update a Virtual Machine

You can update a virtual machine instance by using an update() … apply() method chain.

linuxVM.update()
.withNewDataDisk(20, lun, CachingTypes.READ_WRITE)
.apply();

Create a Virtual Machine Scale Set

You can create a virtual machine scale set instance by using a define() … create() method chain.

VirtualMachineScaleSetvirtualMachineScaleSet = azure.virtualMachineScaleSets().define(vmssName)
.withRegion(Region.US_EAST)
.withExistingResourceGroup(rgName)
.withSku(VirtualMachineScaleSetSkuTypes.STANDARD_D3_V2)
.withExistingPrimaryNetworkSubnet(network, "Front-end")
.withPrimaryInternetFacingLoadBalancer(loadBalancer1)
.withPrimaryInternetFacingLoadBalancerBackends(backendPoolName1, backendPoolName2)
.withPrimaryInternetFacingLoadBalancerInboundNatPools(natPool50XXto22, natPool60XXto23)
.withoutPrimaryInternalLoadBalancer()
.withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS)
.withRootUsername(userName)
.withSsh(sshKey)
.withNewDataDisk(100)
.withNewDataDisk(100, 1, CachingTypes.READ_WRITE)
.withNewDataDisk(100, 2, CachingTypes.READ_WRITE, StorageAccountTypes.STANDARD_LRS)
.withCapacity(3)
.create();

Ready-to-run code samples for virtual machines

ServiceManagement Scenario
Virtual Machines
Virtual Machines - parallel execution
Virtual Machine Scale Sets

Networking

Create a virtual network

You can create a virtual network by using a define() … create() method chain.

Networknetwork = networks.define("mynetwork")
.withRegion(Region.US_EAST)
.withNewResourceGroup()
.withAddressSpace("10.0.0.0/28")
.withSubnet("subnet1", "10.0.0.0/29")
.withSubnet("subnet2", "10.0.0.8/29")
.create();

Create a network security group

You can create a network security group instance by using a define() … create() method chain.

NetworkSecurityGroupfrontEndNSG = azure.networkSecurityGroups().define(frontEndNSGName)
.withRegion(Region.US_EAST)
.withNewResourceGroup(rgName)
.defineRule("ALLOW-SSH")
.allowInbound()
.fromAnyAddress()
.fromAnyPort()
.toAnyAddress()
.toPort(22)
.withProtocol(SecurityRuleProtocol.TCP)
.withPriority(100)
.withDescription("Allow SSH")
.attach()
.defineRule("ALLOW-HTTP")
.allowInbound()
.fromAnyAddress()
.fromAnyPort()
.toAnyAddress()
.toPort(80)
.withProtocol(SecurityRuleProtocol.TCP)
.withPriority(101)
.withDescription("Allow HTTP")
.attach()
.create();

Create an Application Gateway

You can create a application gateway instance by using a define() … create() method chain.

ApplicationGatewayapplicationGateway = azure.applicationGateways().define("myFirstAppGateway")
.withRegion(Region.US_EAST)
.withExistingResourceGroup(resourceGroup)
// Request routing rule for HTTP from public 80 to public 8080
.defineRequestRoutingRule("HTTP-80-to-8080")
.fromPublicFrontend()
.fromFrontendHttpPort(80)
.toBackendHttpPort(8080)
.toBackendIPAddress("11.1.1.1")
.toBackendIPAddress("11.1.1.2")
.toBackendIPAddress("11.1.1.3")
.toBackendIPAddress("11.1.1.4")
.attach()
.withExistingPublicIPAddress(publicIpAddress)
.create();

Ready-to-run code samples for networking

ServiceManagement Scenario
Networking
DNS
Traffic Manager
Application Gateway
Express Route

Application Services

Create a Web App

You can create a Web App instance by using a define() … create() method chain.

WebAppwebApp = azure.webApps()
.define(appName)
.withRegion(Region.US_WEST)
.withNewResourceGroup(rgName)
.withNewWindowsPlan(PricingTier.STANDARD_S1)
.create();

Ready-to-run code samples for Application Services

ServiceManagement Scenario
Web Apps on Windows
Web Apps on Linux
Functions

Databases and Storage

Create a Cosmos DB with CosmosDB Programming Model

You can create a Cosmos DB account by using a define() … create() method chain.

CosmosAccountcosmosDBAccount = azure.cosmosDBAccounts().define(cosmosDBName)
.withRegion(Region.US_EAST)
.withNewResourceGroup(rgName)
.withKind(DatabaseAccountKind.GLOBAL_DOCUMENT_DB)
.withSessionConsistency()
.withWriteReplication(Region.US_WEST)
.withReadReplication(Region.US_CENTRAL)
.create()

Create a SQL Database

You can create a SQL server instance by using a define() … create() method chain.

SqlServersqlServer = azure.sqlServers().define(sqlServerName)
.withRegion(Region.US_EAST)
.withNewResourceGroup(rgName)
.withAdministratorLogin("adminlogin123")
.withAdministratorPassword("myS3cureP@ssword")
.withNewFirewallRule("10.0.0.1")
.withNewFirewallRule("10.2.0.1", "10.2.0.10")
.create();

Then, you can create a SQL database instance by using a define() … create() method chain.

SqlDatabasedatabase = sqlServer.databases().define("myNewDatabase")
...
.create();

Ready-to-run code samples for databases

ServiceManagement Scenario
Storage
SQL Database
Cosmos DB

Other code samples

ServiceManagement Scenario
Active Directory
Container Service
Container Registry and
Container Instances
Service Bus
Resource Groups
Redis Cache
Key Vault
Monitor
CDN
Batch
Batch AI
Search
Event Hub

Download

Latest stable release

If you are using released builds from 1.27.2, add the following to your POM file:

<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure</artifactId>
<version>1.27.2</version>
</dependency>

Latest snapshots

If you are using snapshots builds for this repo, add the following repository and dependency to your POM file:

 <repositories>
<repository>
<id>ossrh</id>
<name>Sonatype Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<layout>default</layout>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure</artifactId>
<version>1.27.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-client-runtime</artifactId>
<version>1.6.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-client-authentication</artifactId>
<version>1.6.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.microsoft.rest</groupId>
<artifactId>client-runtime</artifactId>
<version>1.6.5-SNAPSHOT</version>
</dependency>

Prerequisites

Upgrading from older versions

If you are migrating your code from 1.27.0 to 1.27.2, you can use these release notes for preparing your code for 1.27.2 from 1.27.0.

In general, Azure Libraries for Java follow semantic versioning, so user code should continue working in a compatible fashion between minor versions of the same major version release train, with the following caveats:

  • methods and types annotated with @Beta are not considered "generally available" and their design and functionality may change arbitrarily (including removal) in any future minor release of the libraries. To help identify such @Beta breaking changes from one minor release to the next and see how to mitigate them, see the above mentioned release notes for each release.

  • occasionally the naming and structure of "fluent" interface definitions (i.e. the ones whose names start with With*) may change between minor versions, as long as that change does not affect the fluent "flow" (the chaining of the methods in a definition or update chain).

  • the *Inner types and their methods may occasionally change their naming and structure between minor versions in breaking ways. User code should generally avoid making a reference to those types though, unless their functionality is not yet exposed by the "fluent" API.

Help and Issues

If you encounter any bugs with these libraries, please file issues via Issues or checkout StackOverflow for Azure Java SDK.

Contribute Code

If you would like to become an active contributor to this project please follow the instructions provided in Microsoft Azure Projects Contribution Guidelines.

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

More Information

Previous Releases and Corresponding Repo Branches

VersionSHA1Remarks
1.27.21.27.2Tagged release for 1.27.2 version of Azure management libraries
1.27.01.27.0Tagged release for 1.27.0 version of Azure management libraries
1.26.01.26.0Tagged release for 1.26.0 version of Azure management libraries
1.25.01.25.0Tagged release for 1.25.0 version of Azure management libraries
1.24.21.24.2Tagged release for 1.24.2 version of Azure management libraries
1.24.11.24.1Tagged release for 1.24.1 version of Azure management libraries
1.24.01.24.0Tagged release for 1.24.0 version of Azure management libraries
1.23.01.23.0Tagged release for 1.23.0 version of Azure management libraries
1.22.01.22.0Tagged release for 1.22.0 version of Azure management libraries
1.21.01.21.0Tagged release for 1.21.0 version of Azure management libraries
1.20.11.20.1Tagged release for 1.20.1 version of Azure management libraries
1.20.01.20.0Tagged release for 1.20.0 version of Azure management libraries
1.19.01.19.0Tagged release for 1.19.0 version of Azure management libraries
1.18.01.18.0Tagged release for 1.18.0 version of Azure management libraries
1.17.01.17.0Tagged release for 1.17.0 version of Azure management libraries
1.16.01.16.0Tagged release for 1.16.0 version of Azure management libraries
1.15.11.15.1Tagged release for 1.15.1 version of Azure management libraries
1.15.01.15.0Tagged release for 1.15.0 version of Azure management libraries
1.14.01.14.0Tagged release for 1.14.0 version of Azure management libraries
1.13.01.13.0Tagged release for 1.13.0 version of Azure management libraries
1.12.01.12.0Tagged release for 1.12.0 version of Azure management libraries
1.11.01.11.0Tagged release for 1.11.0 version of Azure management libraries
1.10.01.10.0Tagged release for 1.10.0 version of Azure management libraries
1.9.01.9.0Tagged release for 1.9.0 version of Azure management libraries
1.8.01.8.0Tagged release for 1.8.0 version of Azure management libraries
1.7.01.7.0Tagged release for 1.7.0 version of Azure management libraries
1.6.01.6.0Tagged release for 1.6.0 version of Azure management libraries
1.5.11.5.1Tagged release for 1.5.1 version of Azure management libraries
1.4.01.4.0Tagged release for 1.4.0 version of Azure management libraries
1.3.01.3.0Tagged release for 1.3.0 version of Azure management libraries
1.2.11.2.1Tagged release for 1.2.1 version of Azure management libraries
1.1.01.1.0Tagged release for 1.1.0 version of Azure management libraries
1.0.01.0.0Tagged release for 1.0.0 version of Azure management libraries
1.0.0-beta51.0.0-beta5Tagged release for 1.0.0-beta5 version of Azure management libraries
1.0.0-beta4.11.0.0-beta4.1Tagged release for 1.0.0-beta4.1 version of Azure management libraries
1.0.0-beta31.0.0-beta3Tagged release for 1.0.0-beta3 version of Azure management libraries
1.0.0-beta21.0.0-beta2Tagged release for 1.0.0-beta2 version of Azure management libraries
1.0.0-beta11.0.0-beta1Maintenance branch for AutoRest generated raw clients
1.0.0-beta1+fixes1.0.0-beta1+fixesStable build for AutoRest generated raw clients
0.9.x-SNAPSHOTS0.9Maintenance branch for service management libraries
0.9.30.9.3Latest release for service management libraries

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

About

Azure Management Libraries for Java

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - Azure-Fluent/azure-libraries-for-java: Azure Management Libraries for Java · GitHub
Skip to content

Latest commit

History

579 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Build StatusBuild Status

Azure Management Libraries for Java

This README is based on the released stable version (1.27.2). If you are looking for other releases, see More Information.

The Azure Management Libraries for Java is a higher-level, object-oriented API for managing Azure resources, that is optimized for ease of use, succinctness and consistency.

If you are looking for Java client libraries for consuming (rather than managing) individual Azure services (e.g. storage blob upload, JDBC, messaging, etc), please see https://docs.microsoft.com/en-us/java/azure/java-sdk-azure-install.

Table of contents

Feature Availability and Road Map

🚩 as of Version 1.27.2

Service | featureAvailable as GAAvailable as PreviewComing soon
ComputeVirtual machines and VM extensions
Virtual machine scale sets
Managed disks
Azure container service (AKS) + registry + instances
Availability Zones
More Availability Zones and MSI features
StorageStorage accounts
Encryption (deprecated)
Encryption (Blob)
Encryption (File)
SQL DatabaseDatabases
Firewalls and virtual network
Elastic pools
Import, export, recover and restore dbs
Failover groups and replication links
DNS aliasing and metrics
Sync groups
Encryption protectors
More features
NetworkingVirtual networks
Network interfaces
IP addresses
Routing table
Network security groups
Load balancers
Application gateways
DNS
Traffic managers
Network peering
Virtual Network Gateway
Network watchers
Express Route
Application Security Groups
More application gateway features
More servicesResource Manager
Key Vault
Redis
CDN
Batch
Service bus
Graph RBAC
Web apps
Function Apps
Cosmos DB
Monitor
Batch AI
Search
Event Hub
Data Lake
More Monitor features
Logic Apps
Event Grid
FundamentalsAuthentication - core
Async methods
Managed Service Identity

Preview features are marked with the @Beta annotation at the class or interface or method level in libraries. These features are subject to change. They can be modified in any way, or even removed, in the future.

Code snippets and samples

Azure Authentication

The Azure class is the simplest entry point for creating and interacting with Azure resources.

Azure azure = Azure.authenticate(credFile).withDefaultSubscription();

To learn more about authentication in the Azure Libraries for Java, see AUTH.md.

Virtual Machines

Create a Virtual Machine

You can create a virtual machine instance by using a define() … create() method chain.

System.out.println("Creating a Linux VM");
VirtualMachinelinuxVM = azure.virtualMachines().define("myLinuxVM")
.withRegion(Region.US_EAST)
.withNewResourceGroup(rgName)
.withNewPrimaryNetwork("10.0.0.0/28")
.withPrimaryPrivateIPAddressDynamic()
.withNewPrimaryPublicIPAddress("mylinuxvmdns")
.withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS)
.withRootUsername("tirekicker")
.withSsh(sshKey)
.withSize(VirtualMachineSizeTypes.STANDARD_D3_V2)
.create();
System.out.println("Created a Linux VM: " + linuxVM.id());

Update a Virtual Machine

You can update a virtual machine instance by using an update() … apply() method chain.

linuxVM.update()
.withNewDataDisk(20, lun, CachingTypes.READ_WRITE)
.apply();

Create a Virtual Machine Scale Set

You can create a virtual machine scale set instance by using a define() … create() method chain.

VirtualMachineScaleSetvirtualMachineScaleSet = azure.virtualMachineScaleSets().define(vmssName)
.withRegion(Region.US_EAST)
.withExistingResourceGroup(rgName)
.withSku(VirtualMachineScaleSetSkuTypes.STANDARD_D3_V2)
.withExistingPrimaryNetworkSubnet(network, "Front-end")
.withPrimaryInternetFacingLoadBalancer(loadBalancer1)
.withPrimaryInternetFacingLoadBalancerBackends(backendPoolName1, backendPoolName2)
.withPrimaryInternetFacingLoadBalancerInboundNatPools(natPool50XXto22, natPool60XXto23)
.withoutPrimaryInternalLoadBalancer()
.withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS)
.withRootUsername(userName)
.withSsh(sshKey)
.withNewDataDisk(100)
.withNewDataDisk(100, 1, CachingTypes.READ_WRITE)
.withNewDataDisk(100, 2, CachingTypes.READ_WRITE, StorageAccountTypes.STANDARD_LRS)
.withCapacity(3)
.create();

Ready-to-run code samples for virtual machines

ServiceManagement Scenario
Virtual Machines
Virtual Machines - parallel execution
Virtual Machine Scale Sets

Networking

Create a virtual network

You can create a virtual network by using a define() … create() method chain.

Networknetwork = networks.define("mynetwork")
.withRegion(Region.US_EAST)
.withNewResourceGroup()
.withAddressSpace("10.0.0.0/28")
.withSubnet("subnet1", "10.0.0.0/29")
.withSubnet("subnet2", "10.0.0.8/29")
.create();

Create a network security group

You can create a network security group instance by using a define() … create() method chain.

NetworkSecurityGroupfrontEndNSG = azure.networkSecurityGroups().define(frontEndNSGName)
.withRegion(Region.US_EAST)
.withNewResourceGroup(rgName)
.defineRule("ALLOW-SSH")
.allowInbound()
.fromAnyAddress()
.fromAnyPort()
.toAnyAddress()
.toPort(22)
.withProtocol(SecurityRuleProtocol.TCP)
.withPriority(100)
.withDescription("Allow SSH")
.attach()
.defineRule("ALLOW-HTTP")
.allowInbound()
.fromAnyAddress()
.fromAnyPort()
.toAnyAddress()
.toPort(80)
.withProtocol(SecurityRuleProtocol.TCP)
.withPriority(101)
.withDescription("Allow HTTP")
.attach()
.create();

Create an Application Gateway

You can create a application gateway instance by using a define() … create() method chain.

ApplicationGatewayapplicationGateway = azure.applicationGateways().define("myFirstAppGateway")
.withRegion(Region.US_EAST)
.withExistingResourceGroup(resourceGroup)
// Request routing rule for HTTP from public 80 to public 8080
.defineRequestRoutingRule("HTTP-80-to-8080")
.fromPublicFrontend()
.fromFrontendHttpPort(80)
.toBackendHttpPort(8080)
.toBackendIPAddress("11.1.1.1")
.toBackendIPAddress("11.1.1.2")
.toBackendIPAddress("11.1.1.3")
.toBackendIPAddress("11.1.1.4")
.attach()
.withExistingPublicIPAddress(publicIpAddress)
.create();

Ready-to-run code samples for networking

ServiceManagement Scenario
Networking
DNS
Traffic Manager
Application Gateway
Express Route

Application Services

Create a Web App

You can create a Web App instance by using a define() … create() method chain.

WebAppwebApp = azure.webApps()
.define(appName)
.withRegion(Region.US_WEST)
.withNewResourceGroup(rgName)
.withNewWindowsPlan(PricingTier.STANDARD_S1)
.create();

Ready-to-run code samples for Application Services

ServiceManagement Scenario
Web Apps on Windows
Web Apps on Linux
Functions

Databases and Storage

Create a Cosmos DB with CosmosDB Programming Model

You can create a Cosmos DB account by using a define() … create() method chain.

CosmosAccountcosmosDBAccount = azure.cosmosDBAccounts().define(cosmosDBName)
.withRegion(Region.US_EAST)
.withNewResourceGroup(rgName)
.withKind(DatabaseAccountKind.GLOBAL_DOCUMENT_DB)
.withSessionConsistency()
.withWriteReplication(Region.US_WEST)
.withReadReplication(Region.US_CENTRAL)
.create()

Create a SQL Database

You can create a SQL server instance by using a define() … create() method chain.

SqlServersqlServer = azure.sqlServers().define(sqlServerName)
.withRegion(Region.US_EAST)
.withNewResourceGroup(rgName)
.withAdministratorLogin("adminlogin123")
.withAdministratorPassword("myS3cureP@ssword")
.withNewFirewallRule("10.0.0.1")
.withNewFirewallRule("10.2.0.1", "10.2.0.10")
.create();

Then, you can create a SQL database instance by using a define() … create() method chain.

SqlDatabasedatabase = sqlServer.databases().define("myNewDatabase")
...
.create();

Ready-to-run code samples for databases

ServiceManagement Scenario
Storage
SQL Database
Cosmos DB

Other code samples

ServiceManagement Scenario
Active Directory
Container Service
Container Registry and
Container Instances
Service Bus
Resource Groups
Redis Cache
Key Vault
Monitor
CDN
Batch
Batch AI
Search
Event Hub

Download

Latest stable release

If you are using released builds from 1.27.2, add the following to your POM file:

<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure</artifactId>
<version>1.27.2</version>
</dependency>

Latest snapshots

If you are using snapshots builds for this repo, add the following repository and dependency to your POM file:

 <repositories>
<repository>
<id>ossrh</id>
<name>Sonatype Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<layout>default</layout>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure</artifactId>
<version>1.27.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-client-runtime</artifactId>
<version>1.6.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-client-authentication</artifactId>
<version>1.6.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.microsoft.rest</groupId>
<artifactId>client-runtime</artifactId>
<version>1.6.5-SNAPSHOT</version>
</dependency>

Prerequisites

Upgrading from older versions

If you are migrating your code from 1.27.0 to 1.27.2, you can use these release notes for preparing your code for 1.27.2 from 1.27.0.

In general, Azure Libraries for Java follow semantic versioning, so user code should continue working in a compatible fashion between minor versions of the same major version release train, with the following caveats:

  • methods and types annotated with @Beta are not considered "generally available" and their design and functionality may change arbitrarily (including removal) in any future minor release of the libraries. To help identify such @Beta breaking changes from one minor release to the next and see how to mitigate them, see the above mentioned release notes for each release.

  • occasionally the naming and structure of "fluent" interface definitions (i.e. the ones whose names start with With*) may change between minor versions, as long as that change does not affect the fluent "flow" (the chaining of the methods in a definition or update chain).

  • the *Inner types and their methods may occasionally change their naming and structure between minor versions in breaking ways. User code should generally avoid making a reference to those types though, unless their functionality is not yet exposed by the "fluent" API.

Help and Issues

If you encounter any bugs with these libraries, please file issues via Issues or checkout StackOverflow for Azure Java SDK.

Contribute Code

If you would like to become an active contributor to this project please follow the instructions provided in Microsoft Azure Projects Contribution Guidelines.

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

More Information

Previous Releases and Corresponding Repo Branches

VersionSHA1Remarks
1.27.21.27.2Tagged release for 1.27.2 version of Azure management libraries
1.27.01.27.0Tagged release for 1.27.0 version of Azure management libraries
1.26.01.26.0Tagged release for 1.26.0 version of Azure management libraries
1.25.01.25.0Tagged release for 1.25.0 version of Azure management libraries
1.24.21.24.2Tagged release for 1.24.2 version of Azure management libraries
1.24.11.24.1Tagged release for 1.24.1 version of Azure management libraries
1.24.01.24.0Tagged release for 1.24.0 version of Azure management libraries
1.23.01.23.0Tagged release for 1.23.0 version of Azure management libraries
1.22.01.22.0Tagged release for 1.22.0 version of Azure management libraries
1.21.01.21.0Tagged release for 1.21.0 version of Azure management libraries
1.20.11.20.1Tagged release for 1.20.1 version of Azure management libraries
1.20.01.20.0Tagged release for 1.20.0 version of Azure management libraries
1.19.01.19.0Tagged release for 1.19.0 version of Azure management libraries
1.18.01.18.0Tagged release for 1.18.0 version of Azure management libraries
1.17.01.17.0Tagged release for 1.17.0 version of Azure management libraries
1.16.01.16.0Tagged release for 1.16.0 version of Azure management libraries
1.15.11.15.1Tagged release for 1.15.1 version of Azure management libraries
1.15.01.15.0Tagged release for 1.15.0 version of Azure management libraries
1.14.01.14.0Tagged release for 1.14.0 version of Azure management libraries
1.13.01.13.0Tagged release for 1.13.0 version of Azure management libraries
1.12.01.12.0Tagged release for 1.12.0 version of Azure management libraries
1.11.01.11.0Tagged release for 1.11.0 version of Azure management libraries
1.10.01.10.0Tagged release for 1.10.0 version of Azure management libraries
1.9.01.9.0Tagged release for 1.9.0 version of Azure management libraries
1.8.01.8.0Tagged release for 1.8.0 version of Azure management libraries
1.7.01.7.0Tagged release for 1.7.0 version of Azure management libraries
1.6.01.6.0Tagged release for 1.6.0 version of Azure management libraries
1.5.11.5.1Tagged release for 1.5.1 version of Azure management libraries
1.4.01.4.0Tagged release for 1.4.0 version of Azure management libraries
1.3.01.3.0Tagged release for 1.3.0 version of Azure management libraries
1.2.11.2.1Tagged release for 1.2.1 version of Azure management libraries
1.1.01.1.0Tagged release for 1.1.0 version of Azure management libraries
1.0.01.0.0Tagged release for 1.0.0 version of Azure management libraries
1.0.0-beta51.0.0-beta5Tagged release for 1.0.0-beta5 version of Azure management libraries
1.0.0-beta4.11.0.0-beta4.1Tagged release for 1.0.0-beta4.1 version of Azure management libraries
1.0.0-beta31.0.0-beta3Tagged release for 1.0.0-beta3 version of Azure management libraries
1.0.0-beta21.0.0-beta2Tagged release for 1.0.0-beta2 version of Azure management libraries
1.0.0-beta11.0.0-beta1Maintenance branch for AutoRest generated raw clients
1.0.0-beta1+fixes1.0.0-beta1+fixesStable build for AutoRest generated raw clients
0.9.x-SNAPSHOTS0.9Maintenance branch for service management libraries
0.9.30.9.3Latest release for service management libraries

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

About

Azure Management Libraries for Java

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - Azure-Fluent/azure-libraries-for-java: Azure Management Libraries for Java · GitHub
Skip to content

Latest commit

History

579 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Build StatusBuild Status

Azure Management Libraries for Java

This README is based on the released stable version (1.27.2). If you are looking for other releases, see More Information.

The Azure Management Libraries for Java is a higher-level, object-oriented API for managing Azure resources, that is optimized for ease of use, succinctness and consistency.

If you are looking for Java client libraries for consuming (rather than managing) individual Azure services (e.g. storage blob upload, JDBC, messaging, etc), please see https://docs.microsoft.com/en-us/java/azure/java-sdk-azure-install.

Table of contents

Feature Availability and Road Map

🚩 as of Version 1.27.2

Service | featureAvailable as GAAvailable as PreviewComing soon
ComputeVirtual machines and VM extensions
Virtual machine scale sets
Managed disks
Azure container service (AKS) + registry + instances
Availability Zones
More Availability Zones and MSI features
StorageStorage accounts
Encryption (deprecated)
Encryption (Blob)
Encryption (File)
SQL DatabaseDatabases
Firewalls and virtual network
Elastic pools
Import, export, recover and restore dbs
Failover groups and replication links
DNS aliasing and metrics
Sync groups
Encryption protectors
More features
NetworkingVirtual networks
Network interfaces
IP addresses
Routing table
Network security groups
Load balancers
Application gateways
DNS
Traffic managers
Network peering
Virtual Network Gateway
Network watchers
Express Route
Application Security Groups
More application gateway features
More servicesResource Manager
Key Vault
Redis
CDN
Batch
Service bus
Graph RBAC
Web apps
Function Apps
Cosmos DB
Monitor
Batch AI
Search
Event Hub
Data Lake
More Monitor features
Logic Apps
Event Grid
FundamentalsAuthentication - core
Async methods
Managed Service Identity

Preview features are marked with the @Beta annotation at the class or interface or method level in libraries. These features are subject to change. They can be modified in any way, or even removed, in the future.

Code snippets and samples

Azure Authentication

The Azure class is the simplest entry point for creating and interacting with Azure resources.

Azure azure = Azure.authenticate(credFile).withDefaultSubscription();

To learn more about authentication in the Azure Libraries for Java, see AUTH.md.

Virtual Machines

Create a Virtual Machine

You can create a virtual machine instance by using a define() … create() method chain.

System.out.println("Creating a Linux VM");
VirtualMachinelinuxVM = azure.virtualMachines().define("myLinuxVM")
.withRegion(Region.US_EAST)
.withNewResourceGroup(rgName)
.withNewPrimaryNetwork("10.0.0.0/28")
.withPrimaryPrivateIPAddressDynamic()
.withNewPrimaryPublicIPAddress("mylinuxvmdns")
.withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS)
.withRootUsername("tirekicker")
.withSsh(sshKey)
.withSize(VirtualMachineSizeTypes.STANDARD_D3_V2)
.create();
System.out.println("Created a Linux VM: " + linuxVM.id());

Update a Virtual Machine

You can update a virtual machine instance by using an update() … apply() method chain.

linuxVM.update()
.withNewDataDisk(20, lun, CachingTypes.READ_WRITE)
.apply();

Create a Virtual Machine Scale Set

You can create a virtual machine scale set instance by using a define() … create() method chain.

VirtualMachineScaleSetvirtualMachineScaleSet = azure.virtualMachineScaleSets().define(vmssName)
.withRegion(Region.US_EAST)
.withExistingResourceGroup(rgName)
.withSku(VirtualMachineScaleSetSkuTypes.STANDARD_D3_V2)
.withExistingPrimaryNetworkSubnet(network, "Front-end")
.withPrimaryInternetFacingLoadBalancer(loadBalancer1)
.withPrimaryInternetFacingLoadBalancerBackends(backendPoolName1, backendPoolName2)
.withPrimaryInternetFacingLoadBalancerInboundNatPools(natPool50XXto22, natPool60XXto23)
.withoutPrimaryInternalLoadBalancer()
.withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS)
.withRootUsername(userName)
.withSsh(sshKey)
.withNewDataDisk(100)
.withNewDataDisk(100, 1, CachingTypes.READ_WRITE)
.withNewDataDisk(100, 2, CachingTypes.READ_WRITE, StorageAccountTypes.STANDARD_LRS)
.withCapacity(3)
.create();

Ready-to-run code samples for virtual machines

ServiceManagement Scenario
Virtual Machines
Virtual Machines - parallel execution
Virtual Machine Scale Sets

Networking

Create a virtual network

You can create a virtual network by using a define() … create() method chain.

Networknetwork = networks.define("mynetwork")
.withRegion(Region.US_EAST)
.withNewResourceGroup()
.withAddressSpace("10.0.0.0/28")
.withSubnet("subnet1", "10.0.0.0/29")
.withSubnet("subnet2", "10.0.0.8/29")
.create();

Create a network security group

You can create a network security group instance by using a define() … create() method chain.

NetworkSecurityGroupfrontEndNSG = azure.networkSecurityGroups().define(frontEndNSGName)
.withRegion(Region.US_EAST)
.withNewResourceGroup(rgName)
.defineRule("ALLOW-SSH")
.allowInbound()
.fromAnyAddress()
.fromAnyPort()
.toAnyAddress()
.toPort(22)
.withProtocol(SecurityRuleProtocol.TCP)
.withPriority(100)
.withDescription("Allow SSH")
.attach()
.defineRule("ALLOW-HTTP")
.allowInbound()
.fromAnyAddress()
.fromAnyPort()
.toAnyAddress()
.toPort(80)
.withProtocol(SecurityRuleProtocol.TCP)
.withPriority(101)
.withDescription("Allow HTTP")
.attach()
.create();

Create an Application Gateway

You can create a application gateway instance by using a define() … create() method chain.

ApplicationGatewayapplicationGateway = azure.applicationGateways().define("myFirstAppGateway")
.withRegion(Region.US_EAST)
.withExistingResourceGroup(resourceGroup)
// Request routing rule for HTTP from public 80 to public 8080
.defineRequestRoutingRule("HTTP-80-to-8080")
.fromPublicFrontend()
.fromFrontendHttpPort(80)
.toBackendHttpPort(8080)
.toBackendIPAddress("11.1.1.1")
.toBackendIPAddress("11.1.1.2")
.toBackendIPAddress("11.1.1.3")
.toBackendIPAddress("11.1.1.4")
.attach()
.withExistingPublicIPAddress(publicIpAddress)
.create();

Ready-to-run code samples for networking

ServiceManagement Scenario
Networking
DNS
Traffic Manager
Application Gateway
Express Route

Application Services

Create a Web App

You can create a Web App instance by using a define() … create() method chain.

WebAppwebApp = azure.webApps()
.define(appName)
.withRegion(Region.US_WEST)
.withNewResourceGroup(rgName)
.withNewWindowsPlan(PricingTier.STANDARD_S1)
.create();

Ready-to-run code samples for Application Services

ServiceManagement Scenario
Web Apps on Windows
Web Apps on Linux
Functions

Databases and Storage

Create a Cosmos DB with CosmosDB Programming Model

You can create a Cosmos DB account by using a define() … create() method chain.

CosmosAccountcosmosDBAccount = azure.cosmosDBAccounts().define(cosmosDBName)
.withRegion(Region.US_EAST)
.withNewResourceGroup(rgName)
.withKind(DatabaseAccountKind.GLOBAL_DOCUMENT_DB)
.withSessionConsistency()
.withWriteReplication(Region.US_WEST)
.withReadReplication(Region.US_CENTRAL)
.create()

Create a SQL Database

You can create a SQL server instance by using a define() … create() method chain.

SqlServersqlServer = azure.sqlServers().define(sqlServerName)
.withRegion(Region.US_EAST)
.withNewResourceGroup(rgName)
.withAdministratorLogin("adminlogin123")
.withAdministratorPassword("myS3cureP@ssword")
.withNewFirewallRule("10.0.0.1")
.withNewFirewallRule("10.2.0.1", "10.2.0.10")
.create();

Then, you can create a SQL database instance by using a define() … create() method chain.

SqlDatabasedatabase = sqlServer.databases().define("myNewDatabase")
...
.create();

Ready-to-run code samples for databases

ServiceManagement Scenario
Storage
SQL Database
Cosmos DB

Other code samples

ServiceManagement Scenario
Active Directory
Container Service
Container Registry and
Container Instances
Service Bus
Resource Groups
Redis Cache
Key Vault
Monitor
CDN
Batch
Batch AI
Search
Event Hub

Download

Latest stable release

If you are using released builds from 1.27.2, add the following to your POM file:

<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure</artifactId>
<version>1.27.2</version>
</dependency>

Latest snapshots

If you are using snapshots builds for this repo, add the following repository and dependency to your POM file:

 <repositories>
<repository>
<id>ossrh</id>
<name>Sonatype Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<layout>default</layout>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure</artifactId>
<version>1.27.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-client-runtime</artifactId>
<version>1.6.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-client-authentication</artifactId>
<version>1.6.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.microsoft.rest</groupId>
<artifactId>client-runtime</artifactId>
<version>1.6.5-SNAPSHOT</version>
</dependency>

Prerequisites

Upgrading from older versions

If you are migrating your code from 1.27.0 to 1.27.2, you can use these release notes for preparing your code for 1.27.2 from 1.27.0.

In general, Azure Libraries for Java follow semantic versioning, so user code should continue working in a compatible fashion between minor versions of the same major version release train, with the following caveats:

  • methods and types annotated with @Beta are not considered "generally available" and their design and functionality may change arbitrarily (including removal) in any future minor release of the libraries. To help identify such @Beta breaking changes from one minor release to the next and see how to mitigate them, see the above mentioned release notes for each release.

  • occasionally the naming and structure of "fluent" interface definitions (i.e. the ones whose names start with With*) may change between minor versions, as long as that change does not affect the fluent "flow" (the chaining of the methods in a definition or update chain).

  • the *Inner types and their methods may occasionally change their naming and structure between minor versions in breaking ways. User code should generally avoid making a reference to those types though, unless their functionality is not yet exposed by the "fluent" API.

Help and Issues

If you encounter any bugs with these libraries, please file issues via Issues or checkout StackOverflow for Azure Java SDK.

Contribute Code

If you would like to become an active contributor to this project please follow the instructions provided in Microsoft Azure Projects Contribution Guidelines.

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

More Information

Previous Releases and Corresponding Repo Branches

VersionSHA1Remarks
1.27.21.27.2Tagged release for 1.27.2 version of Azure management libraries
1.27.01.27.0Tagged release for 1.27.0 version of Azure management libraries
1.26.01.26.0Tagged release for 1.26.0 version of Azure management libraries
1.25.01.25.0Tagged release for 1.25.0 version of Azure management libraries
1.24.21.24.2Tagged release for 1.24.2 version of Azure management libraries
1.24.11.24.1Tagged release for 1.24.1 version of Azure management libraries
1.24.01.24.0Tagged release for 1.24.0 version of Azure management libraries
1.23.01.23.0Tagged release for 1.23.0 version of Azure management libraries
1.22.01.22.0Tagged release for 1.22.0 version of Azure management libraries
1.21.01.21.0Tagged release for 1.21.0 version of Azure management libraries
1.20.11.20.1Tagged release for 1.20.1 version of Azure management libraries
1.20.01.20.0Tagged release for 1.20.0 version of Azure management libraries
1.19.01.19.0Tagged release for 1.19.0 version of Azure management libraries
1.18.01.18.0Tagged release for 1.18.0 version of Azure management libraries
1.17.01.17.0Tagged release for 1.17.0 version of Azure management libraries
1.16.01.16.0Tagged release for 1.16.0 version of Azure management libraries
1.15.11.15.1Tagged release for 1.15.1 version of Azure management libraries
1.15.01.15.0Tagged release for 1.15.0 version of Azure management libraries
1.14.01.14.0Tagged release for 1.14.0 version of Azure management libraries
1.13.01.13.0Tagged release for 1.13.0 version of Azure management libraries
1.12.01.12.0Tagged release for 1.12.0 version of Azure management libraries
1.11.01.11.0Tagged release for 1.11.0 version of Azure management libraries
1.10.01.10.0Tagged release for 1.10.0 version of Azure management libraries
1.9.01.9.0Tagged release for 1.9.0 version of Azure management libraries
1.8.01.8.0Tagged release for 1.8.0 version of Azure management libraries
1.7.01.7.0Tagged release for 1.7.0 version of Azure management libraries
1.6.01.6.0Tagged release for 1.6.0 version of Azure management libraries
1.5.11.5.1Tagged release for 1.5.1 version of Azure management libraries
1.4.01.4.0Tagged release for 1.4.0 version of Azure management libraries
1.3.01.3.0Tagged release for 1.3.0 version of Azure management libraries
1.2.11.2.1Tagged release for 1.2.1 version of Azure management libraries
1.1.01.1.0Tagged release for 1.1.0 version of Azure management libraries
1.0.01.0.0Tagged release for 1.0.0 version of Azure management libraries
1.0.0-beta51.0.0-beta5Tagged release for 1.0.0-beta5 version of Azure management libraries
1.0.0-beta4.11.0.0-beta4.1Tagged release for 1.0.0-beta4.1 version of Azure management libraries
1.0.0-beta31.0.0-beta3Tagged release for 1.0.0-beta3 version of Azure management libraries
1.0.0-beta21.0.0-beta2Tagged release for 1.0.0-beta2 version of Azure management libraries
1.0.0-beta11.0.0-beta1Maintenance branch for AutoRest generated raw clients
1.0.0-beta1+fixes1.0.0-beta1+fixesStable build for AutoRest generated raw clients
0.9.x-SNAPSHOTS0.9Maintenance branch for service management libraries
0.9.30.9.3Latest release for service management libraries

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

About

Azure Management Libraries for Java

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); GitHub - Azure-Fluent/azure-libraries-for-java: Azure Management Libraries for Java · GitHub
Skip to content

Latest commit

History

579 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Build StatusBuild Status

Azure Management Libraries for Java

This README is based on the released stable version (1.27.2). If you are looking for other releases, see More Information.

The Azure Management Libraries for Java is a higher-level, object-oriented API for managing Azure resources, that is optimized for ease of use, succinctness and consistency.

If you are looking for Java client libraries for consuming (rather than managing) individual Azure services (e.g. storage blob upload, JDBC, messaging, etc), please see https://docs.microsoft.com/en-us/java/azure/java-sdk-azure-install.

Table of contents

Feature Availability and Road Map

🚩 as of Version 1.27.2

Service | featureAvailable as GAAvailable as PreviewComing soon
ComputeVirtual machines and VM extensions
Virtual machine scale sets
Managed disks
Azure container service (AKS) + registry + instances
Availability Zones
More Availability Zones and MSI features
StorageStorage accounts
Encryption (deprecated)
Encryption (Blob)
Encryption (File)
SQL DatabaseDatabases
Firewalls and virtual network
Elastic pools
Import, export, recover and restore dbs
Failover groups and replication links
DNS aliasing and metrics
Sync groups
Encryption protectors
More features
NetworkingVirtual networks
Network interfaces
IP addresses
Routing table
Network security groups
Load balancers
Application gateways
DNS
Traffic managers
Network peering
Virtual Network Gateway
Network watchers
Express Route
Application Security Groups
More application gateway features
More servicesResource Manager
Key Vault
Redis
CDN
Batch
Service bus
Graph RBAC
Web apps
Function Apps
Cosmos DB
Monitor
Batch AI
Search
Event Hub
Data Lake
More Monitor features
Logic Apps
Event Grid
FundamentalsAuthentication - core
Async methods
Managed Service Identity

Preview features are marked with the @Beta annotation at the class or interface or method level in libraries. These features are subject to change. They can be modified in any way, or even removed, in the future.

Code snippets and samples

Azure Authentication

The Azure class is the simplest entry point for creating and interacting with Azure resources.

Azure azure = Azure.authenticate(credFile).withDefaultSubscription();

To learn more about authentication in the Azure Libraries for Java, see AUTH.md.

Virtual Machines

Create a Virtual Machine

You can create a virtual machine instance by using a define() … create() method chain.

System.out.println("Creating a Linux VM");
VirtualMachinelinuxVM = azure.virtualMachines().define("myLinuxVM")
.withRegion(Region.US_EAST)
.withNewResourceGroup(rgName)
.withNewPrimaryNetwork("10.0.0.0/28")
.withPrimaryPrivateIPAddressDynamic()
.withNewPrimaryPublicIPAddress("mylinuxvmdns")
.withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS)
.withRootUsername("tirekicker")
.withSsh(sshKey)
.withSize(VirtualMachineSizeTypes.STANDARD_D3_V2)
.create();
System.out.println("Created a Linux VM: " + linuxVM.id());

Update a Virtual Machine

You can update a virtual machine instance by using an update() … apply() method chain.

linuxVM.update()
.withNewDataDisk(20, lun, CachingTypes.READ_WRITE)
.apply();

Create a Virtual Machine Scale Set

You can create a virtual machine scale set instance by using a define() … create() method chain.

VirtualMachineScaleSetvirtualMachineScaleSet = azure.virtualMachineScaleSets().define(vmssName)
.withRegion(Region.US_EAST)
.withExistingResourceGroup(rgName)
.withSku(VirtualMachineScaleSetSkuTypes.STANDARD_D3_V2)
.withExistingPrimaryNetworkSubnet(network, "Front-end")
.withPrimaryInternetFacingLoadBalancer(loadBalancer1)
.withPrimaryInternetFacingLoadBalancerBackends(backendPoolName1, backendPoolName2)
.withPrimaryInternetFacingLoadBalancerInboundNatPools(natPool50XXto22, natPool60XXto23)
.withoutPrimaryInternalLoadBalancer()
.withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS)
.withRootUsername(userName)
.withSsh(sshKey)
.withNewDataDisk(100)
.withNewDataDisk(100, 1, CachingTypes.READ_WRITE)
.withNewDataDisk(100, 2, CachingTypes.READ_WRITE, StorageAccountTypes.STANDARD_LRS)
.withCapacity(3)
.create();

Ready-to-run code samples for virtual machines

ServiceManagement Scenario
Virtual Machines
Virtual Machines - parallel execution
Virtual Machine Scale Sets

Networking

Create a virtual network

You can create a virtual network by using a define() … create() method chain.

Networknetwork = networks.define("mynetwork")
.withRegion(Region.US_EAST)
.withNewResourceGroup()
.withAddressSpace("10.0.0.0/28")
.withSubnet("subnet1", "10.0.0.0/29")
.withSubnet("subnet2", "10.0.0.8/29")
.create();

Create a network security group

You can create a network security group instance by using a define() … create() method chain.

NetworkSecurityGroupfrontEndNSG = azure.networkSecurityGroups().define(frontEndNSGName)
.withRegion(Region.US_EAST)
.withNewResourceGroup(rgName)
.defineRule("ALLOW-SSH")
.allowInbound()
.fromAnyAddress()
.fromAnyPort()
.toAnyAddress()
.toPort(22)
.withProtocol(SecurityRuleProtocol.TCP)
.withPriority(100)
.withDescription("Allow SSH")
.attach()
.defineRule("ALLOW-HTTP")
.allowInbound()
.fromAnyAddress()
.fromAnyPort()
.toAnyAddress()
.toPort(80)
.withProtocol(SecurityRuleProtocol.TCP)
.withPriority(101)
.withDescription("Allow HTTP")
.attach()
.create();

Create an Application Gateway

You can create a application gateway instance by using a define() … create() method chain.

ApplicationGatewayapplicationGateway = azure.applicationGateways().define("myFirstAppGateway")
.withRegion(Region.US_EAST)
.withExistingResourceGroup(resourceGroup)
// Request routing rule for HTTP from public 80 to public 8080
.defineRequestRoutingRule("HTTP-80-to-8080")
.fromPublicFrontend()
.fromFrontendHttpPort(80)
.toBackendHttpPort(8080)
.toBackendIPAddress("11.1.1.1")
.toBackendIPAddress("11.1.1.2")
.toBackendIPAddress("11.1.1.3")
.toBackendIPAddress("11.1.1.4")
.attach()
.withExistingPublicIPAddress(publicIpAddress)
.create();

Ready-to-run code samples for networking

ServiceManagement Scenario
Networking
DNS
Traffic Manager
Application Gateway
Express Route

Application Services

Create a Web App

You can create a Web App instance by using a define() … create() method chain.

WebAppwebApp = azure.webApps()
.define(appName)
.withRegion(Region.US_WEST)
.withNewResourceGroup(rgName)
.withNewWindowsPlan(PricingTier.STANDARD_S1)
.create();

Ready-to-run code samples for Application Services

ServiceManagement Scenario
Web Apps on Windows
Web Apps on Linux
Functions

Databases and Storage

Create a Cosmos DB with CosmosDB Programming Model

You can create a Cosmos DB account by using a define() … create() method chain.

CosmosAccountcosmosDBAccount = azure.cosmosDBAccounts().define(cosmosDBName)
.withRegion(Region.US_EAST)
.withNewResourceGroup(rgName)
.withKind(DatabaseAccountKind.GLOBAL_DOCUMENT_DB)
.withSessionConsistency()
.withWriteReplication(Region.US_WEST)
.withReadReplication(Region.US_CENTRAL)
.create()

Create a SQL Database

You can create a SQL server instance by using a define() … create() method chain.

SqlServersqlServer = azure.sqlServers().define(sqlServerName)
.withRegion(Region.US_EAST)
.withNewResourceGroup(rgName)
.withAdministratorLogin("adminlogin123")
.withAdministratorPassword("myS3cureP@ssword")
.withNewFirewallRule("10.0.0.1")
.withNewFirewallRule("10.2.0.1", "10.2.0.10")
.create();

Then, you can create a SQL database instance by using a define() … create() method chain.

SqlDatabasedatabase = sqlServer.databases().define("myNewDatabase")
...
.create();

Ready-to-run code samples for databases

ServiceManagement Scenario
Storage
SQL Database
Cosmos DB

Other code samples

ServiceManagement Scenario
Active Directory
Container Service
Container Registry and
Container Instances
Service Bus
Resource Groups
Redis Cache
Key Vault
Monitor
CDN
Batch
Batch AI
Search
Event Hub

Download

Latest stable release

If you are using released builds from 1.27.2, add the following to your POM file:

<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure</artifactId>
<version>1.27.2</version>
</dependency>

Latest snapshots

If you are using snapshots builds for this repo, add the following repository and dependency to your POM file:

 <repositories>
<repository>
<id>ossrh</id>
<name>Sonatype Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<layout>default</layout>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure</artifactId>
<version>1.27.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-client-runtime</artifactId>
<version>1.6.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-client-authentication</artifactId>
<version>1.6.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.microsoft.rest</groupId>
<artifactId>client-runtime</artifactId>
<version>1.6.5-SNAPSHOT</version>
</dependency>

Prerequisites

Upgrading from older versions

If you are migrating your code from 1.27.0 to 1.27.2, you can use these release notes for preparing your code for 1.27.2 from 1.27.0.

In general, Azure Libraries for Java follow semantic versioning, so user code should continue working in a compatible fashion between minor versions of the same major version release train, with the following caveats:

  • methods and types annotated with @Beta are not considered "generally available" and their design and functionality may change arbitrarily (including removal) in any future minor release of the libraries. To help identify such @Beta breaking changes from one minor release to the next and see how to mitigate them, see the above mentioned release notes for each release.

  • occasionally the naming and structure of "fluent" interface definitions (i.e. the ones whose names start with With*) may change between minor versions, as long as that change does not affect the fluent "flow" (the chaining of the methods in a definition or update chain).

  • the *Inner types and their methods may occasionally change their naming and structure between minor versions in breaking ways. User code should generally avoid making a reference to those types though, unless their functionality is not yet exposed by the "fluent" API.

Help and Issues

If you encounter any bugs with these libraries, please file issues via Issues or checkout StackOverflow for Azure Java SDK.

Contribute Code

If you would like to become an active contributor to this project please follow the instructions provided in Microsoft Azure Projects Contribution Guidelines.

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

More Information

Previous Releases and Corresponding Repo Branches

VersionSHA1Remarks
1.27.21.27.2Tagged release for 1.27.2 version of Azure management libraries
1.27.01.27.0Tagged release for 1.27.0 version of Azure management libraries
1.26.01.26.0Tagged release for 1.26.0 version of Azure management libraries
1.25.01.25.0Tagged release for 1.25.0 version of Azure management libraries
1.24.21.24.2Tagged release for 1.24.2 version of Azure management libraries
1.24.11.24.1Tagged release for 1.24.1 version of Azure management libraries
1.24.01.24.0Tagged release for 1.24.0 version of Azure management libraries
1.23.01.23.0Tagged release for 1.23.0 version of Azure management libraries
1.22.01.22.0Tagged release for 1.22.0 version of Azure management libraries
1.21.01.21.0Tagged release for 1.21.0 version of Azure management libraries
1.20.11.20.1Tagged release for 1.20.1 version of Azure management libraries
1.20.01.20.0Tagged release for 1.20.0 version of Azure management libraries
1.19.01.19.0Tagged release for 1.19.0 version of Azure management libraries
1.18.01.18.0Tagged release for 1.18.0 version of Azure management libraries
1.17.01.17.0Tagged release for 1.17.0 version of Azure management libraries
1.16.01.16.0Tagged release for 1.16.0 version of Azure management libraries
1.15.11.15.1Tagged release for 1.15.1 version of Azure management libraries
1.15.01.15.0Tagged release for 1.15.0 version of Azure management libraries
1.14.01.14.0Tagged release for 1.14.0 version of Azure management libraries
1.13.01.13.0Tagged release for 1.13.0 version of Azure management libraries
1.12.01.12.0Tagged release for 1.12.0 version of Azure management libraries
1.11.01.11.0Tagged release for 1.11.0 version of Azure management libraries
1.10.01.10.0Tagged release for 1.10.0 version of Azure management libraries
1.9.01.9.0Tagged release for 1.9.0 version of Azure management libraries
1.8.01.8.0Tagged release for 1.8.0 version of Azure management libraries
1.7.01.7.0Tagged release for 1.7.0 version of Azure management libraries
1.6.01.6.0Tagged release for 1.6.0 version of Azure management libraries
1.5.11.5.1Tagged release for 1.5.1 version of Azure management libraries
1.4.01.4.0Tagged release for 1.4.0 version of Azure management libraries
1.3.01.3.0Tagged release for 1.3.0 version of Azure management libraries
1.2.11.2.1Tagged release for 1.2.1 version of Azure management libraries
1.1.01.1.0Tagged release for 1.1.0 version of Azure management libraries
1.0.01.0.0Tagged release for 1.0.0 version of Azure management libraries
1.0.0-beta51.0.0-beta5Tagged release for 1.0.0-beta5 version of Azure management libraries
1.0.0-beta4.11.0.0-beta4.1Tagged release for 1.0.0-beta4.1 version of Azure management libraries
1.0.0-beta31.0.0-beta3Tagged release for 1.0.0-beta3 version of Azure management libraries
1.0.0-beta21.0.0-beta2Tagged release for 1.0.0-beta2 version of Azure management libraries
1.0.0-beta11.0.0-beta1Maintenance branch for AutoRest generated raw clients
1.0.0-beta1+fixes1.0.0-beta1+fixesStable build for AutoRest generated raw clients
0.9.x-SNAPSHOTS0.9Maintenance branch for service management libraries
0.9.30.9.3Latest release for service management libraries

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

About

Azure Management Libraries for Java

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages