'Create Variables for SSAS XMLA Script

I need to deploy my tabular cube to different environments. The client wants to use XMLA scripts. The auto-generated XMLA by SSMS includes hard codes data sources connection details. Is there a way I can replace them with an environment variable or look up a table for them?

I found this article, but is this really the only way of doing it? https://www.mssqltips.com/sqlservertip/2790/dynamic-xmla-using-tsql-for-sql-server-analysis-services/



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source