-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathservice-bus-namespace.bicep
56 lines (50 loc) · 1.99 KB
/
service-bus-namespace.bicep
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import { roleAssignmentInfo } from '../security/managed-identity.bicep'
@description('Name of the resource.')
param name string
@description('Location to deploy the resource. Defaults to the location of the resource group.')
param location string = resourceGroup().location
@description('Tags for the resource.')
param tags object = {}
@export()
@description('SKU information for Service Bus Namespace.')
type skuInfo = {
@description('Name of the SKU.')
name: 'Basic' | 'Premium' | 'Standard'
}
@description('Service Bus Namespace SKU. Defaults to Basic.')
param sku skuInfo = {
name: 'Basic'
}
@description('Value indicating whether the namespace is zone-redundant. Defaults to false.')
param zoneRedundant bool = false
@description('Whether to disable local (key-based) authentication. Defaults to true.')
param disableLocalAuth bool = true
@description('Role assignments to create for the Service Bus Namespace.')
param roleAssignments roleAssignmentInfo[] = []
resource serviceBusNamespace 'Microsoft.ServiceBus/namespaces@2022-10-01-preview' = {
name: name
location: location
tags: tags
sku: sku
properties: {
disableLocalAuth: disableLocalAuth
zoneRedundant: zoneRedundant
}
}
resource assignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = [
for roleAssignment in roleAssignments: {
name: guid(serviceBusNamespace.id, roleAssignment.principalId, roleAssignment.roleDefinitionId)
scope: serviceBusNamespace
properties: {
principalId: roleAssignment.principalId
roleDefinitionId: roleAssignment.roleDefinitionId
principalType: roleAssignment.principalType
}
}
]
@description('The deployed Service Bus Namespace resource.')
output resource resource = serviceBusNamespace
@description('ID for the deployed Service Bus Namespace resource.')
output id string = serviceBusNamespace.id
@description('Name for the deployed Service Bus Namespace resource.')
output name string = serviceBusNamespace.name