This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git


The following commit(s) were added to refs/heads/main by this push:
     new 591b0aab68 Add azure-key-vault native support
591b0aab68 is described below

commit 591b0aab68b95f363bb3321a0675ede93e25a3ff
Author: James Netherton <jamesnether...@gmail.com>
AuthorDate: Wed Jul 3 10:08:11 2024 +0100

    Add azure-key-vault native support
    
    Fixes #6248
---
 .../ROOT/examples/components/azure-key-vault.yml   |  6 +-
 .../reference/extensions/azure-key-vault.adoc      | 21 ++++--
 .../vault/deployment/AzureKeyVaultProcessor.java   | 46 ------------
 extensions-jvm/pom.xml                             |  1 -
 .../azure-key-vault/deployment/pom.xml             |  0
 .../vault/deployment/AzureKeyVaultProcessor.java   | 83 ++++++++++++++++++++++
 .../azure-key-vault/pom.xml                        |  2 +-
 .../azure-key-vault/runtime/pom.xml                |  1 +
 .../main/resources/META-INF/quarkus-extension.yaml |  3 +-
 extensions/pom.xml                                 |  1 +
 integration-test-groups/azure/README.adoc          |  5 +-
 .../azure}/azure-key-vault/pom.xml                 | 48 +++++++------
 .../azure/key/vault/it/AzureKeyVaultResource.java  |  0
 .../azure/key/vault/it/AzureKeyVaultRoutes.java    |  0
 .../src/main/resources/application.properties      |  6 +-
 .../azure/key/vault/it/AzureKeyVaultIT.java        | 30 ++++++++
 .../azure/key/vault/it/AzureKeyVaultTest.java      |  0
 integration-test-groups/azure/azure-resources.sh   | 15 ++--
 integration-test-groups/azure/pom.xml              |  1 +
 integration-tests-jvm/pom.xml                      |  1 -
 integration-tests/azure-grouped/pom.xml            | 17 +++++
 21 files changed, 200 insertions(+), 87 deletions(-)

diff --git a/docs/modules/ROOT/examples/components/azure-key-vault.yml 
b/docs/modules/ROOT/examples/components/azure-key-vault.yml
index d958b4acd3..392886f307 100644
--- a/docs/modules/ROOT/examples/components/azure-key-vault.yml
+++ b/docs/modules/ROOT/examples/components/azure-key-vault.yml
@@ -2,11 +2,11 @@
 # This file was generated by 
camel-quarkus-maven-plugin:update-extension-doc-page
 cqArtifactId: camel-quarkus-azure-key-vault
 cqArtifactIdBase: azure-key-vault
-cqNativeSupported: false
-cqStatus: Preview
+cqNativeSupported: true
+cqStatus: Stable
 cqDeprecated: false
 cqJvmSince: 2.10.0
-cqNativeSince: n/a
+cqNativeSince: 3.13.0
 cqCamelPartName: azure-key-vault
 cqCamelPartTitle: Azure Key Vault
 cqCamelPartDescription: Manage secrets and keys in Azure Key Vault Service
diff --git a/docs/modules/ROOT/pages/reference/extensions/azure-key-vault.adoc 
b/docs/modules/ROOT/pages/reference/extensions/azure-key-vault.adoc
index 84179e78f7..9d57aed712 100644
--- a/docs/modules/ROOT/pages/reference/extensions/azure-key-vault.adoc
+++ b/docs/modules/ROOT/pages/reference/extensions/azure-key-vault.adoc
@@ -4,17 +4,17 @@
 = Azure Key Vault
 :linkattrs:
 :cq-artifact-id: camel-quarkus-azure-key-vault
-:cq-native-supported: false
-:cq-status: Preview
-:cq-status-deprecation: Preview
+:cq-native-supported: true
+:cq-status: Stable
+:cq-status-deprecation: Stable
 :cq-description: Manage secrets and keys in Azure Key Vault Service
 :cq-deprecated: false
 :cq-jvm-since: 2.10.0
-:cq-native-since: n/a
+:cq-native-since: 3.13.0
 
 ifeval::[{doc-show-badges} == true]
 [.badges]
-[.badge-key]##JVM since##[.badge-supported]##2.10.0## 
[.badge-key]##Native##[.badge-unsupported]##unsupported##
+[.badge-key]##JVM since##[.badge-supported]##2.10.0## [.badge-key]##Native 
since##[.badge-supported]##3.13.0##
 endif::[]
 
 Manage secrets and keys in Azure Key Vault Service
