1
votes

I have a Cloud Service Package file and a Service Configuration file uploaded on Azure File Storage. Now, I want to write a C# code to pull the files from the storage and upload it to the Cloud Service Staging Deployment and eventually run it as a WebJob.

I was able to achieve this using Powershell script (Publish-AzureServiceProject) on my local machine (with both the package and service file on my local machine) but faced issues while running it as a WebJob. Apparently, Azure PS commands are not completely supported on Azure Webjobs / Websites.

Could someone let me know how to achieve this using C#.

1

1 Answers

0
votes

As far as I known, there are two methods to achieve your requirements.

  1. using powershell commands and encapsulated powershell command using c#. Please refer this document about how to use Powershell to deployment cloud service. You can write code into ps file and call it using C# code.

  2. using REST API to create Cloud service and Deploy your package. Please refer to these methods: create cloud service and Create Deployment