azure analysis service: how to start and pause service with on premise powershell

H. Laguide 1 Reputation point
2020-07-29T22:53:27.977+00:00

Hello All,

I need your help.

I have an azure analysis service that I want to start and pause at different times of the day.
I want to use Powershell to execute a script to do this task.
Do you know how I can do it?

Thank you for your help

Azure Analysis Services
Azure Analysis Services
An Azure service that provides an enterprise-grade analytics engine.
456 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,547 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. PRADEEPCHEEKATLA-MSFT 90,146 Reputation points Microsoft Employee
    2020-07-30T08:18:33.467+00:00

    Hello @H. Laguide ,

    Welcome to Microsoft Q&A platform.

    Here are the steps to start and pause Azure Analysis services with on premise powershell:

    Step1: Import Az.AnalysisServices module
    To create a server in your subscription, you use the Az.AnalysisServices module. Load the Az.AnalysisServices module into your PowerShell session.

       Import-Module Az.AnalysisServices  
    

    Step2: Sign in to Azure
    Sign in to your Azure subscription by using the Connect-AzAccount command. Follow the on-screen directions.

     Connect-AzAccount  
    

    Step3: [Only run if you have multiple Azure Subscription].
    The Set-AzContext cmdlet sets authentication information for cmdlets that you run in the current session. The context includes tenant, subscription, and environment information.

    Set-AzContext -SubscriptionId "xxxx-xxxx-xxxx-xxxx"  
    

    Step4: Gets the details of an Analysis Services server.
    The Get-AzAnalysisServicesServer cmdlet gets the details of an Analysis Services server.

    Get-AzAnalysisServicesServer -ResourceGroupName "ResourceGroup03" -Name "testserver"  
    

    To start Azure Analysis services, use Resume-AzAnalysisServicesServer

    The Resume-AzAnalysisServicesServer cmdlet resumes an instance of Analysis Services server

    Resume-AzAnalysisServicesServer -Name "testserver" -ResourceGroupName "testgroup"  
    

    To stop Azure Analysis services, use Suspend-AzAnalysisServicesServer

    The Suspend-AzAnalysisServicesServer cmdlet suspends an instance of Analysis Services server

    Suspend-AzAnalysisServicesServer -Name "testserver" -ResourceGroupName "testgroup"  
    

    Reference: Azure Analysis services – Azure PowerShell cmdlets

    Now using Azure Automation, you can schedule start & stop of Azure Analysis Services.

    Hope this helps. Do let us know if you any further queries.

    ----------------------------------------------------------------------------------------

    Do click on "Accept Answer" and Upvote on the post that helps you, this can be beneficial to other community members.

    2 people found this answer helpful.

  2. Anonymous
    2020-07-29T23:29:05.22+00:00
    0 comments No comments

  3. 2020-07-30T01:34:21.427+00:00

    Or you can use the command START-SLEEP,Suspends the activity in a script or session for the specified period of time.

    https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/start-sleep?view=powershell-7


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.