@@ -29,6 +29,10 @@ Please refer to the above link for usage and configuration 
details.
 [id="extensions-azure-key-vault-maven-coordinates"]
 == Maven coordinates
 
+https://{link-quarkus-code-generator}/?extension-search=camel-quarkus-azure-key-vault[Create
 a new project with this extension on {link-quarkus-code-generator}, 
window="_blank"]
+
+Or add the coordinates to your existing project:
+
 [source,xml]
 ----
 <dependency>
@@ -39,3 +43,10 @@ Please refer to the above link for usage and configuration 
details.
 ifeval::[{doc-show-user-guide-link} == true]
 Check the xref:user-guide/index.adoc[User guide] for more information about 
writing Camel Quarkus applications.
 endif::[]
+
+[id="extensions-azure-key-vault-ssl-in-native-mode"]
+== SSL in native mode
+
+This extension auto-enables SSL support in native mode. Hence you do not need 
to add
+`quarkus.ssl.native=true` to your `application.properties` yourself. See also
+https://quarkus.io/guides/native-and-ssl[Quarkus SSL guide].
diff --git 
a/extensions-jvm/azure-key-vault/deployment/src/main/java/org/apache/camel/quarkus/component/azure/key/vault/deployment/AzureKeyVaultProcessor.java
 
b/extensions-jvm/azure-key-vault/deployment/src/main/java/org/apache/camel/quarkus/component/azure/key/vault/deployment/AzureKeyVaultProcessor.java
deleted file mode 100644
index 10441a42ca..0000000000
--- 
a/extensions-jvm/azure-key-vault/deployment/src/main/java/org/apache/camel/quarkus/component/azure/key/vault/deployment/AzureKeyVaultProcessor.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.quarkus.component.azure.key.vault.deployment;
-
-import io.quarkus.deployment.annotations.BuildStep;
-import io.quarkus.deployment.annotations.ExecutionTime;
-import io.quarkus.deployment.annotations.Record;
-import io.quarkus.deployment.builditem.FeatureBuildItem;
-import io.quarkus.deployment.pkg.steps.NativeOrNativeSourcesBuild;
-import org.apache.camel.quarkus.core.JvmOnlyRecorder;
-import org.jboss.logging.Logger;
-
-class AzureKeyVaultProcessor {
-
-    private static final Logger LOG = 
Logger.getLogger(AzureKeyVaultProcessor.class);
-    private static final String FEATURE = "camel-azure-key-vault";
-
-    @BuildStep
-    FeatureBuildItem feature() {
-        return new FeatureBuildItem(FEATURE);
-    }
-
-    /**
-     * Remove this once this extension starts supporting the native mode.
-     */
-    @BuildStep(onlyIf = NativeOrNativeSourcesBuild.class)
-    @Record(value = ExecutionTime.RUNTIME_INIT)
-    void warnJvmInNative(JvmOnlyRecorder recorder) {
-        JvmOnlyRecorder.warnJvmInNative(LOG, FEATURE); // warn at build time
-        recorder.warnJvmInNative(FEATURE); // warn at runtime
-    }
-}
diff --git a/extensions-jvm/pom.xml b/extensions-jvm/pom.xml
index 97e0accb35..278b295354 100644
--- a/extensions-jvm/pom.xml
+++ b/extensions-jvm/pom.xml
@@ -40,7 +40,6 @@
         <module>aws-secrets-manager</module>
         <module>aws-xray</module>
         <module>azure-cosmosdb</module>
-        <module>azure-key-vault</module>
         <module>azure-servicebus</module>
         <module>azure-storage-datalake</module>
         <module>barcode</module>
diff --git a/extensions-jvm/azure-key-vault/deployment/pom.xml 
b/extensions/azure-key-vault/deployment/pom.xml
similarity index 100%
rename from extensions-jvm/azure-key-vault/deployment/pom.xml
rename to extensions/azure-key-vault/deployment/pom.xml
diff --git 
a/extensions/azure-key-vault/deployment/src/main/java/org/apache/camel/quarkus/component/azure/key/vault/deployment/AzureKeyVaultProcessor.java
 
