Skip to content

feat: Add AzureBlobStorage connection type support for stream connections#4357

Merged
christineschen merged 11 commits intomasterfrom
CLOUDP-383606_azure_blob_storage_streams
Apr 6, 2026
Merged

feat: Add AzureBlobStorage connection type support for stream connections#4357
christineschen merged 11 commits intomasterfrom
CLOUDP-383606_azure_blob_storage_streams

Conversation

@jwongmongodb
Copy link
Copy Markdown
Collaborator

@jwongmongodb jwongmongodb commented Mar 31, 2026

Description

Adds support for AzureBlobStorage as a new stream connection type in mongodbatlas_stream_connection resource and data sources.

Link to any related issue(s): CLOUDP-383606

Type of change:

  • New feature (non-breaking change which adds functionality). Please, add the "enhancement" label to the PR. A migration guide must be created or updated if the new feature will go in a major version.
  • This change requires a documentation update

Required Checklist:

  • I have signed the MongoDB CLA
  • I have read the contributing guides
  • I have checked that this change does not generate any credentials and that they are NOT accidentally logged anywhere.
  • I have added tests that prove my fix is effective or that my feature works per HashiCorp requirements
  • I have added any necessary documentation (if appropriate)
  • I have run make fix and verified my code
  • If changes include deprecations or removals I have added appropriate changelog entries.
  • If changes include removal or addition of 3rd party GitHub actions, I updated our internal document. Reach out to the APIx Integration slack channel to get access to the internal document.

Copilot AI review requested due to automatic review settings March 31, 2026 18:52
@jwongmongodb jwongmongodb force-pushed the CLOUDP-383606_azure_blob_storage_streams branch from 0fed114 to 7c789c6 Compare March 31, 2026 18:54
Copy link
Copy Markdown
Contributor

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

Adds AzureBlobStorage as a supported stream connection type for the mongodbatlas_stream_connection Terraform resource and related data sources, including schema/model mapping, acceptance tests, and documentation/examples updates.

Changes:

  • Extend stream connection schemas/models (codegen + provider) to include an azure configuration block and AzureBlobStorage type handling.
  • Update request/response mapping to support Azure-specific fields and publicPrivateNetworking mapping for networking.
  • Add acceptance tests, docs, examples, and changelog entries for the new connection type.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
