Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for MongoDB API versions 5.0 and 6.0 #25889

Closed
1 task done
ipock opened this issue May 7, 2024 · 19 comments
Closed
1 task done

Support for MongoDB API versions 5.0 and 6.0 #25889

ipock opened this issue May 7, 2024 · 19 comments
Labels
enhancement service/cosmosdb upstream/microsoft/needs-support-on-azure-api This label is applicable when support for a feature is not currently available on the Azure API. upstream/microsoft/waiting-on-service-team This label is applicable when waiting on the Microsoft Service Team

Comments

@ipock
Copy link

ipock commented May 7, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.

Description

Microsoft now supports running MongoDB API versions 5.0 and 6.0. Currently, these two version numbers cause a validation error when specified in the mongo_server_version variable on the azure_cosmosdb_account resource provider. The resource provider should be updated to reflect the newly available versions.

New or Affected Resource(s)/Data Source(s)

azurerm_cosmosdb_account

Potential Terraform Configuration

resource "azurerm_cosmosdb_account" "mongodb" {

  name                          = "${var.prefix}-mongodb-acct"
  resource_group_name           = var.resource_group_name
  location                      = var.location
  offer_type                    = "Standard"
  kind                          = "MongoDB"
  public_network_access_enabled = false
  enable_automatic_failover     = true
  mongo_server_version          = "5.0" # or 6.0

# remainder of resource settings follow

}

References

Support for MongoDB API 5.0:
https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/feature-support-50

Support for MongoDB API 6.0:
https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/feature-support-60

@neil-yechenwei
Copy link
Contributor

Thanks for raising this issue. This new version hasn't been released to Swagger. Once Service API supports it, we will take another look.

@mybayern1974 mybayern1974 added the upstream/microsoft/blocking-swagger-issue This label is applicable when waiting on Microsoft for an issue with the Swagger definition. label May 8, 2024
@rynhuang
Copy link

A temporary workaround that worked for me is manually setting the version to 6.0 in Azure Portal (Features > Update MongoDB server version) and removing the mongo_server_version variable.

@jvalteren
Copy link

Hi @neil-yechenwei, can you re-evaluate? The versions 5.0 and 6.0 are now clearly present in the stable API: https://github.com/Azure/azure-rest-api-specs/blob/32f566eb38af9593cfc1ed183362471c50d67fb2/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-05-15/cosmos-db.json#L9617

@dv0gt
Copy link

dv0gt commented Jun 11, 2024

Any news? @neil-yechenwei

@tombuildsstuff
Copy link
Contributor

@dv0gt @jvalteren it's worth noting that the API Version isn't fully deployed yet:

$ az rest --method get --url "https://management.azure.com/subscriptions/XXX/providers/Microsoft.DocumentDB?api-version=2024-05-15"
Bad Request({"error":{"code":"InvalidApiVersionParameter","message":"The api-version '2024-05-15' is invalid. The supported versions are '2024-03-01,2023-07-01,2023-07-01-preview,2023-03-01-preview,2022-12-01,2022-11-01-preview,2022-09-01,2022-06-01,2022-05-01,2022-03-01-preview,2022-01-01,2021-04-01,2021-01-01,2020-10-01,2020-09-01,2020-08-01,2020-07-01,2020-06-01,2020-05-01,2020-01-01,2019-11-01,2019-10-01,2019-09-01,2019-08-01,2019-07-01,2019-06-01,2019-05-10,2019-05-01,2019-03-01,2018-11-01,2018-09-01,2018-08-01,2018-07-01,2018-06-01,2018-05-01,2018-02-01,2018-01-01,2017-12-01,2017-08-01,2017-06-01,2017-05-10,2017-05-01,2017-03-01,2016-09-01,2016-07-01,2016-06-01,2016-02-01,2015-11-01,2015-01-01,2014-04-01-preview,2014-04-01,2014-01-01,2013-03-01,2014-02-26,2014-04'."}})

Unfortunately just because the API Definition exists within Azure/azure-rest-api-specs doesn't mean it's available for use - and it's worth noting that some service teams write the API Definitions first, whilst others deploy the API then publish the associated API Definition, so the canonical source remains the versions returned from the Azure API.

