April 18th, 2025

Azure Toolkit for IntelliJ: Introducing the enhanced Java Code Quality Analyzer!

Sameeksha Vaity
Software Engineer

We’re thrilled to unveil a major update to the Azure Toolkit for IntelliJ—the enhanced Java Code Quality Analyzer! This update introduces powerful rule sets designed to help you write cleaner, safer, and more efficient Java code when working with Azure SDK for Java client libraries.

🚀 What’s new?

Azure SDK for Java integration

The latest Azure Toolkit for IntelliJ release integrates the newest Azure SDK for Java, offering categorized rule sets that provide real-time suggestions and best practices tailored for Azure SDK usage. Key enhancements include:

  • Simplified authentication flows: Integrated support to guide developers toward more secure and robust authentication mechanisms, such as DefaultAzureCredential and ManagedIdentityCredential, when working with the Azure Identity library (com.azure:azure-identity).
  • Improved performance and reliability: Suggestions for using performant APIs, such as SyncPoller or use of EventProcessorClient, enabling you to optimize internal library calls, reduce latency, and minimize memory footprint.
  • Modern API patterns and best practices: Recommendations for adopting the latest API conventions, using performant APIs, avoiding complex reactive chaining, and ensuring efficient asynchronous programming.

These features are available starting with Azure Toolkit for IntelliJ version 3.95.0.

📦 Storage improvements

Prevent memory issues: Flags improper usage of Storage Upload APIs that don’t specify a length parameter, helping you avoid potential memory leaks and performance bottlenecks. It recommends explicitly specifying the length parameter or using BlockBlobClient for large uploads.

🔐 Identity & security enhancements

Secure authentication

  • Avoid hardcoded API keys: Detects hardcoded API keys and suggests using DefaultAzureCredential for secure, managed authentication to Microsoft Entra ID.hardcoded-api-keys-check
  • Connection string alternatives: Identifies connection string usage and recommends transitioning to Microsoft Entra ID credentials for enhanced security.

⚡ Asynchronous programming best practices

  • Simplified polling: Recommends SyncPoller for synchronous polling operations, which simplifies code readability and reduces complexity compared to PollerFlux#getSyncPoller().
  • Avoid blocking calls: Flags improper usage of blocking calls made on asynchronous methods, promoting nonblocking programming principles for better scalability and improving responsiveness.block-over-async-check
  • Reactive streams optimization: Highlights opportunities to optimize reactive streams by chaining operators like block and subscribe to improve performance and reduce memory overhead.
  • Timeout management: Identifies asynchronous calls lacking timeout configurations and recommends using APIs like timeout(Duration) to avoid indefinite waits, enhance reliability, and improve application responsiveness.

📬 Messaging (AMQP & Service Bus) recommendations

  • Service Bus client recommendation: Suggests replacing ServiceBusReceiverAsyncClient with ServiceBusProcessorClient for better concurrency management, built-in retry mechanisms, and simplified message processing.
  • Event Hub client recommendation: Detects the usage of EventHubConsumerAsyncClient and suggests using EventProcessorClient for streamlined event processing, automatic load balancing, and improved reliability.eventhub-consumer-client-check
  • Avoid message loss: Flags scenarios where autocomplete is enabled by default in Service Bus clients, recommends disabling it (disableAutoComplete()). Ensuring messages are explicitly acknowledged only after successful processing, preventing accidental completion, and potential data loss.
  • Efficient checkpoint management: Encourages using EventProcessorClient for streamlined checkpoint management and suggests replacing suboptimal updateCheckpointAsync usage with synchronous alternatives.

🌟 General best practices

  • Batch operations: Promotes batching operations instead of single operations within loops for improved performance.
  • Optimized Azure OpenAI usage: Recommends using getChatCompletions instead of getCompletions to achieve better performance and accuracy when working with Azure OpenAI services.
  • Dynamic client creation check: Identifies cases where client objects are dynamically created using methods like buildClient or buildAsyncClient. It recommends creating a single instance and reusing it to enhance performance and optimize resource management. These enhancements empower developers to write robust, scalable, and maintainable asynchronous code while using Azure SDK libraries effectively.

🎯 Why it matters

  • Real-time feedback: Instantly identify and fix potential issues as you code.
  • Improved code quality: Write cleaner, safer, and more maintainable Java code.
  • Optimized Azure SDK usage: Use best practices tailored specifically for Azure services.

🚦 Get started

Ready to enhance your Java development experience?

  1. Update your Azure Toolkit for IntelliJ to the latest version.
  2. Open your Java project in IntelliJ IDEA.
  3. Start coding and receive real-time suggestions!

📚 Learn more

We’re committed to enhancing your Azure development experience. Try the enhanced Azure Toolkit for Java Code Quality Analyzer today and share your feedback!

Author

Sameeksha Vaity
Software Engineer

I am a Software Engineer currently working at Microsoft on their Azure SDK Java team located on the Redmond campus. I love working for this team which is customer focused, driven by talent and share my interest of love for writing code and solving complex issues. In my spare time, you would mostly find me cooking experimental dishes and enjoying nature with some good music in the background!

0 comments