liprec / vsts-release-aas

Repository for my Analysis Service Azure pipelines tasks related to Azure Analysis Service or Power BI Premium
Other
27 stars 28 forks source link

The DeploymentTarget element cannot appear under Envelope/Body/Execute/Command/Statement. #89

Closed rootd00d closed 2 years ago

rootd00d commented 2 years ago

Release task suddenly failing with --

The DeploymentTarget element at line 7, column 600 (namespace urn:schemas-microsoft-com:xml-analysis) cannot appear under Envelope/Body/Execute/Command/Statement.

No changes were made to the TMSL between an initial release, and the release today. Line 7 appears to be "name": "FOO" --

{
    "createOrReplace":  {
                            "object":  {
                                           "database":  "FOO"
                                       },
                            "database":  {
                                             "name":  "FOO",
                                             "compatibilityLevel":  1500,
                                             "model":  {
                                                           "culture":  "en-US",
                                                           "dataSources":  [
                                                                               {
                                                                                   "name":  "RESTRICTED",
                                                                                   "connectionString":  "Provider=SQLNCLI11;Data Source=#{DATABASE_SERVER}#;Persist Security Info=true;User ID=#{adminUsername}#;Password=#{adminPassword}#;Initial Catalog=RESTRICTED",
                                                                                   "impersonationMode":  "impersonateServiceAccount",
                                                                                   "annotations":  [
                                                                                                       {
                                                                                                           "name":  "ConnectionEditUISource",
                                                                                                           "value":  "SqlServer"
                                                                                                       }
                                                                                                   ]
                                                                               }
                                                                           ],

The models are built using Visual Studio tools (bim->asdatabase files), and then they are wrapped to create the TMSL --

{
"createOrReplace": {
    "object": {
        "database": "FOO"
    },
    "database": {}  # Contents of the asdatabase files placed here
    }
}

Finally, the tokens are replaced before being passed to the TMSL Script task. If I had to guess, all of a sudden the name property is no longer supported, and I'll have to update this to remove the property when creating the TMSL JSON.

rootd00d commented 2 years ago

This is the spec we're following -- https://docs.microsoft.com/en-us/analysis-services/tmsl/createorreplace-command-tmsl?view=asallproducts-allversions

rootd00d commented 2 years ago

I've updated the release pipelines to use the new Tabular Database Deployment task (https://azurebi-docs.jppp.org/vsts-extensions/azure-analysis-service-deploy.html?tabs=docs-open) instead of using TMSL in order to unblock an imminent production release, and it seems to be working well!

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.