cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
HarpsichordMan Regular Visitor
Regular Visitor

Programatically start/stop Azure PowerBI capacity for PowerBI Embedded

With the new start/stop capacity options on Azure for PowerBI, can I start and stop the capacity from a .net app or powershell?

I understand that I can pause capacity in the Azure Portal, but would like to be able to pause/start capacity using an API call.

1 ACCEPTED SOLUTION

Accepted Solutions
dahti00 Frequent Visitor
Frequent Visitor

Re: Programatically start/stop Azure PowerBI capacity for PowerBI Embedded

Hi all.

Here is the documentation:
https://docs.microsoft.com/en-us/rest/api/power-bi-embedded/capacities

Here is guide for setting up Postman:
https://www.codit.eu/blog/2017/03/14/authenticate-postman-against-azure-service-management-api/

Wish you well!

Goddamn hate Azure by now though.... hope that changes

21 REPLIES 21
Moderator Eric_Zhang
Moderator

Re: Programatically start/stop Azure PowerBI capacity for PowerBI Embedded


@HarpsichordMan wrote:

With the new start/stop capacity options on Azure for PowerBI, can I start and stop the capacity from a .net app or powershell?

I understand that I can pause capacity in the Azure Portal, but would like to be able to pause/start capacity using an API call.


@HarpsichordMan

There might be. The legency documentation is not updated. I'm going to consult this internally and would post back if there comes any update.

horizondave Frequent Visitor
Frequent Visitor

Re: Programatically start/stop Azure PowerBI capacity for PowerBI Embedded

I was wondering the same thing, and I found this:

https://docs.microsoft.com/en-us/azure/power-bi-embedded/pause-start

 

...Which is for databases, but the API implies it is for "pausing compute" which would probably be the same thing as powerbi embedded?

 

Edit: Wrong link - I meant this: https://docs.microsoft.com/en-us/azure/sql-data-warehouse/sql-data-warehouse-manage-compute-rest-api...

 

HarpsichordMan Regular Visitor
Regular Visitor

Re: Programatically start/stop Azure PowerBI capacity for PowerBI Embedded

I agree that the call looks like it is generic, but the description and example point to only SQL Server. Would be nice to get an official response from MS on this matter. We can't afford to have the PowerBI service up and running all the time, but would like to be able to script a 'go to sleep/wake up' task.

HarpsichordMan Regular Visitor
Regular Visitor

Re: Programatically start/stop Azure PowerBI capacity for PowerBI Embedded

There's also this: https://docs.microsoft.com/en-us/rest/api/sql/Databases/Pause, but again, it appears to be just for SQL Server resources.

horizondave Frequent Visitor
Frequent Visitor

Re: Programatically start/stop Azure PowerBI capacity for PowerBI Embedded

Same boat.....There is a world of difference between £7.50/user and £560/month.  I'm pretty sure as it is a standard Azure Portal resource, the standard azure Portal API will apply to it.  In fact, iirc, the portal uses the API in the same way we would anwyay.

ckelbley
Advisor

Re: Programatically start/stop Azure PowerBI capacity for PowerBI Embedded

I have had success using these API calls:

 

POST https://management.azure.com/subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP_NAME/providers/Microsoft.PowerBIDedicated/capacities/CAPACITY_NAME/resume?api-version=2017-10-01
POST https://management.azure.com/subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP_NAME/providers/Microsoft.PowerBIDedicated/capacities/CAPACITY_NAME/suspend?api-version=2017-10-01

 

Moderator Eric_Zhang
Moderator

Re: Programatically start/stop Azure PowerBI capacity for PowerBI Embedded


@ckelbley wrote:

I have had success using these API calls:

 

POST https://management.azure.com/subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP_NAME/providers/Microsoft.PowerBIDedicated/capacities/CAPACITY_NAME/resume?api-version=2017-10-01
POST https://management.azure.com/subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP_NAME/providers/Microsoft.PowerBIDedicated/capacities/CAPACITY_NAME/suspend?api-version=2017-10-01

 


@ckelbley

Could you share where you find those APIs, any documentations?

ckelbley
Advisor

Re: Programatically start/stop Azure PowerBI capacity for PowerBI Embedded

I couldn't find any official documentation.  I just did some trial and error using Postman and tried different calls based on how the management APIs work for other resource types and looking at what the browser does when you click the pause/start button in the Azure portal.

dahti00 Frequent Visitor
Frequent Visitor

Re: Programatically start/stop Azure PowerBI capacity for PowerBI Embedded

Hi all.

Here is the documentation:
https://docs.microsoft.com/en-us/rest/api/power-bi-embedded/capacities

Here is guide for setting up Postman:
https://www.codit.eu/blog/2017/03/14/authenticate-postman-against-azure-service-management-api/

Wish you well!

Goddamn hate Azure by now though.... hope that changes