b/extensions/azure-key-vault/deployment/src/main/java/org/apache/camel/quarkus/component/azure/key/vault/deployment/AzureKeyVaultProcessor.java
new file mode 100644
index 0000000000..d374450c41
--- /dev/null
+++ 
b/extensions/azure-key-vault/deployment/src/main/java/org/apache/camel/quarkus/component/azure/key/vault/deployment/AzureKeyVaultProcessor.java
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.azure.key.vault.deployment;
+
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import com.azure.json.JsonSerializable;
+import com.azure.security.keyvault.secrets.implementation.SecretClientImpl;
+import 
com.azure.security.keyvault.secrets.implementation.models.KeyVaultErrorException;
+import 
com.microsoft.azure.proton.transport.proxy.impl.DigestProxyChallengeProcessorImpl;
+import io.quarkus.deployment.annotations.BuildProducer;
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
+import io.quarkus.deployment.builditem.ExtensionSslNativeSupportBuildItem;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
+import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
+import 
io.quarkus.deployment.builditem.nativeimage.NativeImageProxyDefinitionBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
+import 
io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem;
+import org.jboss.jandex.ClassInfo;
+
+class AzureKeyVaultProcessor {
+    private static final String FEATURE = "camel-azure-key-vault";
+
+    @BuildStep
+    FeatureBuildItem feature() {
+        return new FeatureBuildItem(FEATURE);
+    }
+
+    @BuildStep
+    ExtensionSslNativeSupportBuildItem enableNativeSslSupport() {
+        return new ExtensionSslNativeSupportBuildItem(FEATURE);
+    }
+
+    @BuildStep
+    IndexDependencyBuildItem indexDependencies() {
+        return new IndexDependencyBuildItem("com.azure", 
"azure-security-keyvault-secrets");
+    }
+
+    @BuildStep
+    void registerForReflection(CombinedIndexBuildItem combinedIndex, 
BuildProducer<ReflectiveClassBuildItem> reflectiveClass) {
+        Set<String> keyVaultModelClasses = combinedIndex.getIndex()
+                .getAllKnownImplementors(JsonSerializable.class)
+                .stream()
+                .map(ClassInfo::toString)
+                .filter(className -> 
className.startsWith("com.azure.security.keyvault"))
+                .collect(Collectors.toSet());
+
+        keyVaultModelClasses.add(KeyVaultErrorException.class.getName());
+
+        
reflectiveClass.produce(ReflectiveClassBuildItem.builder(keyVaultModelClasses.toArray(new
 String[0]))
+                .methods(true)
+                .build());
+    }
+
+    @BuildStep
+    void 
runtimeInitializedClasses(BuildProducer<RuntimeInitializedClassBuildItem> 
runtimeInitializedClass) {
+        runtimeInitializedClass
+                .produce(new 
RuntimeInitializedClassBuildItem("com.microsoft.azure.proton.transport.ws.impl.Utils"));
+        runtimeInitializedClass
+                .produce(new 
RuntimeInitializedClassBuildItem(DigestProxyChallengeProcessorImpl.class.getName()));
+    }
+
+    @BuildStep
+    NativeImageProxyDefinitionBuildItem nativeImageProxyDefinitions() {
+        return new 
NativeImageProxyDefinitionBuildItem(SecretClientImpl.SecretClientService.class.getName());
+    }
+}
diff --git a/extensions-jvm/azure-key-vault/pom.xml 
b/extensions/azure-key-vault/pom.xml
similarity index 96%
rename from extensions-jvm/azure-key-vault/pom.xml
rename to extensions/azure-key-vault/pom.xml
index b7e09c8d03..926ac31304 100644
--- a/extensions-jvm/azure-key-vault/pom.xml
+++ b/extensions/azure-key-vault/pom.xml
@@ -21,7 +21,7 @@
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.camel.quarkus</groupId>
-        <artifactId>camel-quarkus-extensions-jvm</artifactId>
+        <artifactId>camel-quarkus-extensions</artifactId>
         <version>3.13.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
diff --git a/extensions-jvm/azure-key-vault/runtime/pom.xml 
b/extensions/azure-key-vault/runtime/pom.xml
similarity index 98%
rename from extensions-jvm/azure-key-vault/runtime/pom.xml
rename to extensions/azure-key-vault/runtime/pom.xml
index f20832f441..f4be0dca15 100644
--- a/extensions-jvm/azure-key-vault/runtime/pom.xml
+++ b/extensions/azure-key-vault/runtime/pom.xml
@@ -32,6 +32,7 @@
 
     <properties>
         <camel.quarkus.jvmSince>2.10.0</camel.quarkus.jvmSince>
