Adjusting VM Size in Classic Cloud Services Without .csdef access for Migration to CSES

Adjusting VM Size in Classic Cloud Services Without .csdef access for Migration to CSES

Co-Authors: David Padilla, Pablo Castro


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. 


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. 



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



Step #3 
Unzip the .csdx file. 

Step #4 

Access the Service Definition file 



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



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



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

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



 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 

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" 


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


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

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 


Published on:

Learn more
Azure PaaS Blog articles
Azure PaaS Blog articles

Azure PaaS Blog articles

Share post:

Related posts

Stay up to date with latest Microsoft Dynamics 365 and Power Platform news!
* Yes, I agree to the privacy policy