-
Notifications
You must be signed in to change notification settings - Fork 1
Support detect Azure Event Hubs, connect by connection string. #8
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| param storageAccountName string | ||
| param connectionStringSecretName string | ||
| param keyVaultName string | ||
|
|
||
| resource storageAccount 'Microsoft.Storage/storageAccounts@2023-05-01' existing = { | ||
| name: storageAccountName | ||
| } | ||
|
|
||
| resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' existing = { | ||
| name: keyVaultName | ||
| } | ||
|
|
||
| resource connectionStringSecret 'Microsoft.KeyVault/vaults/secrets@2022-07-01' = { | ||
| name: connectionStringSecretName | ||
| parent: keyVault | ||
| properties: { | ||
| value: 'DefaultEndpointsProtocol=https;AccountName=${storageAccount.name};AccountKey=${storageAccount.listKeys().keys[0].value};EndpointSuffix=${environment().suffixes.storage}' | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -197,10 +197,21 @@ module storageAccount 'br/public:avm/res/storage/storage-account:0.14.3' = { | |
| ] | ||
| networkAcls: { | ||
| defaultAction: 'Allow' | ||
| } | ||
| } | ||
| tags: tags | ||
| } | ||
| } | ||
|
|
||
| {{- if (and .AzureStorageAccount .AzureStorageAccount.AuthUsingConnectionString) }} | ||
| module storageAccountConnectionString './modules/set-storage-account-connection-string.bicep' = { | ||
| name: 'storageAccountConnectionString' | ||
| params: { | ||
| storageAccountName: storageAccountName | ||
| connectionStringSecretName: 'STORAGE-ACCOUNT-CONNECTION-STRING' | ||
| keyVaultName: keyVault.outputs.name | ||
| } | ||
| } | ||
| {{end}} | ||
| {{end}} | ||
|
|
||
| {{- if .AzureServiceBus }} | ||
|
|
@@ -340,6 +351,13 @@ module {{bicepName .Name}} 'br/public:avm/res/app/container-app:0.8.0' = { | |
| keyVaultUrl: '${keyVault.outputs.uri}secrets/SERVICEBUS-CONNECTION-STRING' | ||
| } | ||
| {{- end}} | ||
| {{- if (and .AzureStorageAccount .AzureStorageAccount.AuthUsingConnectionString) }} | ||
| { | ||
| name: 'storage-account-connection-string' | ||
| identity:{{bicepName .Name}}Identity.outputs.resourceId | ||
| keyVaultUrl: '${keyVault.outputs.uri}secrets/STORAGE-ACCOUNT-CONNECTION-STRING' | ||
| } | ||
| {{- end}} | ||
| ], | ||
| map({{bicepName .Name}}Secrets, secret => { | ||
| name: secret.secretRef | ||
|
|
@@ -425,7 +443,7 @@ module {{bicepName .Name}} 'br/public:avm/res/app/container-app:0.8.0' = { | |
| {{- end}} | ||
| {{- if (and .AzureEventHubs .AzureEventHubs.AuthUsingManagedIdentity) }} | ||
| { | ||
| name: 'SPRING_CLOUD_AZURE_EVENTHUBS_CONNECTION_STRING' | ||
| name: 'SPRING_CLOUD_AZURE_EVENTHUBS_CONNECTIONSTRING' | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI: Both There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you mean
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. you are right. I updated the comment. |
||
| value: '' | ||
| } | ||
| { | ||
|
|
@@ -439,7 +457,7 @@ module {{bicepName .Name}} 'br/public:avm/res/app/container-app:0.8.0' = { | |
| {{- end}} | ||
| {{- if (and .AzureEventHubs .AzureEventHubs.AuthUsingConnectionString) }} | ||
| { | ||
| name: 'SPRING_CLOUD_AZURE_EVENTHUBS_CONNECTION_STRING' | ||
| name: 'SPRING_CLOUD_AZURE_EVENTHUBS_CONNECTIONSTRING' | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. |
||
| secretRef: 'event-hubs-connection-string' | ||
| } | ||
| { | ||
|
|
@@ -459,14 +477,32 @@ module {{bicepName .Name}} 'br/public:avm/res/app/container-app:0.8.0' = { | |
| {{- end}} | ||
| {{- if (and .AzureStorageAccount .AzureStorageAccount.AuthUsingManagedIdentity) }} | ||
| { | ||
| name: 'SPRING_CLOUD_AZURE_STORAGE_CREDENTIAL_MANAGEDIDENTITYENABLED' | ||
| name: 'SPRING_CLOUD_AZURE_EVENTHUBS_PROCESSOR_CHECKPOINTSTORE_CONNECTIONSTRING' | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI: Convert all
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am just curious how they match the
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For Another example: For Refs: |
||
| value: '' | ||
| } | ||
| { | ||
| name: 'SPRING_CLOUD_AZURE_EVENTHUBS_PROCESSOR_CHECKPOINTSTORE_CREDENTIAL_MANAGEDIDENTITYENABLED' | ||
| value: 'true' | ||
| } | ||
| { | ||
| name: 'SPRING_CLOUD_AZURE_STORAGE_CREDENTIAL_CLIENTID' | ||
| name: 'SPRING_CLOUD_AZURE_EVENTHUBS_PROCESSOR_CHECKPOINTSTORE_CREDENTIAL_CLIENTID' | ||
| value: {{bicepName .Name}}Identity.outputs.clientId | ||
| } | ||
| {{- end}} | ||
| {{- if (and .AzureStorageAccount .AzureStorageAccount.AuthUsingConnectionString) }} | ||
| { | ||
| name: 'SPRING_CLOUD_AZURE_EVENTHUBS_PROCESSOR_CHECKPOINTSTORE_CONNECTIONSTRING' | ||
| secretRef: 'storage-account-connection-string' | ||
| } | ||
| { | ||
| name: 'SPRING_CLOUD_AZURE_EVENTHUBS_PROCESSOR_CHECKPOINTSTORE_CREDENTIAL_MANAGEDIDENTITYENABLED' | ||
| value: 'false' | ||
| } | ||
| { | ||
| name: 'SPRING_CLOUD_AZURE_EVENTHUBS_PROCESSOR_CHECKPOINTSTORE_CREDENTIAL_CLIENTID' | ||
| value: '' | ||
| } | ||
| {{- end}} | ||
|
|
||
| {{- if .AzureServiceBus }} | ||
| { | ||
|
|
@@ -476,7 +512,7 @@ module {{bicepName .Name}} 'br/public:avm/res/app/container-app:0.8.0' = { | |
| {{- end}} | ||
| {{- if (and .AzureServiceBus .AzureServiceBus.AuthUsingManagedIdentity) }} | ||
| { | ||
| name: 'SPRING_CLOUD_AZURE_SERVICEBUS_CONNECTION_STRING' | ||
| name: 'SPRING_CLOUD_AZURE_SERVICEBUS_CONNECTIONSTRING' | ||
| value: '' | ||
| } | ||
| { | ||
|
|
@@ -490,7 +526,7 @@ module {{bicepName .Name}} 'br/public:avm/res/app/container-app:0.8.0' = { | |
| {{- end}} | ||
| {{- if (and .AzureServiceBus .AzureServiceBus.AuthUsingConnectionString) }} | ||
| { | ||
| name: 'SPRING_CLOUD_AZURE_SERVICEBUS_CONNECTION_STRING' | ||
| name: 'SPRING_CLOUD_AZURE_SERVICEBUS_CONNECTIONSTRING' | ||
| secretRef: 'servicebus-connection-string' | ||
| } | ||
| { | ||
|
|
||



There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: This is different to Event Hubs and Service Bus.