-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
azurerm_stream_analytics_reference_input_blob
: Make `storage_accoun…
…t_key` optional when MSI auth is used (#19676) Co-authored-by: Alexander Guth <[email protected]>
- Loading branch information
Showing
9 changed files
with
122 additions
and
28 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
examples/stream-analytics/README.md → ...es/stream-analytics/basic-usage/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
## Example: Azure Stream Analytics | ||
# Azure Stream Analytics: Basic usage | ||
|
||
This example provisions an Azure Storage Account and a Stream Analytics job, that uses it as a reference input. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Azure Stream Analytics: MSI authentication | ||
|
||
This example provisions a Stream Analytics job that uses [MSI authentication](https://learn.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview) for the Stream Analytics inputs and outputs. | ||
|
||
## Inputs | ||
|
||
- `azurerm_stream_analytics_reference_input_blob` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
provider "azurerm" { | ||
features {} | ||
} | ||
|
||
resource "azurerm_resource_group" "example" { | ||
name = "${var.prefix}-example-resources" | ||
location = var.location | ||
} | ||
|
||
resource "azurerm_storage_account" "example" { | ||
name = "${var.prefix}examplestoracc" | ||
resource_group_name = azurerm_resource_group.example.name | ||
location = azurerm_resource_group.example.location | ||
account_tier = "Standard" | ||
account_replication_type = "LRS" | ||
} | ||
|
||
resource "azurerm_role_assignment" "example" { | ||
scope = azurerm_storage_account.example.id | ||
role_definition_name = "Storage Blob Data Contributor" | ||
principal_id = azurerm_stream_analytics_job.example.identity[0].principal_id | ||
} | ||
|
||
resource "azurerm_storage_container" "example" { | ||
name = "${var.prefix}example" | ||
storage_account_name = azurerm_storage_account.example.name | ||
container_access_type = "private" | ||
} | ||
|
||
resource "azurerm_stream_analytics_job" "example" { | ||
name = "${var.prefix}-example-job" | ||
resource_group_name = azurerm_resource_group.example.name | ||
location = azurerm_resource_group.example.location | ||
compatibility_level = "1.1" | ||
data_locale = "en-US" | ||
events_late_arrival_max_delay_in_seconds = 60 | ||
events_out_of_order_max_delay_in_seconds = 50 | ||
events_out_of_order_policy = "Adjust" | ||
output_error_policy = "Drop" | ||
streaming_units = 3 | ||
|
||
identity { | ||
type = "SystemAssigned" | ||
} | ||
|
||
tags = { | ||
environment = "Example" | ||
} | ||
|
||
transformation_query = <<QUERY | ||
SELECT * | ||
INTO [YourOutputAlias] | ||
FROM [YourInputAlias] | ||
QUERY | ||
} | ||
|
||
resource "azurerm_stream_analytics_reference_input_blob" "test" { | ||
name = "${var.prefix}-blob-reference-input" | ||
stream_analytics_job_name = azurerm_stream_analytics_job.example.name | ||
resource_group_name = azurerm_stream_analytics_job.example.resource_group_name | ||
storage_account_name = azurerm_storage_account.example.name | ||
storage_container_name = azurerm_storage_container.example.name | ||
authentication_mode = "Msi" | ||
path_pattern = "some-random-pattern" | ||
date_format = "yyyy/MM/dd" | ||
time_format = "HH" | ||
|
||
serialization { | ||
type = "Json" | ||
encoding = "UTF8" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
variable "prefix" { | ||
description = "The prefix which should be used for all resources in this example" | ||
} | ||
|
||
variable "location" { | ||
description = "The Azure Region in which all resources in this example should be created." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters