Connect to db1 in SQL Server Management Studio and run:
ALTER DATABASE [db1]
SET QUERY_STORE (MAX_STORAGE_SIZE_MB = 4000);
Microsoft documents that Query Store maximum storage size is changed with:
ALTER DATABASE < database_name >
SET QUERY_STORE (MAX_STORAGE_SIZE_MB = < size > );
For Azure SQL Database, the maximum allowed MAX_STORAGE_SIZE_MB value is 10,240 MB, so 4,000 MB is valid.
Method 1 — SSMS / T-SQL Method
This is the cleanest method for the simulation.
Step 1: Open SQL Server Management Studio
Open SQL Server Management Studio.
Connect to the Azure SQL logical server that hosts db1.
Use SQL authentication or Microsoft Entra authentication.
In Connection Properties, select:
db1
You can also connect to master, but for this task it is cleaner to open a query window in db1.
Step 2: Run the Query Store configuration command
Open a new query window and run:
ALTER DATABASE [db1]
SET QUERY_STORE (MAX_STORAGE_SIZE_MB = 4000);
This changes the Query Store maximum allocated storage size to 4,000 MB.
Step 3: Verify the setting
Run this query in db1:
SELECT
actual_state_desc,
desired_state_desc,
current_storage_size_mb,
max_storage_size_mb
FROM sys.database_query_store_options;
Expected result:
max_storage_size_mb = 4000
Microsoft documents sys.database_query_store_options as the catalog view that returns Query Store configuration, including max_storage_size_mb.
Method 2 — SSMS Graphical Method
Use this if the simulation expects a GUI action.
Step 1: Connect to the server
Open SQL Server Management Studio.
Connect to the Azure SQL logical server.
Expand Databases.
Right-click db1.
Select Properties.
Step 2: Open Query Store settings
In the Database Properties window, select Query Store.
Find the setting:
Max Size (MB)
or:
Maximum Storage Size (MB)
Change the value to:
4000
Select OK.
Step 3: Verify
Run:
SELECT max_storage_size_mb
FROM sys.database_query_store_options;
Expected value:
4000
Azure Portal Clarification
The Azure portal is not the best tool for this specific Query Store configuration. Query Store size is a database engine setting, not a normal Azure resource setting like backup retention, locks, alerts, or private endpoints.
Use SSMS/T-SQL for this task.
Important Notes
Query Store must remain enabled
Do not disable Query Store. Azure SQL Database uses Query Store heavily, and Microsoft notes that Query Store is enabled by default for Azure SQL Database. The task only asks to increase the maximum storage size, not to change capture mode, cleanup policy, or operation mode.
4,000 MB is valid
Azure SQL Database allows Query Store MAX_STORAGE_SIZE_MB up to 10,240 MB, so this setting is within the allowed range.
Final Exam-Lab Action
Run this against db1:
ALTER DATABASE [db1]
SET QUERY_STORE (MAX_STORAGE_SIZE_MB = 4000);
Then verify with:
SELECT max_storage_size_mb
FROM sys.database_query_store_options;
The task is complete when the result shows:
4000