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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Martin_D
Super User
Super User

CmdLets to Pause, Resume, Scale Azure Fabric Capacities

Hi,

How do I pause, resume, and scale Fabric capacities F2 and above in a PowerShell script? Are there already CmdLets available for Fabric like there are for Power BI Embedded capacities, or is a release date already announced for this?

 

I need to do the equivalent with Fabric capacity.

Thanks a lot!

 

BR

Martin

1 REPLY 1
JorgeSoriano
New Member

I couldn't find native commands as you said similar for the PowerBiEmbedded, so I created a request to the Rest API. For this, first you need to create an application to obtain the bearer token. the application must have contribuitor role on the Fabric Capacity.

 

# Define las credenciales y la URL del endpoint
$clientId = "[Client_ID]"
$clientSecret = "[Secret]"
$tokenEndpoint = "https://login.microsoftonline.com/[tenant_id]/oauth2/token"
$resource = "https://management.azure.com"

# Define el cuerpo de la solicituds
$body = @{
'client_id' = $clientId
'grant_type' = 'client_credentials'
'client_secret' = $clientSecret
'resource' = $resource
}

# Realiza la solicitud POST para obtener el token
$response = Invoke-RestMethod -Uri $tokenEndpoint -Method POST -Body $body -ContentType 'application/x-www-form-urlencoded'


# Extrae el token de acceso de la respuesta
$token = $response.access_token

# Imprime el token de acceso
Write-Output "Token Bearer"

#Realiza el pausado del recurso

Invoke-RestMethod -Method Post -Uri "https://management.azure.com/subscriptions/[Subscription_ID]/resourceGroups/[Resource_Group]/provide..." -headers @{'Authorization' = "Bearer $token"}
Write-Output "Fabric Paused"

 

 

I hope it works for you. Greetings from Mexico

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.