From eb451508fbf15df470985e2965415a35b5bc63af Mon Sep 17 00:00:00 2001 From: "Adam Ling (MSFT)" Date: Fri, 24 Sep 2021 00:23:11 -0700 Subject: [PATCH 1/3] fix livetest --- sdk/eventhub/azure-eventhub/stress/test-resources.bicep | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/eventhub/azure-eventhub/stress/test-resources.bicep b/sdk/eventhub/azure-eventhub/stress/test-resources.bicep index 353192bab4f7..856f6352e2d2 100644 --- a/sdk/eventhub/azure-eventhub/stress/test-resources.bicep +++ b/sdk/eventhub/azure-eventhub/stress/test-resources.bicep @@ -22,7 +22,7 @@ var defaultSASKeyName = 'RootManageSharedAccessKey' var eventHubsAuthRuleResourceId = resourceId('Microsoft.EventHub/namespaces/authorizationRules', eventHubsNamespace_var, defaultSASKeyName) var storageAccountId = storageAccount.id -resource eventHubsNamespace 'Microsoft.EventHub/Namespaces@[variables(\'ehVersion\')]' = { +resource eventHubsNamespace 'Microsoft.EventHub/Namespaces@2017-04-01' = { name: eventHubsNamespace_var location: location sku: { @@ -32,7 +32,7 @@ resource eventHubsNamespace 'Microsoft.EventHub/Namespaces@[variables(\'ehVersio properties: {} } -resource eventHubsNamespace_eventHubName 'Microsoft.EventHub/namespaces/eventhubs@[variables(\'ehVersion\')]' = { +resource eventHubsNamespace_eventHubName 'Microsoft.EventHub/namespaces/eventhubs@2017-04-01' = { name: '${eventHubsNamespace_var}/${eventHubName}' location: location properties: { @@ -44,10 +44,10 @@ resource eventHubsNamespace_eventHubName 'Microsoft.EventHub/namespaces/eventhub ] } -resource eventHubsNamespace_eventHubName_eventHubAuthRuleName 'Microsoft.EventHub/namespaces/eventhubs/authorizationRules@[variables(\'ehVersion\')]' = { +resource eventHubsNamespace_eventHubName_eventHubAuthRuleName 'Microsoft.EventHub/namespaces/eventhubs/authorizationRules@2017-04-01' = { name: '${eventHubsNamespace_var}/${eventHubName}/${eventHubAuthRuleName}' properties: { - Rights: [ + rights: [ 'Manage' 'Send' 'Listen' From 1e5b9a14e0498f5243b879e9c652d53c5b6a8724 Mon Sep 17 00:00:00 2001 From: "Adam Ling (MSFT)" Date: Fri, 24 Sep 2021 00:59:02 -0700 Subject: [PATCH 2/3] rm bicep file --- .../stress/test-resources.bicep | 107 ------------------ 1 file changed, 107 deletions(-) delete mode 100644 sdk/eventhub/azure-eventhub/stress/test-resources.bicep diff --git a/sdk/eventhub/azure-eventhub/stress/test-resources.bicep b/sdk/eventhub/azure-eventhub/stress/test-resources.bicep deleted file mode 100644 index 856f6352e2d2..000000000000 --- a/sdk/eventhub/azure-eventhub/stress/test-resources.bicep +++ /dev/null @@ -1,107 +0,0 @@ -@description('The base resource name.') -param baseName string = resourceGroup().name - -@description('The client OID to grant access to test resources.') -param testApplicationOid string - -@description('The location of the resources. By default, this is the same as the resource group.') -param location string = resourceGroup().location - -@description('The url suffix to use when creating storage connection strings.') -param storageEndpointSuffix string = 'core.windows.net' - -var ehVersion = '2017-04-01' -var contributorRoleId = 'b24988ac-6180-42a0-ab88-20f7382dd24c' -var eventHubsDataOwnerRoleId = 'f526a384-b230-433a-b45c-95f59c4a2dec' -var eventHubsNamespace_var = 'eh-${baseName}' -var eventHubName = 'eh-${baseName}-hub' -var eventHubAuthRuleName = 'eh-${baseName}-hub-auth-rule' -var storageAccount_var = replace('blb${baseName}', '-', '') -var containerName = 'your-blob-container-name' -var defaultSASKeyName = 'RootManageSharedAccessKey' -var eventHubsAuthRuleResourceId = resourceId('Microsoft.EventHub/namespaces/authorizationRules', eventHubsNamespace_var, defaultSASKeyName) -var storageAccountId = storageAccount.id - -resource eventHubsNamespace 'Microsoft.EventHub/Namespaces@2017-04-01' = { - name: eventHubsNamespace_var - location: location - sku: { - name: 'Standard' - tier: 'Standard' - } - properties: {} -} - -resource eventHubsNamespace_eventHubName 'Microsoft.EventHub/namespaces/eventhubs@2017-04-01' = { - name: '${eventHubsNamespace_var}/${eventHubName}' - location: location - properties: { - messageRetentionInDays: 1 - partitionCount: 32 - } - dependsOn: [ - eventHubsNamespace - ] -} - -resource eventHubsNamespace_eventHubName_eventHubAuthRuleName 'Microsoft.EventHub/namespaces/eventhubs/authorizationRules@2017-04-01' = { - name: '${eventHubsNamespace_var}/${eventHubName}/${eventHubAuthRuleName}' - properties: { - rights: [ - 'Manage' - 'Send' - 'Listen' - ] - } - dependsOn: [ - eventHubsNamespace_eventHubName - ] -} - -resource storageAccount 'Microsoft.Storage/storageAccounts@2019-06-01' = { - name: storageAccount_var - location: location - sku: { - name: 'Standard_LRS' - tier: 'Standard' - } - kind: 'StorageV2' - properties: { - accessTier: 'Hot' - } -} - -resource storageAccount_default_containerName 'Microsoft.Storage/storageAccounts/blobServices/containers@2019-06-01' = { - name: '${storageAccount_var}/default/${containerName}' - dependsOn: [ - storageAccount - ] -} - -resource id_name_baseName_eventHubsDataOwnerRoleId_testApplicationOid 'Microsoft.Authorization/roleAssignments@2019-04-01-preview' = { - name: guid(resourceGroup().id, deployment().name, baseName, eventHubsDataOwnerRoleId, testApplicationOid) - properties: { - roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', eventHubsDataOwnerRoleId) - principalId: testApplicationOid - scope: resourceGroup().id - } -} - -resource id_name_baseName_contributorRoleId_testApplicationOid 'Microsoft.Authorization/roleAssignments@2019-04-01-preview' = { - name: guid(resourceGroup().id, deployment().name, baseName, contributorRoleId, testApplicationOid) - properties: { - roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', contributorRoleId) - principalId: testApplicationOid - scope: resourceGroup().id - } -} - -output EVENT_HUB_NAMESPACE string = eventHubsNamespace_var -output EVENT_HUB_HOSTNAME string = '${eventHubsNamespace_var}.servicebus.windows.net' -output EVENT_HUB_CONN_STR string = listkeys(eventHubAuthRuleName, ehVersion).primaryConnectionString -output EVENT_HUB_NAME string = eventHubName -output EVENT_HUB_SAS_POLICY string = eventHubAuthRuleName -output EVENT_HUB_SAS_KEY string = listkeys(eventHubAuthRuleName, ehVersion).primaryKey -output AZURE_STORAGE_CONN_STR string = 'DefaultEndpointsProtocol=https;AccountName=${storageAccount_var};AccountKey=${listKeys(storageAccountId, providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value};EndpointSuffix=${storageEndpointSuffix}' -output AZURE_STORAGE_ACCOUNT string = storageAccount_var -output AZURE_STORAGE_ACCESS_KEY string = listKeys(storageAccountId, providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value \ No newline at end of file From 1fc907880b71c06c4018d26f7eaeb56ffa33ff4e Mon Sep 17 00:00:00 2001 From: "Adam Ling (MSFT)" Date: Fri, 24 Sep 2021 11:30:17 -0700 Subject: [PATCH 3/3] rename stress test file --- .../stress/stress-test-resources.bicep | 107 ++++++++++++++++++ ...ources.json => stress-test-resources.json} | 0 2 files changed, 107 insertions(+) create mode 100644 sdk/eventhub/azure-eventhub/stress/stress-test-resources.bicep rename sdk/eventhub/azure-eventhub/stress/{test-resources.json => stress-test-resources.json} (100%) diff --git a/sdk/eventhub/azure-eventhub/stress/stress-test-resources.bicep b/sdk/eventhub/azure-eventhub/stress/stress-test-resources.bicep new file mode 100644 index 000000000000..856f6352e2d2 --- /dev/null +++ b/sdk/eventhub/azure-eventhub/stress/stress-test-resources.bicep @@ -0,0 +1,107 @@ +@description('The base resource name.') +param baseName string = resourceGroup().name + +@description('The client OID to grant access to test resources.') +param testApplicationOid string + +@description('The location of the resources. By default, this is the same as the resource group.') +param location string = resourceGroup().location + +@description('The url suffix to use when creating storage connection strings.') +param storageEndpointSuffix string = 'core.windows.net' + +var ehVersion = '2017-04-01' +var contributorRoleId = 'b24988ac-6180-42a0-ab88-20f7382dd24c' +var eventHubsDataOwnerRoleId = 'f526a384-b230-433a-b45c-95f59c4a2dec' +var eventHubsNamespace_var = 'eh-${baseName}' +var eventHubName = 'eh-${baseName}-hub' +var eventHubAuthRuleName = 'eh-${baseName}-hub-auth-rule' +var storageAccount_var = replace('blb${baseName}', '-', '') +var containerName = 'your-blob-container-name' +var defaultSASKeyName = 'RootManageSharedAccessKey' +var eventHubsAuthRuleResourceId = resourceId('Microsoft.EventHub/namespaces/authorizationRules', eventHubsNamespace_var, defaultSASKeyName) +var storageAccountId = storageAccount.id + +resource eventHubsNamespace 'Microsoft.EventHub/Namespaces@2017-04-01' = { + name: eventHubsNamespace_var + location: location + sku: { + name: 'Standard' + tier: 'Standard' + } + properties: {} +} + +resource eventHubsNamespace_eventHubName 'Microsoft.EventHub/namespaces/eventhubs@2017-04-01' = { + name: '${eventHubsNamespace_var}/${eventHubName}' + location: location + properties: { + messageRetentionInDays: 1 + partitionCount: 32 + } + dependsOn: [ + eventHubsNamespace + ] +} + +resource eventHubsNamespace_eventHubName_eventHubAuthRuleName 'Microsoft.EventHub/namespaces/eventhubs/authorizationRules@2017-04-01' = { + name: '${eventHubsNamespace_var}/${eventHubName}/${eventHubAuthRuleName}' + properties: { + rights: [ + 'Manage' + 'Send' + 'Listen' + ] + } + dependsOn: [ + eventHubsNamespace_eventHubName + ] +} + +resource storageAccount 'Microsoft.Storage/storageAccounts@2019-06-01' = { + name: storageAccount_var + location: location + sku: { + name: 'Standard_LRS' + tier: 'Standard' + } + kind: 'StorageV2' + properties: { + accessTier: 'Hot' + } +} + +resource storageAccount_default_containerName 'Microsoft.Storage/storageAccounts/blobServices/containers@2019-06-01' = { + name: '${storageAccount_var}/default/${containerName}' + dependsOn: [ + storageAccount + ] +} + +resource id_name_baseName_eventHubsDataOwnerRoleId_testApplicationOid 'Microsoft.Authorization/roleAssignments@2019-04-01-preview' = { + name: guid(resourceGroup().id, deployment().name, baseName, eventHubsDataOwnerRoleId, testApplicationOid) + properties: { + roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', eventHubsDataOwnerRoleId) + principalId: testApplicationOid + scope: resourceGroup().id + } +} + +resource id_name_baseName_contributorRoleId_testApplicationOid 'Microsoft.Authorization/roleAssignments@2019-04-01-preview' = { + name: guid(resourceGroup().id, deployment().name, baseName, contributorRoleId, testApplicationOid) + properties: { + roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', contributorRoleId) + principalId: testApplicationOid + scope: resourceGroup().id + } +} + +output EVENT_HUB_NAMESPACE string = eventHubsNamespace_var +output EVENT_HUB_HOSTNAME string = '${eventHubsNamespace_var}.servicebus.windows.net' +output EVENT_HUB_CONN_STR string = listkeys(eventHubAuthRuleName, ehVersion).primaryConnectionString +output EVENT_HUB_NAME string = eventHubName +output EVENT_HUB_SAS_POLICY string = eventHubAuthRuleName +output EVENT_HUB_SAS_KEY string = listkeys(eventHubAuthRuleName, ehVersion).primaryKey +output AZURE_STORAGE_CONN_STR string = 'DefaultEndpointsProtocol=https;AccountName=${storageAccount_var};AccountKey=${listKeys(storageAccountId, providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value};EndpointSuffix=${storageEndpointSuffix}' +output AZURE_STORAGE_ACCOUNT string = storageAccount_var +output AZURE_STORAGE_ACCESS_KEY string = listKeys(storageAccountId, providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value \ No newline at end of file diff --git a/sdk/eventhub/azure-eventhub/stress/test-resources.json b/sdk/eventhub/azure-eventhub/stress/stress-test-resources.json similarity index 100% rename from sdk/eventhub/azure-eventhub/stress/test-resources.json rename to sdk/eventhub/azure-eventhub/stress/stress-test-resources.json