Skip to content

Conversation

sebastienros
Copy link
Member

Description

Currently used SqlDatabase API version doesn't support the properties required to use the FREE SKU.

Fixes #9499

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

@Copilot Copilot AI review requested due to automatic review settings May 27, 2025 18:50
@github-actions github-actions bot added the area-integrations Issues pertaining to Aspire Integrations packages label May 27, 2025
@sebastienros
Copy link
Member Author

cc @yorek

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the API version used for SQL Database resources from 2021-11-01 to 2023-08-01 so that the FREE SKU properties are supported. The key changes include:

  • Updating the API version for SQL Database resource declarations in multiple Bicep snapshot files.
  • Modifying the SQL resource creation in AzureSqlExtensions.cs to force the new API version.
  • Removing extraneous characters from file header comments in some Bicep files.

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

File Description
tests/Aspire.Hosting.Azure.Tests/Snapshots/*.bicep Updated SQL Database resource API version
src/Aspire.Hosting.Azure.Sql/AzureSqlExtensions.cs Forced SQL Database creation to use 2023-08-01 version
playground/cdk/CdkSample.AppHost/sql.module.bicep, playground/bicep/BicepSample.AppHost/sql.module.bicep, playground/SqlServerScript/AppHost1/mysqlserver.module.bicep, playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/*.bicep Updated SQL Database resource API version in sample modules
Comments suppressed due to low confidence (1)

tests/Aspire.Hosting.Azure.Tests/Snapshots/AzureResourceOptionsTests.AzureResourceOptionsCanBeConfigured#01.verified.bicep:1

  • A non-printable character was removed from the description line; please verify that this change was intentional and does not affect any documentation tooling.
@description('The location for the resource(s) to be deployed.')

@sebastienros sebastienros requested a review from davidfowl May 27, 2025 19:46
@davidfowl
Copy link
Member

backport?

@sebastienros
Copy link
Member Author

The UseFreeLimit comment states "Allowed on one database in a subscription.".

I tried to deploy two instances and they work fine, showing the same quotas so I would assume they are sharing the quotas but I didn't try to confirm it. @yorek do you know about it?

@sebastienros sebastienros merged commit 24aa53c into main May 27, 2025
255 checks passed
@sebastienros sebastienros deleted the sebros/sqldbapiversion branch May 27, 2025 22:12
@sebastienros
Copy link
Member Author

/backport to release/9.3

Copy link
Contributor

Started backporting to release/9.3: https://github.com/dotnet/aspire/actions/runs/15286776764

Copy link
Contributor

@sebastienros backporting to "release/9.3" failed, the patch most likely resulted in conflicts:

$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch

Applying: Force SqlDatabase resource api version
Using index info to reconstruct a base tree...
M	playground/bicep/BicepSample.AppHost/sql.module.bicep
M	playground/cdk/CdkSample.AppHost/sql.module.bicep
Falling back to patching base and 3-way merge...
Auto-merging playground/cdk/CdkSample.AppHost/sql.module.bicep
Auto-merging playground/bicep/BicepSample.AppHost/sql.module.bicep
CONFLICT (content): Merge conflict in playground/bicep/BicepSample.AppHost/sql.module.bicep
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 Force SqlDatabase resource api version
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

@yorek
Copy link
Contributor

yorek commented May 30, 2025

The UseFreeLimit comment states "Allowed on one database in a subscription.".

I tried to deploy two instances and they work fine, showing the same quotas so I would assume they are sharing the quotas but I didn't try to confirm it. @yorek do you know about it?

You can have up to 10 free databases per subscription. https://learn.microsoft.com/en-us/azure/azure-sql/database/free-offer?view=azuresql#monthly-free-limits

@github-actions github-actions bot locked and limited conversation to collaborators Jun 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-integrations Issues pertaining to Aspire Integrations packages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Azure SQL DB Free
3 participants