Skip to content

Commit

Permalink
Merge pull request #168 from ElYusubov/development
Browse files Browse the repository at this point in the history
Updates to event hub and logic app modules
  • Loading branch information
ElYusubov authored Sep 28, 2024
2 parents 774ec21 + 7bdaecd commit 62d79e5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
3 changes: 3 additions & 0 deletions modules/eventHubRoleAssignment.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ param functionAppPrincipalId string
var eventHubsDataReceiverRoleId = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '2b629674-e913-4c01-ae53-ef4638d8f975')
var eventHubsDataSenderRoleId = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'a638d3c7-ab3a-418d-83e6-5f17a39d4fde')

// Event Hub Namespace
resource eventHub 'Microsoft.EventHub/namespaces@2021-11-01' existing = {
name: eventHubNamespaceName
}

// Assign the Event Hubs Data Receiver and Data Sender roles to the Function App
resource eventHubsDataReceiverRole 'Microsoft.Authorization/roleAssignments@2020-10-01-preview' = {
scope: eventHub
name: guid(eventHub.id, functionAppId, eventHubsDataReceiverRoleId)
Expand All @@ -26,6 +28,7 @@ resource eventHubsDataReceiverRole 'Microsoft.Authorization/roleAssignments@2020
}
}

// Assign the Event Hubs Data Sender role to the Function App
resource eventHubsDataSenderRole 'Microsoft.Authorization/roleAssignments@2020-10-01-preview' = {
name: guid(eventHub.id, functionAppId, eventHubsDataSenderRoleId)
scope: eventHub
Expand Down
3 changes: 3 additions & 0 deletions modules/eventHubs.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ param eventHubsSkuName string
@description('The name of our event hub that we will provision as part of this namespace')
param hubName string

// Event Hub Namespace
resource eventHubNamespace 'Microsoft.EventHub/namespaces@2021-11-01' = {
name: eventHubsName
location: location
Expand All @@ -21,6 +22,7 @@ resource eventHubNamespace 'Microsoft.EventHub/namespaces@2021-11-01' = {
}
}

// Event Hub
resource eventHub 'Microsoft.EventHub/namespaces/eventhubs@2021-11-01' = {
name: hubName
parent: eventHubNamespace
Expand All @@ -29,6 +31,7 @@ resource eventHub 'Microsoft.EventHub/namespaces/eventhubs@2021-11-01' = {
}
}

// Output values
output eventHubNamespaceName string = eventHubNamespace.name
output eventHubNamespaceId string = eventHubNamespace.id
output eventHubName string = eventHub.name
19 changes: 12 additions & 7 deletions modules/logic-app.bicep
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
// Parameters
param location string = resourceGroup().location
// logic-app.bicep

@description('The location that these Logic App resources will be deployed to')
param azureRegion string = resourceGroup().location

@description('The Name of the Logic App')
param logicAppName string

@description('The Logic App definition')
param logicAppDefinition object

// Basic logic app
// Basic Logic App
resource logicApp 'Microsoft.Logic/workflows@2019-05-01' = {
name: logicAppName
location: location
location: azureRegion
properties: {
state: 'Enabled'
definition: logicAppDefinition.definition
parameters: logicAppDefinition.parameters
}
}

// Deployment steps on

// New logic app
resource logicAppNew 'Microsoft.Logic/workflows@2019-05-01' = {
name: 'name'
location: location
location: azureRegion
properties: {
definition: {
'': 'https://schema.management.azure.com/schemas/2016-06-01/Microsoft.Logic.json'
Expand Down

0 comments on commit 62d79e5

Please sign in to comment.