I have a quarkus application which is a main app. Here is an simplified example:
@QuarkusMain
public class MyXYZTool {
public static void main(String... args) {
Quarkus.run(MyXYZTool.class, args);
}
public static class CacheApp implements QuarkusApplication {
@Inject
AgroalDataSource dataSource;
@Override
public int run(String... args) throws Exception {
readCommandLineParameter(args);
//and so on...
return 0;
}
}
};
I have also an application.properties which contains the credentials to access to an Azure cloud blobstorage.
Secrets.BlobStorages.xyz.ConnectionString=abcaccesstoken
I start my app from command line like this:
//start from command line
java -jar ./target/xyz-runner.jar
My app works also so far. But I want to hand over the credentials to access an Azure cloud blob storage over the command line. It should not be hardcoded in the application.properties. This has security reasons.
I ask me how I can hand over Secrets.BlobStorages.xyz.ConnectionString
over the command line and activate this.
Can somebody help me?
I have found an answer to my question by this webside from Quarkus: https://quarkus.io/guides/config#overriding-properties-at-runtime I tried it out and it works.