Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
mbertho
New Member

How to schedule Pause/Stop BI Resource embedded automatically

Hello,

I am trying to configure the start/stop Power BI Embedded resource using web insterface, it is running with succesfull(by reports inside powerBI) but don't is pausing/starting my Power BI resource(it doesn't works).

 

Informations:
Type: Power BI Embedded
Localization: "Brazil South"

*Not exists the resource start/stop avaliable for my localization(Brazil), i used from localization Canada.

 

How the easy way to do it, i prefer some API to program this opition, but i saw the some APIs and didn't find this resource.
Somebody did it and could post some example, please ?

 

Regards,
Marcelo Bertho

 

 

2 REPLIES 2
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @mbertho,

 

Just check this blog. Smiley Happy

Azure Resource Manager API

The release of the new Azure capacities for Power BI Embedded in October enables ISVs to enjoy the full elasticity of an Azure resource. ISVs can now pause or resume capacity, scale up or down and pay for hourly usage only. To fully leverage this capability, those actions need to occur programmatically.

So now, as promised, we are releasing Azure Resource Management APIs to do all these actions automatically. These are all the actions you can perform using the ARM API:

  • Scale up/ down
  • Pause/ start resource
  • Create/ Delete resource
  • Get capacity information
  • Update capacity
  • Get capacity list in a resource group/ subscription

Here are some code samples you can use:

Scale up/ down:

string content = "{\"sku\":{\"name\":\"" + "{Enter new sku for scaling}" + "\"}}";

ASCIIEncoding encoding = new ASCIIEncoding();

byte[] contentArray = encoding.GetBytes(content);

string requestUri = "https://management.azure.com/subscriptions/{Enter subscriptionId}/resourceGroups/{Enter resourceGrou...";

HttpWebRequest request = System.Net.WebRequest.Create(requestUri) as System.Net.HttpWebRequest;

            request.Method = "PATCH";

            request.Headers.Add("Authorization", String.Format("Bearer {0}", accessToken));

            request.ContentType = "application/json; charset=utf-8";

            request.ContentLength = contentArray.Length;

Stream stream = request.GetRequestStream();

            stream.Write(contentArray, 0, contentArray.Length);

            stream.Close();

HttpWebResponse response = request.GetResponse() as HttpWebResponse;

Pause:

string requestUri = "https://management.azure.com/subscriptions/{Enter subscriptionId}/resourceGroups/{Enter resourceGrou...";

HttpWebRequest request = System.Net.WebRequest.Create(requestUri) as System.Net.HttpWebRequest;

            request.Method = “POST”;

            request.ContentLength = 0;

            request.Headers.Add("Authorization", String.Format("Bearer {0}", accessToken));

HttpWebResponse response = request.GetResponse() as HttpWebResponse;

Start:

string requestUri = "https://management.azure.com/subscriptions/{Enter subscriptionId}/resourceGroups/{Enter resourceGrou...";

HttpWebRequest request = System.Net.WebRequest.Create(requestUri) as System.Net.HttpWebRequest;

            request.Method = “POST”;

            request.ContentLength = 0;

            request.Headers.Add("Authorization", String.Format("Bearer {0}", accessToken));

HttpWebResponse response = request.GetResponse() as HttpWebResponse;

 

You can download the full ARM SDK from GitHub, or learn more from our documentation.



 

Regards

Hi v-ljerr-msft,

 

Firstly, thanks for your reply.

 

I am studying your post and did some tests, but i don't know how i get the access token:

 

curl -d "" -H "Authorization:Bearer <TOKEN>" -X POST "https://management.azure.com/subscriptions/<myid>/resourceGroups/BI/providers/Microsoft.PowerBIDedic..."
{"error":{"code":"InvalidAuthenticationToken","message":"The access token is invalid."}}%

 

Where could i get the token ?

 

*My idea is create a jenkins job and schedule for it using the command that you passed in the earlier reply.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.