-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.bicep
46 lines (43 loc) · 1.12 KB
/
main.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
param serviceBusNamespaceName string
param virtualNetworkName string
param subnetName string
param location string = resourceGroup().location
resource serviceBusNamespace 'Microsoft.ServiceBus/namespaces@2018-01-01-preview' = {
name: serviceBusNamespaceName
location: location
sku: {
name: 'Premium'
tier: 'Premium'
}
properties: {}
}
resource virtualNetwork 'Microsoft.Network/virtualNetworks@2017-09-01' = {
name: virtualNetworkName
location: location
properties: {
addressSpace: {
addressPrefixes: [
'10.0.0.0/23'
]
}
subnets: [
{
name: subnetName
properties: {
addressPrefix: '10.0.0.0/23'
serviceEndpoints: [
{
service: 'Microsoft.ServiceBus'
}
]
}
}
]
}
}
resource namespaceVirtualNetworkRule 'Microsoft.ServiceBus/namespaces/VirtualNetworkRules@2018-01-01-preview' = {
name: '${serviceBusNamespace.name}/${virtualNetwork.name}'
properties: {
virtualNetworkSubnetId: resourceId('Microsoft.Network/virtualNetworks/subnets/', virtualNetwork.name, subnetName)
}
}