+        <camel.quarkus.nativeSince>3.13.0</camel.quarkus.nativeSince>
     </properties>
 
     <dependencies>
diff --git 
a/extensions-jvm/azure-key-vault/runtime/src/main/resources/META-INF/quarkus-extension.yaml
 
b/extensions/azure-key-vault/runtime/src/main/resources/META-INF/quarkus-extension.yaml
similarity index 97%
rename from 
extensions-jvm/azure-key-vault/runtime/src/main/resources/META-INF/quarkus-extension.yaml
rename to 
extensions/azure-key-vault/runtime/src/main/resources/META-INF/quarkus-extension.yaml
index 4abc9f6cab..3ada86b3d6 100644
--- 
a/extensions-jvm/azure-key-vault/runtime/src/main/resources/META-INF/quarkus-extension.yaml
+++ 
b/extensions/azure-key-vault/runtime/src/main/resources/META-INF/quarkus-extension.yaml
@@ -25,9 +25,8 @@ name: "Camel Azure Key Vault"
 description: "Manage secrets and keys in Azure Key Vault Service"
 metadata:
   icon-url: 
"https://raw.githubusercontent.com/apache/camel-website/main/antora-ui-camel/src/img/logo-d.svg";
-  unlisted: true
   guide: 
"https://camel.apache.org/camel-quarkus/latest/reference/extensions/azure-key-vault.html";
   categories:
   - "integration"
   status:
-  - "preview"
+  - "stable"
diff --git a/extensions/pom.xml b/extensions/pom.xml
index 120c216785..9d3cf20d12 100644
--- a/extensions/pom.xml
+++ b/extensions/pom.xml
@@ -63,6 +63,7 @@
         <module>aws2-sts</module>
         <module>aws2-translate</module>
         <module>azure-eventhubs</module>
+        <module>azure-key-vault</module>
         <module>azure-storage-blob</module>
         <module>azure-storage-queue</module>
         <module>base64</module>
diff --git a/integration-test-groups/azure/README.adoc 
b/integration-test-groups/azure/README.adoc
index 4a234eb335..55a067376c 100644
--- a/integration-test-groups/azure/README.adoc
+++ b/integration-test-groups/azure/README.adoc
@@ -19,6 +19,7 @@ 
https://docs.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-po
 * View the 
https://docs.microsoft.com/en-us/azure/storage/common/storage-account-keys-manage?tabs=azure-portal#view-account-access-keys[account
 keys] and set the following environment variables:
 * An https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-create[Azure 
Event Hub]
 * An 
https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-get-connection-string[Event
 Hubs connection string]
+* A https://learn.microsoft.com/en-us/azure/key-vault/general/overview[Key 
Vault] configured in your Azure account
 
 To create all of the above, you can use `azure-resources.sh` script as 
follows. Ensure that you have installed the 
https://docs.microsoft.com/en-us/cli/azure/[Azure CLI] beforehand:
 
@@ -36,10 +37,12 @@ Here are the environment variables you need to set:
 export AZURE_STORAGE_ACCOUNT_NAME=<your-azure-storage-account-name>
 export AZURE_STORAGE_ACCOUNT_KEY=<your-azure-storage-account-key>
 
-# optional to test alternate authentication methods
 export AZURE_CLIENT_ID=<your-azure-app-client-id>
 export AZURE_CLIENT_SECRET=<your-azure-app-client-secret>
 export AZURE_TENANT_ID=<your-azure-app-tenant-id>
+export AZURE_VAULT_NAME=<your-azure-key-vault-name>
+
+# optional to test alternate authentication methods
 export AZURE_CLIENT_CERTIFICATE_PATH=<your-azure-app-certificate-pem-file>
 
 # the container has to exist before you run the test
diff --git a/integration-tests-jvm/azure-key-vault/pom.xml 
b/integration-test-groups/azure/azure-key-vault/pom.xml
similarity index 80%
rename from integration-tests-jvm/azure-key-vault/pom.xml
rename to integration-test-groups/azure/azure-key-vault/pom.xml
index 864105c6f2..73ac571983 100644
--- a/integration-tests-jvm/azure-key-vault/pom.xml
+++ b/integration-test-groups/azure/azure-key-vault/pom.xml
@@ -23,32 +23,13 @@
         <groupId>org.apache.camel.quarkus</groupId>
         <artifactId>camel-quarkus-build-parent-it</artifactId>
         <version>3.13.0-SNAPSHOT</version>
