Skip to content

Commit

Permalink
Overriding rules by copy/paste (#209)
Browse files Browse the repository at this point in the history
* Override rules

* Merge XML rules

* Merge Groovy rules

* Fix duplicate rule id
  • Loading branch information
agoncal authored Mar 15, 2024
1 parent a33cf99 commit 35b54da
Show file tree
Hide file tree
Showing 27 changed files with 626 additions and 369 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

* **Use HTTP-based communication**: Replace RMI with a more loosely coupled communication approach, such as HTTP or HTTPS, in combination with an architectural pattern like RESTful APIs.

* **Leverage Azure managed services**: You can also consider using Azure managed services to replace RMI. For real-time, bidirectional communication that require low-latency, consider integrating Azure SignalR Service. It simplifies real-time web functionality and supports WebSocket communication. For asynchronous, message-based communication, consider using Azure messaging services like Azure Service Bus or Azure Event Hubs.
* **Leverage Azure managed services**: You can also consider using Azure managed services to replace RMI. For real-time, bidirectional communication that require low-latency, consider integrating Azure SignalR Service. It simplifies real-time web functionality and supports WebSocket communication. For asynchronous, message-based communication, consider using Azure messaging services like Azure Service Bus or Azure Event Hubs.
</message>
<link title="Twelve-factor app - Backing services" href="https://12factor.net/backing-services"/>
<link title="Azure SignalR Service" href="https://learn.microsoft.com/azure/azure-signalr/signalr-overview"/>
Expand Down Expand Up @@ -66,7 +66,7 @@

* **Use HTTP-based communication**: Replace RMI with a more loosely coupled communication approach, such as HTTP or HTTPS, in combination with an architectural pattern like RESTful APIs.

* **Leverage Azure managed services**: You can also consider using Azure managed services to replace RMI. For real-time, bidirectional communication that require low-latency, consider integrating Azure SignalR Service. It simplifies real-time web functionality and supports WebSocket communication. For asynchronous, message-based communication, consider using Azure messaging services like Azure Service Bus or Azure Event Hubs.
* **Leverage Azure managed services**: You can also consider using Azure managed services to replace RMI. For real-time, bidirectional communication that require low-latency, consider integrating Azure SignalR Service. It simplifies real-time web functionality and supports WebSocket communication. For asynchronous, message-based communication, consider using Azure messaging services like Azure Service Bus or Azure Event Hubs.
</description>
<link title="Twelve-factor app - Backing services" href="https://12factor.net/backing-services"/>
<link title="Azure SignalR Service" href="https://learn.microsoft.com/azure/azure-signalr/signalr-overview"/>
Expand Down
12 changes: 6 additions & 6 deletions rules/rules-overridden-azure/cloud-readiness/mail.windup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
<rules>
<rule id="mail-00000">
<when>
<or>
<javaclass references="javax.mail.{*}"/>
<javaclass references="com.sun.mail.{*}"/>
<javaclass references="org.simplejavamail.{*}"/>
<javaclass references="org.apache.commons.mail.{*}"/>
</or>
<or>
<javaclass references="javax.mail.{*}"/>
<javaclass references="com.sun.mail.{*}"/>
<javaclass references="org.simplejavamail.{*}"/>
<javaclass references="org.apache.commons.mail.{*}"/>
</or>
</when>
<perform>
<hint title="Java Mail API" effort="3" category-id="potential">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
<rules>
<rule id="session-00001">
<when>
<or>
<javaclass references="javax.servlet.http.HttpSession.setAttribute({*})"/>
<javaclass references="javax.servlet.http.HttpSession.putValue({*})"/>
<or>
<javaclass references="javax.servlet.http.HttpSession.setAttribute({*})"/>
<javaclass references="javax.servlet.http.HttpSession.putValue({*})"/>
</or>
</when>
<perform>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
<rules>
<rule id="clustering-00000">
<when>
<xmlfile matches="/w:web-app/w:distributable">
<namespace prefix="w" uri="http://java.sun.com/xml/ns/javaee"/>
</xmlfile>
<xmlfile matches="/w:web-app/w:distributable">
<namespace prefix="w" uri="http://java.sun.com/xml/ns/javaee"/>
</xmlfile>
</when>
<perform>
<hint title="Distributed Environments found" category-id="mandatory" effort="5">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<hint title="Embedded library - Spring Cloud Config" category-id="information" effort="0">
<message>
The application embeds Spring Cloud Config.

If you are migrating to Azure Spring Apps, the connection info of Config Server will be injected automatically upon app start.
Find any explicit configurations of config server connection info:

Expand Down Expand Up @@ -70,13 +70,13 @@
<message>
The application embeds Spring Cloud Vault.
To migrate a Java application that uses Spring Cloud Vault to store and access secrets to Azure, you can follow this recommendation:
* Identify the backing secret store (for example, HashiCorp Vault or CredHub).

* Identify the backing secret store (for example, HashiCorp Vault or CredHub).

* Identify all the secrets used by the application code.

* Migrate Spring Cloud Vault secrets to Azure KeyVault. You can inject secrets directly into applications through Spring by using the Azure KeyVault Spring Boot Starter.

* Note that Migration may require you to rename some secrets. Update your application code accordingly.
</message>
<link title="Load a secret from Azure Key Vault in a Spring Boot application" href="https://learn.microsoft.com/azure/developer/java/spring-framework/configure-spring-boot-starter-java-app-with-azure-key-vault"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset id="connect"
<ruleset id="connect-xml"
xmlns="http://windup.jboss.org/schema/jboss-ruleset"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://windup.jboss.org/schema/jboss-ruleset http://windup.jboss.org/schema/jboss-ruleset/windup-jboss-ruleset.xsd">
Expand All @@ -11,12 +11,7 @@
<addon id="org.jboss.windup.rules,windup-rules-javaee,3.0.0.Final"/>
<addon id="org.jboss.windup.rules,windup-rules-java,3.0.0.Final"/>
</dependencies>
<targetTechnology id="azure-spring-apps"/>
<targetTechnology id="azure-appservice"/>
<targetTechnology id="azure-aks"/>
<targetTechnology id="azure-container-apps"/>
<tag>connect</tag>
<overrideRules>true</overrideRules>
</metadata>
<rules>
<rule id="connect-01500">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset id="database"
<ruleset id="database-xml"
xmlns="http://windup.jboss.org/schema/jboss-ruleset"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://windup.jboss.org/schema/jboss-ruleset http://windup.jboss.org/schema/jboss-ruleset/windup-jboss-ruleset.xsd">
Expand All @@ -11,15 +11,10 @@
<addon id="org.jboss.windup.rules,windup-rules-javaee,3.0.0.Final"/>
<addon id="org.jboss.windup.rules,windup-rules-java,3.0.0.Final"/>
</dependencies>
<targetTechnology id="azure-spring-apps"/>
<targetTechnology id="azure-appservice"/>
<targetTechnology id="azure-aks"/>
<targetTechnology id="azure-container-apps"/>
<tag>database</tag>
<overrideRules>true</overrideRules>
</metadata>
<rules>
<rule id="database-01400">
<rule id="database-01500">
<when>
<file filename="{*}mysql-connector{*}.jar"/>
</when>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
The application uses EHCache. Azure does not have a managed service for EHCache. You either have to set up the EHCache distribution on Azure yourself, or you can take advantage of a managed Redis service if you are ready to migrate from EHCache to Redis. Azure Cache for Redis offers scalability, high availability, and monitoring capabilities. **Azure Cache for Redis** provides features like data persistence, automatic failover, and built-in support for Redis commands, allowing you to leverage the benefits of Redis caching in your application running on Azure.

* **Provision an Azure Cache for Redis**: Configure the cache size and other relevant settings based on your application's requirements.

* **Update your Java code**: Replace the EHCache code in your Java application with the Azure Cache for Redis client libraries or SDKs. Update the code that establishes a connection to the Redis cache and performs cache-related operations.

* **Connect to Azure Cache for Redis**: Update the connection details in your Java application to point to the Azure Cache for Redis instance. Use the connection information provided by Azure (hostname, port, access keys, etc.) to establish a connection from your application.
</message>
<link title="Azure Cache for Redis documentation" href="https://learn.microsoft.com/azure/azure-cache-for-redis"/>
Expand Down Expand Up @@ -65,9 +65,9 @@
The application uses a Redis cache. You can take advantage of a managed Redis service that offers scalability, high availability, and monitoring capabilities. **Azure Cache for Redis** provides features like data persistence, automatic failover, and built-in support for Redis commands, allowing you to leverage the benefits of Redis caching in your application running on Azure.

* **Provision an Azure Cache for Redis**: Configure the cache size and other relevant settings based on your application's requirements.

* **Update your Java code**: Replace the embedded Redis cache code in your Java application with the Azure Cache for Redis client libraries or SDKs. Update the code that establishes a connection to the Redis cache and performs cache-related operations.

* **Connect to Azure Cache for Redis**: Connect your app to Azure Cache for Redis on azure by **Service Connector**. Use the connection information provided by Azure (hostname, port, access keys, etc.) to create a connection from your application.
</message>
<link title="Azure Cache for Redis documentation" href="https://learn.microsoft.com/azure/azure-cache-for-redis"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<hint title="Embedded framework - Feign" category-id="information" effort="0">
<message>
The application embeds the Feign framework. If you are migrating to Azure Spring Apps, it is recommended to use Spring Cloud OpenFeign instead (Spring Cloud Feign has been deprecated).

When migrating to Azure Spring Apps, Eureka (Standard Tier) or Service Registry (Enterprise Tier) will be hosted for you. Spring Cloud OpenFeign will easily discover the service registry and invoke the services.
</message>
<link title="Migrate clients bypassing the service registry" href="https://learn.microsoft.com/azure/developer/java/migration/migrate-spring-cloud-to-azure-spring-apps?pivots=sc-standard-tier#identify-clients-that-bypass-the-service-registry"/>
Expand All @@ -60,7 +60,7 @@
<hint title="Embedded framework - Zipkin" category-id="information" effort="0">
<message>
The application embeds the Zipkin framework. To migrate a Java application that uses Zipkin to Azure, it is recommended to use Azure Monitor instead.

* **Identify Zipkin dependencies**: Identify the Zipkin dependencies in your application.

* **Replace with Azure Monitor**: Azure Monitor provides distributed tracing capabilities. Azure services such as Azure Spring Apps, Azure Kubernetes Service, Azure App Service support auto-instrumentation for Azure Monitor.
Expand All @@ -86,7 +86,7 @@
<hint title="Embedded framework - Eureka Client" category-id="information" effort="0">
<message>
The application embeds the Eureka client. If you are migrating to Azure Spring Apps, the connection info of Eureka will be injected upon app start.

Find any explicit configurations of config server connection info:

If configured in **configuration files**: they will be ignored and overrided by Azure Spring Apps.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@

Consider using Azure Active Directory as an identity provider.
</message>
<link title="Spring Security-related dependencies found in the project" href="https://learn.microsoft.com/azure/developer/java/migration/migrate-spring-boot-to-app-service#identity-providers" />
<link title="Azure Active Directory (Azure AD) identity provider for External Identities" href="https://docs.microsoft.com/azure/active-directory/external-identities/azure-ad-account"/>
<link title="Spring Security" href="https://docs.spring.io/spring-security/reference/index.html"/>
<link title="Spring Boot API: Authorization" href="https://auth0.com/docs/quickstart/backend/java-spring-security5/01-authorization"/>
<link title="Spring Security-related dependencies found in the project" href="https://learn.microsoft.com/azure/developer/java/migration/migrate-spring-boot-to-app-service#identity-providers" />
<link title="Azure Active Directory (Azure AD) identity provider for External Identities" href="https://docs.microsoft.com/azure/active-directory/external-identities/azure-ad-account"/>
<link title="Spring Security" href="https://docs.spring.io/spring-security/reference/index.html"/>
<link title="Spring Boot API: Authorization" href="https://auth0.com/docs/quickstart/backend/java-spring-security5/01-authorization"/>
</hint>
<technology-tag level="INFORMATIONAL">Spring Security</technology-tag>
</perform>
Expand All @@ -95,7 +95,7 @@
<hint title="Embedded library - OAuth 2.0" category-id="information" effort="0">
<message>
The application embeds an OAuth 2.0 library. For Spring Boot applications, please ensure that the application is configured to use Spring Security OAuth2.

The Microsoft identity platform uses OAuth 2.0 and other protocols to enable applications to provide a Single Sign-On experience.

By migrating your SSO implementation to Azure AD with OAuth 2.0, you leverage the capabilities of Azure AD for managing identities and enabling secure SSO across your applications.
Expand Down
Loading

0 comments on commit 35b54da

Please sign in to comment.