Uploading Jar files to azure blob storage

We are trying to use Octopus deploy as our deployment server for all types of workloads that will run in Azure platform.
One of the requirements we just got was to deploy scala jobs on Azure HDInsight spark cluster.
We are using bamboo server to build the scala project. It creates a jar files.
Our bamboo server runs on Windows.
After jar file is built we package it into a zip file and push it to Octopus deploy.
We don’t see tentacles as most of our deployments use Azure ARM or scripts.
I need to upload jar file to azure storage. After uploading the jar file,
I need to use REST API to call a service that will do the actual submission of the job to HDInsight.

jar file is in a package. I am trying to find the best way to extract the jar file and copy it to azure storage.
I was hoping to use Powershell script.

The only thing I have come up with is to deploy a package to a custom install directory on the Octopus deploy server.
I tried to select the deploy package option. It required defining a role. Role definition required installing a tentacle.
So far we have not had a use to install tentacle. The ARM scripts were executing fine even without a tentacle.

I have no problem with installing a tentacle. But I want to make sure I am not missing another simpler option.
I could have easily used a powershell script directly from bamboo to azure blob storage but I like the separation of deployment from the build server.

Let me know if somebody has a better way to upload a jar file to azure blob storage.

Thanks

Another option I was considering was offline deployment package and a powershell script. Is this better than installing a tentacle on the octopus deploy server?

Hi Raj,

I believe I understand what you are trying to achieve.

You can actually do this without installing a Tentacle. The only catch is, you will have to embed your PowerShell script in the NuGet package with your jar file.
Once you have done that, you can create a Run an Azure PowerShell Script step, and for the “Script Source” field select “Script file inside a package”.

Inside your PowerShell script you can use the $OctopusOriginalPackageDirectoryPath variable to get the location the package was extracted to.

The nice thing about this is, Azure steps are executed on the Octopus server, so no Tentacle is required.

I’m sorry the solution to achieve this isn’t more clear. This is something we’ll look to improve in the future.

I hope this helps. Don’t hesitate to reply if you have any issues.

Regards,
Michael

Thanks Michael. I had a demo coming up and I wanted to get this working. I had just check time in the various time zones and I was hoping that I will get a prompt reply.
Your suggestion will meet my needs. I appreciate your prompt response.

You’re most welcome Raj.

Good luck, and let us know if there’s anything else we can do to help.

Happy Deployments!

My project had only 1 step. this step executed the powershell script.
I tried using $OctopusOriginalPackageDirectoryPath and it seemed to be blank. Perhaps I am doing something wrong.
A simple example of how to use this variable in a custom powershell script that can be used to communicate with Azure would e great.

Thanks

Hi Raj,

I think I may have led you slightly astray, so I apologize.

If your single step is a “Run Azure PowerShell” step, then that variable won’t be available.
The files in the package can be accessed using relative-paths from your script. For example, the path to a hello.txt file in the same directory as your script within the package would be .\hello.txt.

Something that may be of interest to you is the Azure Blob Storage Upload step template from our community library.

Please let me know if this helps?

Regards,
Michael