Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Download uploaded cspkg file from Azure

Tags:

azure

Can I download the cspkg from Azure that I uploaded (rather than reuploading new package)?

The scenario is -

I need to add files into existing website - let say an image.

I rdp and add manually; however, Azure recreates a new instance and wipe out my files when my instance behaves so abnormally.

(Ideally, I should store them in storage, but the question is not about that.)

Thank you for your advice!

like image 850
Win Avatar asked Sep 20 '12 16:09

Win


2 Answers

[The paragraph below is incorrect]

Currently there is no API or mechanism which can download the exact same CSPKG directly from Windows Azure Portal which was uploaded. This sure is a big requirement from Windows Azure user specially when you loose your Windows Azure Project/Solution.

[Edit- Correction to above paragraph]

Using "Get Package" REST API you can download the package from specific deployment to your Azure Blog storage. IF you decide to write your own C# application to use REST API the sample is here. If you don't want to write API and just download the package using REST call, there are a few tools and I have used BURP (based on Java) as described in my blog here. You can use the info in the blog to setup connect to Azure Portal and then use REST call as documented to get the package.

Next even if you download the CSPKG (or have a local copy of CSPKG) still you can not edit it by adding or removing any content directly to it because this will break the CSPKG package integrity and you will get an error uploading it. The package must be created using CSPACK tool.

The Drive E:\ where your approot is does include most of your compiled code so if you can download it locally and come up with an idea to build a new project form that (???), that could be an option. If the package was created directly using CSPACK tool and the downloading the files from drive E:\ and recreating the package does work however if the project the a complex application included source and compiled code files i.e. ASP.NET/MVCx application, it is tough.

like image 128
AvkashChauhan Avatar answered Oct 08 '22 00:10

AvkashChauhan


I faced the similar issue,

What I did was,

Use Get-Package REST API calls to store cspkg and cscfg files in a storage container.

Remember this storage container should be in under the same subscription, otherwise Get-Package REST API calls will fail.

Then I used AzCopy (http://blogs.msdn.com/b/windowsazurestorage/archive/2012/12/03/azcopy-uploading-downloading-files-for-windows-azure-blobs.aspx) , to copy files from the storage container to my local disks.

You can also use AzCopy to copy from one StorageContainer to another, even under different subscriptions.

Let me know if you need more details.

like image 34
GauravKatoch Avatar answered Oct 08 '22 00:10

GauravKatoch