# Automatic resizing

Have you ever encountered the need to adjust the capacity in Azure during periods of high demand for reports?

With Power Embedded, you can now do this easily and quickly directly through the portal.

The new feature allows you to change the capacity SKU based on a schedule, making the process much more efficient.

### How it works

Previously, it was only possible to turn the resource on and off through the portal. Now, with the new feature, it is possible to manage the capacity SKU, that is, perform upscale and downscale at specific times of the week or even on specific days.

To use this feature, go to ***Artifacts > Capacities > Cost Optimization*** and enable the **Set schedule for cost optimization** permission. This will allow you to work with schedules.

After enabling a day of the week, you will see the *Time* and *Action* fields. The *Time* field defines when the action will be performed, and the *Action* field allows you to choose between turning on, turning off, or changing the capacity.

Previously, the only available options were turning on and off, but now you can also opt to change the capacity, and that is what we will detail here.

<figure><img src="/files/GKAwGyrTswTc3ckPeSbO" alt=""><figcaption></figcaption></figure>

When selecting the "change capacity" action, a field will be displayed where you can choose the desired capacity level, with information about size, processing, and cost. When you contract a resource, you define a size in Azure.

With the new feature, if your model is pay-per-use and you need to adjust the capacity for a specific period, simply define an action to change the capacity. This will happen automatically without you needing to access Azure.

Additionally, you can set a specific time or day for the capacity to return to its initial value.

### Practical configuration example

After configuring everything in Azure to manage the resource directly in the portal, follow these steps to optimize the capacity:

1. Access the [Capacity Management](https://admin.powerembedded.com.br/Capacities) screen
2. Check if the capacity you want to control is shown in the capacity list. If not, click the ***Reload*** button
3. If the message "Not configured" appears next to the capacity you want to control, you will need to configure the capacity correctly in Power Embedded and grant the necessary permissions for the system to manage the capacity. See more in [Azure Permissions](https://github.com/dirceuresende/docs-power-embedded-english/blob/main/administration-portal/artifacts/capacities/permissoes-no-azure.md).
4. Click the ***Actions*** button next to the capacity you want to change and click the ***Edit*** option
5. On the capacity editing screen, click the ***Cost Optimization*** tab
6. Enable the ***Cost Optimization*** option and select ***Set schedule for cost optimization*** **to start the configuration.** This will allow scheduled capacity changes.

In the example below, the SKU initially contracted in Azure was an F2.

<figure><img src="/files/lMxPKQHdEYrIBmZ7KwL0" alt=""><figcaption></figcaption></figure>

It can be observed that the capacity is activated at 08:00 in the morning. During the 12:00 period, when an intensive update process occurs and user activity is high, we chose to increase the capacity to a higher level, such as from F2 to F4. According to the metrics analyzed in Fabric Capacity Metrics, an F4 is suitable for handling demand peaks in our scenario.

At 16:00, when capacity consumption decreases, we perform a downgrade to a lower level.

Finally, at 18:00, the capacity is turned off and starts being activated on demand, if you enable the permission for users or groups.

This is a practical example of the usability of this new feature. It is important to note that a copy option is available, which allows you to copy this information to other days of the week.

### Operating rules

1. The feature is only available if the resource is contracted. The Fabric trial does not allow capacity management.
2. The capacity needs to be configured to appear in Power Embedded. To better understand how to perform this configuration, access [Capacity Configuration](https://github.com/dirceuresende/docs-power-embedded-english/blob/main/administration-portal/artifacts/capacities/configurar-a-capacidade-no-power-embedded.md).
3. When changing the capacity size, it will only return to its initial value if you create some action to change the capacity again or change it manually through the Azure portal.
4. You do not need to turn on the capacity to change it, that is, it is possible to change the capacity even while paused and this does not change billing while it is paused.
5. This control of turning the capacity on/off to reduce costs only makes sense for the **Pay-per-use** payment model. Pausing a capacity that is in **Reserved Instance** mode will not reduce your monthly cost at all (fixed, only varies with the dollar) and will only generate unavailability in access to reports.
6. If your capacity is in **Reserved Instance** mode and you change it to a larger SKU than the current one, you will continue to be charged for the reserved instance normally, in addition to the time you used the larger capacity than the contracted reservation.\
   \
   Ex: You have an F2 reservation and for 8 hours, you changed it to F8. You will be charged normally for your F2 reserved instance, and Microsoft will charge an amount equivalent to an F6 (F8 - F2), in **Pay-per-use** mode, for a period of 8 hours.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.powerembedded.com/administration-portal/artifacts/capacities/automatic-resizing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