tools/codegen/models/stream_connection_api.yaml Adds AzureBlobStorage type + azure fields and allows networking for the new type in codegen model.
internal/testutil/acc/pre_check.go Adds acceptance test pre-check for Azure Blob Storage env vars.
internal/serviceapi/streamconnectionapi/resource_schema.go Generated schema updated to include azure and allow it for AzureBlobStorage.
internal/service/streamconnection/resource_stream_connection.go Adds connection-type constants and Azure object model/type definitions.
internal/service/streamconnection/resource_schema.go Adds AzureBlobStorage schema block and expands type validation list.
internal/service/streamconnection/model_stream_connection.go Maps Azure fields to/from SDK and routes networking to PublicPrivateNetworking for Azure.
internal/service/streamconnection/resource_stream_connection_test.go Adds AzureBlobStorage acceptance test and helpers.
internal/service/streamconnection/model_stream_connection_test.go Adds unit test coverage for Azure SDK<->TF mapping and TF->SDK request creation.
examples/mongodbatlas_stream_connection/* Adds example configuration and variables for Azure Blob Storage connection.
docs/resources/stream_connection.md Adds Azure example and documents Azure arguments/type.
docs/data-sources/stream_connections.md Documents Azure in stream connections data source.
docs/data-sources/stream_connection.md Documents Azure in stream connection data source.
.changelog/4356.txt Adds release notes for AzureBlobStorage support and PRIVATE_LINK networking.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/testutil/acc/pre_check.go Outdated
Comment thread examples/mongodbatlas_stream_connection/variables.tf
Comment thread docs/resources/stream_connection.md Outdated
Comment thread docs/data-sources/stream_connections.md Outdated
Comment thread docs/data-sources/stream_connections.md Outdated
Comment thread docs/data-sources/stream_connection.md Outdated
Comment thread docs/data-sources/stream_connection.md Outdated
@christineschen christineschen force-pushed the CLOUDP-383606_azure_blob_storage_streams branch 2 times, most recently from 87e352b to 957e89c Compare April 1, 2026 20:04
@christineschen christineschen marked this pull request as ready for review April 2, 2026 03:00
@christineschen christineschen requested review from a team as code owners April 2, 2026 03:00
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 2, 2026

APIx bot: a message has been sent to Docs Slack channel

@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented Apr 2, 2026

🤖 Augment PR Summary

Summary: Adds first-class support for AzureBlobStorage as a stream connection type in the Terraform provider.

Changes:

  • Extends the stream connection resource/data source docs to include Azure Blob Storage and its attributes
  • Adds an azure nested block to the framework-based mongodbatlas_stream_connection schema and maps it to Atlas SDK request/response models
  • Updates networking handling to support PUBLIC/PRIVATE_LINK for Azure Blob Storage via the API’s public/private networking field
  • Adds type validation for the stream connection type attribute
  • Adds unit test coverage for AzureBlobStorage model conversions and an acceptance test for the new connection type
  • Updates acceptance-test runner workflow to pass required Azure environment variables
  • Adds changelog entries documenting the new connection type and networking access support

Technical Notes: Azure networking uses the public/private networking API shape while still exposing a consistent Terraform networking block in the framework resource.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread internal/service/streamconnection/resource_stream_connection_test.go Outdated
Comment thread internal/serviceapi/streamconnectionapi/resource_schema.go Outdated
Comment thread tools/codegen/models/stream_connection_api.yaml Outdated
Copy link
Copy Markdown

@lizo-mdb lizo-mdb left a comment

Choose a reason for hiding this comment

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

LGTM with a few small suggestions!

Comment thread examples/mongodbatlas_stream_connection/README.md Outdated
Comment thread examples/mongodbatlas_stream_connection/variables.tf Outdated
Comment thread docs/data-sources/stream_connection.md Outdated
Comment thread docs/data-sources/stream_connections.md Outdated
Comment thread docs/resources/stream_connection.md Outdated
"strings"
"testing"

"github.com/hashicorp/terraform-plugin-sdk/helper/acctest"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"github.com/hashicorp/terraform-plugin-sdk/helper/acctest"
"github.com/hashicorp/terraform-plugin-testing/helper/acctest"

"storage_account_name": schema.StringAttribute{
Required: true,
},
"region": schema.StringAttribute{
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

do we need a UseStateForUnknown plan modifier? How does the plan show if anything is changed in this object?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

since region is computed each time the storage account changes, UseStateForUnknown may cause errors if the planned value doesn't match what the API returns

"storage_account_name": schema.StringAttribute{
Required: true,
},
"region": schema.StringAttribute{
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why is this optional/computed?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

it's in the API spec as optional, so it's computed if users don't supply a value. In the UI there's not even a field for users to add it so it would only be something that the api/sdk/tf supports

@christineschen christineschen force-pushed the CLOUDP-383606_azure_blob_storage_streams branch from 1a726f0 to f423200 Compare April 2, 2026 22:23
@christineschen christineschen requested a review from maastha April 2, 2026 22:23
},
}
default:
return nil, diag.Diagnostics{diag.NewErrorDiagnostic(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

one nit but I think right now we're never erroring, right? no matter what's the type we assume is StreamsKafkaNetworking

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

right that's the existing behavior, and PublicPrivateNetworking was introduced in the last SDK update (so as of yet will only be used for Azure blob storage and GCP pubsub)

@christineschen christineschen requested a review from marcosuma April 3, 2026 15:03
@christineschen christineschen force-pushed the CLOUDP-383606_azure_blob_storage_streams branch from f423200 to 1040cec Compare April 3, 2026 16:47
}

variable "azure_region" {
description = "Azure region where you locate the storage account"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What format is used? The atlas US_EAST_1 or azure style eastus1?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

azure style eastus1

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you add that example to the docs? (Common source of confusion)

Comment thread internal/service/streamconnection/resource_schema.go Outdated
Comment thread internal/service/streamconnection/resource_stream_connection_test.go Outdated
Copy link
Copy Markdown
Collaborator

@EspenAlbert EspenAlbert left a comment

Choose a reason for hiding this comment

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

Looks quite good. Would maybe consider an example to demonstrate the privatelink functionality.
Main uncertainty I have is about the stream_connection not using role_id, seems weird to specify the service_principal_id twice

connection_name = %[10]q
type = "AzureBlobStorage"
azure = {
service_principal_id = %[4]q
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This setup confuses me a bit.
Why is the azure not referencing the mongodbatlas_cloud_provider_access_setup.azure_setup.role_id?

Seems a bit inconsistent that the atlas resource require azure service_principal_id?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

the way the API is set up, the input is service_principal_id and then role_id is computed

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

IMO: This is a bad experience. role_id is what should be configured, but understand it is a big ask to change the API :/

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think it has to do with the way the UI is set up, where users will configure their Azure integration and get a service principal ID, and then on the streams connection manager page they choose between their service principal IDs (since there may be multiple), and role ID is abstracted away

Comment thread internal/service/streamconnection/resource_stream_connection_test.go Outdated
Comment thread docs/data-sources/stream_connection.md Outdated
## Attributes Reference

* `type` - Type of connection. Can be `AWSLambda`, `Cluster`, `GCPPubSub`, `Https`, `Kafka`, `Sample`, or `SchemaRegistry`.
* `type` - Type of connection. Can be `AWSKinesisDataStreams`, `AWSLambda`, `AzureBlobStorage`, `Cluster`, `GCPPubSub`, `Https`, `Kafka`, `S3`, `Sample`, or `SchemaRegistry`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks like some types were missing that are not related to this PR change, consider either doing it in a different PR or at least mention it in this PR description. same for the other files

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

removed from this PR

Comment thread docs/resources/stream_connection.md Outdated
### AWS
* `role_arn` - Amazon Resource Name (ARN) that identifies the Amazon Web Services (AWS) Identity and Access Management (IAM) role that MongoDB Cloud assumes when it accesses resources in your AWS account.

* `service_principal_id` - (Required) UUID that identifies the Azure Service Principal used to access the Azure Blob Storage account.
Copy link
Copy Markdown
Member

@lantoli lantoli Apr 6, 2026

Choose a reason for hiding this comment

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

new 3 attrs should be in Azure section instead of AWS section

Comment thread docs/data-sources/stream_connection.md Outdated
* `security` - Properties for the secure transport connection to Kafka. For SASL_SSL, this can include the trusted certificate to use. See [security](#security).
* `networking` - Networking Access Type can either be `PUBLIC` (default) or `VPC`. See [networking](#networking).

If `type` is `AzureBlobStorage` the the configuration defines the following additional attributes:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
If `type` is `AzureBlobStorage` the the configuration defines the following additional attributes:
If `type` is `AzureBlobStorage` the configuration defines the following additional attributes:

resourceChecks := []resource.TestCheckFunc{
checkStreamConnectionExists(),
resource.TestCheckResourceAttrSet(resourceName, "project_id"),
resource.TestCheckResourceAttr(resourceName, "workspace_name", workspaceName),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we're in TPF so no need to check customer-provided values, only useful to check Computed attributes

Comment thread docs/resources/stream_connection.md Outdated
* `instance_name` - (Optional, Deprecated) Label that identifies the stream processing workspace. Use `workspace_name` instead; this attribute will be removed in a future major version.
* `connection_name` - (Required) Label that identifies the stream connection. In the case of the Sample type, this is the name of the sample source.
* `type` - (Required) Type of connection. Can be `AWSLambda`, `Cluster`, `GCPPubSub`, `Https`, `Kafka`, `Sample`, or `SchemaRegistry`.
* `type` - (Required) Type of connection. Can be `AWSKinesisDataStreams`, `AWSLambda`, `AzureBlobStorage`, `Cluster`, `GCPPubSub`, `Https`, `Kafka`, `S3`, `Sample`, or `SchemaRegistry`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: i guess it's because of the Atlas API, there is a naming inconsistency, prefixing with AWS/Azure sometimes (e.g., AWSKinesisDataStreams, AWSLambda, AzureBlobStorage) but not with S3

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

yeah we had a discussion about this on the streams team since S3 can be used by other non-AWS providers too

@christineschen
Copy link
Copy Markdown
Collaborator

@EspenAlbert the private link support is done in a separate PR that I just put up for review here: #4366

I can remove the line from the changelog in this PR if that makes it confusing


resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(t); acc.PreCheckLogIntegrationEnvAzure(t) },
PreCheck: func() { acc.PreCheckAzureEnvWithServicePrincipal(t) },
Copy link
Copy Markdown
Collaborator

@EspenAlbert EspenAlbert Apr 6, 2026

Choose a reason for hiding this comment

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

notice how

func azureStorageContainerConfig(projectID string, config *azureConfig) string {
return fmt.Sprintf(`
uses the exact same storage account setup.
Can we refactor into acc package? see code/provider/internal/testutil/acc/stream_instance.go for existing example

Copy link
Copy Markdown
Collaborator

@EspenAlbert EspenAlbert left a comment

Choose a reason for hiding this comment

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

Thank you for addressing the comments!

@EspenAlbert
Copy link
Copy Markdown
Collaborator

@EspenAlbert the private link support is done in a separate PR that I just put up for review here: #4366

I can remove the line from the changelog in this PR if that makes it confusing

Yes, that would be great 👍

Copy link
Copy Markdown
Member

@lantoli lantoli left a comment

Choose a reason for hiding this comment

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

thanks, LGTM once all comments are addressed and new acceptance test passes in PR checks

@christineschen christineschen merged commit df626fe into master Apr 6, 2026
46 of 47 checks passed
@christineschen christineschen deleted the CLOUDP-383606_azure_blob_storage_streams branch April 6, 2026 20:14
svc-apix-Bot added a commit that referenced this pull request Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants