How to stop cube processing that was triggered from ADF web activity

Poornima 21 Reputation points
2023-05-08T15:31:09.4533333+00:00

I have created ADF pipeline to process tabular model in AAS using web activity (By referring the url https://github.com/furmangg/automating-azure-analysis-services/blob/master/ADFv2/ProcessAzureAS.json).

As web activity is an asynchronous call to process cube, I am unable to stop the process in the middle. Is there any method to stop cube processing. If we can use the XMLA cancel command then please provide me an example and kindly help me on how to identify the particular session id that ADF is using from $SYSTEM.DISCOVER_SESSIONS.

Azure Analysis Services
Azure Analysis Services
An Azure service that provides an enterprise-grade analytics engine.
457 questions
{count} votes

1 answer

Sort by: Most helpful
  1. ShaikMaheer-MSFT 38,456 Reputation points Microsoft Employee
    2023-05-10T10:22:10.9566667+00:00

    Hi Poornima,

    Thank you for posting query in Microsoft Q&A Platform.

    To stop the cube processing in the middle, you can use the XMLA cancel command. Here is an example of how to use it:

    <Batch xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
      <Cancel xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
        <SPID>1234</SPID>
      </Cancel>
    </Batch>
    
    

    In the above example, replace "1234" with the session ID that you want to cancel. To identify the session ID that ADF is using from $SYSTEM.DISCOVER_SESSIONS, you can use the following query:

    <Batch xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
      <Discover xmlns="urn:schemas-microsoft-com:xml-analysis">
        <RequestType>DISCOVER_SESSIONS</RequestType>
        <Restrictions>
          <RestrictionList>
            <ObjectExpansion>ObjectProperties</ObjectExpansion>
          </RestrictionList>
        </Restrictions>
        <Properties>
          <PropertyList>
            <Catalog>AdventureWorks</Catalog>
          </PropertyList>
        </Properties>
      </Discover>
    </Batch>
    
    

    In the above example, replace "AdventureWorks" with the name of your AAS database. This query will return a list of all active sessions, including the session ID that ADF is using. You can then use this session ID in the cancel command to stop the cube processing.

    Please note that cancelling a session will cause any uncommitted transactions to be rolled back, so use this command with caution. Let me know if you have any further questions.
    Hope this helps. Please let me know how it goes or if any further queries.


    Please consider hitting Accept Answer button. Accepted answers help community as well.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.