3
votes

How to access .jks file stored in "Azure Secure Files" from "Azure Pipelines" while signing Android apk?

My idea is just to call gradlew assembleRelease to generate and sign apk on Azure Pipeline. Signing in gradle is configured like this:

    signingConfigs {
    register("release") {
        storeFile(file(System.getenv("APK_KEYSTORE")))
        storePassword(System.getenv("APK_KEYSTORE_PASSWORD"))
        keyAlias(System.getenv("APK_KEY_ALIAS"))
        keyPassword(System.getenv("APK_KEY_PASSWORD"))
    }
}

It works locally but can't access the APK_KEYSTORE file stored in "secured files" in Azure

What I've already tried and it works is this Android signing task, but I need signing and generating apk locally also, so I need this one example above

1
Hi @artois. Is there any update about this ticket? Feel free to let me know if the answer could give you some help. Just a remind of this.Kevin Lu-MSFT

1 Answers

5
votes

How to access .jks file stored in "Azure Secure Files" from "Azure Pipelines" while signing Android apk?

In Azure Pipelines, you couldn't directly use the Secure file from Pipelines -> Library -> Secure files.

You need to add the Download secure file task in the Pipeline. Then the .jks file will be download to $(Agent.TempDirectory). This is the Agent temp folder(e.g. /home/vsts/work/_temp).

Here is an example:

enter image description here

When running the pipeline, the .jks will be downloaded to the local, and then you can find and use it in the temp folder(Path: $(Agent.TempDirectory)/key.jks ).