-        <relativePath>../../poms/build-parent-it/pom.xml</relativePath>
+        <relativePath>../../../poms/build-parent-it/pom.xml</relativePath>
     </parent>
 
     <artifactId>camel-quarkus-integration-test-azure-key-vault</artifactId>
     <name>Camel Quarkus :: Integration Tests :: Azure Key Vault</name>
     <description>Integration tests for Camel Quarkus Azure Key Vault 
extension</description>
 
-    <dependencyManagement>
-        <dependencies>
-            <dependency>
-                <groupId>${quarkus.platform.group-id}</groupId>
-                <artifactId>${quarkus.platform.artifact-id}</artifactId>
-                <version>${quarkus.platform.version}</version>
-                <type>pom</type>
-                <scope>import</scope>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.camel.quarkus</groupId>
-                <artifactId>camel-quarkus-bom-test</artifactId>
-                <version>${camel-quarkus.version}</version>
-                <type>pom</type>
-                <scope>import</scope>
-            </dependency>
-        </dependencies>
-    </dependencyManagement>
-
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
@@ -82,6 +63,33 @@
     </dependencies>
 
     <profiles>
+        <profile>
+            <id>native</id>
+            <activation>
+                <property>
+                    <name>native</name>
+                </property>
+            </activation>
+            <properties>
+                <quarkus.native.enabled>true</quarkus.native.enabled>
+            </properties>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-failsafe-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <goals>
+                                    <goal>integration-test</goal>
+                                    <goal>verify</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
         <profile>
             <id>virtualDependencies</id>
             <activation>
diff --git 
a/integration-tests-jvm/azure-key-vault/src/main/java/org/apache/camel/quarkus/component/azure/key/vault/it/AzureKeyVaultResource.java
 
b/integration-test-groups/azure/azure-key-vault/src/main/java/org/apache/camel/quarkus/component/azure/key/vault/it/AzureKeyVaultResource.java
similarity index 100%
rename from 
integration-tests-jvm/azure-key-vault/src/main/java/org/apache/camel/quarkus/component/azure/key/vault/it/AzureKeyVaultResource.java
rename to 
integration-test-groups/azure/azure-key-vault/src/main/java/org/apache/camel/quarkus/component/azure/key/vault/it/AzureKeyVaultResource.java
diff --git 
a/integration-tests-jvm/azure-key-vault/src/main/java/org/apache/camel/quarkus/component/azure/key/vault/it/AzureKeyVaultRoutes.java
 
b/integration-test-groups/azure/azure-key-vault/src/main/java/org/apache/camel/quarkus/component/azure/key/vault/it/AzureKeyVaultRoutes.java
similarity index 100%
rename from 
integration-tests-jvm/azure-key-vault/src/main/java/org/apache/camel/quarkus/component/azure/key/vault/it/AzureKeyVaultRoutes.java
rename to 
integration-test-groups/azure/azure-key-vault/src/main/java/org/apache/camel/quarkus/component/azure/key/vault/it/AzureKeyVaultRoutes.java
diff --git 
a/integration-tests-jvm/azure-key-vault/src/main/resources/application.properties
 
b/integration-test-groups/azure/azure-key-vault/src/main/resources/application.properties
similarity index 82%
rename from 
integration-tests-jvm/azure-key-vault/src/main/resources/application.properties
rename to 
integration-test-groups/azure/azure-key-vault/src/main/resources/application.properties
index 251f65d06e..b1a4b92e90 100644
--- 
a/integration-tests-jvm/azure-key-vault/src/main/resources/application.properties
+++ 
b/integration-test-groups/azure/azure-key-vault/src/main/resources/application.properties
@@ -15,7 +15,7 @@
 ## limitations under the License.
 ## ---------------------------------------------------------------------------
 #
