CosmosDBManagement.java is a Java application that utilizes the Azure SDK to manage Azure Cosmos DB resources. This sample demonstrates how to interact with Cosmos DB using the Azure Resource Manager (ARM) APIs, allowing users to create, update, and manage Cosmos DB accounts, databases, and containers.
To run this application, ensure you have the following installed:
- Java Development Kit (JDK): Version 8 or higher.
- Maven: For managing dependencies.
- Azure Account: You need an Azure subscription. If you don’t have one, you can create a free account.
The project uses Azure SDK libraries, which can be included in your Maven pom.xml file. Below are the relevant dependencies:
-
Clone the Repository (if applicable):
git clone https://github.com/your-repo/CosmosDBManagement.git cd CosmosDBManagement -
Build the Project: Use Maven to build the project:
mvn clean install
-
Run the Application: Execute the application with the following command:
mvn exec:java -Dexec.mainClass="com.example.CosmosDBManagement"
This sample provides the following functionalities:
- Authenticate: Uses
DefaultAzureCredentialto authenticate with Azure. - Manage Cosmos DB Accounts: Create, update, and delete Cosmos DB accounts.
- Database and Container Management: Create and manage databases and containers within the Cosmos DB account.
- Configure Autoscale Settings: Set autoscale configurations for containers.
- CosmosDBManagement.java: The main class containing the logic for managing Cosmos DB resources.
Contributions are welcome! Please feel free to submit a pull request or open an issue for any enhancements or bug fixes.
This project is licensed under the MIT License - see the LICENSE file for details.
- Azure SDK for Java
- Azure Cosmos DB Documentation