Skip to content

Commit 6a7c68b

Browse files
[azeventhubs] Fixing bicep to remove shared key/connection string auth (Azure#23978)
- Removing the iothub endpoint, which we aren't currently testing against. - Removing shared key/connection string auth from the storage account
1 parent dba109e commit 6a7c68b

File tree

1 file changed

+1
-63
lines changed

1 file changed

+1
-63
lines changed

sdk/messaging/azeventhubs/test-resources.bicep

Lines changed: 1 addition & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ resource storageAccount 'Microsoft.Storage/storageAccounts@2019-04-01' = {
109109
}
110110
kind: 'StorageV2'
111111
properties: {
112+
allowSharedKeyAccess: false
112113
networkAcls: {
113114
bypass: 'AzureServices'
114115
virtualNetworkRules: []
@@ -138,68 +139,6 @@ resource storageAccountName_default_container 'Microsoft.Storage/storageAccounts
138139
]
139140
}
140141

141-
resource iot 'Microsoft.Devices/IotHubs@2018-04-01' = {
142-
name: iotName
143-
location: location
144-
sku: {
145-
name: 'S1'
146-
capacity: 1
147-
}
148-
properties: {
149-
ipFilterRules: []
150-
eventHubEndpoints: {
151-
events: {
152-
retentionTimeInDays: 1
153-
partitionCount: 4
154-
}
155-
}
156-
routing: {
157-
endpoints: {
158-
serviceBusQueues: []
159-
serviceBusTopics: []
160-
eventHubs: []
161-
storageContainers: []
162-
}
163-
routes: []
164-
fallbackRoute: {
165-
name: '$fallback'
166-
source: 'DeviceMessages'
167-
condition: 'true'
168-
endpointNames: [
169-
'events'
170-
]
171-
isEnabled: true
172-
}
173-
}
174-
storageEndpoints: {
175-
'$default': {
176-
sasTtlAsIso8601: 'PT1H'
177-
connectionString: 'DefaultEndpointsProtocol=https;AccountName=${storageAccountName};AccountKey=${listKeys(storageAccount.id, storageApiVersion).keys[0].value};EndpointSuffix=${storageEndpointSuffix}'
178-
containerName: containerName
179-
}
180-
}
181-
messagingEndpoints: {
182-
fileNotifications: {
183-
lockDurationAsIso8601: 'PT1M'
184-
ttlAsIso8601: 'PT1H'
185-
maxDeliveryCount: 10
186-
}
187-
}
188-
enableFileUploadNotifications: false
189-
cloudToDevice: {
190-
maxDeliveryCount: 10
191-
defaultTtlAsIso8601: 'PT1H'
192-
feedback: {
193-
lockDurationAsIso8601: 'PT1M'
194-
ttlAsIso8601: 'PT1H'
195-
maxDeliveryCount: 10
196-
}
197-
}
198-
features: 'None'
199-
}
200-
}
201-
output IOTHUB_CONNECTION_STRING string = 'HostName=${reference(iot.id, providers('Microsoft.Devices', 'IoTHubs').apiVersions[0]).hostName};SharedAccessKeyName=iothubowner;SharedAccessKey=${listKeys(iot.id, providers('Microsoft.Devices', 'IoTHubs').apiVersions[0]).value[0].primaryKey}'
202-
203142
// used for TokenCredential tests
204143
output EVENTHUB_NAMESPACE string = '${namespace.name}.servicebus.windows.net'
205144
output CHECKPOINTSTORE_STORAGE_ENDPOINT string = storageAccount.properties.primaryEndpoints.blob
@@ -219,7 +158,6 @@ output EVENTHUB_CONNECTION_STRING_SEND_ONLY string = listKeys(
219158
resourceId('Microsoft.EventHub/namespaces/authorizationRules', namespaceName, authorizedSendOnly.name),
220159
apiVersion
221160
).primaryConnectionString
222-
output CHECKPOINTSTORE_STORAGE_CONNECTION_STRING string = 'DefaultEndpointsProtocol=https;AccountName=${storageAccountName};AccountKey=${listKeys(storageAccount.id, storageApiVersion).keys[0].value};EndpointSuffix=${storageEndpointSuffix}'
223161

224162
output RESOURCE_GROUP string = resourceGroup().name
225163
output AZURE_SUBSCRIPTION_ID string = subscription().subscriptionId

0 commit comments

Comments
 (0)