-camel.vault.azure.tenantId = ${AZURE_TENANT_ID}
-camel.vault.azure.clientId = ${AZURE_CLIENT_ID}
-camel.vault.azure.clientSecret = ${AZURE_CLIENT_SECRET}
+camel.vault.azure.tenantId = ${AZURE_TENANT_ID:placeholderTenantId}
+camel.vault.azure.clientId = ${AZURE_CLIENT_ID:placeholderClientId}
+camel.vault.azure.clientSecret = ${AZURE_CLIENT_SECRET:placeholderClientSecret}
 camel.vault.azure.vaultName = ${AZURE_VAULT_NAME:cq-vault-testing}
\ No newline at end of file
diff --git 
a/integration-test-groups/azure/azure-key-vault/src/test/java/org/apache/camel/quarkus/component/azure/key/vault/it/AzureKeyVaultIT.java
 
b/integration-test-groups/azure/azure-key-vault/src/test/java/org/apache/camel/quarkus/component/azure/key/vault/it/AzureKeyVaultIT.java
new file mode 100644
index 0000000000..c6b8875c62
--- /dev/null
+++ 
b/integration-test-groups/azure/azure-key-vault/src/test/java/org/apache/camel/quarkus/component/azure/key/vault/it/AzureKeyVaultIT.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.azure.key.vault.it;
+
+import io.quarkus.test.junit.QuarkusIntegrationTest;
+import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
+
+// Azure Key Vault is not supported by Azurite 
https://github.com/Azure/Azurite/issues/619
+@EnabledIfEnvironmentVariable(named = "AZURE_TENANT_ID", matches = ".+")
+@EnabledIfEnvironmentVariable(named = "AZURE_CLIENT_ID", matches = ".+")
+@EnabledIfEnvironmentVariable(named = "AZURE_CLIENT_SECRET", matches = ".+")
+@EnabledIfEnvironmentVariable(named = "AZURE_VAULT_NAME", matches = ".+")
+@QuarkusIntegrationTest
+class AzureKeyVaultIT extends AzureKeyVaultTest {
+
+}
diff --git 
a/integration-tests-jvm/azure-key-vault/src/test/java/org/apache/camel/quarkus/component/azure/key/vault/it/AzureKeyVaultTest.java
 
b/integration-test-groups/azure/azure-key-vault/src/test/java/org/apache/camel/quarkus/component/azure/key/vault/it/AzureKeyVaultTest.java
similarity index 100%
rename from 
integration-tests-jvm/azure-key-vault/src/test/java/org/apache/camel/quarkus/component/azure/key/vault/it/AzureKeyVaultTest.java
rename to 
integration-test-groups/azure/azure-key-vault/src/test/java/org/apache/camel/quarkus/component/azure/key/vault/it/AzureKeyVaultTest.java
diff --git a/integration-test-groups/azure/azure-resources.sh 
b/integration-test-groups/azure/azure-resources.sh
index 0e774bc022..243d541662 100755
--- a/integration-test-groups/azure/azure-resources.sh
+++ b/integration-test-groups/azure/azure-resources.sh
@@ -36,6 +36,8 @@ export ZONE=westeurope
 export EH_NAMESPACE=cq-eh-namenspace-${suffix}
 export EH_NAME=cq-event-hub-${suffix}
 
+export AZURE_VAULT_NAME="cq-key-vault"
+
 function createResources() {
     set -e
     set -x
@@ -78,19 +80,23 @@ function createResources() {
 
     AZURE_STORAGE_ACCOUNT_KEY=$(az storage account keys list --account-name 
${AZURE_STORAGE_ACCOUNT_NAME} --query '[0].value' -o tsv)
 
+    az keyvault create --name "${AZURE_VAULT_NAME}" --resource-group 
"${RESOURCE_GROUP}" --location "${ZONE}"
+    az role assignment create --role "Key Vault Administrator" --assignee 
"${az ad signed-in-user show --query 'id' --output tsv}" --scope 
"/subscriptions/$(az account show --query id --output 
tsv)/resourceGroups/${RESOURCE_GROUP}/providers/Microsoft.KeyVault/vaults/${AZURE_VAULT_NAME}"
+    az role assignment create --role "Key Vault Administrator" --assignee 
"${AZURE_CLIENT_ID}" --scope "/subscriptions/$(az account show --query id 
--output 
tsv)/resourceGroups/${RESOURCE_GROUP}/providers/Microsoft.KeyVault/vaults/${AZURE_VAULT_NAME}"
+
     set +x
     echo "Add the following to your environment:"
