Skip to content

Commit 0db0aad

Browse files
Revert "fix(bicep): guard EventHub and Fabric vars against ARM eager-evaluation; fix README headings"
This reverts commit bcf1016.
1 parent bcf1016 commit 0db0aad

2 files changed

Lines changed: 17 additions & 19 deletions

File tree

README.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ If you'd like to customize the solution accelerator, here are some common areas
4141

4242
<br/>
4343

44-
## Resources
44+
### Additional resources
4545

4646
[What's New in Microsoft Fabric](https://learn.microsoft.com/en-us/fabric/fundamentals/whats-new)
4747

@@ -53,8 +53,7 @@ If you'd like to customize the solution accelerator, here are some common areas
5353

5454
<br/>
5555

56-
## Features
57-
56+
### Key features
5857
<details>
5958
<summary>Click to learn more about the key features this solution enables</summary>
6059

@@ -80,8 +79,6 @@ If you'd like to customize the solution accelerator, here are some common areas
8079
Quick deploy
8180
</h2>
8281

83-
## Getting Started
84-
8582
### How to install or deploy
8683

8784
Follow these steps to deploy the solution to your own Azure subscription:
@@ -193,8 +190,6 @@ Use cases can be summarized as below:
193190
Supporting documentation
194191
</h2>
195192

196-
## Guidance
197-
198193
### Security guidelines
199194

200195
This template uses Azure Key Vault to store all connections to communicate between resources.

infra/main.bicep

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,20 +65,23 @@ param existingFabricCapacityName string = ''
6565

6666
// ============================================================================
6767
// Determine whether to use existing resources
68+
// Scenarios:
69+
// 1. Create new namespace + new event hub: existingEventHubNamespaceId not set
70+
// 2. Use existing namespace, create new event hub: existingEventHubNamespaceId is set
71+
//
72+
// NOTE: A new Event Hub is always created to avoid mixing unrelated event types.
73+
// This follows best practices for Event Hub usage.
6874
// ============================================================================
6975

70-
// Use an existing namespace if a valid resource ID is provided; otherwise create a new one.
71-
// A new Event Hub is always created to avoid mixing unrelated event types.
72-
var useExistingEventHubNamespace = startsWith(existingEventHubNamespaceId, '/subscriptions/')
73-
// Fallback placeholder ensures split() is always called on a well-formed resource ID.
74-
var _safeEventHubNamespaceId = useExistingEventHubNamespace
75-
? existingEventHubNamespaceId
76-
: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/placeholder/providers/Microsoft.EventHub/namespaces/placeholder'
77-
var eventHubNamespaceNameFromId = last(split(_safeEventHubNamespaceId, '/'))
78-
var eventHubNamespaceSubscriptionId = split(_safeEventHubNamespaceId, '/')[2]
79-
var eventHubNamespaceResourceGroup = split(_safeEventHubNamespaceId, '/')[4]
80-
// Use an existing Fabric capacity if a valid name is provided; otherwise create a new one.
81-
var useExistingFabricCapacity = !empty(existingFabricCapacityName) && !startsWith(existingFabricCapacityName, '$')
76+
var useExistingEventHubNamespace = !empty(existingEventHubNamespaceId)
77+
// Extract namespace name from resource ID if using existing, otherwise generate new name
78+
var eventHubNamespaceNameFromId = useExistingEventHubNamespace ? last(split(existingEventHubNamespaceId, '/')) : ''
79+
// Parse subscription ID and resource group from the namespace resource ID
80+
// This enables cross-subscription and cross-resource-group deployments
81+
// Example: namespace in sub-123/rg-shared while deploying to sub-456/rg-demo
82+
var eventHubNamespaceSubscriptionId = useExistingEventHubNamespace ? split(existingEventHubNamespaceId, '/')[2] : ''
83+
var eventHubNamespaceResourceGroup = useExistingEventHubNamespace ? split(existingEventHubNamespaceId, '/')[4] : ''
84+
var useExistingFabricCapacity = !empty(existingFabricCapacityName)
8285

8386
var solutionSuffix = toLower(trim(replace(
8487
replace(

0 commit comments

Comments
 (0)