Skip to content

Commit

Permalink
Merge pull request #67 from dynatrace-oss/PCLOUDS-1689/make-storage-a…
Browse files Browse the repository at this point in the history
…ccount-name-unique

PCLOUDS-1689: Make storage account name unique
  • Loading branch information
mmajcher authored Jan 25, 2023
2 parents 8cf2163 + a1598ea commit b282599
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
- az group create --name "$RESOURCE_GROUP_NAME" --location westeurope
- az resource invoke-action --action enable --name "$LOGIC_APP_NAME" -g "$RESOURCE_GROUP_STATIC_RESOURCES" --resource-type "$LOGIC_APP_RESOURCE_TYPE"
script:
- ./deployment/dynatrace-azure-logs.sh --deployment-name "e2e-${TRAVIS_BUILD_ID}" --resource-group "$RESOURCE_GROUP_NAME" --target-url "$TARGET_URL" --target-api-token "$TARGET_API_TOKEN" --use-existing-active-gate true --event-hub-connection-string "$EH_CONNECTION_STRING" --repository-release-url "https://${STORAGE_ACCOUNT_NAME}.blob.core.windows.net/${STORAGE_ACCOUNT_DIR_NAME}/"
- ./deployment/dynatrace-azure-logs.sh --deployment-name "e2e${TRAVIS_BUILD_ID}" --resource-group "$RESOURCE_GROUP_NAME" --target-url "$TARGET_URL" --target-api-token "$TARGET_API_TOKEN" --use-existing-active-gate true --event-hub-connection-string "$EH_CONNECTION_STRING" --repository-release-url "https://${STORAGE_ACCOUNT_NAME}.blob.core.windows.net/${STORAGE_ACCOUNT_DIR_NAME}/"
- pytest tests/e2e -v
after_script:
- az group delete --name "$RESOURCE_GROUP_NAME" --yes
Expand Down
4 changes: 3 additions & 1 deletion deployment/dynatrace-azure-forwarder.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@
"containerSubnetName": "aci",
"appServicePlan": "[concat(parameters('forwarderName'),'-plan')]",
"functionName": "[concat(parameters('forwarderName'),'-function')]",
"storageAccountName": "[replace(concat(parameters('forwarderName'),'sa'), '-', '')]",
"forwarderNameShort": "[take(parameters('forwarderName'), 18)]",
"randomIdToMakeStorageAccountGloballyUnique": "[substring(uniqueString(parameters('forwarderName'), resourceGroup().id), 0, 4)]",
"storageAccountName": "[concat(variables('forwarderNameShort'), 'sa', variables('randomIdToMakeStorageAccountGloballyUnique'))]",
"virtualNetworkId": "[resourceId('Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]",
"functionSubnetId": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworkName'), variables('functionSubnetName'))]",
"containerSubnetId": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworkName'), variables('containerSubnetName'))]",
Expand Down
4 changes: 2 additions & 2 deletions deployment/dynatrace-azure-logs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ readonly FUNCTION_ZIP_PACKAGE=dynatrace-azure-log-forwarder.zip
readonly FUNCTION_REPOSITORY_RELEASE_URL=https://github.com/dynatrace-oss/dynatrace-azure-log-forwarder/releases/latest/download/
readonly DYNATRACE_TARGET_URL_REGEX="^(https?:\/\/[-a-zA-Z0-9@:%._+~=]{1,255}\/?)(\/e\/[a-z0-9-]{36}\/?)?$"
readonly ACTIVE_GATE_TARGET_URL_REGEX="^https:\/\/[-a-zA-Z0-9@:%._+~=]{1,255}\/e\/[-a-z0-9]{1,36}[\/]{0,1}$"
readonly DEPLOYMENT_NAME_REGEX="^[-a-z0-9]{3,20}$"
readonly DEPLOYMENT_NAME_REGEX="^[a-z0-9]{3,20}$"
readonly EVENT_HUB_CONNECTION_STRING_REGEX="^Endpoint=sb:\/\/.*EntityPath=[^[:space:]]+$"
readonly FILTER_CONFIG_REGEX="([^;\s].+?)=([^;]*)"
readonly TAGS_REGEX="^([^<>,%&\?\/]+?:[^,]+,?)+$"
Expand Down Expand Up @@ -94,7 +94,7 @@ check_arg() {
exit 1
else
if ! [[ "$ARGUMENT" =~ $REGEX ]]; then
echo "Not correct $CLI_ARGUMENT_NAME"
echo "Not correct $CLI_ARGUMENT_NAME, pattern is: $REGEX"
exit 1
fi
fi
Expand Down

0 comments on commit b282599

Please sign in to comment.