-
     echo 'export AZURE_STORAGE_ACCOUNT_NAME="'${AZURE_STORAGE_ACCOUNT_NAME}'"'
     echo 'export AZURE_STORAGE_ACCOUNT_KEY="'${AZURE_STORAGE_ACCOUNT_KEY}'"'
     echo 'export 
AZURE_EVENT_HUBS_BLOB_CONTAINER_NAME="'${AZURE_BLOB_CONTAINER_NAME}'"'
     echo 'export 
AZURE_EVENT_HUBS_CONNECTION_STRING="'$AZURE_EVENT_HUBS_CONNECTION_STRING';EntityPath='${EH_NAME}'"'
-    echo
-    echo
-    echo "Optionally set the following to test alternate authentication 
mechanisms:"
     echo 'export AZURE_CLIENT_ID="'${AZURE_CLIENT_ID}'"'
     echo 'export AZURE_CLIENT_SECRET="'${AZURE_CLIENT_SECRET}'"'
     echo 'export AZURE_TENANT_ID="'${AZURE_TENANT_ID}'"'
+    echo 'export AZURE_VAULT_NAME="'${AZURE_VAULT_NAME}'"'
+    echo
+    echo
+    echo "Optionally set the following to test alternate authentication 
mechanisms:"
     echo 'export AZURE_CLIENT_CERTIFICATE_PATH="'${AZURE_APP_CERT_PATH}'"'
 }
 
@@ -104,6 +110,7 @@ function deleteResources() {
     az storage account delete --name ${AZURE_STORAGE_ACCOUNT_NAME} 
--resource-group ${RESOURCE_GROUP} --yes
     az group delete --name ${RESOURCE_GROUP} --yes
     az ad app delete --id $(az ad app list --display-name ${AZURE_APP_NAME} 
--query '[0].appId' -o tsv)
+    az keyvault delete --name "${AZURE_VAULT_NAME}"
 }
 
 case "$1" in
diff --git a/integration-test-groups/azure/pom.xml 
b/integration-test-groups/azure/pom.xml
index 1e1d3a7e08..0cdabb63da 100644
--- a/integration-test-groups/azure/pom.xml
+++ b/integration-test-groups/azure/pom.xml
@@ -38,6 +38,7 @@
     <modules>
         <!-- extensions a..z; do not remove this comment, it is important when 
sorting via  mvn process-resources -Pformat -->
         <module>azure-eventhubs</module>
+        <module>azure-key-vault</module>
         <module>azure-storage-blob</module>
         <module>azure-storage-queue</module>
     </modules>
diff --git a/integration-tests-jvm/pom.xml b/integration-tests-jvm/pom.xml
index ab8f3a7239..aa47f5301d 100644
--- a/integration-tests-jvm/pom.xml
+++ b/integration-tests-jvm/pom.xml
@@ -38,7 +38,6 @@
         <module>aws-secrets-manager</module>
         <module>aws-xray</module>
         <module>azure-cosmosdb</module>
-        <module>azure-key-vault</module>
         <module>azure-servicebus</module>
         <module>azure-storage-datalake</module>
         <module>barcode</module>
diff --git a/integration-tests/azure-grouped/pom.xml 
b/integration-tests/azure-grouped/pom.xml
index b143ca60a6..7034a0b541 100644
--- a/integration-tests/azure-grouped/pom.xml
+++ b/integration-tests/azure-grouped/pom.xml
@@ -52,6 +52,10 @@
             <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-azure-eventhubs</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-azure-key-vault</artifactId>
+        </dependency>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-azure-storage-blob</artifactId>
@@ -181,6 +185,19 @@
                         </exclusion>
                     </exclusions>
                 </dependency>
+                <dependency>
+                    <groupId>org.apache.camel.quarkus</groupId>
+                    
<artifactId>camel-quarkus-azure-key-vault-deployment</artifactId>
+                    <version>${project.version}</version>
+                    <type>pom</type>
+                    <scope>test</scope>
+                    <exclusions>
+                        <exclusion>
+                            <groupId>*</groupId>
+                            <artifactId>*</artifactId>
+                        </exclusion>
+                    </exclusions>
+                </dependency>
                 <dependency>
                     <groupId>org.apache.camel.quarkus</groupId>
                     
<artifactId>camel-quarkus-azure-storage-blob-deployment</artifactId>

Reply via email to