'azure-storage-wagon: Server failed to authenticate... Make sure ... Authorization header is formed correctly including the signature

When trying to follow the instructions at this link, I am getting an authentication failure from azure-storage-wagon lib.

Here is how I configured my pom.xml :

  <distributionManagement>
    <snapshotRepository>
      <id>my-repo-bucket-snapshot</id>
      <url>http://stacctname99.blob.core.windows.net/snapshot</url>
    </snapshotRepository>
    <repository>
      <id>my-repo-bucket-release</id>
      <url>http://stacctname99.blob.core.windows.net/release</url>
    </repository>
  </distributionManagement>

And, in my .m2/settings.xml, I configured it like so:

<servers>
<server>
    <id>my-repo-bucket-snapshot</id>
    <username>stacctname99</username>
    <password>XXrO5jvcWjtTcW/........MPrLIJsvb7A0Na3VK/Tg==</password>
</server>
<server>
    <id>my-repo-bucket-release</id>
    <username>stacctname99</username>
    <password>XXrO5jvcWjtTcW/.......MPrLIJsvb7A0Na3VK/Tg==</password>
</server>
</servers>

And here is the error that I get on mvn deploy . It makes me wonder if I shouldn't use a https/http url?

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project storage-wagon-poc: Failed to deploy artifacts: Could not transfer artifact com.st.azure:storage-wagon-poc:jar:1.0-20220518.171854-1 from/to my-repo-bucket-snapshot (http://stacctname99.blob.core.windows.net/snapshot): authorization failed for http://stacctname99.blob.core.windows.net/snapshot/com/st/azure/storage-wagon-poc/1.0-SNAPSHOT/storage-wagon-poc-1.0-20220518.171854-1.jar, status: 403 Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.

NOTE1: My storage account does not require https. My storage account is public access to both blobs and container. In debug mode, this azure-storage-wagon extension does not show me the header it sends in the request. How would you troubleshoot? Do you see a typo in my setup? The GitHub repo does not allow creating a new issue.

NOTE2: The lib seems to be looking for 6 env variables: https://github.com/Azure/azure-sdk-for-java/blob/83f62af66b349c4dc663489570ad78f97dfee2b1/sdk/identity/azure-identity/src/main/java/com/azure/identity/EnvironmentCredential.java BUT I am unsure where to find some of those values since the storageapp in azure portal does not just show them to you.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source