Powershell to identify whether the data source is legacy one

Nandan Hegde 31,346 Reputation points MVP
2021-01-27T04:57:00.613+00:00

Hello.
Is there any particular property via which we can identify through powershell whether the data source within an AAS is a legacy one ?

Legacy :

ConnectionString   : Persist Security Info=false;User ID=abc;Encrypt=true;TrustServerCertificate=false;Data 
                     Source=abc.database.windows.net;Initial Catalog=xyz
ImpersonationMode  : ImpersonateAccount
Account            : dev

New:

ConnectionDetails  : {"protocol":"tds","address":{"server":"abc.database.windows.net","database":"
                     xyz"},"authentication":null,"query":null}
Options            : {}
Credential         : {"AuthenticationKind":"UsernamePassword","Username":"1234","EncryptConnection":true,"Privac
                     ySetting":"Private"}

Note: 1 way is to compare whether the below powershell output contains a credential value:

$ServerName = "asazure://northeurope.asazure.windows.net/abc"
 $DB = "xyz" 

 $MyServer = New-Object Microsoft.AnalysisServices.Server
 $MyServer.Connect($ServerName)

 $myDatabase = $myServer.Databases.Item($DB)

Write-Output $myDatabase.Model.DataSources
Azure Analysis Services
Azure Analysis Services
An Azure service that provides an enterprise-grade analytics engine.
444 questions
{count} votes

Accepted answer
  1. Saurabh Sharma 23,791 Reputation points Microsoft Employee
    2021-01-29T19:06:23.347+00:00

    @Nandan Hegde Thanks for sharing that.
    Yes, I believe you are correct and you can use Credential property to identify if the source is legacy as the Credential object is only supported when the compatibility level of the database is at 1400 or above while creating and publishing your models from VS. Please refer to the documentation.

    ----------

    Please do not forget to "Accept the answer" wherever the information provided helps you to help others in the community.

    0 comments No comments

0 additional answers

Sort by: Most helpful