- 25 Jan 2023
- 1 Minute to read
Cloud Services Packages
- Updated on 25 Jan 2023
- 1 Minute to read
BuildMaster can be used to build, test, and deploy any type of application, that includes Azure Cloud Services
To deploy an Azure Cloud Services project, you need two files:
- a Cloud Service package file
.cspkgthat contains your compiled code that will run as a service.
- a Cloud Service config file
.cscfgcontains XML that determines configuration details for your Cloud Service.
These two files are created when you build a Cloud Services Project and they are used by Azure to provision and configure your Cloud Service instance in Azure. Upon a successful build these two files can be found in this path:
<ProjectPath>\bin\<Configuration>\app.publish which should be stored as a variable in your build plan to be used in your
set $projectPath = "C:\SourceCode\CloudServiceApp\"; set $csOutputFilePath = "$projectPath\bin\<Configuration>\app.publish";
In order to create the two Cloud Service Package files from BuildMaster you can use the
MSBuild::Build-Project operation. Simply add this operation into your plan and complete the form with the values that relate to your Cloud Service project.
MSBuild::Build-Project <pathToProject>\<web-project>.csproj ( Configuration: Debug, Platform: AnyCPU, Arguments: /t:Publish /p:TargetProfile=Local /p:AutomatedBuild=True To: <pathToProject>\<web-project> );
This plan effectively runs this msbuild.exe command
msbuild <web_app.csproj> /t:Publish /p:TargetProfile=Local /p:AutomatedBuild=True
Now that you have created the
.cscfg files you can use them to create your Cloud Service in Azure. From inside a Powershell operation, the Azure PowerShell command
Publish-AzureServiceProject is used to build the
.cspkg and upload it. This can be added to your deploy plan by using the PSExec operation.
Execute-PowerShell Publish-AzureServiceProject -package $csOutputFilePath\AzureCloudService1.cspkg -config $csOutputFilePath\ServiceConfiguration.Local.cscfg;