Voidsbane
Voidsbane

Reputation: 231

Is there any way download source code from "cloud services" in Windows Azure?

I don't have the latest version of the code deployed in the company's Windows Azure account, and I need to provide a fix to it. I know this can be done with "Azure Web Sites", but I'm not sure it's possible with "Azure Cloud Services".

Can anyone help?

Upvotes: 7

Views: 8438

Answers (5)

tallman
tallman

Reputation: 129

I realize it's an old question, in case anyone else needs it... I use the Cloud Explorer in Visual Studio 2017. In the Cloud explorer, you can drill down Subscription -> Resource Group -> App Service -> Files. Then, at the bottom of the Cloud Explorer, click "Download Files as a Zip."

Upvotes: 1

TheVillageIdiot
TheVillageIdiot

Reputation: 40507

Well, Azure now had a new portal and things are bit different. I had to retrieve the code for one of my websites.

To download the code,

  1. go to App Service. In Overview panel, download publisher profile.
  2. Now go to Deployment credentials panel. Enter the username for FTP and choose a password.
  3. To connect to ftp, you need the URL from publishing profile (example.PublishSettings).
  4. Now fire up your FTP client (FileZilla in my case) and put the FTP address and put the username like sitename\ftpusername (example\ftp-exmaple-user for me) and put in the password you choose in Deployment credentials panel.

wwwroot contains your code!

Upvotes: 1

user3394095
user3394095

Reputation: 31

yes. you can download it with an ftp client.

Ggo to dashboard of your site on https://manage.windowsazure.com. Get credentials (username , password, host) and connect with you preferred ftp client.

Upvotes: 1

Fernando Correia
Fernando Correia

Reputation: 22365

In Windows Azure Cloud Services, instances are uploaded in the form of .cspkg packages.

According to the documentation, the Get Package operation retrieves a cloud service package for a deployment and stores the package files in Windows Azure Blob storage.

You could then download and extract this package (it is in ZIP file format) to retrieve its content. See this answer for more details.

In the case of ASP.NET applications, that will be a mixture of text files and binary assemblies (.DLLs). In the case of Java, it will be .jar files. You could use the appropriate decompiler to retrieve an approximation of the original source code. But it probably wouldn't be safe to change this reverse-engineered source code and upload it back into production, at least not without extensive testing.

Upvotes: 2

Dennis Burton
Dennis Burton

Reputation: 3332

If you did git deployment of the cloud service, you could fetch from the remote the same way you could with Windows Azure Web Sites. You may have updated the cloud service by uploading the package to blob storage first, in which case you could get the package. But, the package is not source code.

From a process perspective, you should label your deployments with a tag that can be matched in source control. You never know when a "hotfix" needs to be added to a branch off of the current production code.

Upvotes: 2

Related Questions