Adjusting VM Size in Classic Cloud Services Without .csdef access for Migration to CSES
Published May 09 2024 07:48 PM 843 Views

Co-Authors: David Padilla, Pablo Castro

Scenario  

Customers migrating from Classic Cloud Service to Cloud Service (Extended Support) often face a challenge if they have been running Classic Cloud Services for years without changes, leading to lost source code or only having access to the final product (package and .cscfg files).  
 
A frequent migration issue arises when the Classic Cloud Service utilizes a deprecated VM SKU Family like (A-Series), and without the source code, customers are unable to modify the VM size in the Service Definition File and repackage the project. 
 
The following Blog will help in this specific scenario to allow the migration without the need for the source code. 
 

carlosbermudezlopez_0-1715289602918.png


Requirement 
Access to the config files. If you do not have access to these files, please reference the following blog about How to retrieve Cloud Service Packages from an existing Classic Cloud Service. 
 
Step #1 
Change the package extension .cspkg to .zip. 
 

carlosbermudezlopez_1-1715289602920.png

 

Step #2 
Unzip the .cspkg file and change the extension of the .csdx file to zip. 

carlosbermudezlopez_2-1715289602921.png

 

Step #3 
Unzip the .csdx file. 
 

carlosbermudezlopez_3-1715289602923.png
Step #4 

Access the Service Definition file 

carlosbermudezlopez_4-1715289602924.png

 

Step #5 
Open and edit the VM size (in this case we changed from "Standard_A1_v2" to "Standard_D1_v2") and save it.
 

carlosbermudezlopez_5-1715289602927.png

 

Step #6 
Since the file has changed, it is necessary to get the new hash, this is possible using the PowerShell command Get-FileHash. 
 

carlosbermudezlopez_6-1715289602930.png

 

Step #7 
On same directory where the Definition file is, the .csman file is available, this is the Manifest.
 

carlosbermudezlopez_7-1715289602931.png
Step #8 
Edit the .csman file, changing the hash of the .csdef using the new one obtained from PowerShell on Step #6. 
 

carlosbermudezlopez_8-1715289602932.png

 

 Step #9 
IMPORTANT.  It is necessary to zip again all the files, however, if we zip the folder unzipped it will fail:  

  • You need to be inside the unzipped folder where you did the changes of csdef and csman file  
  • Select all the files and zip them. 
  • After, you should move this new zip file outside from "cspkgchangetest\SDPackage_56bee6e2-6455-4f15-b8b5-c5328044988c" to "cspkgchangetest\" and rename it and change de extension to csdx Example: SDPackage_56bee6e2-6455-4f15-b8b5-c5328044988c.csdx 
  • Delete the old "SDPackage_56bee6e2-6455-4f15-b8b5-c5328044988c" zip file and unzipped folder 
     
    carlosbermudezlopez_9-1715289602935.png 

Step #10 
At "cspkgchangetest\" level having the new modified csdx file, you should repeat the steps that you did with the csdef file: 

  • Use the PowerShell command Get-FileHash the get a new hash to "SDPackage_56bee6e2-6455-4f15-b8b5-c5328044988c.csdx" 
  • Edit de csman file changing the hash of "SDPackage_56bee6e2-6455-4f15-b8b5-c5328044988c.csdx" 

                         carlosbermudezlopez_10-1715289602938.png

  • Now, we are ready to zip the package and deploy.

                           carlosbermudezlopez_11-1715289602940.png

 
Step #11 Finally, it should be able to update the cloud service deployment using the new files, to update the VM Size. 

DISCLAIMER   
While the process described is indeed functional and accurate, it is advisable to employ it only as a contingency measure or as a way to obtain the original csdef file to later use these files as a reference for the creation of a new solution and subsequently create a new deployment 

 

Version history
Last update:
‎May 09 2024 02:58 PM
Updated by: