How to add a description to TMSL script for Azure Analysis Services

45 Views Asked by At

I'm trying to update a role in a Tabular model (compatibility 1500) that's hosted on a managed Azure Analysis Service instance (version 16.0.101.19). The member of this role is a security group so it's referenced by via it's Azure AD Obj Id. What I'd like to do is update the role to add a description attribute where I can provide the friendly display name of the group.

Below is a copy of the current script in which I've tried adding the description attribute.

{
  "createOrReplace": {
    "object": {
      "database": "Test",
      "role": "Processor"
    },
    "role": {
      "name": "Processor",
      "modelPermission": "administrator",
      "members": [
        {
          "memberName": "obj:zzzzzzz@zzzzzzzzzzzz",
          "identityProvider": "AzureAD",
          "description": "This is really security group A"
        }
      ]
    }
  }
}

Unfortunately this results in the following error when I try to execute the script via SSMS.

The JSON DDL request failed with the following error: <ccon>Cannot de-serialize Model Role. Error: Unrecognized JSON property: description. Check path 'members[0].description', line 14, position 18..</ccon>

I was expecting this to be a simple update but apparently I'm misunderstanding something.

1

There are 1 best solutions below

1
On

Per the doc there's no "description" property, but there is an "annotations" collection of name/value pairs.

                    {  
                      "description": "ExternalModelRoleMember object of Tabular Object Model (TOM)",  
                      "type": "object",  
                      "properties": {  
                        "memberName": {  
                          "type": "string"  
                        },  
                        "memberId": {  
                          "type": "string"  
                        },  
                        "identityProvider": {  
                          "type": "string"  
                        },  
                        "memberType": {  
                          "enum": [  
                            "auto",  
                            "user",  
                            "group"  
                          ]  
                        },  
                        "annotations": {  
                          "type": "array",  
                          "items": {  
                            "description": "Annotation object of Tabular Object Model (TOM)",  
                            "type": "object",  
                            "properties": {  
                              "name": {  
                                "type": "string"  
                              },  
                              "value": {  
                                "anyOf": [  
                                  {  
                                    "type": "string"  
                                  },  
                                  {  
                                    "type": "array",  
                                    "items": {  
                                      "type": "string"  
                                    }  
                                  }  
                                ]  
                              }  
                            },  
                            "additionalProperties": false  
                          }  
                        }  
                      },