All of which is to say, unfortunately this remains blocked until the API is deployed (in multiple regions) - right now only the API definition is available.

@tombuildsstuff tombuildsstuff added upstream/microsoft/waiting-on-service-team This label is applicable when waiting on the Microsoft Service Team upstream/microsoft/needs-support-on-azure-api This label is applicable when support for a feature is not currently available on the Azure API. and removed upstream/microsoft/blocking-swagger-issue This label is applicable when waiting on Microsoft for an issue with the Swagger definition. labels Jun 11, 2024
@jvalteren
Copy link

jvalteren commented Jun 13, 2024

Thanks @tombuildsstuff, that is good to know (and unexpected).

Do you know of any status page or other information source where these things can be tracked? I didn't expect to find myself at 'the cutting edge' of Azure infrastructure development with these simple things.

Migration of a hosting project with relatively low complexity has required way more effort than expected because of little issues like this. It would greatly help predictability and thus planning if there would be more transparency on changes in API (preview status, availability etc).

@ferronsw
Copy link

Any ETA on when this will be available?

@jvalteren this can help https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/change-log or https://azure.microsoft.com/en-gb/updates/.

Microsoft is never super clear when they will release things like this unfortunately.

@EpicWink
Copy link

Cosmos DB also supports MongoDB API v7.0

@steph409
Copy link
Contributor

steph409 commented Sep 4, 2024

The version can be changed using the azapi, the following worked for me to deploy version 6

resource "azurerm_resource_group" "example" {
  name     = "democosmos"
  location = "westus2"
}

resource "azurerm_cosmosdb_account" "db" {
  name                 = "stephitest"
  location             = azurerm_resource_group.example.location
  resource_group_name  = azurerm_resource_group.example.name
  offer_type           = "Standard"
  kind                 = "MongoDB"
  mongo_server_version = "4.2"

  automatic_failover_enabled = false


  capabilities {
    name = "EnableServerless"
  }

  capabilities {
    name = "EnableMongo"
  }

  consistency_policy {
    consistency_level       = "Session"
    max_interval_in_seconds = 5
    max_staleness_prefix    = 100
  }

  geo_location {
    failover_priority = 0
    location          = "westus2"
  }
  lifecycle {
    ignore_changes = [ mongo_server_version ]
  }
}


provider "azapi" {
  subscription_id = var.subscription_id
}

resource "azapi_update_resource" "update" {
  resource_id = azurerm_cosmosdb_account.db.id
  type = "Microsoft.DocumentDB/databaseAccounts@2024-05-15"
  body = {
    properties = {
        apiProperties = {
            serverVersion = "6.0"
        }
    }
  }
}


@anton-x-t
Copy link

anton-x-t commented Sep 10, 2024

The code limiting mongo_server_version to version 3.2, 3.6, 4.0 and 4.2 seem to be here (just supplying for reference):
https://github.com/hashicorp/terraform-provider-azurerm/blob/main/internal/services/cosmos/cosmosdb_account_resource.go#L482

This is the commit where 4.2 was added:
1f9a6f6

@svaraksin-gd
Copy link

Any news on this?

@ManuelAngel99
Copy link

Any updates?

@Kortex
Copy link

Kortex commented Oct 6, 2024

Hello, any updates on this?

@michalwilk96
Copy link

Hello,
Any update on this?

@kosoniu
Copy link

kosoniu commented Oct 25, 2024

Hello!

Is there any update on any newer version of MongoDB than 4.2?

Azure provides support up to 7.0
image

Latest 4.2 release was: Jun 21, 2022, so it is over 2 years old.

When can we expect support at least 5/6?

@Gwenael22
Copy link

Gwenael22 commented Oct 25, 2024

There is an existing PR #27763

@anton-x-t
Copy link

@stephybun Please close this issue as it already has been fixed in #27763
The version in which this was fixed was v4.8.0

@stephybun
Copy link
Member

Closed by #27763

Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement service/cosmosdb upstream/microsoft/needs-support-on-azure-api This label is applicable when support for a feature is not currently available on the Azure API. upstream/microsoft/waiting-on-service-team This label is applicable when waiting on the Microsoft Service Team
Projects
None yet
Development

No branches or pull requests