diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index dfdb8b771..000000000 --- a/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.sh text eol=lf diff --git a/.github/actions/createPostgresqlFlexibleServer/action.yml b/.github/actions/createPostgresqlFlexibleServer/action.yml deleted file mode 100644 index 4e88d3da7..000000000 --- a/.github/actions/createPostgresqlFlexibleServer/action.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: Create PostgreSQL Flexible Server -description: Create PostgreSQL Flexible Server that allows access from Azure services. -inputs: - dbAdminUser: - description: "Database Admin User" - required: true - dbName: - description: "Database Name" - required: true - dbPassword: - description: "Database Password" - required: true - dbServerName: - description: "Database Server Name" - required: true - location: - description: "Location" - required: true - resourceGroupName: - description: "Resource Group Name" - required: true - -runs: - using: "composite" - steps: - - uses: actions/checkout@v2.3.4 - - name: Set azCliVersion - uses: ./.github/actions/setvars - with: - varFilePath: ./.github/variables/vm-dependencies.env - - name: Set Up Azure Postgresql that allows access from Azure services - id: setup-postgresql - uses: azure/CLI@v1 - with: - azcliversion: ${{ env.azCliVersion }} - inlineScript: | - echo "Deploy DB with name " ${{ inputs.dbName }} - az postgres flexible-server create \ - --resource-group ${{ inputs.resourceGroupName }} \ - --name ${{ inputs.dbName }} \ - --location ${{ inputs.location }} \ - --admin-user ${{ inputs.dbAdminUser }} \ - --admin-password ${{ inputs.dbPassword }} \ - --version 16 \ - --public-access 0.0.0.0 \ - --tier Burstable \ - --sku-name Standard_B1ms \ - --yes - - az postgres flexible-server db create \ - --resource-group ${{ inputs.resourceGroupName }} \ - --server-name ${{ inputs.dbName }} \ - --database-name ${{ inputs.dbServerName }} - - sleep 1m - echo "Allow Access To Azure Services" - az postgres flexible-server firewall-rule create \ - -g ${{ inputs.resourceGroupName }} \ - -n ${{ inputs.dbName }} \ - -r "AllowAllAzureServices" \ - --start-ip-address "0.0.0.0" \ - --end-ip-address "0.0.0.0" diff --git a/.github/actions/setupmaven/action.yml b/.github/actions/setupmaven/action.yml deleted file mode 100644 index 50f50652e..000000000 --- a/.github/actions/setupmaven/action.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Set Up Maven -description: Set up Maven with github token. -inputs: - token: - description: "GitHub token" - required: true -runs: - using: "composite" - steps: - - uses: actions/checkout@v4 - - name: Set up Apache Maven and JDK - uses: actions/setup-java@v4 - with: - distribution: 'microsoft' - java-version: 21 - server-id: github # Value of the distributionManagement/repository/id field of the pom.xml - server-username: MAVEN_USERNAME # env variable for username - server-password: MAVEN_TOKEN # env variable for token - - name: Set Maven env - env: - MAVEN_USERNAME: github - MAVEN_TOKEN: ${{ inputs.token }} - shell: bash - run: | - echo "MAVEN_USERNAME=${MAVEN_USERNAME}" >> $GITHUB_ENV - echo "MAVEN_TOKEN=${MAVEN_TOKEN}" >> $GITHUB_ENV \ No newline at end of file diff --git a/.github/actions/setvars/action.yml b/.github/actions/setvars/action.yml deleted file mode 100644 index a9991b1ec..000000000 --- a/.github/actions/setvars/action.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: "Set environment variables" -description: "Configures environment variables for a workflow" -inputs: - varFilePath: - description: "File path to variable file or directory. Defaults to ./.github/variables/* if none specified and runs against each file in that directory." - required: false - default: ./.github/variables/* -runs: - using: "composite" - steps: - - run: | - sed "" ${{ inputs.varFilePath }} >> $GITHUB_ENV - shell: bash diff --git a/.github/docs/check-arm-vm-size.md b/.github/docs/check-arm-vm-size.md deleted file mode 100644 index dd318afb5..000000000 --- a/.github/docs/check-arm-vm-size.md +++ /dev/null @@ -1,73 +0,0 @@ -## GitHub Action: Check ARM VM Size Changes - -### Overview -This GitHub Action runs on a schedule to check for changes in Azure ARM VM sizes and creates a pull request to update configurations if changes are detected. - -The action will compare the latest ARM VM sizes queried using AZ CLI with those listed in the variable azure.armBased.vmSize.list within oracle/weblogic-azure/resources/azure-common.properties. If changes are detected, it will initiate a pull request to the main branch of the current repository that runs the action. - -### Schedule -- **Frequency:** Every 14 days (2 weeks) -- **Schedule Expression:** `0 0 */14 * *` (Runs at midnight (00:00) UTC) - -The schedule event only happens in [azure-javaee/weblogic-azure](https://github.com/azure-javaee/weblogic-azure). - -If you want to run the action in your repository, you have to trigger it from Web Browser. - -### Environment Variables -- **azureCredentials:** Secret for Azure credentials -- **repoName:** Repository name set to "weblogic-azure" -- **userEmail:** Secret for user Email of GitHub acount to access GitHub repository -- **userName:** Secret for user name of GitHub account - -### Jobs -#### check-vm-sizes -- **Runs on:** `ubuntu-latest` -- **Steps:** - 1. **Checkout repository:** Checks out the repository using `actions/checkout@v2`. - - 2. **Azure Login:** Logs into Azure using `azure/login@v1`. - - 3. **Check for VM size changes:** - - Reads from `resources/azure-common.properties`. - - Extracts and compares current VM sizes with the latest available. - - Determines if there are changes and prepares data for output. - - 4. **Create PR if changes detected:** - - Conditionally creates a pull request if changes in ARM VM sizes are detected. - - Updates the ARM VM sizes configuration in `resources/azure-common.properties`. - - Commits changes to a new branch and pushes to origin. - - Creates a pull request with a title and description based on detected changes. - -### Run the action - -You can use `.github/resource/azure-credential-setup-wls-vm.sh` to create GitHub Action Secret for the pipeline. - -1. Fill in `.github/resource/credentials-params-wls-vm.yaml` with your values. - - | Variable Name | Value | - |----------------|----------------------| - | OTN_USERID | Oracle single sign-on userid. If you don't have one, sign up from [Create Your Oracle Account](https://profile.oracle.com/myprofile/account/create-account.jspx?nexturl=https%3A%2F%2Fsupport.oracle.com&pid=mos) | - | OTN_PASSWORD | Password for Oracle single sign-on userid. | - | WLS_PSW | Password for WebLogic Server. | - | USER_EMAIL | User Email of GitHub acount to access GitHub repository. | - | USER_NAME | User name of GitHub account. | - | GIT_TOKEN | GitHub token to access GitHub repository.
Make sure the token have permissions:
- Read and write of Pull requests.
- Read and write of Contents. | - -2. Set up secret - - Run `azure-credential-setup-wls-vm.sh` to set up secret. - - ```shell - bash .github/resource/azure-credential-setup-wls-vm.sh - ``` - - Follow the output to set up secrets. - -3. Trigger the workflow - - - Fork this repo from [oracle/weblogic-azure](https://github.com/azure-javaee/weblogic-azure). - - - Enable workflow in the fork. Select **Actions**, then follow the instructions to enable workflow. - - - Select **Actions** -> **Check ARM VM Size Changes** -> **Run workflow** to run the workflow. - diff --git a/.github/resource/azure-credential-setup-wls-aks.sh b/.github/resource/azure-credential-setup-wls-aks.sh deleted file mode 100644 index 31b8af155..000000000 --- a/.github/resource/azure-credential-setup-wls-aks.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash - -set -Eeuo pipefail - -echo "Execute azure-credential-setup.sh - Start------------------------------------------" - -## Create Azure Credentials -SERVICE_PRINCIPAL_NAME_WLS_AKS="sp-${REPO_NAME}-wls-aks-$(date +%s)" -echo "Creating Azure Service Principal with name: $SERVICE_PRINCIPAL_NAME_WLS_AKS" -SUBSCRIPTION_ID=$(az account show --query id -o tsv| tr -d '\r\n') - -AZURE_CREDENTIALS=$(az ad sp create-for-rbac --name ${SERVICE_PRINCIPAL_NAME_WLS_AKS} --role="Contributor" --scopes="/subscriptions/${SUBSCRIPTION_ID}" --sdk-auth --only-show-errors) -SP_ID=$( az ad sp list --display-name $SERVICE_PRINCIPAL_NAME_WLS_AKS --query \[0\].id -o tsv | tr -d '\r\n') -az role assignment create --assignee ${SP_ID} --scope="/subscriptions/${SUBSCRIPTION_ID}" --role "User Access Administrator" - -## Set the Azure Credentials as a secret in the repository -gh secret --repo $(gh repo set-default --view) set "AZURE_CREDENTIALS" -b"${AZURE_CREDENTIALS}" -gh variable --repo $(gh repo set-default --view) set "SERVICE_PRINCIPAL_NAME_WLS_AKS" -b"${SERVICE_PRINCIPAL_NAME_WLS_AKS}" - -echo "Execute azure-credential-setup.sh - End--------------------------------------------" diff --git a/.github/resource/azure-credential-setup-wls-vm.sh b/.github/resource/azure-credential-setup-wls-vm.sh deleted file mode 100644 index 9d57cffb9..000000000 --- a/.github/resource/azure-credential-setup-wls-vm.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -set -Eeuo pipefail - -echo "Execute azure-credential-setup.sh - Start------------------------------------------" - -## Create Azure Credentials -SERVICE_PRINCIPAL_NAME_WLS_VM="sp-${REPO_NAME}-$(date +%s)" -echo "Creating Azure Service Principal with name: $SERVICE_PRINCIPAL_NAME_WLS_VM" -SUBSCRIPTION_ID=$(az account show --query id -o tsv| tr -d '\r\n') - -SERVICE_PRINCIPAL=$(az ad sp create-for-rbac --name ${SERVICE_PRINCIPAL_NAME_WLS_VM} --role="Contributor" --scopes="/subscriptions/${SUBSCRIPTION_ID}" --sdk-auth --only-show-errors | base64 ${w0}) -AZURE_CREDENTIALS=$(echo $SERVICE_PRINCIPAL | base64 -d) - -## Set the Azure Credentials as a secret in the repository -gh secret --repo $(gh repo set-default --view) set "AZURE_CREDENTIALS" -b"${AZURE_CREDENTIALS}" -gh variable --repo $(gh repo set-default --view) set "SERVICE_PRINCIPAL_NAME_WLS_VM" -b"${SERVICE_PRINCIPAL_NAME_WLS_VM}" - -echo "Execute azure-credential-setup.sh - End--------------------------------------------" diff --git a/.github/resource/azure-credential-teardown-wls-aks.sh b/.github/resource/azure-credential-teardown-wls-aks.sh deleted file mode 100644 index 8e85df681..000000000 --- a/.github/resource/azure-credential-teardown-wls-aks.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -set -Eeuo pipefail - -echo "Execute azure-credential-teardown.sh - Start------------------------------------------" - -gh secret --repo $(gh repo set-default --view) delete "AZURE_CREDENTIALS" -SERVICE_PRINCIPAL_NAME_WLS_AKS=$(gh variable --repo $(gh repo set-default --view) get "SERVICE_PRINCIPAL_NAME_WLS_AKS") -az ad sp delete --id $(az ad sp list --display-name $SERVICE_PRINCIPAL_NAME_WLS_AKS --query "[].appId" -o tsv| tr -d '\r\n') - -echo "Execute azure-credential-teardown.sh - End--------------------------------------------" diff --git a/.github/resource/azure-credential-teardown-wls-vm.sh b/.github/resource/azure-credential-teardown-wls-vm.sh deleted file mode 100644 index 520873f85..000000000 --- a/.github/resource/azure-credential-teardown-wls-vm.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -set -Eeuo pipefail - -echo "Execute azure-credential-teardown.sh - Start------------------------------------------" - -gh secret --repo $(gh repo set-default --view) delete "AZURE_CREDENTIALS" -SERVICE_PRINCIPAL_NAME_WLS_VM=$(gh variable --repo $(gh repo set-default --view) get "SERVICE_PRINCIPAL_NAME_WLS_VM") -az ad sp delete --id $(az ad sp list --display-name $SERVICE_PRINCIPAL_NAME_WLS_VM --query "[].appId" -o tsv| tr -d '\r\n') - -echo "Execute azure-credential-teardown.sh - End--------------------------------------------" diff --git a/.github/resource/credentials-params-setup.sh b/.github/resource/credentials-params-setup.sh deleted file mode 100644 index b30bd6e11..000000000 --- a/.github/resource/credentials-params-setup.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env bash -set -Eeuo pipefail - -# ANSI color codes -RED='\033[0;31m' -NC='\033[0m' # No Color - -echo "setup-credentials.sh - Start" - -# Function to print error messages in red -print_error() { - local message=$1 - echo -e "${RED}Error: ${message}${NC}" -} - -check_parameters() { - echo "Checking parameters..." - local has_empty_value=0 - - while IFS= read -r line; do - name=$(echo "$line" | yq -r '.name') - value=$(echo "$line" | yq -r '.value') - - if [ -z "$value" ] || [ "$value" == "null" ]; then - print_error "The parameter '$name' has an empty/null value. Please provide a valid value." - has_empty_value=1 - break - else - echo "Name: $name, Value: $value" - fi - done < <(yq eval -o=json '.[]' "$param_file" | jq -c '.') - - echo "return $has_empty_value" - return $has_empty_value -} - -# Function to set values from YAML -set_values() { - echo "Setting values..." - yq eval -o=json '.[]' "$param_file" | jq -c '.' | while read -r line; do - name=$(echo "$line" | jq -r '.name') - value=$(echo "$line" | jq -r '.value') - gh secret --repo $(gh repo set-default --view) set "$name" -b"${value}" - done -} - -# Main script execution -main() { - if check_parameters; then - echo "All parameters are valid." - set_values - else - echo "Parameter check failed. Exiting." - exit 1 - fi - - echo "setup-credentials.sh - Finish" -} - -# Run the main function -main diff --git a/.github/resource/credentials-params-teardown.sh b/.github/resource/credentials-params-teardown.sh deleted file mode 100644 index a014c4761..000000000 --- a/.github/resource/credentials-params-teardown.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash -set -Eeuo pipefail - -echo "teardown-credentials.sh - Start" - -# remove param the json -yq eval -o=json '.[]' "$param_file" | jq -c '.' | while read -r line; do - name=$(echo "$line" | jq -r '.name') - value=$(echo "$line" | jq -r '.value') - gh secret --repo $(gh repo set-default --view) delete "$name" -done - -echo "teardown-credentials.sh - Finish" diff --git a/.github/resource/credentials-params-wls-aks.yaml b/.github/resource/credentials-params-wls-aks.yaml deleted file mode 100644 index c5c5784e8..000000000 --- a/.github/resource/credentials-params-wls-aks.yaml +++ /dev/null @@ -1,23 +0,0 @@ -# This file contains the parameters for the credentials used in the workflows. -- name: ORC_SSOUSER - value: "" - description: "Oracle single sign-on userid." -- name: ORC_SSOPSW - value: "" - description: "Password for Oracle single sign-on userid." -- name: WDT_RUNTIMEPSW - value: "" - description: "Password for WebLogic Server and Runtime Deployment Tooling encryption." -- name: WLS_PSW - value: ${WDT_RUNTIMEPSW} - description: "Password for WebLogic Server and Runtime Deployment Tooling encryption." -# parameters for the credentials used in the workflows with default values. -- name: WLS_USERNAME - value: "weblogic" - description: "WebLogic Server user name." -- name: DB_PASSWORD - value: "Secret123!" - description: "Password for the database" -- name: LOCATION - value: "eastus" - description: "Location of the resource group" diff --git a/.github/resource/credentials-params-wls-vm.yaml b/.github/resource/credentials-params-wls-vm.yaml deleted file mode 100644 index 33dc568f8..000000000 --- a/.github/resource/credentials-params-wls-vm.yaml +++ /dev/null @@ -1,35 +0,0 @@ -# This file contains the parameters for the credentials used in the workflows. -- name: OTN_USERID - value: "" - description: Oracle single sign-on userid. -- name: OTN_PASSWORD - value: "" - description: Password for Oracle single sign-on userid. -- name: WLS_PSW - value: "" - description: Password for WebLogic Server. -# Git credentials -- name: USER_EMAIL - value: "" - description: User Email of GitHub acount to access GitHub repository. -- name: USER_NAME - value: "" - description: User name of GitHub account -- name: GIT_TOKEN - value: "" - description: GitHub token to access GitHub repository. -# parameters for the credentials used in the workflows with default values. -- name: LOCATION - value: "eastus" - description: Location of the resource group -# Optional parameters: -# if you want to use optional parameters, please uncomment the following lines -#- name: ELK_URI -# value: "" -# description: URI (hostname:port) for Elastic server, leave blank if you don't want to integrate ELK. -#- name: ELK_USER_NAME -# value: "" -# description: Account password for Elastic server, leave blank if you don't want to integrate ELK. -#- name: ELK_PSW -# value: "" -# description: Account password for Elastic server, leave blank if you don't want to integrate ELK. diff --git a/.github/resource/pre-check.sh b/.github/resource/pre-check.sh deleted file mode 100644 index 533c230db..000000000 --- a/.github/resource/pre-check.sh +++ /dev/null @@ -1,68 +0,0 @@ -# Check environment and tools required to run the script - -# ANSI color codes -GREEN='\033[0;32m' -NC='\033[0m' # No Color - -## Check if the required tools are installed and logged in -echo -e "${GREEN}To run this script, you need to have the following tools installed:${NC}" -echo -e "${GREEN}1. yq${NC}" -echo -e "${GREEN}2. Github CLI (gh)${NC}" -echo -e "${GREEN}3. Azure CLI (az)${NC}" -echo -e "${GREEN}And you need to be logged in to GitHub CLI (gh), and Azure CLI (az).${NC}" - -echo "Checking if the required tools are installed..." -echo "Checking progress started..." - -if ! command -v yq &> /dev/null; then - echo "Check required tools and environment failed." - echo "yq is not installed. Please install it to proceed." - exit 1 -fi -echo "1/6...yq is installed." - -if ! command -v jq &> /dev/null; then - echo "Check required tools and environment failed." - echo "jq is not installed. Please install it to proceed." - exit 1 -fi -echo "2/6...jq is installed." - -# Check gh installed -if ! command -v gh &> /dev/null; then - echo "Check required tools and environment failed." - echo "GitHub CLI (gh) is not installed. Please install it to proceed." - exit 1 -fi -echo "3/6...GitHub CLI (gh) is installed." - - -# Check if the GitHub CLI (gh) is logged in -if ! gh auth status &> /dev/null; then - echo "Check required tools and environment failed." - echo "You are not logged in to GitHub CLI (gh). Please log in with `gh auth login` to proceed." - exit 1 -fi -echo "4/6...You are logged in to GitHub CLI (gh)." - -# check if az is installed -if ! command -v az &> /dev/null; then - echo "Check required tools and environment failed." - echo "Azure CLI (az) is not installed. Please install it to proceed." - exit 1 -fi -echo "5/6...Azure CLI (az) is installed." - - -# check if az is logged in -if ! az account show &> /dev/null; then - echo "Check required tools and environment failed." - echo "You are not logged in to Azure CLI (az). Please log in with command `az login` to proceed." - exit 1 -fi -echo "6/6...You are logged in to Azure CLI (az)." - -echo "Checking progress completed..." - -echo "Select default repository for this project" -gh repo set-default diff --git a/.github/variables/vm-dependencies.env b/.github/variables/vm-dependencies.env deleted file mode 100644 index 84d9c771d..000000000 --- a/.github/variables/vm-dependencies.env +++ /dev/null @@ -1,2 +0,0 @@ -refArmttk=6b75cb7a3f65234995a2019fcae20a9b2c2d8635 -azCliVersion=2.60.0 diff --git a/.github/workflows/buildWlsAksArtifact.yml b/.github/workflows/buildWlsAksArtifact.yml deleted file mode 100644 index fe14bc687..000000000 --- a/.github/workflows/buildWlsAksArtifact.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: Build WLS on AKS artifact - -on: - workflow_dispatch: - repository_dispatch: - types: [aks-package] - # Sample cURL - # curl --verbose -X POST https://api.github.com/repos//weblogic-azure/dispatches -H 'Accept: application/vnd.github.everest-preview+json' -H 'Authorization: token ' --data '{"event_type": "aks-package"}' - -env: - location: eastus - aksRepoUserName: oracle - aksRepoBranchName: main - -jobs: - preflight: - runs-on: ubuntu-latest - steps: - - name: Get versions of external dependencies - run: | - curl -Lo external-deps-versions.properties https://raw.githubusercontent.com/Azure/azure-javaee-iaas/main/external-deps-versions.properties - source external-deps-versions.properties - echo "azCliVersion=${AZ_CLI_VERSION}" >> $GITHUB_ENV - echo "bicepVersion=${BICEP_VERSION}" >> $GITHUB_ENV - - name: Set up bicep - run: | - curl -Lo bicep https://github.com/Azure/bicep/releases/download/${bicepVersion}/bicep-linux-x64 - chmod +x ./bicep - sudo mv ./bicep /usr/local/bin/bicep - bicep --version - - uses: actions/checkout@v2.3.4 - - name: Set up Maven with GitHub token - uses: ./.github/actions/setupmaven - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: Download arm-ttk used in partner center pipeline - run: | - wget -O arm-template-toolkit.zip https://aka.ms/arm-ttk-azureapps - unzip arm-template-toolkit.zip -d arm-ttk - - name: Checkout ${{ env.aksRepoUserName }}/weblogic-azure - uses: actions/checkout@v2 - with: - path: weblogic-azure - - name: Build and test weblogic-azure/weblogic-azure-aks - run: mvn -Pbicep -Passembly clean install -Ptemplate-validation-tests --file weblogic-azure/weblogic-azure-aks/pom.xml - - name: Generate artifact file name and path - id: artifact_file - run: | - version=$(mvn -q -Dexec.executable=echo -Dexec.args='${version.wls-on-aks-azure-marketplace}' --file weblogic-azure/pom.xml --non-recursive exec:exec) - artifactName=wls-on-aks-azure-marketplace-$version-arm-assembly - unzip weblogic-azure/weblogic-azure-aks/target/$artifactName.zip -d weblogic-azure/weblogic-azure-aks/target/$artifactName - echo "##[set-output name=artifactName;]${artifactName}" - echo "##[set-output name=artifactPath;]weblogic-azure/weblogic-azure-aks/target/$artifactName" - - name: Archive weblogic-azure/weblogic-azure-aks template - uses: actions/upload-artifact@v4 - if: success() - with: - name: ${{steps.artifact_file.outputs.artifactName}} - path: ${{steps.artifact_file.outputs.artifactPath}} diff --git a/.github/workflows/buildWlsVm4AsArtifact.yml b/.github/workflows/buildWlsVm4AsArtifact.yml deleted file mode 100644 index e66c1bfea..000000000 --- a/.github/workflows/buildWlsVm4AsArtifact.yml +++ /dev/null @@ -1,102 +0,0 @@ -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -name: Build Admin Server VM artifact -on: - repository_dispatch: - types: [vms-admin-package] - workflow_dispatch: - inputs: - pidType: - description: 'Specify which pids to use, oracle or microsoft.' - required: true - default: 'oracle' - ref: - description: 'Specify Git Ref if needed.' - required: false - default: 'refs/heads/main' - # Sample cURL - # curl --verbose -X POST https://api.github.com/repos//weblogic-azure/dispatches -H 'Accept: application/vnd.github.everest-preview+json' -H 'Authorization: token ' --data '{"event_type": "vms-admin-package", "client_payload": {"pidType": "microsoft", "ref": "refs/heads/main"}}' -env: - offerName: "arm-oraclelinux-wls-admin" - repoName: "weblogic-azure" - repoOwner: ${{ secrets.USER_NAME }} - -jobs: - package: - runs-on: ubuntu-latest - steps: - - name: Setup environment variables - id: setup-env-variables-based-on-dispatch-event - run: | - if [ ${{ github.event_name }} == 'workflow_dispatch' ]; then - pidType=${{ github.event.inputs.pidType }} - ref=${{ github.event.inputs.ref }} - else - pidType=${{ github.event.client_payload.pidType }} - ref=${{ github.event.client_payload.ref }} - fi - - if [ -z "$pidType" ]; then - pidType='microsoft' - fi - - if [ -z "$ref" ]; then - ref='refs/heads/main' - fi - - echo "##[set-output name=pidType;]${pidType}" - echo "##[set-output name=ref;]${ref}" - echo "pidType=${pidType}" >> $GITHUB_ENV - echo "ref=${ref}" >> $GITHUB_ENV - - uses: actions/checkout@v2.3.4 - - name: Set up Maven with GitHub token - uses: ./.github/actions/setupmaven - with: - token: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/checkout@v2.3.4 - - name: Set dependency reference - uses: ./.github/actions/setvars - with: - varFilePath: ./.github/variables/vm-dependencies.env - - name: Download arm-ttk used in partner center pipeline - run: | - wget -O arm-template-toolkit.zip https://aka.ms/arm-ttk-azureapps - unzip arm-template-toolkit.zip -d arm-ttk - - name: Checkout ${{ env.repoName }} - uses: actions/checkout@v2 - with: - path: ${{ env.repoName }} - ref: ${{ env.ref }} - - name: Update utilities path location - run: | - cd ${{env.repoName}}/weblogic-azure-vm/${{ env.offerName }} - find . -name "*.json" | xargs sed -i 's|../../../../utilities|../utilities|g' $1 - - name: Build and test ${{ env.offerName }} using ${{ env.pidType }} pids - run: | - cd ${{env.repoName}}/weblogic-azure-vm/${{ env.offerName }} - pidType=${{ env.pidType }} - if [[ "${pidType}" == "oracle" ]];then - echo "using oracle pid" - mvn -Ptemplate-validation-tests clean install -Dgit.repo.owner=${{ env.repoOwner }} -Dgit.tag=${{ env.ref }} - else - echo "using ms pid" - mvn -Ptemplate-validation-tests clean install -Ddev -Dgit.repo.owner=${{ env.repoOwner }} -Dgit.tag=${{ env.ref }} - fi - - - name: Generate artifact file name and path - id: artifact_file - run: | - version=$(mvn -q -Dexec.executable=echo -Dexec.args='${version.${{ env.offerName }}}' --file weblogic-azure/pom.xml --non-recursive exec:exec) - cd ${{env.repoName}}/weblogic-azure-vm/${{ env.offerName }} - artifactName=${{ env.offerName }}-$version-arm-assembly - unzip target/$artifactName.zip -d target/$artifactName - echo "##[set-output name=artifactName;]${artifactName}-${{ env.pidType }}" - echo "##[set-output name=artifactPath;]${{env.repoName}}/weblogic-azure-vm/${{ env.offerName }}/target/$artifactName" - - name: Archive ${{ env.offerName }} template - uses: actions/upload-artifact@v4 - if: success() - with: - name: ${{steps.artifact_file.outputs.artifactName}} - path: ${{steps.artifact_file.outputs.artifactPath}} - diff --git a/.github/workflows/buildWlsVm4CcArtifact.yml b/.github/workflows/buildWlsVm4CcArtifact.yml deleted file mode 100644 index 51007c65a..000000000 --- a/.github/workflows/buildWlsVm4CcArtifact.yml +++ /dev/null @@ -1,101 +0,0 @@ -#Copyright (c) 2021 Oracle and/or its affiliates. -#Released under the Universal Permissive License v1.0 as shown at -# https://oss.oracle.com/licenses/upl/ - -name: Build Configured Cluster VM artifact -on: - repository_dispatch: - types: [vms-configured-cluster-package] - workflow_dispatch: - inputs: - pidType: - description: 'Specify which pids to use, oracle or microsoft.' - required: true - default: 'oracle' - ref: - description: 'Specify Git Ref if needed.' - required: false - default: 'refs/heads/main' - # Sample cURL - # curl --verbose -X POST https://api.github.com/repos//weblogic-azure/dispatches -H 'Accept: application/vnd.github.everest-preview+json' -H 'Authorization: token ' --data '{"event_type": "vms-configured-cluster-package", "client_payload": {"pidType": "microsoft", "ref": "refs/heads/main"} }' -env: - offerName: "arm-oraclelinux-wls-cluster" - repoName: "weblogic-azure" - repoOwner: ${{ secrets.USER_NAME }} - -jobs: - package: - runs-on: ubuntu-latest - steps: - - name: Setup environment variables - id: setup-env-variables-based-on-dispatch-event - run: | - if [ ${{ github.event_name }} == 'workflow_dispatch' ]; then - pidType=${{ github.event.inputs.pidType }} - ref=${{ github.event.inputs.ref }} - else - pidType=${{ github.event.client_payload.pidType }} - ref=${{ github.event.client_payload.ref }} - fi - if [ -z "$pidType" ]; then - pidType='microsoft' - fi - if [ -z "$ref" ]; then - ref='refs/heads/main' - fi - echo "##[set-output name=pidType;]${pidType}" - echo "##[set-output name=ref;]${ref}" - echo "pidType=${pidType}" >> $GITHUB_ENV - echo "ref=${ref}" >> $GITHUB_ENV - - uses: actions/checkout@v2.3.4 - - name: Set up Maven with GitHub token - uses: ./.github/actions/setupmaven - with: - token: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/checkout@v2.3.4 - - name: Set dependency reference - uses: ./.github/actions/setvars - with: - varFilePath: ./.github/variables/vm-dependencies.env - - name: Download arm-ttk used in partner center pipeline - run: | - wget -O arm-template-toolkit.zip https://aka.ms/arm-ttk-azureapps - unzip arm-template-toolkit.zip -d arm-ttk - - name: Checkout ${{ env.repoName }} - uses: actions/checkout@v2 - with: - path: ${{ env.repoName }} - ref: ${{ env.ref }} - - name: Update utilities path location - run: | - cd ${{env.repoName}}/weblogic-azure-vm/${{ env.offerName }} - find . -name "*.json" | xargs sed -i 's|../../../../../utilities|../utilities|g' $1 - - name: Build and test ${{ env.offerName }} using ${{ env.pidType }} pids - run: | - cd ${{env.repoName}}/weblogic-azure-vm/${{ env.offerName }}/${{ env.offerName }} - pidType=${{ env.pidType }} - if [[ "${pidType}" == "oracle" ]];then - echo "using oracle pid" - mvn -Ptemplate-validation-tests clean install -Dgit.repo.owner=${{ env.repoOwner }} -Dgit.tag=${{ env.ref }} - else - echo "using ms pid" - mvn -Ptemplate-validation-tests clean install -Ddev -Dgit.repo.owner=${{ env.repoOwner }} -Dgit.tag=${{ env.ref }} - fi - - - name: Generate artifact file name and path - id: artifact_file - run: | - version=$(mvn -q -Dexec.executable=echo -Dexec.args='${version.${{ env.offerName }}}' --file weblogic-azure/pom.xml --non-recursive exec:exec) - cd ${{env.repoName}}/weblogic-azure-vm/${{ env.offerName }}/${{ env.offerName }} - artifactName=${{ env.offerName }}-$version-arm-assembly - unzip target/$artifactName.zip -d target/$artifactName - echo "##[set-output name=artifactName;]${artifactName}-${{ env.pidType }}" - echo "##[set-output name=artifactPath;]${{env.repoName}}/weblogic-azure-vm/${{ env.offerName }}/${{ env.offerName }}/target/$artifactName" - - name: Archive ${{ env.offerName }} template - uses: actions/upload-artifact@v4 - if: success() - with: - name: ${{steps.artifact_file.outputs.artifactName}} - path: ${{steps.artifact_file.outputs.artifactPath}} - - diff --git a/.github/workflows/buildWlsVm4DcArtifact.yml b/.github/workflows/buildWlsVm4DcArtifact.yml deleted file mode 100644 index 7f5c68373..000000000 --- a/.github/workflows/buildWlsVm4DcArtifact.yml +++ /dev/null @@ -1,97 +0,0 @@ -#Copyright (c) 2021 Oracle and/or its affiliates. -#Released under the Universal Permissive License v1.0 as shown at -# https://oss.oracle.com/licenses/upl/ - -name: Build Dynamic Cluster VM artifact -on: - repository_dispatch: - types: [vms-dynamic-cluster-package] - workflow_dispatch: - inputs: - pidType: - description: 'Specify which pids to use, oracle or microsoft.' - required: true - default: 'oracle' - ref: - description: 'Specify Git Ref if needed.' - required: false - default: 'refs/heads/main' - # Sample cURL - # curl --verbose -X POST https://api.github.com/repos//weblogic-azure/dispatches -H 'Accept: application/vnd.github.everest-preview+json' -H 'Authorization: token ' --data '{"event_type": "vms-dynamic-cluster-package", "client_payload": {"pidType": "microsoft", "ref": "refs/heads/main"}}' -env: - offerName: "arm-oraclelinux-wls-dynamic-cluster" - repoName: "weblogic-azure" - repoOwner: ${{ secrets.USER_NAME }} - - -jobs: - package: - runs-on: ubuntu-latest - steps: - - name: Setup environment variables - id: setup-env-variables-based-on-dispatch-event - run: | - if [ ${{ github.event_name }} == 'workflow_dispatch' ]; then - pidType=${{ github.event.inputs.pidType }} - ref=${{ github.event.inputs.ref }} - else - pidType=${{ github.event.client_payload.pidType }} - ref=${{ github.event.client_payload.ref }} - fi - if [ -z "$pidType" ]; then - pidType='microsoft' - fi - if [ -z "$ref" ]; then - ref='refs/heads/main' - fi - echo "##[set-output name=pidType;]${pidType}" - echo "##[set-output name=ref;]${ref}" - echo "pidType=${pidType}" >> $GITHUB_ENV - echo "ref=${ref}" >> $GITHUB_ENV - - uses: actions/checkout@v2.3.4 - - name: Set up Maven with GitHub token - uses: ./.github/actions/setupmaven - with: - token: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/checkout@v2.3.4 - - name: Download arm-ttk used in partner center pipeline - run: | - wget -O arm-template-toolkit.zip https://aka.ms/arm-ttk-azureapps - unzip arm-template-toolkit.zip -d arm-ttk - - name: Checkout ${{ env.repoName }} - uses: actions/checkout@v2 - with: - path: ${{ env.repoName }} - ref: ${{ env.ref }} - - name: Update utilities path location - run: | - cd ${{env.repoName}}/weblogic-azure-vm/${{ env.offerName }} - find . -name "*.json" | xargs sed -i 's|../../../../../utilities|../utilities|g' $1 - - name: Build and test ${{ env.offerName }} using ${{ env.pidType }} pids - run: | - cd ${{env.repoName}}/weblogic-azure-vm/${{ env.offerName }}/${{ env.offerName }} - pidType=${{ env.pidType }} - echo ${pidType} - if [[ "${pidType}" == "oracle" ]];then - echo "using oracle pids" - mvn -Ptemplate-validation-tests clean install -Dgit.repo.owner=${{ env.repoOwner }} -Dgit.tag=${{ env.ref }} - else - echo "using ms pids" - mvn -Ptemplate-validation-tests clean install -Ddev -Dgit.repo.owner=${{ env.repoOwner }} -Dgit.tag=${{ env.ref }} - fi - - - name: Generate artifact file name and path - id: artifact_file - run: | - version=$(mvn -q -Dexec.executable=echo -Dexec.args='${version.${{ env.offerName }}}' --file weblogic-azure/pom.xml --non-recursive exec:exec) - cd ${{env.repoName}}/weblogic-azure-vm/${{ env.offerName }}/${{ env.offerName }} - artifactName=${{ env.offerName }}-$version-arm-assembly - unzip target/$artifactName.zip -d target/$artifactName - echo "##[set-output name=artifactName;]${artifactName}-${{ env.pidType }}" - echo "##[set-output name=artifactPath;]${{env.repoName}}/weblogic-azure-vm/${{ env.offerName }}/${{ env.offerName }}/target/$artifactName" - - name: Archive ${{ env.offerName }} template - uses: actions/upload-artifact@v4 - if: success() - with: - name: ${{steps.artifact_file.outputs.artifactName}} - path: ${{steps.artifact_file.outputs.artifactPath}} diff --git a/.github/workflows/buildWlsVm4SnArtifact.yml b/.github/workflows/buildWlsVm4SnArtifact.yml deleted file mode 100644 index bf8531b86..000000000 --- a/.github/workflows/buildWlsVm4SnArtifact.yml +++ /dev/null @@ -1,94 +0,0 @@ -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -name: Build Single Node VM artifact -on: - repository_dispatch: - types: [vms-single-node-package] - workflow_dispatch: - inputs: - pidType: - description: 'Specify which pids to use, oracle or microsoft.' - required: true - default: 'oracle' - ref: - description: 'Specify Git Ref if needed.' - required: false - default: 'refs/heads/main' - # Sample cURL - # curl --verbose -X POST https://api.github.com/repos//weblogic-azure/dispatches -H 'Accept: application/vnd.github.everest-preview+json' -H 'Authorization: token ' --data '{"event_type": "vms-single-node-package", "client_payload": {"pidType": "microsoft", "ref": "refs/heads/main"}}' -env: - offerName: "arm-oraclelinux-wls" - repoName: "weblogic-azure" - repoOwner: ${{ secrets.USER_NAME }} - -jobs: - package: - runs-on: ubuntu-latest - steps: - - name: Setup environment variables - id: setup-env-variables-based-on-dispatch-event - run: | - if [ ${{ github.event_name }} == 'workflow_dispatch' ]; then - pidType=${{ github.event.inputs.pidType }} - ref=${{ github.event.inputs.ref }} - else - pidType=${{ github.event.client_payload.pidType }} - ref=${{ github.event.client_payload.ref }} - fi - - if [ -z "$pidType" ]; then - pidType='microsoft' - fi - - if [ -z "$ref" ]; then - ref='refs/heads/main' - fi - - echo "##[set-output name=pidType;]${pidType}" - echo "##[set-output name=ref;]${ref}" - echo "pidType=${pidType}" >> $GITHUB_ENV - echo "ref=${ref}" >> $GITHUB_ENV - - uses: actions/checkout@v2.3.4 - - name: Set up Maven with GitHub token - uses: ./.github/actions/setupmaven - with: - token: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/checkout@v2.3.4 - - name: Download arm-ttk used in partner center pipeline - run: | - wget -O arm-template-toolkit.zip https://aka.ms/arm-ttk-azureapps - unzip arm-template-toolkit.zip -d arm-ttk - - name: Checkout ${{ env.repoName }} - uses: actions/checkout@v2 - with: - path: ${{ env.repoName }} - ref: ${{ env.ref }} - - name: Build and test ${{ env.offerName }} using ${{ env.pidType }} pids - run: | - cd ${{env.repoName}}/weblogic-azure-vm/${{ env.offerName }} - pidType=${{ env.pidType }} - if [[ "${pidType}" == "oracle" ]];then - echo "using oracle pid" - mvn -Ptemplate-validation-tests clean install -Dgit.repo.owner=${{ env.repoOwner }} -Dgit.tag=${{ env.ref }} - else - echo "using ms pid" - mvn -Ptemplate-validation-tests clean install -Ddev -Dgit.repo.owner=${{ env.repoOwner }} -Dgit.tag=${{ env.ref }} - fi - - - name: Generate artifact file name and path - id: artifact_file - run: | - cd ${{env.repoName}}/weblogic-azure-vm/${{ env.offerName }} - version=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec) - artifactName=${{ env.offerName }}-$version-arm-assembly - unzip target/$artifactName.zip -d target/$artifactName - echo "##[set-output name=artifactName;]${artifactName}-${{ env.pidType }}" - echo "##[set-output name=artifactPath;]${{env.repoName}}/weblogic-azure-vm/${{ env.offerName }}/target/$artifactName" - - name: Archive ${{ env.offerName }} template - uses: actions/upload-artifact@v4 - if: success() - with: - name: ${{steps.artifact_file.outputs.artifactName}} - path: ${{steps.artifact_file.outputs.artifactPath}} - diff --git a/.github/workflows/checkARMVMSize.yml b/.github/workflows/checkARMVMSize.yml deleted file mode 100644 index ac776235d..000000000 --- a/.github/workflows/checkARMVMSize.yml +++ /dev/null @@ -1,110 +0,0 @@ -name: Check ARM VM Size Changes - -on: - workflow_dispatch: - schedule: - - cron: '0 0 */14 * *' # Runs at midnight (00:00) UTC every 14 days (2 weeks) - -env: - azureCredentials: ${{ secrets.AZURE_CREDENTIALS }} - repoName: "weblogic-azure" - userEmail: ${{ secrets.USER_EMAIL }} - userName: ${{ secrets.USER_NAME }} - GH_TOKEN: ${{ secrets.GIT_TOKEN }} - -jobs: - check-vm-sizes: - if: github.event_name == 'workflow_dispatch' || (github.event_name == 'schedule' && github.repository_owner == 'azure-javaee') - runs-on: ubuntu-latest - steps: - - name: Checkout weblogic-azure - uses: actions/checkout@v2 - with: - path: weblogic-azure - - - uses: azure/login@v1 - id: azure-login - with: - creds: ${{ env.azureCredentials }} - - - name: Check for VM size changes - id: check_vm_sizes - run: | - ls -l ${{ env.repoName }} - # Path to the properties file - property_file="${{ env.repoName }}/resources/azure-common.properties" - - # Check if the properties file exists - if [ ! -f "$property_file" ]; then - echo "Properties file '$property_file' not found." - exit 1 - fi - - if ! grep -q '^azure\.armBased\.vmSize\.list=' "$property_file"; then - echo "Line 'azure.armBased.vmSize.list' not found in $property_file." - echo "vm_sizes_changed=false" >> "$GITHUB_OUTPUT" - exit 0 - fi - - # Using grep to find the line containing azure.armBased.vmSize.list - vm_size_variable=$(grep '^azure\.armBased\.vmSize\.list=' "$property_file") - vm_size_list=${vm_size_variable#*=} - - # Print the extracted value - echo "$vm_size_list" - - latest_locations=$(az account list-locations --query '[?not_null(metadata.latitude)] .name' -o tsv) - - new_sizes="" - for location in $latest_locations; do - latest_sizes=$(az vm list-sizes --location $location | jq '.[] | select(.name | contains("p")) | .name' | tr -d "\"") - for size in $latest_sizes; do - # if new_sizes does not contain size - if [[ $(echo "[$new_sizes]" | jq '. | index("'${size}'")') == null ]]; then - echo "Add size: ${size}" - if [ -z "$new_sizes" ]; then - new_sizes="\"$size\"" - else - new_sizes="$new_sizes,\"$size\"" - fi - fi - done - done - - if [ ${#new_sizes} -ne ${#vm_size_list} ]; then - echo "VM sizes changed" - echo "vm_sizes_changed=true" >> "$GITHUB_OUTPUT" - else - echo "vm_sizes_changed=false" >> "$GITHUB_OUTPUT" - fi - - echo "Current sizes : $new_sizes" - echo "latest_sizes=\"${new_sizes}\"" >> "$GITHUB_OUTPUT" - - - name: Create PR if changes detected - if: steps.check_vm_sizes.outputs.vm_sizes_changed == 'true' - run: | - # Logic to create a pull request to update the ARM VM sizes configuration file - # Example: Use GitHub CLI or git commands to create a branch and push changes - cd ${{ env.repoName }} - branchName="update-vm-sizes-$(date +%s)" - git config --global user.email "${userEmail}" - git config --global user.name "${userName}" - - git checkout -b ${branchName} - # Use sed to delete the line starting with azure.armBased.vmSize.list= - property_file="resources/azure-common.properties" - sed -i '/^azure\.armBased\.vmSize\.list=/d' "$property_file" - latest_sizes=$(echo ${{ steps.check_vm_sizes.outputs.latest_sizes }} | sed 's/,/","/g') - echo "azure.armBased.vmSize.list=\"$latest_sizes\"" >> "$property_file" - - git add $property_file - git commit -m "Update ARM VM sizes" - git push origin ${branchName} - - # Create a pull request - gh pr create --title "Update ARM VM sizes" \ - --body "Automatic update of ARM VM sizes based on latest changes" \ - --reviewer edburns,galiacheng \ - --base main \ - --head ${branchName} diff --git a/.github/workflows/newtag.yml b/.github/workflows/newtag.yml deleted file mode 100644 index 82a158998..000000000 --- a/.github/workflows/newtag.yml +++ /dev/null @@ -1,151 +0,0 @@ -name: New Tag -on: - workflow_dispatch: - inputs: - tagname: - description: 'Specify Tag name to create/update.' - required: true - default: '2021-12-10-01-Q4' - ref: - description: 'Specify Git Ref if needed.' - required: false - default: 'refs/heads/main' - repository_dispatch: - types: [gh-pages-newtag] - # sample cURL - # curl --verbose -X POST https://api.github.com/repos//weblogic-azure/dispatches -H 'Accept: application/vnd.github.everest-preview+json' -H 'Authorization: token ' --data '' - # sample - # {"event_type": "gh-pages-newtag", "client_payload": {"tagname": "2021-12-09-02-Q4", "ref": "refs/heads/main" }} - -env: - tagbranch: "tagbranch" - gitToken: ${{ secrets.GIT_TOKEN }} - repoName: "weblogic-azure" - userEmail: ${{ secrets.USER_EMAIL }} - userName: ${{ secrets.USER_NAME }} - repoOwner: ${{ secrets.USER_NAME }} - -jobs: - newtag: - runs-on: ubuntu-latest - steps: - - name: Setup environment variables - id: setup-env-variables-based-on-dispatch-event - run: | - if [ ${{ github.event_name }} == 'workflow_dispatch' ]; then - tagname=${{ github.event.inputs.tagname }} - ref=${{ github.event.inputs.ref }} - else - tagname=${{ github.event.client_payload.tagname }} - ref=${{ github.event.client_payload.ref }} - fi - - if [ -z "$tagname" ]; then - tagname=${userName}`date +%m%d` - fi - - if [ -z "$ref" ]; then - ref='refs/heads/main' - fi - - echo "##[set-output name=tagname;]${tagname}" - echo "##[set-output name=ref;]${ref}" - echo "tagname=${tagname}" >> $GITHUB_ENV - echo "ref=${ref}" >> $GITHUB_ENV - - uses: actions/checkout@v2.3.4 - - name: Set up Maven with GitHub token - uses: ./.github/actions/setupmaven - with: - token: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/checkout@v2.3.4 - - name: Set dependency reference - uses: ./.github/actions/setvars - with: - varFilePath: ./.github/variables/vm-dependencies.env - - name: Get versions of external dependencies - id: get-external-dependencies-version - run: | - curl -Lo external-deps-versions.properties https://raw.githubusercontent.com/Azure/azure-javaee-iaas/main/external-deps-versions.properties - source external-deps-versions.properties - echo "bicepVersion=${BICEP_VERSION}" >> $GITHUB_ENV - - name: Checkout ${{ env.repoName }} - uses: actions/checkout@v2 - with: - path: ${{ env.repoName }} - ref: ${{ env.ref }} - token: ${{ env.gitToken }} - - name: Checkout arm-ttk - uses: actions/checkout@v2 - with: - repository: Azure/arm-ttk - path: arm-ttk - ref: ${{ env.refArmttk }} - - name: Set up bicep - run: | - curl -Lo bicep https://github.com/Azure/bicep/releases/download/${bicepVersion}/bicep-linux-x64 - chmod +x ./bicep - sudo mv ./bicep /usr/local/bin/bicep - bicep --version - - name: Build ${{ env.repoName }} - run: | - cd ${{ env.repoName }} - mvn -Ptemplate-validation-tests clean install --file weblogic-azure-vm/pom.xml -Dgit.repo.owner=${{ env.repoOwner }} -Dgit.tag=${{ env.ref }} - - mvn -Ptemplate-validation-tests -Pbicep clean install --file weblogic-azure-aks/pom.xml -Dgit.repo.owner=${{ env.repoOwner }} -Dgit.tag=${{ env.ref }} - ls weblogic-azure-aks/target/bicep - bicep build weblogic-azure-aks/target/bicep/mainTemplate.bicep --outfile weblogic-azure-aks/src/main/arm/mainTemplate.json - bicep build weblogic-azure-aks/target/bicep/modules/setupDBConnection.bicep --outfile weblogic-azure-aks/src/main/arm/dbTemplate.json - bicep build weblogic-azure-aks/target/bicep/modules/updateWebLogicApplications.bicep --outfile weblogic-azure-aks/src/main/arm/updateAppTemplate.json - - - name: Create new tag - run: | - cd ${{ env.repoName }} - - git config --global core.longpaths true - git config --global user.email $userEmail - git config --global user.name $userName - - authGitPath=https://$gitToken@github.com/${GITHUB_REPOSITORY}.git - - echo "Create tag branch" - remoteBranches=$(git ls-remote --heads) - echo ${remoteBranches} - if [[ -n `echo ${remoteBranches} | grep "${tagbranch}"` ]]; then - git push ${authGitPath} --delete ${tagbranch} -f - fi - - if [[ -n `git branch --all | grep "${tagbranch}"` ]]; then - git branch -D ${tagbranch} - fi - - git checkout -b ${tagbranch} - - # replace pids - list=$(find weblogic-azure-vm -name "*.json" | grep "\/target\/") - for file in ${list}; do - sourcePath=$(echo "$file" | sed "s:target:src/main:g") - if test -f "$sourcePath"; then - echo "Replace ${sourcePath} with ${file}" - cp -f $file $sourcePath - fi - done - - git status - git add --all - git commit -m "hard code pids" - git fetch --unshallow - git push ${authGitPath} ${tagbranch} -f - - # remove existing tag - if [[ -n `git ls-remote --tags | grep "${tagname}"` ]]; then - git push ${authGitPath} --delete ${tagname} -f - fi - - # create new tag - git tag ${tagname} - git push ${authGitPath} ${tagname} -f - git remote add upstream $gitToken@github.com:oracle/weblogic-azure.git - # ignore the error if cannot push, but log it - push_upstream_ignore_failure () { echo "push upstream result: $?" return 0; } - git push upstream ${tagname} -f || push_upstream_ignore_failure - git push ${authGitPath} --delete ${tagbranch} -f diff --git a/.github/workflows/setup-for-wls-aks.sh b/.github/workflows/setup-for-wls-aks.sh deleted file mode 100644 index 50a147246..000000000 --- a/.github/workflows/setup-for-wls-aks.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - -################################################ -# This script is invoked by a human who: -# - has done az login. -# - can create repository secrets in the github repo from which this file was cloned. -# - has the gh client >= 2.0.0 installed. -# - has yq 4.x installed. -# -# This script initializes the repo from which this file is was cloned -# with the necessary secrets to run the workflows. -# Steps to run the Script: -# 1. Run az login. -# 2. Run gh auth login. -# 3. Clone the repository. -# 4. Prepare the .github/resource/credentials-params-wls-aks.yaml file with the required parameters. -# 5. Run the script with the following command: -# ``` -# cd .github/workflows -# bash setup-for-wls-aks.sh -# ``` -# 6. The script will set the required secrets in the repository. -# 7. Check the repository secrets to verify that the secrets are set. -################################################ - -set -Eeuo pipefail - -source ../resource/pre-check.sh -## Set environment variables -export param_file="../resource/credentials-params-wls-aks.yaml" -source ../resource/credentials-params-setup.sh -source ../resource/azure-credential-setup-wls-aks.sh diff --git a/.github/workflows/setup-for-wls-vm.sh b/.github/workflows/setup-for-wls-vm.sh deleted file mode 100644 index 1cb3d71eb..000000000 --- a/.github/workflows/setup-for-wls-vm.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - -################################################ -# This script is invoked by a human who: -# - has done az login. -# - can create repository secrets in the github repo from which this file was cloned. -# - has the gh client >= 2.0.0 installed. -# - has yq 4.x installed. -# -# This script initializes the repo from which this file is was cloned -# with the necessary secrets to run the workflows. -# Steps to run the Script: -# 1. Run az login. -# 2. Run gh auth login. -# 3. Clone the repository. -# 4. Prepare the .github/resource/credentials-params-wls-vm.yaml file with the required parameters. -# 5. Run the script with the following command: -# ``` -# cd .github/workflows -# bash setup-for-wls-vm.sh -# ``` -# 6. The script will set the required secrets in the repository. -# 7. Check the repository secrets to verify that the secrets are set. -################################################ - -set -Eeuo pipefail - -source ../resource/pre-check.sh -## Set environment variables -export param_file="../resource/credentials-params-wls-vm.yaml" -source ../resource/credentials-params-setup.sh -source ../resource/azure-credential-setup-wls-vm.sh diff --git a/.github/workflows/setupWlsAksDependency.yml b/.github/workflows/setupWlsAksDependency.yml deleted file mode 100644 index 1d21e1f15..000000000 --- a/.github/workflows/setupWlsAksDependency.yml +++ /dev/null @@ -1,108 +0,0 @@ -name: Setup DB and Storage Account - -on: - workflow_dispatch: - # Sample cURL - # curl --verbose -X POST https://api.github.com/repos//weblogic-azure/dispatches -H 'Accept: application/vnd.github.everest-preview+json' -H 'Authorization: token ' --data '{"event_type": "aks-deploy-dependency"}' - repository_dispatch: - types: [aks-deploy-dependency] - -env: - azureCredentials: ${{ secrets.AZURE_CREDENTIALS }} - location: eastus - dbAdminUser: weblogic - dbPassword: ${{ secrets.DB_PASSWORD }} - dbName: wlsdb${{ github.run_id }}${{ github.run_number }} - dbServerName: weblogicdb - resourceGroupForDB: wlsd-db-${{ github.run_id }}-${{ github.run_number }} - resourceGroupForStorageAccount: wlsd-sa-${{ github.run_id }}-${{ github.run_number }} - storageAccountName: wlsdsa${{ github.run_id }}${{ github.run_number }} - storageContainerName: wlsdcon${{ github.run_id }}${{ github.run_number }} - -jobs: - deploy-db: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2.3.4 - - name: Set AZ CLI Version - id: set-az-cli-version - uses: ./.github/actions/setvars - with: - varFilePath: ./.github/variables/vm-dependencies.env - - uses: azure/login@v1 - id: azure-login - with: - creds: ${{ env.azureCredentials }} - - name: Create Resource Group - uses: azure/CLI@v1 - with: - azcliversion: ${{ env.azCliVersion }} - inlineScript: | - echo "create resource group" ${{ env.resourceGroupForDB }} - az group create --verbose --name ${{ env.resourceGroupForDB }} --location ${{ env.location }} - - - uses: actions/checkout@v2.3.4 - - name: Set up PostgreSQL Flexible Server that allows access from Azure services - uses: ./.github/actions/createPostgresqlFlexibleServer - with: - dbAdminUser: ${{ env.dbAdminUser }} - dbName: ${{ env.dbName }} - dbPassword: ${{ env.dbPassword }} - dbServerName: ${{ env.dbServerName }} - location: ${{ env.location }} - resourceGroupName: ${{ env.resourceGroupForDB }} - deploy-storage-account: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2.3.4 - - name: Set AZ CLI Version - id: set-az-cli-version - uses: ./.github/actions/setvars - with: - varFilePath: ./.github/variables/vm-dependencies.env - - uses: azure/login@v1 - id: azure-login - with: - creds: ${{ env.azureCredentials }} - - name: Create Resource Group - uses: azure/CLI@v1 - with: - azcliversion: ${{ env.azCliVersion }} - inlineScript: | - echo "create resource group" ${{ env.resourceGroupForStorageAccount }} - az group create --verbose --name ${{ env.resourceGroupForStorageAccount }} --location ${{ env.location }} - - name: Create Storage Account - uses: azure/CLI@v1 - with: - azcliversion: ${{ env.azCliVersion }} - inlineScript: | - az storage account create --name ${{ env.storageAccountName }} \ - --resource-group ${{ env.resourceGroupForStorageAccount }} \ - --location ${{ env.location }} \ - --sku Standard_LRS \ - --kind StorageV2 - - name: Create Storage Container - uses: azure/CLI@v1 - with: - azcliversion: ${{ env.azCliVersion }} - inlineScript: | - az storage container create -n ${{ env.storageContainerName }} --account-name ${{ env.storageAccountName }} - format-db-sa-parameters-for-integration-test: - needs: [deploy-storage-account, deploy-db] - runs-on: ubuntu-latest - steps: - - name: Generate integration-test parameter json - id: artifact_file - run: | - cat <integration-test-data.txt - # sample request - curl --verbose -X POST https://api.github.com/repos/${{ github.repository_owner }}/weblogic-azure/dispatches -H 'Accept: application/vnd.github.everest-preview+json' -H 'Authorization: token ' --data '' - # copy the JSON as - {"event_type": "aks-integration-test-without-dependency-creation", "client_payload": {"gitUserNameForArtifactsLocation": "${{ github.repository_owner }}", "testBranchNameForArtifactsLocation": "${{ github.ref }}", "isForDemo": "false", "disambiguationSuffix": "${{ github.run_id }}", "storageAccountName": "${{ env.storageAccountName }}", "storageContainerName": "${{ env.storageContainerName }}", "dbName": "${{ env.dbName }}"}} - EOF - - name: Archive integration-test-data.txt - uses: actions/upload-artifact@v4 - if: success() - with: - name: integration-test-data - path: integration-test-data.txt diff --git a/.github/workflows/syncupWithUpstream.yml b/.github/workflows/syncupWithUpstream.yml deleted file mode 100644 index 35c9df677..000000000 --- a/.github/workflows/syncupWithUpstream.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Merge upstream branches for WLS on AKS -on: - workflow_dispatch: - # Sample cURL - # curl --verbose -X POST https://api.github.com/repos//weblogic-azure/dispatches -H 'Accept: application/vnd.github.everest-preview+json' -H 'Authorization: token ' --data '{"event_type": "aks-upstream-sync"}' - repository_dispatch: - types: [aks-upstream-sync] -env: - userName: ${{ secrets.USER_NAME }} - userEmail: ${{ secrets.USER_EMAIL }} - gitToken: ${{ secrets.GIT_TOKEN }} -jobs: - merge: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - token: ${{ env.gitToken }} - - name: Merge upstream - run: | - git config --global user.name ${{ env.userName }} - git config --global user.email ${{ env.userEmail }} - - # "git checkout main" is unnecessary, already here by default - git pull --unshallow - - git remote add upstream https://github.com/oracle/weblogic-azure.git - git fetch upstream - - git merge --no-edit upstream/main - git push origin main diff --git a/.github/workflows/teardown-for-wls-aks.sh b/.github/workflows/teardown-for-wls-aks.sh deleted file mode 100644 index 25fada69b..000000000 --- a/.github/workflows/teardown-for-wls-aks.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash - -################################################ -# This script is invoked by a human who: -# - can remove repository secrets in the github repo from which this file was cloned. -# - has the gh client >= 2.0.0 installed. -# - has yq 4.x installed. -# -# This script initializes the repo from which this file is was cloned -# with the necessary secrets to run the workflows. -# Steps to run the Script: -# 1. Run gh auth login. -# 2. Clone the repository. -# 3. Run the script with the following command: -# ``` -# cd .github/workflows -# bash teardown-for-wls-aks.sh -# ``` -# 4. The script will remove the required secrets in the repository. -# 5. Check the repository secrets to verify that the secrets are removed. -################################################ - -set -Eeuo pipefail - -source ../resource/pre-check.sh -## Set environment variables -export param_file="../resource/credentials-params-wls-aks.yaml" -source ../resource/credentials-params-teardown.sh -source ../resource/azure-credential-teardown-wls-aks.sh diff --git a/.github/workflows/teardown-for-wls-vm.sh b/.github/workflows/teardown-for-wls-vm.sh deleted file mode 100644 index f05889971..000000000 --- a/.github/workflows/teardown-for-wls-vm.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash - -################################################ -# This script is invoked by a human who: -# - can remove repository secrets in the github repo from which this file was cloned. -# - has the gh client >= 2.0.0 installed. -# - has yq 4.x installed. -# -# This script initializes the repo from which this file is was cloned -# with the necessary secrets to run the workflows. -# Steps to run the Script: -# 1. Run gh auth login. -# 2. Clone the repository. -# 3. Run the script with the following command: -# ``` -# cd .github/workflows -# bash teardown-for-wls-vm.sh -# ``` -# 4. The script will remove the required secrets in the repository. -# 5. Check the repository secrets to verify that the secrets are removed. -################################################ - -set -Eeuo pipefail - -source ../resource/pre-check.sh -## Set environment variables -export param_file="../resource/credentials-params-wls-vm.yaml" -source ../resource/credentials-params-teardown.sh -source ../resource/azure-credential-teardown-wls-vm.sh diff --git a/.github/workflows/testWlsAksWithDependencyCreation.yml b/.github/workflows/testWlsAksWithDependencyCreation.yml deleted file mode 100644 index 4c06db9d6..000000000 --- a/.github/workflows/testWlsAksWithDependencyCreation.yml +++ /dev/null @@ -1,464 +0,0 @@ -name: Test WLS on AKS with Dependency creation - -on: - workflow_dispatch: - inputs: - isForDemo: - description: 'If set to true, resources will not be deleted' - required: true - default: 'false' - gitUserNameForArtifactsLocation: - description: 'Replaced into https://raw.githubusercontent.com/#gitUserName#/weblogic-azure/#testbranchName#/weblogic-azure-aks/src/main/arm/' - required: true - default: oracle - testBranchNameForArtifactsLocation: - description: 'Replaced into https://raw.githubusercontent.com/#gitUserName#/weblogic-azure/#testbranchName#/weblogic-azure-aks/src/main/arm/' - required: true - default: main - vmSize: - description: 'The VM size for the AKS pool' - required: true - default: Standard_D2s_v3 - location: - description: 'The location for the resources' - required: true - default: eastus - # sample cURL - # curl --verbose -X POST https://api.github.com/repos//weblogic-azure/dispatches -H 'Accept: application/vnd.github.everest-preview+json' -H 'Authorization: token ' --data '{"event_type": "aks-integration-test-with-dependency-creation", "client_payload": {"gitUserNameForArtifactsLocation": "", "testBranchNameForArtifactsLocation": "", "isForDemo": "false"}}' - repository_dispatch: - types: [aks-integration-test-with-dependency-creation,integration-test-all] - -env: - azureCredentials: ${{ secrets.AZURE_CREDENTIALS }} - resourceGroupForWlsAks: wlsd-aks-${{ github.run_id }}-${{ github.run_number }} - dbAdminUser: weblogic - dbPassword: ${{ secrets.DB_PASSWORD }} - dbName: wlsdb${{ github.run_id }}${{ github.run_number }} - dbServerName: weblogicdb - ocrSSOPSW: ${{ secrets.ORC_SSOPSW }} - ocrSSOUser: ${{ secrets.ORC_SSOUSER }} - wdtRuntimePassword: ${{ secrets.WDT_RUNTIMEPSW}} - wlsUserName: ${{ secrets.WLS_USERNAME }} - wlsPassword: ${{ secrets.WLS_PSW }} - resourceGroupForDB: wlsd-db-${{ github.run_id }}-${{ github.run_number }} - resourceGroupForStorageAccount: wlsd-sa-${{ github.run_id }}-${{ github.run_number }} - storageAccountName: wlsdsa${{ github.run_id }}${{ github.run_number }} - storageContainerName: wlsdcon${{ github.run_id }}${{ github.run_number }} - -jobs: - preflight: - outputs: - artifactName: ${{steps.artifact_file.outputs.artifactName}} - isForDemo: ${{ steps.setup-env-variables-based-on-dispatch-event.outputs.isForDemo }} - gitUserNameForArtifactsLocation: ${{ steps.setup-env-variables-based-on-dispatch-event.outputs.gitUserNameForArtifactsLocation }} - testBranchNameForArtifactsLocation: ${{ steps.setup-env-variables-based-on-dispatch-event.outputs.testBranchNameForArtifactsLocation }} - azCliVersion: ${{steps.set-az-cli-version.outputs.azCliVersion}} - vmSize: ${{ steps.setup-env-variables-based-on-dispatch-event.outputs.vmSize }} - location: ${{ steps.setup-env-variables-based-on-dispatch-event.outputs.location }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2.3.4 - - name: Set AZ CLI Version and save in variable azCliVersion - uses: ./.github/actions/setvars - with: - varFilePath: ./.github/variables/vm-dependencies.env - - name: Output Az CLi version - id: set-az-cli-version - run: | - echo "azCliVersion=${azCliVersion}" >> $GITHUB_OUTPUT - - name: Get versions of external dependencies - id: get-external-dependencies-version - run: | - curl -Lo external-deps-versions.properties https://raw.githubusercontent.com/Azure/azure-javaee-iaas/main/external-deps-versions.properties - source external-deps-versions.properties - echo "bicepVersion=${BICEP_VERSION}" >> $GITHUB_ENV - echo "refArmttk=${ARM_TTK_REFERENCE}" >> $GITHUB_ENV - - name: Setup environment variables - id: setup-env-variables-based-on-dispatch-event - run: | - location=eastus # default value - if [ ${{ github.event_name }} == 'workflow_dispatch' ]; then - isForDemo=${{ github.event.inputs.isForDemo }} - gitUserNameForArtifactsLocation=${{ github.event.inputs.gitUserNameForArtifactsLocation }} - testBranchNameForArtifactsLocation=${{ github.event.inputs.testBranchNameForArtifactsLocation }} - vmSize=${{ github.event.inputs.vmSize }} - location=${{ github.event.inputs.location }} - else - isForDemo=${{ github.event.client_payload.isForDemo }} - gitUserNameForArtifactsLocation=${{ github.event.client_payload.gitUserNameForArtifactsLocation }} - testBranchNameForArtifactsLocation=${{ github.event.client_payload.testBranchNameForArtifactsLocation }} - vmSize=${{ github.event.client_payload.vmSize }} - location=${{ github.event.client_payload.location }} - fi - - echo "##[set-output name=isForDemo;]${isForDemo}" - echo "##[set-output name=gitUserNameForArtifactsLocation;]${gitUserNameForArtifactsLocation}" - echo "##[set-output name=testBranchNameForArtifactsLocation;]${testBranchNameForArtifactsLocation}" - echo "##[set-output name=vmSize;]${vmSize}" - echo "##[set-output name=location;]${location}" - - echo "isForDemo=${isForDemo}" >> $GITHUB_ENV - echo "gitUserNameForArtifactsLocation=${gitUserNameForArtifactsLocation}" >> $GITHUB_ENV - echo "testBranchNameForArtifactsLocation=${testBranchNameForArtifactsLocation}" >> $GITHUB_ENV - echo "vmSize=${vmSize}" >> $GITHUB_ENV - echo "location=${location}" >> $GITHUB_ENV - - uses: actions/checkout@v2.3.4 - - name: Set up Maven with GitHub token - uses: ./.github/actions/setupmaven - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: Set up bicep - run: | - curl -Lo bicep https://github.com/Azure/bicep/releases/download/${bicepVersion}/bicep-linux-x64 - chmod +x ./bicep - sudo mv ./bicep /usr/local/bin/bicep - bicep --version - - name: Checkout arm-ttk - uses: actions/checkout@v2 - with: - repository: Azure/arm-ttk - path: arm-ttk - ref: ${{ env.refArmttk }} - - name: Checkout weblogic-azure - uses: actions/checkout@v2 - with: - path: weblogic-azure - - name: Build and test weblogic-azure/weblogic-azure-aks - run: mvn -Pbicep -Passembly clean install -Ptemplate-validation-tests --file weblogic-azure/weblogic-azure-aks/pom.xml - - name: Generate artifact file name and path - id: artifact_file - run: | - version=$(mvn -q -Dexec.executable=echo -Dexec.args='${version.wls-on-aks-azure-marketplace}' --file weblogic-azure/pom.xml --non-recursive exec:exec) - artifactName=wls-on-aks-azure-marketplace-$version-arm-assembly - unzip weblogic-azure/weblogic-azure-aks/target/$artifactName.zip -d weblogic-azure/weblogic-azure-aks/target/$artifactName - echo "##[set-output name=artifactName;]${artifactName}" - echo "##[set-output name=artifactPath;]weblogic-azure/weblogic-azure-aks/target/$artifactName" - - name: Archive weblogic-azure/weblogic-azure-aks template - uses: actions/upload-artifact@v4 - if: success() - with: - name: ${{steps.artifact_file.outputs.artifactName}} - path: ${{steps.artifact_file.outputs.artifactPath}} - deploy-db: - needs: preflight - runs-on: ubuntu-latest - steps: - - name: Get AZ CLI Version - run: | - echo "azCliVersion=${{needs.preflight.outputs.azCliVersion}}" >> $GITHUB_ENV - echo "location=${{needs.preflight.outputs.location}}" >> $GITHUB_ENV - - uses: azure/login@v1 - id: azure-login - with: - creds: ${{ env.azureCredentials }} - - name: Create Resource Group - uses: azure/CLI@v1 - with: - azcliversion: ${{ env.azCliVersion }} - inlineScript: | - echo "create resource group" ${{ env.resourceGroupForDB }} - az group create --verbose --name ${{ env.resourceGroupForDB }} --location $location - - - uses: actions/checkout@v2.3.4 - - name: Set up PostgreSQL Flexible Server that allows access from Azure services - uses: ./.github/actions/createPostgresqlFlexibleServer - with: - dbAdminUser: ${{ env.dbAdminUser }} - dbName: ${{ env.dbName }} - dbPassword: ${{ env.dbPassword }} - dbServerName: ${{ env.dbServerName }} - location: $location - resourceGroupName: ${{ env.resourceGroupForDB }} - - deploy-storage-account: - needs: preflight - runs-on: ubuntu-latest - steps: - - name: Get AZ CLI Version - run: | - echo "azCliVersion=${{needs.preflight.outputs.azCliVersion}}" >> $GITHUB_ENV - echo "location=${{needs.preflight.outputs.location}}" >> $GITHUB_ENV - - name: Checkout Azure-Samples/cargotracker-wls-aks - uses: actions/checkout@v2 - with: - repository: Azure-Samples/cargotracker-wls-aks - path: cargotracker - - uses: actions/setup-java@v4 - with: - distribution: 'microsoft' - java-version: '11' - - run: mvn clean install -PweblogicOnAks --file cargotracker/pom.xml - - name: Query version string for deployment verification - run: | - PROPERTY_FILE="cargotracker/target/cargo-tracker/WEB-INF/classes/org/eclipse/cargotracker/messages.properties" - PROP_KEY=versionString - deployVersion=$(cat $PROPERTY_FILE | grep "$PROP_KEY" | cut -d '=' -f 2) - echo "deployVersion=${deployVersion}" >> $GITHUB_ENV - - uses: azure/login@v1 - id: azure-login - with: - creds: ${{ env.azureCredentials }} - - name: Create Resource Group - uses: azure/CLI@v1 - with: - azcliversion: ${{ env.azCliVersion }} - inlineScript: | - echo "create resource group" ${{ env.resourceGroupForStorageAccount }} - az group create --verbose --name ${{ env.resourceGroupForStorageAccount }} --location $location - - name: Create Storage Account - uses: azure/CLI@v1 - with: - azcliversion: ${{ env.azCliVersion }} - inlineScript: | - az storage account create --name ${{ env.storageAccountName }} \ - --resource-group ${{ env.resourceGroupForStorageAccount }} \ - --location $location \ - --sku Standard_LRS \ - --kind StorageV2 - - name: Create Storage Container - uses: azure/CLI@v1 - with: - azcliversion: ${{ env.azCliVersion }} - inlineScript: | - az storage container create -n ${{ env.storageContainerName }} --account-name ${{ env.storageAccountName }} - - name: Upload built web app war file - uses: azure/CLI@v1 - with: - azcliversion: ${{ env.azCliVersion }} - inlineScript: | - az storage blob upload --account-name ${{ env.storageAccountName }} --container-name ${{ env.storageContainerName }} --file cargotracker/target/cargo-tracker.war --name cargo-tracker.war - deploy-wls-on-aks: - needs: [deploy-storage-account, deploy-db, preflight] - runs-on: ubuntu-latest - steps: - - name: Get AZ CLI Version - run: | - echo "azCliVersion=${{needs.preflight.outputs.azCliVersion}}" >> $GITHUB_ENV - echo "location=${{needs.preflight.outputs.location}}" >> $GITHUB_ENV - - name: Checkout weblogic-azure - uses: actions/checkout@v2 - with: - path: weblogic-azure - - name: Download artifact for deployment - uses: actions/download-artifact@v4 - with: - name: ${{needs.preflight.outputs.artifactName}} - path: ${{needs.preflight.outputs.artifactName}} - - uses: azure/login@v1 - id: azure-login - with: - creds: ${{ env.azureCredentials }} - - name: Query web app blob url and set to env - uses: azure/CLI@v1 - with: - azcliversion: ${{ env.azCliVersion }} - inlineScript: | - sasTokenValidTime=3600 - expiryData=$(( `date +%s`+${sasTokenValidTime})) - sasEnd=`date -d@"$expiryData" -u '+%Y-%m-%dT%H:%MZ'` - sasToken=$(az storage account generate-sas \ - --permissions r \ - --account-name ${{ env.storageAccountName }} \ - --services b \ - --resource-types sco \ - --expiry $sasEnd -o tsv) - cargoTrackerBlobUrl=$(az storage blob url \ - --container-name ${{ env.storageContainerName }} \ - --name cargo-tracker.war \ - --account-name ${{ env.storageAccountName }} \ - --sas-token ${sasToken} -o tsv) - - echo "cargoTrackerBlobUrl=${cargoTrackerBlobUrl}" >> $GITHUB_ENV - - name: Create Resource Group - uses: azure/CLI@v1 - with: - azcliversion: ${{ env.azCliVersion }} - inlineScript: | - echo "create resource group" ${{ env.resourceGroupForWlsAks }} - az group create --verbose --name ${{ env.resourceGroupForWlsAks }} --location $location - - name: Checkout Azure-Samples/cargotracker-wls-aks - uses: actions/checkout@v2 - with: - repository: Azure-Samples/cargotracker-wls-aks - path: cargotracker - - name: Prepare parameter file - run: | - echo "generate parameter file" - bash weblogic-azure/weblogic-azure-aks/src/test/genWlsAksParameters.sh \ - ${{ needs.preflight.outputs.gitUserNameForArtifactsLocation }} \ - ${{ needs.preflight.outputs.testBranchNameForArtifactsLocation }} \ - "${cargoTrackerBlobUrl}" \ - ${dbPassword} \ - ${dbAdminUser} \ - jdbc:postgresql:\/\/${dbName}.postgres.database.azure.com:5432\/${{ env.dbServerName }} \ - ${location} \ - ${ocrSSOPSW} \ - ${ocrSSOUser} \ - ${wdtRuntimePassword} \ - ${wlsPassword} \ - ${wlsUserName} \ - ${{ needs.preflight.outputs.vmSize }} \ - weblogic-azure/weblogic-azure-aks/src/test/setupWlsAksParameters.jsonc - - name: Deploy WebLogic Server Cluster Domain offer - id: deploy-wls-cluster - uses: azure/CLI@v1 - with: - azcliversion: ${{ env.azCliVersion }} - inlineScript: | - artifactName=${{ needs.preflight.outputs.artifactName }} - az deployment group create \ - --verbose \ - --resource-group ${{ env.resourceGroupForWlsAks }} \ - --name wls-on-aks \ - --parameters @weblogic-azure/weblogic-azure-aks/src/test/setupWlsAksParameters.jsonc \ - --template-file ${artifactName}/mainTemplate.json - - name: Query Application Gateway URL - run: | - appgatewayname=$(az resource list --resource-group ${{ env.resourceGroupForWlsAks }} --query "[?type=='Microsoft.Network/applicationGateways'].name|[0]" -o tsv) - echo $appgatewayname - publicIpAddressId=$(az network application-gateway show --resource-group ${{ env.resourceGroupForWlsAks }} --name ${appgatewayname} --query frontendIPConfigurations[0].publicIPAddress.id -o tsv) - echo $publicIpAddressId - appGatewayURL=$(az network public-ip show --resource-group ${{ env.resourceGroupForWlsAks }} --ids ${publicIpAddressId} --query dnsSettings.fqdn -o tsv) - echo $appGatewayURL - echo "appGatewayURL=${appGatewayURL}" >> $GITHUB_ENV - - name: Verify Cargo Tracker is deployed as expected - run: | - echo "Verifying Cargo Tracker is deployed as expected" - curl --verbose http://${{ env.appGatewayURL }}/cargo-tracker/ - response=$(curl --write-out '%{http_code}' --silent --output /dev/null http://${{ env.appGatewayURL }}/cargo-tracker/) - echo "$response" - if [ "$response" -ne 200 ]; then - echo "Cargo Tracker is not accessible" - exit 1 - else - echo "Cargo Tracker is accessible" - fi - - name: Install kubectl - run: | - curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" - curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256" - sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl - kubectl version --client - - name: Connect to AKS cluster - run: | - echo "connect to cluster" - aksClusterName=$(az resource list --resource-group ${{ env.resourceGroupForWlsAks }} --query "[?type=='Microsoft.ContainerService/managedClusters'].name|[0]" -o tsv) - az aks get-credentials --resource-group ${{ env.resourceGroupForWlsAks }} --name $aksClusterName - - name: Generate&Apply configmap - run: | - wlsDomainNS=sample-domain1-ns - wlsConfigmapName=sample-domain1-wdt-config-map - wlsConfigmapJson=cargo-tracker-db.json - modelFilePath=models - mkdir ${modelFilePath} - echo "create configmap" - echo "export exisiting configmap" - kubectl -n ${wlsDomainNS} get configmap ${wlsConfigmapName} -o json >${wlsConfigmapJson} - - echo "query model keys" - keyList=$(cat ${wlsConfigmapJson} | jq '.data | keys[]' | tr -d "\"") - for item in $keyList; do - data=$(cat ${wlsConfigmapJson} | jq ".data[\"${item}\"]") - data=$(echo "${data:1:${#data}-2}") - echo -e "${data}" >${modelFilePath}/${item} - done - - # remove current configmap and create a new one - kubectl -n ${wlsDomainNS} delete configmap ${wlsConfigmapName} - - cp cargotracker/src/test/aks/cargo-tracker-jms.yaml ${modelFilePath}/cargo-tracker-jms.yaml - - kubectl -n ${wlsDomainNS} create configmap ${wlsConfigmapName} \ - --from-file=${modelFilePath} - - kubectl -n ${wlsDomainNS} label configmap ${wlsConfigmapName} \ - weblogic.domainUID=sample-domain1 - restartVersion=$(kubectl -n ${wlsDomainNS} get domain sample-domain1 '-o=jsonpath={.spec.restartVersion}') - # increase restart version - restartVersion=$((restartVersion + 1)) - # record timestamp before apply changes - timestampBeforePatchingDomain=$(date +%s) - # get the replica number - clusterName=$(kubectl get cluster -n ${wlsDomainNS} -o json | jq -r '.items[0].metadata.name') - replicas=$(kubectl -n ${wlsDomainNS} get cluster ${clusterName} -o json | jq '. | .spec.replicas') - echo "append configmap and update restart version" - kubectl -n ${wlsDomainNS} patch domain sample-domain1 \ - --type=json \ - '-p=[{"op": "replace", "path": "/spec/restartVersion", "value": "'${restartVersion}'" }, {"op": "add", "path": "/spec/configuration/model/configMap", "value": "'${wlsConfigmapName}'" }]' - echo "timestampBeforePatchingDomain=${timestampBeforePatchingDomain}" >> $GITHUB_ENV - echo "replicas=${replicas}" >> $GITHUB_ENV - - name: Verify pods are restarted - run: | - # interval of checking pod status. - checkPodStatusInterval=20 - # max attempt to check pod status. - checkPodStatusMaxAttemps=30 - # domain and namespaces - wlsDomainUID="sample-domain1" - wlsDomainNS=${wlsDomainUID}-ns - - updatedPodNum=0 - attempt=0 - - echo $timestampBeforePatchingDomain $appReplicas $wlsDomainUID $checkPodStatusMaxAttemps $checkPodStatusInterval - - while [[ ${updatedPodNum} -le ${appReplicas} ]] && [[ $attempt -le ${checkPodStatusMaxAttemps} ]]; do - echo "attempts ${attempt}" - ret=$(kubectl get pods -n ${wlsDomainNS} -l weblogic.domainUID=${wlsDomainUID} -o json | jq '.items[] | .metadata.creationTimestamp' | tr -d "\"") - - counter=0 - for item in $ret; do - podCreateTimeStamp=$(date -u -d "${item}" +"%s") - echo "pod create time: $podCreateTimeStamp, base time: ${timestampBeforePatchingDomain}" - if [[ ${podCreateTimeStamp} -gt ${timestampBeforePatchingDomain} ]]; then - counter=$((counter + 1)) - fi - done - - updatedPodNum=$counter - echo "Number of new pod: ${updatedPodNum}" - - attempt=$((attempt + 1)) - sleep ${checkPodStatusInterval} - done - - if [[ ${attempt} -gt ${checkPodStatusMaxAttemps} ]]; then - echo "Failed to restart all weblogic server pods. " - exit 1 - fi - cleanup: - needs: [deploy-wls-on-aks, preflight] - if: ${{ needs.preflight.outputs.isForDemo == 'false' }} - runs-on: ubuntu-latest - steps: - - name: Get AZ CLI Version - run: | - echo "azCliVersion=${{needs.preflight.outputs.azCliVersion}}" >> $GITHUB_ENV - - uses: azure/login@v1 - id: azure-login - with: - creds: ${{ secrets.AZURE_CREDENTIALS }} - - name: Delete Storage Account Resource Group - id: delete-sa-resource-group - uses: azure/CLI@v1 - with: - azcliversion: ${{ env.azCliVersion }} - inlineScript: | - echo "delete... " ${{ env.resourceGroupForStorageAccount }} - az group delete --yes --no-wait --verbose --name ${{ env.resourceGroupForStorageAccount }} - - name: Delete DB Resource Group - id: delete-db-resource-group - uses: azure/CLI@v1 - with: - azcliversion: ${{ env.azCliVersion }} - inlineScript: | - echo "delete... " ${{ env.resourceGroupForDB }} - az group delete --yes --no-wait --verbose --name ${{ env.resourceGroupForDB }} - - name: Delete AKS Resource Group - id: delete-aks-resource-group - uses: azure/CLI@v1 - with: - azcliversion: ${{ env.azCliVersion }} - inlineScript: | - echo "delete... " ${{ env.resourceGroupForWlsAks }} - az group delete --yes --no-wait --verbose --name ${{ env.resourceGroupForWlsAks }} diff --git a/.github/workflows/testWlsAksWithoutDependencyCreation.yml b/.github/workflows/testWlsAksWithoutDependencyCreation.yml deleted file mode 100644 index 1fe5dc75a..000000000 --- a/.github/workflows/testWlsAksWithoutDependencyCreation.yml +++ /dev/null @@ -1,403 +0,0 @@ -name: Test WLS on AKS without dependency creation - -on: - workflow_dispatch: - inputs: - gitUserNameForArtifactsLocation: - description: 'Replaced into https://raw.githubusercontent.com/#gitUserName#/weblogic-azure/#testbranchName#/weblogic-azure-aks/src/main/arm/' - required: true - default: oracle - testBranchNameForArtifactsLocation: - description: 'Replaced into https://raw.githubusercontent.com/#gitUserName#/weblogic-azure/#testbranchName#/weblogic-azure-aks/src/main/arm/' - required: true - default: main - isForDemo: - description: 'If set to true, resources will not be deleted' - required: true - default: 'false' - disambiguationSuffix: - description: 'Included in names to disambiguate. Get from another pipeline execution' - required: true - storageAccountName: - description: 'Specify storage account of uploading .war file' - required: true - storageContainerName: - description: 'Specify name of storage container within account' - required: true - dbName: - description: 'Name of the database. Get from another pipeline run' - required: true - vmSize: - description: 'The VM size for the AKS pool' - required: true - default: Standard_D2s_v3 - # sample cURL - # curl --verbose -X POST https://api.github.com/repos//weblogic-azure/dispatches -H 'Accept: application/vnd.github.everest-preview+json' -H 'Authorization: token ' --data '' - # sample - # {"event_type": "aks-integration-test-without-dependency-creation", "client_payload": {"gitUserNameForArtifactsLocation": "", "testBranchNameForArtifactsLocation": "", "isForDemo": "false", "disambiguationSuffix": "1397121054", "storageAccountName": "wlsdsa13971210545", "storageContainerName": "wlsdcon13971210545", "dbName": "wlsdb13971210545"}} - # the request data can be get from setupWlsAksDependency pipeline, please checkout the summary page and download the generated artifact name 'integration-test-data' - repository_dispatch: - types: [aks-integration-test-without-dependency-creation,integration-test-all] - -env: - azureCredentials: ${{ secrets.AZURE_CREDENTIALS }} - location: eastus - dbAdminUser: weblogic - dbPassword: ${{ secrets.DB_PASSWORD }} - dbServerName: weblogicdb - ocrSSOPSW: ${{ secrets.ORC_SSOPSW }} - ocrSSOUser: ${{ secrets.ORC_SSOUSER }} - wdtRuntimePassword: ${{ secrets.WDT_RUNTIMEPSW}} - wlsUserName: ${{ secrets.WLS_USERNAME }} - wlsPassword: ${{ secrets.WLS_PSW }} - -jobs: - preflight: - runs-on: ubuntu-latest - outputs: - artifactName: ${{steps.artifact_file.outputs.artifactName}} - resourceGroupForWlsAks: ${{ steps.setup-env-variables-based-on-dispatch-event.outputs.resourceGroupForWlsAks }} - dbName: ${{ steps.setup-env-variables-based-on-dispatch-event.outputs.dbName }} - storageAccountName: ${{ steps.setup-env-variables-based-on-dispatch-event.outputs.storageAccountName }} - storageContainerName: ${{ steps.setup-env-variables-based-on-dispatch-event.outputs.storageContainerName }} - isForDemo: ${{ steps.setup-env-variables-based-on-dispatch-event.outputs.isForDemo }} - gitUserNameForArtifactsLocation: ${{ steps.setup-env-variables-based-on-dispatch-event.outputs.gitUserNameForArtifactsLocation }} - testBranchNameForArtifactsLocation: ${{ steps.setup-env-variables-based-on-dispatch-event.outputs.testBranchNameForArtifactsLocation }} - azCliVersion: ${{steps.set-az-cli-version.outputs.azCliVersion}} - vmSize: ${{ steps.setup-env-variables-based-on-dispatch-event.outputs.vmSize }} - steps: - - uses: actions/checkout@v2.3.4 - - name: Set AZ CLI Version - uses: ./.github/actions/setvars - with: - varFilePath: ./.github/variables/vm-dependencies.env - - name: Output Az CLi version - id: set-az-cli-version - run: | - echo "azCliVersion=${azCliVersion}" >> $GITHUB_OUTPUT - - name: Get versions of external dependencies - id: get-external-dependencies-version - run: | - curl -Lo external-deps-versions.properties https://raw.githubusercontent.com/Azure/azure-javaee-iaas/main/external-deps-versions.properties - source external-deps-versions.properties - echo "bicepVersion=${BICEP_VERSION}" >> $GITHUB_ENV - echo "refArmttk=${ARM_TTK_REFERENCE}" >> $GITHUB_ENV - - name: Setup environment variables - id: setup-env-variables-based-on-dispatch-event - run: | - if [ ${{ github.event_name }} == 'workflow_dispatch' ]; then - resourceGroupForWlsAks=wlsd-aks-${{ github.event.inputs.disambiguationSuffix }}-${{ github.run_number }} - dbName=${{ github.event.inputs.dbName }} - storageAccountName=${{ github.event.inputs.storageAccountName }} - storageContainerName=${{ github.event.inputs.storageContainerName }} - isForDemo=${{ github.event.inputs.isForDemo }} - gitUserNameForArtifactsLocation=${{ github.event.inputs.gitUserNameForArtifactsLocation }} - testBranchNameForArtifactsLocation=${{ github.event.inputs.testBranchNameForArtifactsLocation }} - vmSize=${{ github.event.inputs.vmSize }} - else - resourceGroupForWlsAks=wlsd-aks-${{ github.event.client_payload.disambiguationSuffix }}-${{ github.run_number }} - dbName=${{ github.event.client_payload.dbName }} - storageAccountName=${{ github.event.client_payload.storageAccountName }} - storageContainerName=${{ github.event.client_payload.storageContainerName }} - isForDemo=${{ github.event.client_payload.isForDemo }} - gitUserNameForArtifactsLocation=${{ github.event.client_payload.gitUserNameForArtifactsLocation }} - testBranchNameForArtifactsLocation=${{ github.event.client_payload.testBranchNameForArtifactsLocation }} - vmSize=${{ github.event.client_payload.vmSize }} - fi - - echo "##[set-output name=resourceGroupForWlsAks;]${resourceGroupForWlsAks}" - echo "##[set-output name=dbName;]${dbName}" - echo "##[set-output name=storageAccountName;]${storageAccountName}" - echo "##[set-output name=storageContainerName;]${storageContainerName}" - echo "##[set-output name=isForDemo;]${isForDemo}" - echo "##[set-output name=gitUserNameForArtifactsLocation;]${gitUserNameForArtifactsLocation}" - echo "##[set-output name=testBranchNameForArtifactsLocation;]${testBranchNameForArtifactsLocation}" - echo "##[set-output name=vmSize;]${vmSize}" - - echo "resourceGroupForWlsAks=${resourceGroupForWlsAks}" >> $GITHUB_ENV - echo "dbName=${dbName}" >> $GITHUB_ENV - echo "storageAccountName=${storageAccountName}" >> $GITHUB_ENV - echo "storageContainerName=${storageContainerName}" >> $GITHUB_ENV - echo "isForDemo=${isForDemo}" >> $GITHUB_ENV - echo "gitUserNameForArtifactsLocation=${gitUserNameForArtifactsLocation}" >> $GITHUB_ENV - echo "testBranchNameForArtifactsLocation=${testBranchNameForArtifactsLocation}" >> $GITHUB_ENV - echo "vmSize=${vmSize}" >> $GITHUB_ENV - - uses: actions/checkout@v2.3.4 - - name: Set up Maven with GitHub token - uses: ./.github/actions/setupmaven - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: Set up bicep - run: | - curl -Lo bicep https://github.com/Azure/bicep/releases/download/${bicepVersion}/bicep-linux-x64 - chmod +x ./bicep - sudo mv ./bicep /usr/local/bin/bicep - bicep --version - - name: Checkout arm-ttk - uses: actions/checkout@v2 - with: - repository: Azure/arm-ttk - path: arm-ttk - ref: ${{ env.refArmttk }} - - name: Checkout weblogic-azure - uses: actions/checkout@v2 - with: - path: weblogic-azure - - name: Build and test weblogic-azure/weblogic-azure-aks - run: mvn -Pbicep -Passembly clean install -Ptemplate-validation-tests --file weblogic-azure/weblogic-azure-aks/pom.xml - - name: Generate artifact file name and path - id: artifact_file - run: | - version=$(mvn -q -Dexec.executable=echo -Dexec.args='${version.wls-on-aks-azure-marketplace}' --file weblogic-azure/pom.xml --non-recursive exec:exec) - artifactName=wls-on-aks-azure-marketplace-$version-arm-assembly - unzip weblogic-azure/weblogic-azure-aks/target/$artifactName.zip -d weblogic-azure/weblogic-azure-aks/target/$artifactName - echo "##[set-output name=artifactName;]${artifactName}" - echo "##[set-output name=artifactPath;]weblogic-azure/weblogic-azure-aks/target/$artifactName" - - name: Archive weblogic-azure/weblogic-azure-aks template - uses: actions/upload-artifact@v4 - if: success() - with: - name: ${{steps.artifact_file.outputs.artifactName}} - path: ${{steps.artifact_file.outputs.artifactPath}} - - name: Checkout Azure-Samples/cargotracker-wls-aks - uses: actions/checkout@v2 - with: - repository: Azure-Samples/cargotracker-wls-aks - path: cargotracker - - name: Maven build web app - run: | - mvn clean install -PweblogicOnAks --file cargotracker/pom.xml - - uses: azure/login@v1 - id: azure-login - with: - creds: ${{ env.azureCredentials }} - - name: Upload built web app war file - uses: azure/CLI@v1 - with: - azcliversion: ${{ env.azCliVersion }} - inlineScript: | - az storage blob upload \ - --account-name ${{ env.storageAccountName }} \ - --container-name ${{ env.storageContainerName }} \ - --file cargotracker/target/cargo-tracker.war \ - --name cargo-tracker.war \ - --overwrite - deploy-wls-on-aks: - needs: preflight - runs-on: ubuntu-latest - steps: - - name: Get AZ CLI Version - run: | - echo "azCliVersion=${{needs.preflight.outputs.azCliVersion}}" >> $GITHUB_ENV - - name: Checkout weblogic-azure - uses: actions/checkout@v2 - with: - path: weblogic-azure - - name: Download artifact for deployment - uses: actions/download-artifact@v4 - with: - name: ${{needs.preflight.outputs.artifactName}} - path: ${{needs.preflight.outputs.artifactName}} - - uses: azure/login@v1 - id: azure-login - with: - creds: ${{ env.azureCredentials }} - - name: Query web app blob url and set to env - uses: azure/CLI@v1 - with: - azcliversion: ${{ env.azCliVersion }} - inlineScript: | - sasTokenValidTime=3600 - expiryData=$(( `date +%s`+${sasTokenValidTime})) - sasEnd=`date -d@"$expiryData" -u '+%Y-%m-%dT%H:%MZ'` - sasToken=$(az storage account generate-sas \ - --permissions r \ - --account-name ${{ needs.preflight.outputs.storageAccountName }} \ - --services b \ - --resource-types sco \ - --expiry $sasEnd -o tsv) - cargoTrackerBlobUrl=$(az storage blob url \ - --container-name ${{ needs.preflight.outputs.storageContainerName }} \ - --name cargo-tracker.war \ - --account-name ${{ needs.preflight.outputs.storageAccountName }} \ - --sas-token ${sasToken} -o tsv) - - echo "cargoTrackerBlobUrl=${cargoTrackerBlobUrl}" >> $GITHUB_ENV - - name: Create Resource Group - uses: azure/CLI@v1 - with: - azcliversion: ${{ env.azCliVersion }} - inlineScript: | - echo "create resource group" ${{ needs.preflight.outputs.resourceGroupForWlsAks }} - az group create --verbose --name ${{ needs.preflight.outputs.resourceGroupForWlsAks }} --location ${{ env.location }} - - name: Checkout Azure-Samples/cargotracker-wls-aks - uses: actions/checkout@v2 - with: - repository: Azure-Samples/cargotracker-wls-aks - path: cargotracker - - name: Prepare parameter file - run: | - echo "generate parameter file" - bash weblogic-azure/weblogic-azure-aks/src/test/genWlsAksParameters.sh \ - ${{ needs.preflight.outputs.gitUserNameForArtifactsLocation }} \ - ${{ needs.preflight.outputs.testBranchNameForArtifactsLocation }} \ - "${cargoTrackerBlobUrl}" \ - ${dbPassword} \ - ${dbAdminUser} \ - jdbc:postgresql:\/\/${{ needs.preflight.outputs.dbName }}.postgres.database.azure.com:5432\/${{ env.dbServerName }} \ - ${location} \ - ${ocrSSOPSW} \ - ${ocrSSOUser} \ - ${wdtRuntimePassword} \ - ${wlsPassword} \ - ${wlsUserName} \ - ${{ needs.preflight.outputs.vmSize }} \ - weblogic-azure/weblogic-azure-aks/src/test/setupWlsAksParameters.jsonc - - name: Deploy WebLogic Server Cluster Domain offer - id: deploy-wls-cluster - uses: azure/CLI@v1 - with: - azcliversion: ${{ env.azCliVersion }} - inlineScript: | - artifactName=${{ needs.preflight.outputs.artifactName }} - - az deployment group create \ - --verbose \ - --resource-group ${{ needs.preflight.outputs.resourceGroupForWlsAks }} \ - --name wls-on-aks \ - --parameters @weblogic-azure/weblogic-azure-aks/src/test/setupWlsAksParameters.jsonc \ - --template-file ${artifactName}/mainTemplate.json - - name: Query Application Gateway URL - run: | - appgatewayname=$(az resource list --resource-group ${{ needs.preflight.outputs.resourceGroupForWlsAks }} --query "[?type=='Microsoft.Network/applicationGateways'].name|[0]" -o tsv) - echo $appgatewayname - publicIpAddressId=$(az network application-gateway show --resource-group ${{ needs.preflight.outputs.resourceGroupForWlsAks }} --name ${appgatewayname} --query frontendIPConfigurations[0].publicIPAddress.id -o tsv) - echo $publicIpAddressId - appGatewayURL=$(az network public-ip show --resource-group ${{ needs.preflight.outputs.resourceGroupForWlsAks }} --ids ${publicIpAddressId} --query dnsSettings.fqdn -o tsv) - echo $appGatewayURL - echo "appGatewayURL=${appGatewayURL}" >> $GITHUB_ENV - - name: Verify Cargo Tracker is deployed as expected - run: | - echo "Verifying Cargo Tracker is deployed as expected" - curl --verbose http://${{ env.appGatewayURL }}/cargo-tracker/ - response=$(curl --write-out '%{http_code}' --silent --output /dev/null http://${{ env.appGatewayURL }}/cargo-tracker/) - echo "$response" - if [ "$response" -ne 200 ]; then - echo "Cargo Tracker is not accessible" - exit 1 - else - echo "Cargo Tracker is accessible" - fi - - name: Install kubectl - run: | - curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" - curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256" - sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl - kubectl version --client - - name: Connect to AKS cluster - run: | - echo "connect to cluster" - aksClusterName=$(az resource list --resource-group ${{ needs.preflight.outputs.resourceGroupForWlsAks }} --query "[?type=='Microsoft.ContainerService/managedClusters'].name|[0]" -o tsv) - az aks get-credentials --resource-group ${{ needs.preflight.outputs.resourceGroupForWlsAks }} --name $aksClusterName - - name: Generate&Apply configmap - run: | - wlsDomainNS=sample-domain1-ns - wlsConfigmapName=sample-domain1-wdt-config-map - wlsConfigmapJson=cargo-tracker-db.json - modelFilePath=models - mkdir ${modelFilePath} - echo "create configmap" - echo "export exisiting configmap" - kubectl -n ${wlsDomainNS} get configmap ${wlsConfigmapName} -o json >${wlsConfigmapJson} - - echo "query model keys" - keyList=$(cat ${wlsConfigmapJson} | jq '.data | keys[]' | tr -d "\"") - for item in $keyList; do - data=$(cat ${wlsConfigmapJson} | jq ".data[\"${item}\"]") - data=$(echo "${data:1:${#data}-2}") - echo -e "${data}" >${modelFilePath}/${item} - done - - # remove current configmap and create a new one - kubectl -n ${wlsDomainNS} delete configmap ${wlsConfigmapName} - - cp cargotracker/src/test/aks/cargo-tracker-jms.yaml ${modelFilePath}/cargo-tracker-jms.yaml - - kubectl -n ${wlsDomainNS} create configmap ${wlsConfigmapName} \ - --from-file=${modelFilePath} - - kubectl -n ${wlsDomainNS} label configmap ${wlsConfigmapName} \ - weblogic.domainUID=sample-domain1 - restartVersion=$(kubectl -n ${wlsDomainNS} get domain sample-domain1 '-o=jsonpath={.spec.restartVersion}') - # increase restart version - restartVersion=$((restartVersion + 1)) - # record timestamp before apply changes - timestampBeforePatchingDomain=$(date +%s) - # get the replica number - clusterName=$(kubectl get cluster -n ${wlsDomainNS} -o json | jq -r '.items[0].metadata.name') - replicas=$(kubectl -n ${wlsDomainNS} get cluster ${clusterName} -o json | jq '. | .spec.replicas') - echo "append configmap and update restart version" - kubectl -n ${wlsDomainNS} patch domain sample-domain1 \ - --type=json \ - '-p=[{"op": "replace", "path": "/spec/restartVersion", "value": "'${restartVersion}'" }, {"op": "add", "path": "/spec/configuration/model/configMap", "value": "'${wlsConfigmapName}'" }]' - echo "timestampBeforePatchingDomain=${timestampBeforePatchingDomain}" >> $GITHUB_ENV - echo "replicas=${replicas}" >> $GITHUB_ENV - - name: Verify pods are restarted - run: | - # interval of checking pod status. - checkPodStatusInterval=20 - # max attempt to check pod status. - checkPodStatusMaxAttemps=30 - # domain and namespaces - wlsDomainUID="sample-domain1" - wlsDomainNS=${wlsDomainUID}-ns - - updatedPodNum=0 - attempt=0 - - echo $timestampBeforePatchingDomain $appReplicas $wlsDomainUID $checkPodStatusMaxAttemps $checkPodStatusInterval - - while [[ ${updatedPodNum} -le ${appReplicas} ]] && [[ $attempt -le ${checkPodStatusMaxAttemps} ]]; do - echo "attempts ${attempt}" - ret=$(kubectl get pods -n ${wlsDomainNS} -l weblogic.domainUID=${wlsDomainUID} -o json | jq '.items[] | .metadata.creationTimestamp' | tr -d "\"") - - counter=0 - for item in $ret; do - podCreateTimeStamp=$(date -u -d "${item}" +"%s") - echo "pod create time: $podCreateTimeStamp, base time: ${timestampBeforePatchingDomain}" - if [[ ${podCreateTimeStamp} -gt ${timestampBeforePatchingDomain} ]]; then - counter=$((counter + 1)) - fi - done - - updatedPodNum=$counter - echo "Number of new pod: ${updatedPodNum}" - - attempt=$((attempt + 1)) - sleep ${checkPodStatusInterval} - done - - if [[ ${attempt} -gt ${checkPodStatusMaxAttemps} ]]; then - echo "Failed to restart all weblogic server pods. " - exit 1 - fi - cleanup: - needs: [deploy-wls-on-aks, preflight] - if: ${{ needs.preflight.outputs.isForDemo == 'false' }} - runs-on: ubuntu-latest - steps: - - name: Get AZ CLI Version - run: | - echo "azCliVersion=${{needs.preflight.outputs.azCliVersion}}" >> $GITHUB_ENV - - uses: azure/login@v1 - id: azure-login - with: - creds: ${{ env.azureCredentials }} - - name: Delete AKS Resource Group - id: delete-aks-resource-group - uses: azure/CLI@v1 - with: - azcliversion: ${{ env.azCliVersion }} - inlineScript: | - echo "delete... " ${{ needs.preflight.outputs.resourceGroupForWlsAks }} - az group delete --yes --no-wait --verbose --name ${{ needs.preflight.outputs.resourceGroupForWlsAks }} diff --git a/.github/workflows/testWlsVmAdmin.yml b/.github/workflows/testWlsVmAdmin.yml deleted file mode 100644 index 005faff87..000000000 --- a/.github/workflows/testWlsVmAdmin.yml +++ /dev/null @@ -1,406 +0,0 @@ -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -name: Test Admin Server on VM - -on: - workflow_dispatch: - inputs: - ref: - description: 'Specify Git Ref if needed.' - required: false - default: 'refs/heads/main' - location: - description: 'The location for the resources' - required: true - default: eastus - # Allows you to run this workflow using GitHub APIs - # PERSONAL_ACCESS_TOKEN= - # REPO_NAME=mriccell/weblogic-azure - # curl --verbose -XPOST -u "mriccell:${PERSONAL_ACCESS_TOKEN}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/${REPO_NAME}/dispatches --data '{"event_type": "test-vm-admin", "client_payload": {"ref": "refs/heads/main"}}' - repository_dispatch: - types: [test-vm-admin,integration-test-all] - -env: - adminConsolePort: 7005 - adminVMName: adminServerVM - adminPassword: ${{ secrets.WLS_PSW }} - dbAdminUser: weblogic - dbName: wlsdb${{ github.run_id }}${{ github.run_number }} - dbServerName: weblogicdb - gitToken: ${{ secrets.GIT_TOKEN }} - offerName: arm-oraclelinux-wls-admin - adminOfferPath: weblogic-azure/weblogic-azure-vm/arm-oraclelinux-wls-admin - testbranchName: cicd-${{ github.run_id }}-${{ github.run_number }} - repoName: weblogic-azure - repoOwner: ${{ secrets.USER_NAME }} - resourceGroupPrefix: wls-${{ github.run_id }}-${{ github.run_number }} - resourceGroupForDependency: wlsd-${{ github.run_id }}-${{ github.run_number }} - userEmail: ${{ secrets.USER_EMAIL }} - userName: ${{ secrets.USER_NAME }} - wlsPassword: ${{ secrets.WLS_PSW }} - wlsDomainName: adminDomain - wlsUserName: weblogic - -jobs: - preflight: - outputs: - location: ${{ steps.setup-env-variables-based-on-dispatch-event.outputs.location }} - artifactName: ${{steps.artifact_file.outputs.artifactName}} - runs-on: ubuntu-latest - steps: - - name: Setup environment variables - id: setup-env-variables-based-on-dispatch-event - run: | - location=eastus # default value - - if [ ${{ github.event_name }} == 'workflow_dispatch' ]; then - ref=${{ github.event.inputs.ref }} - location=${{ github.event.inputs.location }} - else - ref=${{ github.event.client_payload.ref }} - location=${{ github.event.client_payload.location }} - fi - - if [ -z "$ref" ]; then - ref='refs/heads/main' - fi - - echo "##[set-output name=ref;]${ref}" - echo "##[set-output name=location;]${location}" - echo "ref=${ref}" >> $GITHUB_ENV - echo "location=${location}" >> $GITHUB_ENV - - uses: actions/checkout@v2.3.4 - - name: Set up Maven with GitHub token - uses: ./.github/actions/setupmaven - with: - token: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/checkout@v2.3.4 - - name: Set dependency reference - uses: ./.github/actions/setvars - with: - varFilePath: ./.github/variables/vm-dependencies.env - - name: Checkout arm-ttk - uses: actions/checkout@v2 - with: - repository: Azure/arm-ttk - path: arm-ttk - ref: ${{ env.refArmTtk }} - - name: Checkout ${{env.repoOwner}}/${{env.repoName}} - uses: actions/checkout@v2 - with: - repository: ${{env.repoOwner}}/${{env.repoName}} - ref: ${{ env.ref }} - path: ${{env.repoName}} - - name: Build and test ${{ env.offerName }} - run: | - ls - mvn -Ptemplate-validation-tests clean install -Dgit.repo.owner=${{ env.repoOwner }} -Dgit.tag=${{ env.ref }} --file ${adminOfferPath}/pom.xml - - - name: Checkout ${{env.repoOwner}}/${{env.repoName}} for test - uses: actions/checkout@v2 - with: - repository: ${{env.repoOwner}}/${{env.repoName}} - path: ${{env.repoName}}-dev - - name: Create a new branch with development pids in nestedtemplates - run: | - current=`pwd` - echo "current=${current}" >> $GITHUB_ENV - offerDevPath=${{ env.repoName }}-dev/weblogic-azure-vm/${{env.offerName}} - cd ${offerDevPath}/src/main/arm/nestedtemplates - git config --global core.longpaths true - git config --global user.email $userEmail - git config --global user.name $userName - echo "create branch $testbranchName" - git checkout -b $testbranchName - rm -r -f $current/${offerDevPath}/src/main/arm/nestedtemplates/* - cp -r -f $current/${{ env.adminOfferPath }}/target/arm/nestedtemplates/* $current/${offerDevPath}/src/main/arm/nestedtemplates/ - git status - git commit -a -m "hard code pids" - git push https://$gitToken@github.com/${GITHUB_REPOSITORY}.git -f - - - uses: azure/login@v1 - id: azure-login - with: - creds: ${{ secrets.AZURE_CREDENTIALS }} - - name: Validate deployment templates for different combinations of service integration - id: validate-deployment-templates - run: | - bash ${{ env.adminOfferPath }}/test/scripts/verify-deployments.sh \ - <<< "${{ github.run_id }}${{ github.run_number }} ${location} \ - ${{ env.adminOfferPath }}/target/arm/mainTemplate.json \ - ${GITHUB_REPOSITORY} ${testbranchName} ${{ env.adminOfferPath }}/test/scripts" - - - name: Get version information from pom.xml - id: version - run: | - version=$(mvn -q -Dexec.executable=echo -Dexec.args='${version.${{ env.offerName }}}' --file weblogic-azure/pom.xml --non-recursive exec:exec) - echo "version=${version}" >> $GITHUB_ENV - - name: Print version - run: echo $version - - name: Generate artifact name - run: echo "artifactName=${{ env.offerName }}-$version-arm-assembly" >> $GITHUB_ENV - - name: Print artifact name - run: echo $artifactName - - name: Output artifact name - id: artifact_file - run: echo "##[set-output name=artifactName;]${{ env.offerName }}-$version-arm-assembly" - - name: Generate zip package path - id: artifact_path - run: echo "##[set-output name=artifactPath;]${{ env.adminOfferPath }}/target/$artifactName" - - name: Output artifact path - run: echo $artifactPath - env: - artifactPath: ${{steps.package.outputs.artifactPath}} - - name: Unzip the package as upload action will zip again - run: unzip ${{ env.adminOfferPath }}/target/$artifactName.zip -d ${{ env.adminOfferPath }}/target/$artifactName - - - name: Archive ${{ env.offerName }} template - uses: actions/upload-artifact@v4 - if: success() - with: - name: ${{steps.artifact_file.outputs.artifactName}} - path: ${{steps.artifact_path.outputs.artifactPath}} - - deploy-dependencies: - needs: preflight - runs-on: ubuntu-latest - steps: - - name: Initialize environment variables - run: | - echo "location=${{needs.preflight.outputs.location}}" >> $GITHUB_ENV - - uses: azure/login@v1 - id: azure-login - with: - creds: ${{ secrets.AZURE_CREDENTIALS }} - - name: Create Resource Group - id: create-resource-group - run: | - echo "create resource group" ${{ env.resourceGroupForDependency }} - az group create --verbose --name ${{ env.resourceGroupForDependency }} --location ${location} - - uses: actions/checkout@v2.3.4 - - name: Set up PostgreSQL Flexible Server that allows access from Azure services - uses: ./.github/actions/createPostgresqlFlexibleServer - with: - dbAdminUser: ${{ env.dbAdminUser }} - dbName: ${{ env.dbName }} - dbPassword: ${{ env.wlsPassword }} - dbServerName: ${{ env.dbServerName }} - location: ${{ env.location }} - resourceGroupName: ${{ env.resourceGroupForDependency }} - - deploy-weblogic-admin: - needs: [deploy-dependencies, preflight] - runs-on: ubuntu-latest - strategy: - max-parallel: 1 - fail-fast: false - matrix: - images: - [ - "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest", - "owls-141100-jdk11-ol87;Oracle:weblogic-141100-jdk11-ol87:owls-141100-jdk11-ol87;latest", - "owls-141100-jdk8-ol91;Oracle:weblogic-141100-jdk8-ol91:owls-141100-jdk8-ol91;latest", - "owls-141100-jdk8-ol87;Oracle:weblogic-141100-jdk8-ol87:owls-141100-jdk8-ol87;latest", - "owls-122140-jdk8-ol91;Oracle:weblogic-122140-jdk8-ol91:owls-122140-jdk8-ol91;latest", - "owls-122140-jdk8-ol87;Oracle:weblogic-122140-jdk8-ol87:owls-122140-jdk8-ol87;latest", - "owls-122140-jdk8-ol76;Oracle:weblogic-122140-jdk8-ol76:owls-122140-jdk8-ol7;latest", - "owls-141100-jdk8-ol76;Oracle:weblogic-141100-jdk8-ol76:owls-141100-jdk8-ol7;latest", - "owls-141100-jdk11-ol76;Oracle:weblogic-141100-jdk11-ol76:owls-141100-jdk11-ol7;latest", - "owls-122140-jdk8-rhel76;Oracle:weblogic-122140-jdk8-rhel76:owls-122140-jdk8-rhel76;latest", - "owls-141100-jdk8-rhel76;Oracle:weblogic-141100-jdk8-rhel76:owls-141100-jdk8-rhel76;latest", - "owls-141100-jdk11-rhel76;Oracle:weblogic-141100-jdk11-rhel76:owls-141100-jdk11-rhel76;latest" - ] - - steps: - - name: Initialize environment variables - run: | - echo "location=${{needs.preflight.outputs.location}}" >> $GITHUB_ENV - echo "artifactName=${{ needs.preflight.outputs.artifactName }}" >> $GITHUB_ENV - - name: Checkout ${{env.repoOwner}}/${{env.repoName}} - uses: actions/checkout@v2 - with: - repository: ${{env.repoOwner}}/${{env.repoName}} - path: ${{env.repoName}} - - name: Download artifact for deployment - uses: actions/download-artifact@v4 - with: - name: ${{ needs.preflight.outputs.artifactName }} - path: ${{needs.preflight.outputs.artifactName}} - - - uses: azure/login@v1 - id: azure-login - with: - creds: ${{ secrets.AZURE_CREDENTIALS }} - - name: Get Image SKU - id: image-sku - run: | - imageUrn="${{ matrix.images }}" - sku=${imageUrn%%;*} - echo "sku=${sku}" >> $GITHUB_ENV - echo ${resourceGroupPrefix} - resourceGroup=$(echo "${resourceGroupPrefix}-${sku}" | sed "s/_//g") - echo "resourceGroup=${resourceGroup}" >> $GITHUB_ENV - - name: Create Resource Group - id: create-resource-group - run: | - echo "create resource group" $resourceGroup - az group create --verbose --name $resourceGroup --location ${location} - echo "resourceGroup=${resourceGroup}" >> $GITHUB_ENV - - - name: Prepare deployed parameters and test script - id: prepare-deployed-parameters-and-test-script - run: | - repoPath=${GITHUB_REPOSITORY//\//\\/} - # Generate parameters for db template deployment - bash ${{ env.adminOfferPath }}/test/scripts/gen-parameters-deploy.sh \ - <<< "${{ env.adminOfferPath }}/test/scripts/ \ - $wlsPassword \ - ${{ matrix.images }} \ - $wlsDomainName \ - ${{ env.adminVMName }} \ - ${{ env.wlsPassword}} \ - ${{ env.dbAdminUser }} \ - ${{ env.dbName }} \ - ${{ env.location }} \ - ${{ env.wlsUserName }} \ - ${{ env.wlsPassword }} \ - ${GITHUB_REPOSITORY} \ - ${{ env.testbranchName }}" - - - name: Accept Image Terms - id: accept-terms - run: | - echo "accept terms for " "${{ matrix.images }}" - rawUrn="${{ matrix.images }}" - publisherAndName=$(echo ${rawUrn} | grep -o ";.*:" | sed "s/;//g") - imageVersion=${rawUrn##*;} - az vm image terms accept --urn ${publisherAndName}${sku}:${imageVersion} - - - name: Deploy WebLogic Server Admin only Domain offer - id: deploy-wls-admin - run: | - az deployment group create \ - --verbose \ - --resource-group $resourceGroup \ - --name wls-admin-node \ - --parameters @${{ env.adminOfferPath }}/test/scripts/parameters-deploy.json \ - --template-file ${artifactName}/mainTemplate.json - - # query the admin vm name - export adminVMName=$(az deployment group show \ - --resource-group $resourceGroup \ - --name wls-admin-node \ - --query "properties.outputs.adminVMName.value" -o tsv) - echo "adminVMName=${adminVMName}" >> $GITHUB_ENV - - - name: Verify system services at admin server - id: veriy-admin-service - run: | - echo "Verifying WebLogic services at admin server" - message=$(az vm run-command invoke \ - --resource-group $resourceGroup \ - --name $adminVMName \ - --command-id RunShellScript \ - --scripts @${{ env.adminOfferPath }}/test/scripts/verify-services.sh \ - --query value[*].message) - - if [[ $message == *"not in active (running) state"* ]]; then - echo "Error: $message" - exit 1 - fi - - name: Configure network security group - id: configure-nsg - run: | - nsg=$(az network nsg list \ - --resource-group $resourceGroup \ - --query "[0].name" -o tsv) - - echo "Allow access to ${adminConsolePort}" - az network nsg rule update \ - --resource-group $resourceGroup \ - --nsg-name ${nsg} \ - --name WebLogicAdminChannelPort \ - --access Allow \ - --source-address-prefixes 10.0.0.0/24 - - name: Query public IP of AdminServer VM - id: query-wls-admin-ip - run: | - echo "query public ip" - publicIP=$(az vm show \ - --resource-group $resourceGroup \ - --name $adminVMName -d \ - --query publicIps -o tsv) - echo "wlsPublicIP=${publicIP}" >> $GITHUB_ENV - - - name: Verify WebLogic Server Access - id: verify-wls-access - run: | - echo "Verifying Weblogic Server Access" - echo ${wlsPublicIP} - bash ${{ env.adminOfferPath }}/test/scripts/verify-wls-access.sh <<< "${wlsPublicIP} ${adminConsolePort}" - - - name: Delete Resource Group - id: delete-resource-group - if: always() - run: | - echo "delete... " $resourceGroup - az group delete --yes --no-wait --verbose --name $resourceGroup - - cleanup-github-resource: - needs: deploy-weblogic-admin - if: always() - runs-on: ubuntu-latest - steps: - - name: Checkout ${{ env.repoOwner }}/${{ env.repoName }} - uses: actions/checkout@v2 - with: - repository: ${{ env.repoOwner }}/${{ env.repoName }} - path: ${{ env.repoName }} - - name: Delete testing branch - run: | - cd ${{ env.repoName }} - git push https://$gitToken@github.com/${GITHUB_REPOSITORY}.git -f --delete $testbranchName - - cleanup-az-resource: - needs: deploy-weblogic-admin - if: always() - runs-on: ubuntu-latest - steps: - - uses: azure/login@v1 - id: azure-login - with: - creds: ${{ secrets.AZURE_CREDENTIALS }} - - name: Delete DB Resource Group - id: delete-db-resource-group - run: | - echo "delete... " $resourceGroup - az group delete --yes --no-wait --verbose --name ${{ env.resourceGroupForDependency }} - - summary: - needs: deploy-weblogic-admin - if: always() - runs-on: ubuntu-latest - steps: - - name: summarize jobs - if: ${{ github.repository_owner == 'wls-eng' }} - run: | - workflow_jobs=$(curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/${GITHUB_REPOSITORY}/actions/runs/${{ github.run_id }}/jobs) - critical_job_num=$(echo $workflow_jobs | jq '.jobs | map(select(.name|test("^deploy-weblogic-admin."))) | length') - echo "$critical_job_num" - succeed_critical_job_num=$(echo $workflow_jobs | jq '.jobs | map(select(.conclusion=="success") | select(.name|test("^deploy-weblogic-admin."))) | length') - echo "$succeed_critical_job_num" - failed_job_num="$(($critical_job_num-$succeed_critical_job_num))" - echo $failed_job_num - if (($failed_job_num >= 2));then - echo "too many jobs failed, send notification to Teams" - curl ${{ secrets.MSTEAMS_WEBHOOK }} \ - -H 'Content-Type: application/json' \ - --data-binary @- << EOF - { - "@context":"http://schema.org/extensions", - "@type":"MessageCard", - "text":"$failed_job_num jobs failed in Admin Offer's workflow, please take a look at: https://github.com/${GITHUB_REPOSITORY}/actions/runs/${{ github.run_id }}" - } - EOF - fi diff --git a/.github/workflows/testWlsVmCluster.yml b/.github/workflows/testWlsVmCluster.yml deleted file mode 100644 index 5ec41d2cd..000000000 --- a/.github/workflows/testWlsVmCluster.yml +++ /dev/null @@ -1,466 +0,0 @@ -#Copyright (c) 2021 Oracle and/or its affiliates. -#Released under the Universal Permissive License v1.0 as shown at -# https://oss.oracle.com/licenses/upl/ - -name: Test Configured Cluster on VM -on: - workflow_dispatch: - inputs: - ref: - description: 'Specify Git Ref if needed.' - required: false - default: 'refs/heads/main' - location: - description: 'The location for the resources' - required: true - default: eastus - # Allows you to run this workflow using GitHub APIs - # PERSONAL_ACCESS_TOKEN= - # REPO_NAME=oracle/weblogic-azure/weblogic-azure-vm/arm-oraclelinux-wls-cluster - # curl --verbose -XPOST -u "mriccell:${PERSONAL_ACCESS_TOKEN}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/${REPO_NAME}/dispatches --data '{"event_type": "test-vm-cluster", "client_payload": {"ref": "refs/heads/main"}}' - repository_dispatch: - types: [test-vm-cluster,integration-test-all] - -env: - adminConsolePort: 7001 - adminPassword: ${{ secrets.WLS_PSW }} - dbAdminUser: weblogic - dbName: wlsdb${{ github.run_id }}${{ github.run_number }} - dbServerName: weblogicdb - gitEmail: ${{ secrets.USER_EMAIL }} - gitToken: ${{ secrets.GIT_TOKEN }} - gitUserName: ${{ secrets.USER_NAME }} - managedServers: "msp1" - numberOfInstances: 2 - offerName: arm-oraclelinux-wls-cluster - offerPath: weblogic-azure/weblogic-azure-vm/arm-oraclelinux-wls-cluster - repoName: weblogic-azure - repoOwner: ${{ secrets.USER_NAME }} - resourceGroupForDependency: wlsd-${{ github.run_id }}-${{ github.run_number }} - resourceGroupPrefix: ${{ github.run_id }}-${{ github.run_number }} - testbranchName: cicd-${{ github.run_id }}-${{ github.run_number }} - wlsDomainName: wlsd - wlsPassword: ${{ secrets.WLS_PSW }} - wlsUserName: weblogic - -jobs: - preflight: - outputs: - artifactName: ${{steps.artifact_file.outputs.artifactName}} - location: ${{ steps.setup-env-variables-based-on-dispatch-event.outputs.location }} - runs-on: ubuntu-latest - steps: - - name: Setup environment variables - id: setup-env-variables-based-on-dispatch-event - run: | - location=eastus # default value - - if [ ${{ github.event_name }} == 'workflow_dispatch' ]; then - ref=${{ github.event.inputs.ref }} - location=${{ github.event.inputs.location }} - else - ref=${{ github.event.client_payload.ref }} - location=${{ github.event.client_payload.location }} - fi - if [ -z "$ref" ]; then - ref='refs/heads/main' - fi - echo "##[set-output name=ref;]${ref}" - echo "##[set-output name=location;]${location}" - echo "ref=${ref}" >> $GITHUB_ENV - echo "location=${location}" >> $GITHUB_ENV - - uses: actions/checkout@v2.3.4 - - name: Set up Maven with GitHub token - uses: ./.github/actions/setupmaven - with: - token: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/checkout@v2.3.4 - - name: Set dependency reference - uses: ./.github/actions/setvars - with: - varFilePath: ./.github/variables/vm-dependencies.env - - name: Checkout arm-ttk - uses: actions/checkout@v2 - with: - repository: Azure/arm-ttk - path: arm-ttk - ref: ${{ env.refArmttk }} - - name: Checkout ${{env.repoOwner}}/${{env.repoName}} - uses: actions/checkout@v2 - with: - repository: ${{env.repoOwner}}/${{env.repoName}} - path: ${{env.repoName}} - ref: ${{ env.ref }} - - name: Build and test ${{ env.offerName }} - run: | - mvn -Ptemplate-validation-tests clean install --file ${offerPath}/pom.xml -Dgit.repo.owner=${{ env.repoOwner }} -Dgit.tag=${{ env.ref }} - - name: Checkout ${{env.repoOwner}}/${{env.repoName}} - uses: actions/checkout@v2 - with: - repository: ${{env.repoOwner}}/${{env.repoName}} - path: ${{env.repoName}}-dev - - name: Create a new branch with development pids in nestedtemplates - run: | - current=`pwd` - echo "current=${current}" >> $GITHUB_ENV - offerDevPath=${{ env.repoName }}-dev/weblogic-azure-vm/${{env.offerName}}/${{env.offerName}} - cd ${offerDevPath}/src/main/arm/nestedtemplates - git config --global core.longpaths true - git config --global user.email $gitEmail - git config --global user.name $gitUserName - echo "create branch $testbranchName" - git checkout -b $testbranchName - rm -r -f $current/${offerDevPath}/src/main/arm/nestedtemplates/* - cp -r -f $current/${offerPath}/${{ env.offerName }}/target/arm/nestedtemplates/* $current/${offerDevPath}/src/main/arm/nestedtemplates/ - git status - git commit -a -m "hard code pids" - git push https://$gitToken@github.com/${GITHUB_REPOSITORY}.git -f - - - uses: azure/login@v1 - id: azure-login - with: - creds: ${{ secrets.AZURE_CREDENTIALS }} - - name: Validate deployment templates for different combinations of service integration - id: validate-deployment-templates - run: | - bash ${{ env.offerPath }}/test/scripts/verify-deployments.sh <<< "${{ github.run_id }}${{ github.run_number }} ${location} \ - ${{ env.offerPath }}/${{ env.offerName }}/target/arm/mainTemplate.json \ - ${GITHUB_REPOSITORY} ${testbranchName} ${{ env.offerPath }}/test/scripts" - - - name: Generate artifact file name and path - id: artifact_file - run: | - version=$(mvn -q -Dexec.executable=echo -Dexec.args='${version.${{ env.offerName }}}' --file weblogic-azure/pom.xml --non-recursive exec:exec) - artifactName=${{ env.offerName }}-$version-arm-assembly - unzip ${{ env.offerPath }}/${{ env.offerName }}/target/$artifactName.zip -d ${{ env.offerPath }}/${{ env.offerName }}/target/$artifactName - echo "##[set-output name=artifactName;]${artifactName}" - echo "##[set-output name=artifactPath;]${{ env.offerPath }}/${{ env.offerName }}/target/$artifactName" - - name: Archive ${{ env.offerName }} template - uses: actions/upload-artifact@v4 - if: success() - with: - name: ${{steps.artifact_file.outputs.artifactName}} - path: ${{steps.artifact_file.outputs.artifactPath}} - - deploy-dependencies: - needs: preflight - runs-on: ubuntu-latest - steps: - - name: Initialize environment variables - run: | - echo "location=${{needs.preflight.outputs.location}}" >> $GITHUB_ENV - - uses: azure/login@v1 - id: azure-login - with: - creds: ${{ secrets.AZURE_CREDENTIALS }} - - - name: Create Resource Group - run: | - echo "create resource group" ${{ env.resourceGroupForDependency }} - az group create --verbose --name ${{ env.resourceGroupForDependency }} --location ${location} - - uses: actions/checkout@v2.3.4 - - name: Set up PostgreSQL Flexible Server that allows access from Azure services - uses: ./.github/actions/createPostgresqlFlexibleServer - with: - dbAdminUser: ${{ env.dbAdminUser }} - dbName: ${{ env.dbName }} - dbPassword: ${{ env.wlsPassword }} - dbServerName: ${{ env.dbServerName }} - location: ${{ env.location }} - resourceGroupName: ${{ env.resourceGroupForDependency }} - - deploy-weblogic-cluster: - needs: [deploy-dependencies, preflight] - runs-on: ubuntu-latest - strategy: - max-parallel: 1 - fail-fast: false - matrix: - images: - [ - "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest", - "owls-141100-jdk11-ol87;Oracle:weblogic-141100-jdk11-ol87:owls-141100-jdk11-ol87;latest", - "owls-141100-jdk8-ol91;Oracle:weblogic-141100-jdk8-ol91:owls-141100-jdk8-ol91;latest", - "owls-141100-jdk8-ol87;Oracle:weblogic-141100-jdk8-ol87:owls-141100-jdk8-ol87;latest", - "owls-122140-jdk8-ol91;Oracle:weblogic-122140-jdk8-ol91:owls-122140-jdk8-ol91;latest", - "owls-122140-jdk8-ol87;Oracle:weblogic-122140-jdk8-ol87:owls-122140-jdk8-ol87;latest", - "owls-122140-jdk8-ol76;Oracle:weblogic-122140-jdk8-ol76:owls-122140-jdk8-ol7;latest", - "owls-141100-jdk8-ol76;Oracle:weblogic-141100-jdk8-ol76:owls-141100-jdk8-ol7;latest", - "owls-141100-jdk11-ol76;Oracle:weblogic-141100-jdk11-ol76:owls-141100-jdk11-ol7;latest", - "owls-122140-jdk8-rhel76;Oracle:weblogic-122140-jdk8-rhel76:owls-122140-jdk8-rhel76;latest", - "owls-141100-jdk8-rhel76;Oracle:weblogic-141100-jdk8-rhel76:owls-141100-jdk8-rhel76;latest", - "owls-141100-jdk11-rhel76;Oracle:weblogic-141100-jdk11-rhel76:owls-141100-jdk11-rhel76;latest" - ] - steps: - - name: Initialize environment variables - run: | - echo "location=${{needs.preflight.outputs.location}}" >> $GITHUB_ENV - - name: Checkout ${{env.repoOwner}}/${{env.repoName}} - uses: actions/checkout@v2 - with: - repository: ${{env.repoOwner}}/${{env.repoName}} - path: ${{env.repoName}} - - name: Download artifact for deployment - uses: actions/download-artifact@v4 - with: - path: ${{ needs.preflight.outputs.artifactName }} - name: ${{ needs.preflight.outputs.artifactName }} - - uses: azure/login@v1 - id: azure-login - with: - creds: ${{ secrets.AZURE_CREDENTIALS }} - - name: Get Image SKU - id: image-sku - run: | - imageUrn="${{ matrix.images }}" - sku=${imageUrn%%;*} - echo "sku=${sku}" >> $GITHUB_ENV - echo ${resourceGroupPrefix} - resourceGroup=$(echo "${resourceGroupPrefix}-${sku}" | sed "s/_//g") - echo "resourceGroup=${resourceGroup}" >> $GITHUB_ENV - - name: Create Resource Group - id: create-resource-group - run: | - echo "create resource group" $resourceGroup - az group create --verbose --name $resourceGroup --location ${location} - - - name: Prepare deployed parameters and test script - id: prepare-deployed-parameters-and-test-script - run: | - repoPath=${GITHUB_REPOSITORY//\//\\/} - bash ${{ env.offerPath }}/test/scripts/gen-parameters-deploy.sh <<< "${{ env.offerPath }}/test/scripts/parameters-test.json \ - $repoPath \ - ${{ env.testbranchName }} \ - ${{ env.location }} \ - ${{ env.wlsPassword }} \ - ${{ env.wlsUserName }} \ - ${{ env.wlsDomainName }} \ - ${{ matrix.images }} \ - ${{ env.dbServerName }} \ - ${{ env.dbName }} \ - ${{ env.wlsPassword }} \ - ${{ env.dbAdminUser }} \ - ${{ env.wlsPassword }}" - - - name: Accept Image Terms - id: accept-terms - run: | - echo "accept terms for " "${{ matrix.images }}" - rawUrn="${{ matrix.images }}" - publisherAndName=$(echo ${rawUrn} | grep -o ";.*:" | sed "s/;//g") - imageVersion=${rawUrn##*;} - az vm image terms accept --urn ${publisherAndName}${sku}:${imageVersion} - - - name: Deploy WebLogic Server Cluster Domain offer - id: deploy-wls-cluster - run: | - artifactName=${{ needs.preflight.outputs.artifactName }} - echo "artifactName=${{ needs.preflight.outputs.artifactName }}" >> $GITHUB_ENV - - az deployment group create \ - --verbose \ - --resource-group $resourceGroup \ - --name wls-cluster-node \ - --parameters ${{ env.offerPath }}/test/scripts/parameters-test.json \ - --template-file ${artifactName}/mainTemplate.json - - export adminVMName=$(az deployment group show \ - --resource-group $resourceGroup \ - --name wls-cluster-node \ - --query "properties.outputs.adminVMName.value" -o tsv) - echo "adminVMName=${adminVMName}" >> $GITHUB_ENV - - - name: Configure network security group - id: configure-nsg - run: | - nsg=$(az network nsg list \ - --resource-group $resourceGroup \ - --query "[0].name" -o tsv) - echo "Allow access to ${adminConsolePort}" - az network nsg rule update \ - --resource-group $resourceGroup \ - --nsg-name ${nsg} \ - --name WebLogicAdminChannelPort \ - --access Allow \ - --source-address-prefixes 10.0.0.0/24 - - - name: Verify system services at admin server - id: verify-admin-service - run: | - echo "Verifying WebLogic services at admin server" - message=$(az vm run-command invoke \ - --resource-group $resourceGroup \ - --name $adminVMName \ - --command-id RunShellScript \ - --scripts @${{ env.offerPath }}/test/scripts/verify-admin-services.sh \ - --query value[*].message) - - if [[ $message == *"not in active (running) state"* ]]; then - echo "Error: $message" - exit 1 - fi - - - name: Verify wls managed server services - id: verify-msservice - run: | - managedServerVMNamePrefix=$(az deployment group show \ - --resource-group $resourceGroup \ - --name wls-cluster-node \ - --query "properties.outputs.managedServerVMNamePrefix.value" -o tsv) - echo "managedServerVMNamePrefix=${managedServerVMNamePrefix}" >> $GITHUB_ENV - - managedServer1="${managedServerVMNamePrefix}1" - - echo "Verifying WebLogic services at admin server" - message=$(az vm run-command invoke \ - --resource-group $resourceGroup \ - --name $managedServer1 \ - --command-id RunShellScript \ - --scripts @${{ env.offerPath }}/test/scripts/verify-node-services.sh \ - --query value[*].message) - - if [[ $message == *"not in active (running) state"* ]]; then - echo "Error: $message" - exit 1 - fi - - - name: Query public IP of AdminServer VM - id: query-wls-admin-ip - run: | - echo "query public ip" - publicIP=$(az vm show \ - --resource-group $resourceGroup \ - --name $adminVMName -d \ - --query publicIps -o tsv) - # echo environment variable - echo "wlsPublicIP=${publicIP}" >> $GITHUB_ENV - - - name: Verify WebLogic Server Access - id: verify-wls-access - run: | - echo "Verifying Weblogic Server Access" - bash ${{ env.offerPath }}/test/scripts/verify-wls-access.sh <<< "$wlsPublicIP ${adminConsolePort} $wlsUserName $wlsPassword $managedServers" - - - name: Verify WebLogic Managed Server LifeCycle check - id: verify-server-lifecycle - run: | - echo "Verifying Weblogic managed server lifecycle" - bash ${{ env.offerPath }}/test/scripts/verify-servers-lifecycle.sh <<< "$wlsUserName ${wlsPassword} $wlsPublicIP $adminConsolePort $managedServers" - - - name: Query appGatewayURL of appgateway deployment - id: query-agwurl - run: | - echo "query appgatewayURL" - export appGatewayURL=$(az deployment group show \ - --resource-group $resourceGroup \ - --name wls-cluster-node \ - --query "properties.outputs.appGatewayURL.value" -o tsv) - - echo "appGatewayURL=${appGatewayURL}" >> $GITHUB_ENV - - - name: Checkout WebLogic-Cafe - id: checkout-webapp - uses: actions/checkout@v2 - with: - repository: azure-javaee/weblogic-on-azure - path: weblogic-on-azure - - - name: Maven build the web app - id: maven-build-webapp - run: | - echo "build the WebLogic Cafe web app" - mvn -DskipTests clean install --file weblogic-on-azure/javaee/weblogic-cafe/pom.xml - - - name: Query adminVMsver DNS - id: query-adminvmdns - run: | - echo "query public ip id of $adminVMName" - adminNicId=$(az vm show \ - --resource-group $resourceGroup \ - --name $adminVMName \ - --query networkProfile.networkInterfaces[0].id -o tsv) - adminPublicIPId=$(az network nic show --id ${adminNicId} --query ipConfigurations[0].publicIPAddress.id -o tsv) - echo "query adminVMsver DNS for $adminVMName" - adminVMDNS=$(az network public-ip show \ - --id "${adminPublicIPId}" \ - --query dnsSettings.fqdn -o tsv) - echo "save the adminVMDNS in environment variable" - echo "adminVMDNS=${adminVMDNS}" >> $GITHUB_ENV - - - name: Deploy WebLogicCafe app using WebLogic Management Services - id: deploy-webapp - run: | - echo "Deploy WebLogic Cafe to server" - timeout 6m sh -c 'until nc -zv $0 $1; do echo "nc rc: $?"; sleep 5; done' ${adminVMDNS} ${adminConsolePort} - bash ${{ env.offerPath }}/test/scripts/deploy-webapp.sh <<< "$wlsUserName $wlsPassword ${adminVMDNS} ${adminConsolePort} " - - - name: Verify WebLogicCafe app is successfully deployed - id: verify-webapp-deployment - run: | - echo "Verify WebLogicCafe app is successfully deployed" - bash ${{ env.offerPath }}/test/scripts/verify-webapp-deployment.sh <<< "${appGatewayURL}" - - - name: Delete Resource Group - id: delete-resource-group - if: always() - run: | - echo "delete... " $resourceGroup - az group delete --yes --no-wait --verbose --name $resourceGroup - - cleanup-github-resource: - needs: deploy-weblogic-cluster - if: always() - runs-on: ubuntu-latest - steps: - - name: Checkout ${{ env.repoName }} - uses: actions/checkout@v2 - with: - repository: ${{env.repoOwner}}/${{env.repoName}} - path: ${{ env.repoName }} - - name: Delete testing branch - run: | - cd ${{ env.repoName }} - git push https://$gitToken@github.com/$GITHUB_REPOSITORY.git -f --delete $testbranchName - - cleanup-az-resource: - if: always() - needs: deploy-weblogic-cluster - runs-on: ubuntu-latest - steps: - - uses: azure/login@v1 - id: azure-login - with: - creds: ${{ secrets.AZURE_CREDENTIALS }} - - name: Delete DB Resource Group - id: delete-db-resource-group - run: | - echo "delete... " $resourceGroup - az group delete --yes --no-wait --verbose --name ${{ env.resourceGroupForDependency }} - - summary: - needs: deploy-weblogic-cluster - if: always() - runs-on: ubuntu-latest - steps: - - name: summarize jobs - if: ${{ github.repository_owner == 'wls-eng' }} - run: | - workflow_jobs=$(curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/${GITHUB_REPOSITORY}/actions/runs/${{ github.run_id }}/jobs) - critical_job_num=$(echo $workflow_jobs | jq '.jobs | map(select(.name|test("^deploy-weblogic-cluster."))) | length') - echo "$critical_job_num" - succeed_critical_job_num=$(echo $workflow_jobs | jq '.jobs | map(select(.conclusion=="success") | select(.name|test("^deploy-weblogic-cluster."))) | length') - echo "$succeed_critical_job_num" - failed_job_num="$(($critical_job_num-$succeed_critical_job_num))" - echo $failed_job_num - if (($failed_job_num >= 2));then - echo "too many jobs failed, send notification to Teams" - curl ${{ secrets.MSTEAMS_WEBHOOK }} \ - -H 'Content-Type: application/json' \ - --data-binary @- << EOF - { - "@context":"http://schema.org/extensions", - "@type":"MessageCard", - "text":"$failed_job_num jobs failed in Configured Cluster Offer's workflow, please take a look at: https://github.com/${GITHUB_REPOSITORY}/actions/runs/${{ github.run_id }}" - } - EOF - fi diff --git a/.github/workflows/testWlsVmDynamicCluster.yml b/.github/workflows/testWlsVmDynamicCluster.yml deleted file mode 100644 index fcca9b018..000000000 --- a/.github/workflows/testWlsVmDynamicCluster.yml +++ /dev/null @@ -1,464 +0,0 @@ -#Copyright (c) 2021 Oracle and/or its affiliates. -#Released under the Universal Permissive License v1.0 as shown at -# https://oss.oracle.com/licenses/upl/ - -name: Test Dynamic Cluster on VM -on: - workflow_dispatch: - inputs: - location: - description: 'Location of the resources' - required: true - default: 'eastus' - # Allows you to run this workflow using GitHub APIs - # PERSONAL_ACCESS_TOKEN= - # REPO_NAME=oracle/weblogic-azure/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster - # curl --verbose -XPOST -u "mriccell:${PERSONAL_ACCESS_TOKEN}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/${REPO_NAME}/dispatches --data '{"event_type": "test-vm-dynamic-cluster"}' - repository_dispatch: - types: [test-vm-dynamic-cluster,integration-test-all] - -env: - adminConsolePort: 7001 - adminPassword: ${{ secrets.WLS_PSW }} - dbAdminUser: weblogic - dbName: wlsdb${{ github.run_id }}${{ github.run_number }} - dbServerName: weblogicdb - dynamicClusterSize: 1 - gitEmail: ${{ secrets.USER_EMAIL }} - gitToken: ${{ secrets.GIT_TOKEN }} - gitUserName: ${{ secrets.USER_NAME }} - location: eastus - nsg: wls-nsg - managedServerPrefix: managedServer - managedServers: "managedServer1" - managedServerVM: "managedServerVM1" - maxDynamicClusterSize: 2 - offerName: arm-oraclelinux-wls-dynamic-cluster - offerPath: weblogic-azure/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster - repoName: weblogic-azure - repoOwner: ${{ secrets.USER_NAME }} - resourceGroupForDependency: wlsd-${{ github.run_id }}-${{ github.run_number }} - resourceGroupPrefix: wls-${{ github.run_id }}-${{ github.run_number }} - testbranchName: cicd-${{ github.run_id }}-${{ github.run_number }} - wlsDomainName: dyClusterDomain - wlsPassword: ${{ secrets.WLS_PSW }} - wlsUserName: weblogic - -jobs: - preflight: - outputs: - artifactName: ${{steps.artifact_file.outputs.artifactName}} - location: ${{ steps.setup-env-variables-based-on-dispatch-event.outputs.location }} - runs-on: ubuntu-latest - steps: - - name: Setup environment variables - id: setup-env-variables-based-on-dispatch-event - run: | - location=eastus # default value - - if [ ${{ github.event_name }} == 'workflow_dispatch' ]; then - location=${{ github.event.inputs.location }} - else - location=${{ github.event.client_payload.location }} - fi - - echo "##[set-output name=location;]${location}" - echo "location=${location}" >> $GITHUB_ENV - - uses: actions/checkout@v2.3.4 - - name: Set up Maven with GitHub token - uses: ./.github/actions/setupmaven - with: - token: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/checkout@v2.3.4 - - name: Set dependency reference - uses: ./.github/actions/setvars - with: - varFilePath: ./.github/variables/vm-dependencies.env - - name: Checkout arm-ttk - uses: actions/checkout@v2 - with: - repository: Azure/arm-ttk - path: arm-ttk - ref: ${{ env.refArmTtk }} - - name: Checkout ${{env.repoOwner}}/${{env.repoName}} - uses: actions/checkout@v2 - with: - repository: ${{env.repoOwner}}/${{env.repoName}} - path: ${{env.repoName}} - - name: Built and test ${{env.offerName}} - run: mvn -Ptemplate-validation-tests clean install --file ${offerPath}/pom.xml - - - name: Checkout ${{env.repoOwner}}/${{env.repoName}} - uses: actions/checkout@v2 - with: - repository: ${{env.repoOwner}}/${{env.repoName}} - path: ${{env.repoName}}-dev - - name: Create a new branch with development pids in nestedtemplates - run: | - current=`pwd` - echo "current=${current}" >> $GITHUB_ENV - offerDevPath=${{ env.repoName }}-dev/weblogic-azure-vm/${{env.offerName}}/${{env.offerName}} - cd ${offerDevPath}/src/main/arm/nestedtemplates - git config --global core.longpaths true - git config --global user.email $gitEmail - git config --global user.name $gitUserName - echo "create branch $testbranchName" - git checkout -b $testbranchName - rm -r -f $current/${offerDevPath}/src/main/arm/nestedtemplates/* - cp -r -f $current/${offerPath}/${{ env.offerName }}/target/arm/nestedtemplates/* $current/${offerDevPath}/src/main/arm/nestedtemplates/ - git status - git commit -a -m "hard code pids" - git push https://$gitToken@github.com/${GITHUB_REPOSITORY}.git -f - - - uses: azure/login@v1 - id: azure-login - with: - creds: ${{ secrets.AZURE_CREDENTIALS }} - - name: Validate deployment templates for different combinations of service integration - id: validate-deployment-templates - run: | - bash ${offerPath}/test/scripts/verify-deployments.sh <<< \ - "${{ github.run_id }}${{ github.run_number }} ${location} \ - ${offerPath}/${offerName}/target/arm/mainTemplate.json \ - ${GITHUB_REPOSITORY} ${testbranchName} ${offerPath}/test/scripts" - - - name: Generate artifact file name and path - id: artifact_file - run: | - version=$(mvn -q -Dexec.executable=echo -Dexec.args='${version.${{ env.offerName }}}' --file weblogic-azure/pom.xml --non-recursive exec:exec) - artifactName=${{ env.offerName }}-$version-arm-assembly - unzip ${offerPath}/${{ env.offerName }}/target/$artifactName.zip -d ${offerPath}/${{ env.offerName }}/target/$artifactName - echo "##[set-output name=artifactName;]${artifactName}" - echo "##[set-output name=artifactPath;]${offerPath}/${{ env.offerName }}/target/$artifactName" - - name: Archive ${{env.offerName}} template - uses: actions/upload-artifact@v4 - if: success() - with: - name: ${{steps.artifact_file.outputs.artifactName}} - path: ${{steps.artifact_file.outputs.artifactPath}} - - deploy-dependencies: - needs: preflight - runs-on: ubuntu-latest - steps: - - name: Initialize environment variables - run: | - echo "location=${{needs.preflight.outputs.location}}" >> $GITHUB_ENV - - uses: azure/login@v1 - id: azure-login - with: - creds: ${{ secrets.AZURE_CREDENTIALS }} - - name: Create Resource Group - id: create-resource-group - run: | - echo "create resource group" ${{ env.resourceGroupForDependency }} - az group create --verbose --name ${{ env.resourceGroupForDependency }} --location ${location} - - uses: actions/checkout@v2.3.4 - - name: Set up PostgreSQL Flexible Server that allows access from Azure services - uses: ./.github/actions/createPostgresqlFlexibleServer - with: - dbAdminUser: ${{ env.dbAdminUser }} - dbName: ${{ env.dbName }} - dbPassword: ${{ env.wlsPassword }} - dbServerName: ${{ env.dbServerName }} - location: ${{ env.location }} - resourceGroupName: ${{ env.resourceGroupForDependency }} - - deploy-weblogic-cluster: - needs: [preflight, deploy-dependencies] - runs-on: ubuntu-latest - strategy: - max-parallel: 1 - fail-fast: false - matrix: - images: - [ - "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest", - "owls-141100-jdk11-ol87;Oracle:weblogic-141100-jdk11-ol87:owls-141100-jdk11-ol87;latest", - "owls-141100-jdk8-ol91;Oracle:weblogic-141100-jdk8-ol91:owls-141100-jdk8-ol91;latest", - "owls-141100-jdk8-ol87;Oracle:weblogic-141100-jdk8-ol87:owls-141100-jdk8-ol87;latest", - "owls-122140-jdk8-ol91;Oracle:weblogic-122140-jdk8-ol91:owls-122140-jdk8-ol91;latest", - "owls-122140-jdk8-ol87;Oracle:weblogic-122140-jdk8-ol87:owls-122140-jdk8-ol87;latest", - "owls-122140-jdk8-ol76;Oracle:weblogic-122140-jdk8-ol76:owls-122140-jdk8-ol7;latest", - "owls-141100-jdk8-ol76;Oracle:weblogic-141100-jdk8-ol76:owls-141100-jdk8-ol7;latest", - "owls-141100-jdk11-ol76;Oracle:weblogic-141100-jdk11-ol76:owls-141100-jdk11-ol7;latest", - "owls-122140-jdk8-rhel76;Oracle:weblogic-122140-jdk8-rhel76:owls-122140-jdk8-rhel76;latest", - "owls-141100-jdk8-rhel76;Oracle:weblogic-141100-jdk8-rhel76:owls-141100-jdk8-rhel76;latest", - "owls-141100-jdk11-rhel76;Oracle:weblogic-141100-jdk11-rhel76:owls-141100-jdk11-rhel76;latest" - ] - steps: - - name: Initialize environment variables - run: | - echo "location=${{needs.preflight.outputs.location}}" >> $GITHUB_ENV - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - distribution: 'microsoft' - java-version: '11' - - name: Checkout ${{env.repoOwner}}/${{env.repoName}} - uses: actions/checkout@v4 - with: - repository: ${{env.repoOwner}}/${{env.repoName}} - path: ${{env.repoName}} - - name: Download artifact for deployment - uses: actions/download-artifact@v4 - with: - path: ${{needs.preflight.outputs.artifactName}} - name: ${{ needs.preflight.outputs.artifactName }} - - uses: azure/login@v1 - id: azure-login - with: - creds: ${{ secrets.AZURE_CREDENTIALS }} - - name: Get Image SKU - id: image-sku - run: | - imageUrn="${{ matrix.images }}" - sku=${imageUrn%%;*} - echo "sku=${sku}" >> $GITHUB_ENV - echo ${resourceGroupPrefix} - resourceGroup=$(echo "${resourceGroupPrefix}-${sku}" | sed "s/_//g") - echo "resourceGroup=${resourceGroup}" >> $GITHUB_ENV - - name: Create Resource Group - id: create-resource-group - run: | - echo "create resource group" $resourceGroup - az group create --verbose --name $resourceGroup --location ${location} - - - name: Prepare deployed parameters and test script - id: prepare-deployed-parameters-and-test-script - run: | - imageUrn="${{ matrix.images }}" - - echo "Generate selfsigned certificate" - echo $JAVA_HOME - bash ${offerPath}/test/scripts/generate-selfsigned-keystore.sh <<< \ - "${wlsPassword} ${wlsPassword} ${wlsPassword}" - sslIdentityData=$(cat identity.jks | base64 -w 0) - - echo "Generate deployment parameters..." - bash ${offerPath}/test/scripts/gen-parameters-deploy.sh <<< \ - "${offerPath}/test/scripts/parameters-test.json \ - $location \ - $wlsPassword \ - $wlsDomainName \ - $wlsUserName \ - $wlsPassword \ - $managedServerPrefix \ - $maxDynamicClusterSize \ - $dynamicClusterSize \ - $imageUrn \ - $testbranchName \ - $GITHUB_REPOSITORY \ - ${{ env.dbServerName }} \ - ${{ env.dbName }} \ - ${{ env.wlsPassword }} \ - ${{ env.dbAdminUser }} \ - ${sslIdentityData}" - - - name: Accept Image Terms - id: accept-terms - run: | - echo "accept terms for " "${{ matrix.images }}" - rawUrn="${{ matrix.images }}" - publisherAndName=$(echo ${rawUrn} | grep -o ";.*:" | sed "s/;//g") - imageVersion=${rawUrn##*;} - az vm image terms accept --urn ${publisherAndName}${sku}:${imageVersion} - - - name: Deploy WebLogic Server Dynamic Cluster Domain offer - id: deploy-wls-dycluster - run: | - artifactName=${{ needs.preflight.outputs.artifactName }} - echo "artifactName=${{ needs.preflight.outputs.artifactName }}" >> $GITHUB_ENV - - az deployment group create \ - --verbose \ - --resource-group $resourceGroup \ - --name wls-dycluster-node \ - --parameters @${offerPath}/test/scripts/parameters-test.json \ - --template-file ${artifactName}/mainTemplate.json - - export adminVMName=$(az deployment group show \ - --resource-group $resourceGroup \ - --name wls-dycluster-node \ - --query "properties.outputs.adminVMName.value" -o tsv) - echo "adminVMName=${adminVMName}" >> $GITHUB_ENV - - - name: Verify wls admin services - id: veriy-admin-service - run: | - echo "Verifying WebLogic services at admin server" - message=$(az vm run-command invoke \ - --resource-group $resourceGroup \ - --name $adminVMName \ - --command-id RunShellScript \ - --scripts @${{ env.offerPath }}/test/scripts/verify-admin-services.sh \ - --query value[*].message) - - if [[ $message == *"not in active (running) state"* ]]; then - echo "Error: $message" - exit 1 - fi - - - name: Verify wls managed server services - id: veriy-msservice - run: | - managedServerVMNamePrefix=$(az deployment group show \ - --resource-group $resourceGroup \ - --name wls-dycluster-node \ - --query "properties.outputs.managedServerVMNamePrefix.value" -o tsv) - echo "managedServerVMNamePrefix=${managedServerVMNamePrefix}" >> $GITHUB_ENV - - managedServer1="${managedServerVMNamePrefix}1" - - echo "Verifying WebLogic services at admin server" - message=$(az vm run-command invoke \ - --resource-group $resourceGroup \ - --name $managedServer1 \ - --command-id RunShellScript \ - --scripts @${{ env.offerPath }}/test/scripts/verify-node-services.sh \ - --query value[*].message) - - if [[ $message == *"not in active (running) state"* ]]; then - echo "Error: $message" - exit 1 - fi - - - name: Query public IP of AdminServer VM - id: query-wls-admin-ip - run: | - echo "query public ip" - publicIP=$(az vm show \ - --resource-group $resourceGroup \ - --name $adminVMName -d \ - --query publicIps -o tsv) - # echo environment variable - echo "wlsPublicIP=${publicIP}" >> $GITHUB_ENV - - - name: Verify WebLogic Server Access - id: verify-wls-access - run: | - echo "Verifying Weblogic Server Access" - bash ${offerPath}/test/scripts/verify-wls-access.sh <<< "$wlsPublicIP ${adminConsolePort} $wlsUserName $wlsPassword $managedServers" - - - name: Verify WebLogic Managed Server LifeCycle check - id: verify-server-lifecycle - run: | - echo "Verifying Weblogic managed server lifecycle" - bash ${offerPath}/test/scripts/verify-servers-lifecycle.sh <<< "$wlsUserName $wlsPassword ${wlsPublicIP} ${adminConsolePort} ${managedServers}" - - - name: Checkout WebLogic-Cafe - id: checkout-webapp - uses: actions/checkout@v2 - with: - repository: azure-javaee/weblogic-on-azure - path: weblogic-on-azure - - - name: Maven build the web app - id: maven-build-webapp - run: | - echo "build the WebLogic Cafe web app" - mvn -DskipTests clean install --file weblogic-on-azure/javaee/weblogic-cafe/pom.xml - - - name: Query adminVMsver DNS - id: query-adminvmdns - run: | - echo "query public ip id of $adminVMName" - adminNicId=$(az vm show \ - --resource-group $resourceGroup \ - --name $adminVMName \ - --query networkProfile.networkInterfaces[0].id -o tsv) - adminPublicIPId=$(az network nic show --id ${adminNicId} --query ipConfigurations[0].publicIPAddress.id -o tsv) - echo "query adminVMsver DNS for $adminVMName" - adminVMDNS=$(az network public-ip show \ - --id "${adminPublicIPId}" \ - --query dnsSettings.fqdn -o tsv) - echo "save the adminVMDNS in environment variable" - echo "adminVMDNS=${adminVMDNS}" >> $GITHUB_ENV - - - name: Deploy WebLogicCafe app using WebLogic Management Services - id: deploy-and-verify-webapp - run: | - echo "Deploy WebLogic Cafe to server" - timeout 6m sh -c 'until nc -zv $0 $1; do echo "nc rc: $?"; sleep 5; done' ${adminVMDNS} ${adminConsolePort} - bash ${{ env.offerPath }}/test/scripts/deploy-webapp.sh <<< "$wlsUserName $wlsPassword ${adminVMDNS} ${adminConsolePort} " - - - name: Query ohsAccessURL from deployment output - id: query-ohsvmdns - run: | - echo "query ohsAccessURL" - ohsAccessURL=$(az deployment group show \ - --resource-group $resourceGroup \ - --name wls-dycluster-node \ - --query "properties.outputs.ohsAccessURL.value" -o tsv) - echo "ohsAccessURL=${ohsAccessURL}" >> $GITHUB_ENV - - - name: Verify WebLogicCafe app is successfully deployed - id: verify-webapp-deployment - run: | - echo "Verify WebLogicCafe app is successfully deployed" - bash ${{ env.offerPath }}/test/scripts/verify-webapp-deployment.sh <<< "${ohsAccessURL}" - - - name: Delete Resource Group - id: delete-resource-group - if: always() - run: | - echo "delete... " $resourceGroup - az group delete --yes --no-wait --verbose --name $resourceGroup - - cleanup-github-resource: - needs: deploy-weblogic-cluster - if: always() - runs-on: ubuntu-latest - steps: - - name: Checkout ${{env.repoName}} - uses: actions/checkout@v2 - with: - repository: ${{ env.repoOwner }}/${{env.repoName}} - path: ${{env.repoName}} - - name: Delete testing branch - run: | - cd ${{env.repoName}} - git push https://$gitToken@github.com/${GITHUB_REPOSITORY}.git -f --delete $testbranchName - - cleanup-az-resource: - if: always() - needs: deploy-weblogic-cluster - runs-on: ubuntu-latest - steps: - - uses: azure/login@v1 - id: azure-login - with: - creds: ${{ secrets.AZURE_CREDENTIALS }} - - name: Delete DB Resource Group - id: delete-db-resource-group - run: | - echo "delete... " $resourceGroup - az group delete --yes --no-wait --verbose --name ${{ env.resourceGroupForDependency }} - - summary: - needs: deploy-weblogic-cluster - if: always() - runs-on: ubuntu-latest - steps: - - name: summarize jobs - if: ${{ github.repository_owner == 'wls-eng' }} - run: | - workflow_jobs=$(curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/${GITHUB_REPOSITORY}/actions/runs/${{ github.run_id }}/jobs) - critical_job_num=$(echo $workflow_jobs | jq '.jobs | map(select(.name|test("^deploy-weblogic-cluster."))) | length') - echo "$critical_job_num" - succeed_critical_job_num=$(echo $workflow_jobs | jq '.jobs | map(select(.conclusion=="success") | select(.name|test("^deploy-weblogic-cluster."))) | length') - echo "$succeed_critical_job_num" - failed_job_num="$(($critical_job_num-$succeed_critical_job_num))" - echo $failed_job_num - if (($failed_job_num >= 2));then - echo "too many jobs failed, send notification to Teams" - curl ${{ secrets.MSTEAMS_WEBHOOK }} \ - -H 'Content-Type: application/json' \ - --data-binary @- << EOF - { - "@context":"http://schema.org/extensions", - "@type":"MessageCard", - "text":"$failed_job_num jobs failed in Dynamic Cluster Offer's workflow, please take a look at: https://github.com/${GITHUB_REPOSITORY}/actions/runs/${{ github.run_id }}" - } - EOF - fi diff --git a/.gitignore b/.gitignore index 2addfa51c..82606e1bb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,32 +1 @@ -*.fpr -*/target/* -*~ -*# -.#* -**/*.iml -*.iml -**/.idea -.idea -target/* -target -**/.classpath -**/.project -**/velocity.log* -.classpath -.project -.settings -**/.settings -**/.settings/* -.pydevproject -*.log -*.class -pom.xml.versionsBackup -release.properties -.mvn/maven.config -.mvn/java.config -**/nbactions.xml -**/.DS_Store -dependency-reduced-pom.xml -*.ipr -*.iws -.git/logs +/_site/** \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 1caa14f8e..000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,55 +0,0 @@ -# Contributing to this repository - -We welcome your contributions! There are multiple ways to contribute. - -## Opening issues - -For bugs or enhancement requests, please file a GitHub issue unless it's -security related. When filing a bug remember that the better written the bug is, -the more likely it is to be fixed. If you think you've found a security -vulnerability, do not raise a GitHub issue and follow the instructions in our -[security policy](./SECURITY.md). - -## Contributing code - -We welcome your code contributions. Before submitting code via a pull request, -you will need to have signed the [Oracle Contributor Agreement][OCA] (OCA) and -your commits need to include the following line using the name and e-mail -address you used to sign the OCA: - -```text -Signed-off-by: Your Name -``` - -This can be automatically added to pull requests by committing with `--sign-off` -or `-s`, e.g. - -```text -git commit --signoff -``` - -Only pull requests from committers that can be verified as having signed the OCA -can be accepted. - -## Pull request process - -1. Ensure there is an issue created to track and discuss the fix or enhancement - you intend to submit. -1. Fork this repository -1. Create a branch in your fork to implement the changes. We recommend using - the issue number as part of your branch name, e.g. `1234-fixes` -1. Ensure that any documentation is updated with the changes that are required - by your change. -1. Ensure that any samples are updated if the base image has been changed. -1. Submit the pull request. *Do not leave the pull request blank*. Explain exactly - what your changes are meant to do and provide simple steps on how to validate - your changes. Ensure that you reference the issue you created as well. -1. We will assign the pull request to 2-3 people for review before it is merged. - -## Code of conduct - -Follow the [Golden Rule](https://en.wikipedia.org/wiki/Golden_Rule). If you'd -like more specific guidelines, see the [Contributor Covenant Code of Conduct][COC]. - -[OCA]: https://oca.opensource.oracle.com -[COC]: https://www.contributor-covenant.org/version/1/4/code-of-conduct/ diff --git a/Gemfile b/Gemfile new file mode 100755 index 000000000..669aa8011 --- /dev/null +++ b/Gemfile @@ -0,0 +1,13 @@ +# Copyright (c) 2021, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. + +source "https://rubygems.org" +ruby RUBY_VERSION + +# This is the default theme for new Jekyll sites. You may change this to anything you like. +gem "minima", "~> 2.0" + +# If you want to use GitHub Pages, remove the "gem "jekyll"" above and +# uncomment the line below. To upgrade, run `bundle update github-pages`. +gem "github-pages", group: :jekyll_plugins + diff --git a/LICENSE.txt b/LICENSE similarity index 97% rename from LICENSE.txt rename to LICENSE index 4ac08f591..733249598 100644 --- a/LICENSE.txt +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2021 Oracle and/or its affiliates. +Copyright (c) 2021, Oracle and/or its affiliates. The Universal Permissive License (UPL), Version 1.0 diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..f1e324825 --- /dev/null +++ b/Makefile @@ -0,0 +1,28 @@ +# Copyright (c) 2021, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. + +all: + cp subtemplate-src/addnode-coherence.md cluster/addnode-coherence.md + cp subtemplate-src/addnode-coherence.md dynamic-cluster/addnode-coherence.md + cp subtemplate-src/admin-aadNestedTemplate.md admin/aadNestedTemplate.md + cp subtemplate-src/admin-customDNSTemplate.md admin/customDNSTemplate.md + cp subtemplate-src/admin-elkNestedTemplate.md admin/elkNestedTemplate.md + cp subtemplate-src/appGatewayNestedTemplate.md cluster + cp subtemplate-src/cluster-aadNestedTemplate.md cluster/aadNestedTemplate.md + cp subtemplate-src/cluster-addnode.md cluster/addnode.md + cp subtemplate-src/cluster-customDNSTemplate.md cluster/customDNSTemplate.md + cp subtemplate-src/cluster-deletenode.md cluster/deletenode.md + cp subtemplate-src/cluster-elkNestedTemplate.md cluster/elkNestedTemplate.md + cp subtemplate-src/cluster-nsgRulesTemplate.md cluster/nsgRulesTemplate.md + cp subtemplate-src/coherenceTemplate.md cluster/coherenceTemplate.md + cp subtemplate-src/coherenceTemplate.md dynamic-cluster/coherenceTemplate.md + cp subtemplate-src/admin-dbTemplate.md admin/dbTemplate.md + cp subtemplate-src/dbTemplate.md cluster + cp subtemplate-src/dbTemplate.md dynamic-cluster + cp subtemplate-src/dynamic-cluster-aadNestedTemplate.md dynamic-cluster/aadNestedTemplate.md + cp subtemplate-src/dynamic-cluster-addnode.md dynamic-cluster/addnode.md + cp subtemplate-src/dynamic-cluster-deletenode.md dynamic-cluster/deletenode.md + cp subtemplate-src/dynamic-cluster-elkNestedTemplate.md dynamic-cluster/elkNestedTemplate.md + cp subtemplate-src/dynamic-cluster-nsgRulesTemplate.md dynamic-cluster/nsgRulesTemplate.md + cp subtemplate-src/dynamic-cluster-ohsNestedTemplate.md dynamic-cluster/ohsNestedTemplate.md + cp subtemplate-src/dynamic-cluster-customDNSTemplate.md dynamic-cluster/customDNSTemplate.md diff --git a/README.md b/README.md index 6a42d10de..769b07726 100644 --- a/README.md +++ b/README.md @@ -1,267 +1,96 @@ -# About WebLogic on Microsoft Azure + + +# arm-oraclelinux-wls +# Simple deployment of a Oracle Linux VM with WebLogic Server pre-installed + +This template allows us to deploy a simple Oracle Linux VM with WebLogic Server (12.2.1.3.0) pre-installed. +By default, this template deploys an A3 size VM in the resource group location and return the fully qualified domain name of the VM. + +To install WebLogic Server, requires Oracle WebLogic Install kit and Oracle JDK to be downloaded, from OTN Site (https://www.oracle.com/technical-resources/). The OTN site requires the user to accept OTN Free Developer License Agreement before downloading any resources. +So, when this template is run, the user will be required to accept the OTN Free Developer License Agreement and also provide OTN credentials (username and password), to download the Oracle WebLogic Install Kit and Oracle JDK. + + +

Using the template

+ +

Perform string substitution to generate the necessary artifacts for deployment or uploading to the Azure Cloud Partner Portal

+ +* Install Apache Maven. This project uses Apache Maven to do a simple + string substitution for several required parameters in the templates. + +* From the top level run `mvn clean install`. + +* The templates end up in `arm-oraclelinux-wls/arm-oraclelinux-wls/target/arm`. Change to that directory to run the templates. + +

Once you have performed the string substitution, you can deploy the template via the command line

+ +**PowerShell** + +*#use this command when you need to create a new resource group for your deployment* -As part of a broad-ranging partnership between Oracle and Microsoft, this project offers support for running Oracle WebLogic Server in the Azure Virtual Machines and Azure Kubernetes Service (AKS). The partnership includes joint support for a range of Oracle software running on Azure, including Oracle WebLogic, Oracle Linux, and Oracle DB, as well as interoperability between Oracle Cloud Infrastructure (OCI) and Azure. +*New-AzResourceGroup -Name <resource-group-name> -Location <resource-group-location> -## Installation +*New-AzResourceGroupDeployment -ResourceGroupName <resource-group-name> -TemplateFile mainTemplate.json* -The [Azure Marketplace WebLogic Server Offering](https://azuremarketplace.microsoft.com/en-us/marketplace/apps?search=WebLogic) offers a simplified UI and installation experience over the full power of the Azure Resource Manager (ARM) template. +**Command line** -## Documentation +``` +az group create --name <resource-group-name> --location <resource-group-location> -Please refer to the README for [documentation on WebLogic Server running on an Azure Kubernetes Service](https://oracle.github.io/weblogic-kubernetes-operator/userguide/aks/) +az group deployment create --resource-group <resource-group-name> --template-file mainTemplate.json --parameters @parametersFile.json +``` -Please refer to the README for [documentation on WebLogic Server running on an Azure Virtual Machine](https://docs.oracle.com/en/middleware/standalone/weblogic-server/wlazu/get-started-oracle-weblogic-server-microsoft-azure-iaas.html#GUID-E0B24A45-F496-4509-858E-103F5EBF67A7) +For example: -## Local Build Setup and Requirements +``` +az group deployment create --resource-group 20191001-01-my-rg --parameters @my-parameters.json --template-file arm-oraclelinux-wls/target/arm/mainTemplate.json +``` -This project utilizes [GitHub Packages](https://github.com/features/packages) for hosting and retrieving some dependencies. To ensure you can smoothly run and build the project in your local environment, specific configuration settings are required. +If you are new to Azure virtual machines, see: -GitHub Packages requires authentication to download or publish packages. Therefore, you need to configure your Maven `settings.xml` file to authenticate using your GitHub credentials. The primary reason for this is that GitHub Packages does not support anonymous access, even for public packages. +- [Azure Virtual Machines](https://azure.microsoft.com/services/virtual-machines/). +- [Azure Linux Virtual Machines documentation](https://docs.microsoft.com/azure/virtual-machines/linux/) +- [Azure Windows Virtual Machines documentation](https://docs.microsoft.com/azure/virtual-machines/windows/) +- [Template reference](https://docs.microsoft.com/azure/templates/microsoft.compute/allversions) +- [Quickstart templates](https://azure.microsoft.com/resources/templates/?resourceType=Microsoft.Compute&pageNumber=1&sort=Popular) -Please follow these steps: +If you are new to template deployment, see: -1. Create a Personal Access Token (PAT) - - Go to [Personal access tokens](https://github.com/settings/tokens). - - Click on Generate new token. - - Give your token a descriptive name, set the expiration as needed, and select the scopes (read:packages, write:packages). - - Click Generate token and make sure to copy the token. +[Azure Resource Manager documentation](https://docs.microsoft.com/azure/azure-resource-manager/) + +## Considerations for CI/CD + +

Running the tests

+ +Microsoft provides template validation tests in the Git repo for [azure-quickstart-templates](https://github.com/Azure/azure-quickstart-templates/tree/master/test/template-tests). This project includes a Maven configuration to run those tests against the ARM template. This is useful when building the template as part of a CI/CD pipeline. + +

Preconditions

+ +The environment running the tests must have the git repo for +[Azure Quickstart Templates)[https://github.com/Azure/azure-quickstart-templates] checked +out in the expected place, and the necessary PowerShell software installed + +1. Make it so the environment that runs `mvn` is able to execute the PowerShell command. + +2. Git clone the [Azure Quickstart Templates)[https://github.com/Azure/azure-quickstart-templates] into the top level `target` directory. + +

Running the tests

+ +1. run `mvn install` in the top level directory. **Do not run `mvn + clean` as this will delete the directory from step 3 above** -2. Configure Maven Settings - - Locate or create the settings.xml file in your .m2 directory(~/.m2/settings.xml). - - Add the GitHub Package Registry server configuration with your username and the PAT you just created. It should look something like this: - ```xml - - - - - - - github - YOUR_GITHUB_USERNAME - YOUR_PERSONAL_ACCESS_TOKEN - - - - - - - ``` - - -## Deployment Description - -### WLS on VMs - -#### Oracle WebLogic Server Single Node - -The offer provisions the following Azure resources based on Oracle WebLogic Server base images and an Oracle WebLogic Server Enterprise Edition (WLS) without domain configuration. - -- The offer includes a choice of operating system, JDK, Oracle WebLogic Server versions. - - OS: Oracle Linux or Red Hat Enterprise Linux - - JDK: Oracle JDK 8, or 11 - - WLS version: 12.2.1.4, 14.1.1.0 -- Computing resources - - A VM with the following configurations: - - Operating system as described in the selected base image. - - Choice of VM size. - - An OS disk attached to the VM. -- Network resources - - A virtual network and a subnet. - - A network security group. - - A network interface. - - A public IP address assigned to the network interface. -- Storage resources - - An Azure Storage Account to store the VM diagnostics profile. -- Key Software components - - Oracle WebLogic Server Enterprise Edition. Version as described in the selected base image. The **ORACLE_HOME** is **/u01/app/wls/install/oracle/middleware/oracle_home**. - - Oracle JDK. The version as described in the selected base image. The **JAVA_HOME** is **/u01/app/jdk/jdk-${version}**. - - In addition to the database drivers that come standard with WLS, the offer includes the most recent supported PostgreSQL JDBC driver and Microsoft SQL JDBC driver. The drivers are stored in **/u01/app/wls/install/oracle/middleware/oracle_home/wlserver/server/lib/**. - -#### Oracle WebLogic Server with Admin Server - -The offer provisions Oracle WebLogic Server (WLS) with a domain and Administration Server. All supporting Azure resources are automatically provisioned. - -- The offer includes a choice of operating system, JDK, Oracle WLS versions. - - OS: Oracle Linux or Red Hat Enterprise Linux - - JDK: Oracle JDK 8, or 11 - - WLS version: 12.2.1.4, 14.1.1.0 -- Computing resources - - VM with the followings configuration: - - A VM to run the Administration Server. - - Choice of VM size. - - An OS disk attached to the VM. -- Network resources - - A virtual network and a subnet. If desired, you can deploy into a pre-existing virtual network. - - A network security group if creating a new virtual network. - - Network interface for VM. - - Public IP address. -- Key software components - - Oracle WLS Enterprise Edition. Version as described in the selected base image. The **ORACLE_HOME** is **/u01/app/wls/install/oracle/middleware/oracle_home**. - - Oracle JDK. The version as described in the selected base image. The **JAVA_HOME** is **/u01/app/jdk/jdk-${version}**. - - A WLS domain with the Administration Server up and running. Admin server sign in with the user name and password provided to the offer. The default domain name is **adminDomain**, the domain path is **/u01/domains/adminDomain/**. -- Database connectivity - - The offer provides database connectivity for PostgreSQL, Oracle database, Azure SQL, MySQL, or an arbitrary JDBC compliant database. - - Some database options support Azure Passwordless database connection. -- Access URLs - - See the deployment outputs for access URLs. - -#### Oracle WebLogic Server Cluster - -The offer provisions Oracle WebLogic Server (WLS) Enterprise Edition with a domain, the Administration Server and a configured cluster. All supporting Azure resources are automatically provisioned. - -- The offer includes a choice of operating system, JDK, WLS versions. - - OS: Oracle Linux or Red Hat Enterprise Linux - - JDK: Oracle JDK 8, or 11 - - WLS version: 12.2.1.4, 14.1.1.0 -- Computing resources - - VMs with the followings configurations: - - A VM to run the Administration Server and VMs to run Managed Servers. - - VMs to run Coherence Cache servers. - - Choice of VM size. - - An OS disk attached to the VM. -- Load Balancer - - If desired, an Azure Application Gateway (agw). The TLS/SSL certificate for the agw can be uploaded, retrieved from a key vault, or self-signed auto-generated. -- Network resources - - A virtual network and a subnet. If desired, you can deploy into a pre-existing virtual network. - - A network security group if creating a new virtual network. - - Network interfaces for VMs. - - Public IP addresses assigned to the network interfaces - - Public IP assigned for agw, if desired. -- High Availability - - An Azure Availability Set for the VMs. -- Key software components - - WLS Enterprise Edition. Version as described in the selected base image. The **ORACLE_HOME** is **/u01/app/wls/install/oracle/middleware/oracle_home**. - - Oracle JDK. The version as described in the selected base image. The **JAVA_HOME** is **/u01/app/jdk/jdk-${version}***. - - A WLS domain with the Administration Server up and running. Admin server sign in with the user name and password provided to the offer. The default domain name is **wlsd**, the domain path is **/u01/domains/wlsd/**. - - A configured cluster with Managed Servers running. The number of managed servers is specified in the UI when deploying the offer. - - Coherence Cache. If you select to enable Coherence Cache, the offer creates a data tier configured with Managed Coherence cache servers. -- Database connectivity - - The offer provides database connectivity for PostgreSQL, Oracle database, Azure SQL, MySQL, or an arbitrary JDBC compliant database. - - Some database options support Azure Passwordless database connection. -- Access URLs - - See the deployment outputs for access URLs. - -#### Oracle WebLogic Server Dynamic Cluster - -The offer provisions Oracle WebLogic Server (WLS) Enterprise Edition with a domain, the Administration Server and a dynamic cluster. All supporting Azure resources are automatically provisioned. - -- The offer includes a choice of operating system, JDK, WLS versions. - - OS: Oracle Linux or Red Hat Enterprise Linux - - JDK: Oracle JDK 8, or 11 - - WLS version: 12.2.1.4, 14.1.1.0 -- The offer includes the choice of the following Oracle HTTP Server (OHS) base images - - OS: Oracle Linux - - OHS version 12.2.1.4.0 -- Computing resources - - VMs for WLS: - - A VM to run the Administration Server and VMs to run Managed Servers. - - VMs to run Coherence Cache servers. - - Choice of VM size. - - An OS disk attached to the VM. - - VM for OHS, if desired: - - Choice of VM size. - - An OS disk attached to the VM. -- Load Balancer - - If desired, an OHS. The TLS/SSL certificate for the OHS can be uploaded, or retrieved from a key vault. -- Network resources - - A virtual network and a subnet. If desired, you can deploy into a pre-existing virtual network. - - A network security group if creating a new virtual network. - - Network interfaces for VMs. - - Public IP addresses assigned to the network interfaces. - - A public IP assigned OHS, if desired. -- Storage resources - - An Azure Storage Account and a file share named **wlsshare**. The mount point is **/mnt/wlsshare**. - - The storage account is also used to store the diagnostics profile of the VMs. - - A private endpoint in the same subnet with the VM, which allows the VM to access the file share. -- Key software components for WLS - - WLS Enterprise Edition. Version as described in the selected base image. The **ORACLE_HOME** is **/u01/app/wls/install/oracle/middleware/oracle_home**. - - Oracle JDK. The version as described in the selected base image. The **JAVA_HOME** is **/u01/app/jdk/jdk-${version}**. - - A WLS domain with the Administration Server up and running. Admin server sign in with the user name and password provided to the offer. The default domain name is **wlsd**, the domain path is **/u01/domains/wlsd/**. - - A dynamic cluster with desired number of Managed Servers running. The number of Managed servers is specified by **Initial Dynamic Cluster Size**. The cluster size is specified by **Maximum Dynamic Cluster Size**. - - Coherence Cache. If you select to enable Coherence Cache, the offer creates a data tier configured with Managed Coherence cache servers. -- Key software components for OHS - - Version as described in the selected base image. The **ORACLE_HOME** is **/u01/app/ohs/install/oracle/middleware/oracle_home**. - - Oracle JDK. The version as described in the selected base image. The **JAVA_HOME** is **/u01/app/jdk/jdk-${version}**. - - A domain is configured based on the node manager user name and credentials provided by the user. The default domain name is **ohsStandaloneDomain**, the domain path is **/u01/domains/ohsStandaloneDomain/**. - - An Oracle HTTP Server Component with default name **ohs_component**. -- Database connectivity - - The offer provides database connectivity for PostgreSQL, Oracle database, Azure SQL, MySQL, or an arbitrary JDBC compliant database. - - Some database options support Azure Passwordless database connection. -- Access URLs - - See the deployment outputs for access URLs. - -### WLS on AKS - -The offer provisions an Oracle WebLogic Server Enterprise Edition (WLS) and supporting Azure resources. WLS is configured with a domain, the Administration Server and a dynamic cluster set up and running. - -- The offer includes the choice of the following WLS container images - - Images from Oracle Container Registry (OCR) (General or Patched images) - - OS: Oracle Linux or Red Hat Enterprise Linux - - JDK: Oracle JDK 8, or 11 - - WLS version: 12.2.1.4, 14.1.1.0 - - You can specify any arbitrary docker image tag that is available from OCR. - - An image from your own Azure Container Registry. -- Computing resources - - Azure Kubernetes Service cluster - - Dynamically created AKS cluster with - - Choice of Node count. - - Choice of Node size. - - Network plugin: Azure CNI. - - If desired, you can also deploy into a pre-existing AKS cluster. - - An Azure Container Registry. If desired, you can select a pre-existing Azure Container Registry. -- Network resources - - A virtual network and a subnet. If desired, you can deploy into a pre-existing virtual network. - - Public IP addresses assigned to the managed load balancer and Azure Application Gateway, if selected. -- Load Balancer - - Choice of Azure Application Gateway (agw) or standard load balancer service. With agw, you can upload TLS/SSL certificate, use a certificates stored in a key vault, or allow a self-signed certificate to be generated and installed. -- Storage resources - - An Azure Storage Account and a file share named weblogic if you select to create Persistent Volume using Azure File share service. The mount point is **/shared**. -- Monitoring resources - - If desired, Azure Container Insights and workspace. -- Key software components - - Oracle WebLogic Server Enterprise Edition. The **ORACLE_HOME** is **/u01/app/wls/install/oracle/middleware/oracle_home**. - - This offer always deploys WLS using the 'Model in image' domain home source type. For more information, see the documentation from Oracle. - - WebLogic Kubernetes Operator - - Oracle JDK. The **JAVA_HOME** is **/u01/app/jdk/jdk-${version}**. - - A WLS domain with the Administration Server up configured based on the provided Administrator user name and credentials. The default domain name is sample-domain1, the domain path is **/u01/domains/sample-domain1/**. - - A dynamic cluster with Managed Servers running. The number of initial and maximum number of Managed Servers are configurable. -- Database connectivity - - The offer provides database connectivity for PostgreSQL, Oracle database, Azure SQL, MySQL, or an arbitrary JDBC compliant database. - - Some database options support Azure Passwordless database connection. -- Access URLs - - See the deployment outputs for access URLs. - -## Examples - -To get details of how to run Oracle WebLogic Server on Azure Virtual Machines refer to the blog [WebLogic on Azure Virtual Machines Major Release Now Available](https://blogs.oracle.com/weblogicserver/weblogic-on-azure-virtual-machines-major-release-now-available). - -To get details of how to run Oracle WebLogic Server on Azure Kubernetes Service refer to the blog [Run Oracle WebLogic Server on the Azure Kubernetes Service](https://blogs.oracle.com/weblogicserver/run-oracle-weblogic-server-on-the-azure-kubernetes-service). - -## Issues - -Issue related to Oracle WebLogic Server on Microsoft Azure implementation are tracked ain the [Issues tab](https://github.com/oracle/weblogic-azure/issues) of the GitHub project. - - -## Contributing - -This project welcomes contributions from the community. Before submitting a pull -request, please [review our contribution guide](./CONTRIBUTING.md). - -## Security - -Please consult the [security guide](./SECURITY.md) for our responsible security -vulnerability disclosure process. - -## License +2. Change to `arm-oraclelinux-wls` and run `mvn -Dgit.repo=edburns -Ptemplate-validation-tests install` -Copyright (c) 2021, Oracle and/or its affiliates. +3. The template validation tests should run. You must see no failures, signified by lines that start with `[-]` + tests and some large number of passing tests: `[+]`. + +4. The zip file to upload to the Cloud Partner Portal is located in the + target directory. + +## Updating the Versions -Released under the Universal Permissive License v1.0 as shown at -. +``` +mvn versions:set -DnewVersion=1.0.1 -DoldVersion=* -DgroupId=com.oracle.weblogic.azure -DartifactId=* +``` diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 2ca81027f..000000000 --- a/SECURITY.md +++ /dev/null @@ -1,38 +0,0 @@ -# Reporting security vulnerabilities - -Oracle values the independent security research community and believes that -responsible disclosure of security vulnerabilities helps us ensure the security -and privacy of all our users. - -Please do NOT raise a GitHub Issue to report a security vulnerability. If you -believe you have found a security vulnerability, please submit a report to -[secalert_us@oracle.com][1] preferably with a proof of concept. Please review -some additional information on [how to report security vulnerabilities to Oracle][2]. -We encourage people who contact Oracle Security to use email encryption using -[our encryption key][3]. - -We ask that you do not use other channels or contact the project maintainers -directly. - -Non-vulnerability related security issues including ideas for new or improved -security features are welcome on GitHub Issues. - -## Security updates, alerts and bulletins - -Security updates will be released on a regular cadence. Many of our projects -will typically release security fixes in conjunction with the -Oracle Critical Patch Update program. Additional -information, including past advisories, is available on our [security alerts][4] -page. - -## Security-related information - -We will provide security related information such as a threat model, considerations -for secure use, or any known security issues in our documentation. Please note -that labs and sample code are intended to demonstrate a concept and may not be -sufficiently hardened for production use. - -[1]: mailto:secalert_us@oracle.com -[2]: https://www.oracle.com/corporate/security-practices/assurance/vulnerability/reporting.html -[3]: https://www.oracle.com/security-alerts/encryptionkey.html -[4]: https://www.oracle.com/security-alerts/ diff --git a/_config.yml b/_config.yml new file mode 100644 index 000000000..b9199f1b2 --- /dev/null +++ b/_config.yml @@ -0,0 +1,5 @@ +# Copyright (c) 2021, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. + +theme: jekyll-theme-primer +repository: "oracle/weblogic-azure" diff --git a/_data/var.yml b/_data/var.yml new file mode 100644 index 000000000..4728159c5 --- /dev/null +++ b/_data/var.yml @@ -0,0 +1,25 @@ +# Copyright (c) 2021, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. + +azureFullBrandName: Microsoft Azure IaaS +aksFullName: Azure Kubernetes Service +wlsFullBrandName: Oracle WebLogic Server +brandNameNumber: 12c +partNumber: E48696-01 +publicationDate: March 2021 +versionOr: 12.1.2.3 +# versionOr: 12.1.2.3 or 12.1.2.4 # edburns: only support 12.2.1.3 now. +oracleLinuxVersion: 7.4 +jdkVersion: Oracle JDK 8u131 +jdkVersionNumber: jdk1.8.0_131 +repoPrefix: /arm-oraclelinux-wls- +artifactsLocationBase: https://raw.githubusercontent.com/oracle/weblogic-azure +artifactsLocationSubPathForVM: weblogic-azure-vm/arm-oraclelinux-wls- +artifactsLocationSubPathForAks: weblogic-azure-aks +passwordInFileNote: |-3 + Some things to note: + + * We did not include values for parameters that have a default value. + * Even though this parameters file has values for sensitive fields such as passwords, these values are not echoed on the command line, or repeated in the logs because they are passed directly as `secureString` type in ARM. **Please ensure any occurrences of the parameters file in the filesystem are sufficiently secured.** + +artifactsLocationTag: 2024-02-29-1-Q1 diff --git a/_includes/head.html b/_includes/head.html new file mode 100644 index 000000000..9983823a4 --- /dev/null +++ b/_includes/head.html @@ -0,0 +1,3 @@ + + + diff --git a/_includes/sub-template-01.md b/_includes/sub-template-01.md new file mode 100644 index 000000000..d2eaf6fd7 --- /dev/null +++ b/_includes/sub-template-01.md @@ -0,0 +1,8 @@ + + +This page lists the available templates for working with existing +deployments. These templates perform various operations on an existing +deployment after it has initially been deployed from the Azure portal. diff --git a/_includes/sub-template-advanced-usage.md b/_includes/sub-template-advanced-usage.md new file mode 100644 index 000000000..bcf9cbe15 --- /dev/null +++ b/_includes/sub-template-advanced-usage.md @@ -0,0 +1,11 @@ +Oracle and Microsoft maintain an [Azure Marketplace offer](https://portal.azure.com/?feature.customPortal=false#create/oracle.20210620-wls-on-aks20210620-wls-on-aks) that +makes it easy to get started with {{ site.data.var.wlsFullBrandName }} on Azure. For complete documentation on the offer, see [the user guide](https://oracle.github.io/weblogic-kubernetes-operator/userguide/aks/). + +If you need to go beyond the capabilities of the Azure Marketplace offer, this guidance enables several advanced features. The following features and more are possible. + +- Customize Azure Container Insights with specified retention days, workspace SKU and resource permissions. + +- Customize Azure Kubernetes Service version and Agent Pool name. + +- Create custom T3 channel for {{ site.data.var.wlsFullBrandName }} Administration Server and cluster and expose the T3 channel via Azure Standard Load Balancer +- Customize the CPU and memory resources for server pod. This enables you to go beyond the default values of 200m and 1.5Gi. diff --git a/_includes/sub-template-connect-db-with-msi.md b/_includes/sub-template-connect-db-with-msi.md new file mode 100644 index 000000000..c34544984 --- /dev/null +++ b/_includes/sub-template-connect-db-with-msi.md @@ -0,0 +1,7 @@ +### Connect database with Managed Identity + +The template supports to connect [Azure Database for MySQL](https://learn.microsoft.com/en-us/azure/mysql/single-server/quickstart-create-mysql-server-database-using-azure-portal) and [Azure Database for PostgreSQL](https://docs.microsoft.com/en-us/azure/azure-sql/database/single-database-create-quickstart?WT.mc_id=gallery&tabs=azure-portal) with Managed Identity. + +You can follow [Creating a MySQL user for your Managed Identity](https://learn.microsoft.com/en-us/azure/mysql/single-server/how-to-connect-with-managed-identity#creating-a-mysql-user-for-your-managed-identity) to create a database user for your Managed Identity in MySQL instance. Once you finish that, you are able to connect the database without password. + +You can follow [Create a PostgreSQL user for your Managed Identity](https://learn.microsoft.com/en-us/azure/postgresql/single-server/how-to-connect-with-managed-identity#creating-a-postgresql-user-for-your-managed-identity) to create a database user for your Managed Identity in PostgreSQL instance. Once you finish that, you are able to connect the database without password. \ No newline at end of file diff --git a/_includes/sub-template-create-update-wls-on-aks.md b/_includes/sub-template-create-update-wls-on-aks.md new file mode 100644 index 000000000..10d1b1c18 --- /dev/null +++ b/_includes/sub-template-create-update-wls-on-aks.md @@ -0,0 +1,135 @@ +## Prepare the Parameters + +You must construct a parameters JSON file containing the parameters to be passed to the ARM template. +For background information about parameter files, see [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files). +This section shows how to obtain the values for the required properties. + +### Obtain parameter values from Azure portal + +The following steps use the [Azure Create UI Definition Sandbox](https://portal.azure.com/?feature.customPortal=false#blade/Microsoft_Azure_CreateUIDef/SandboxBlade) to obtain the values. If you prefer to edit a JSON file, you can also create the objects in your parameters file directly. The Azure UI Definition Sandbox provides controls to select resources and input your values easily. **More importantly, this approach generates syntactically valid JSON, eliminating an important class of data entry error.** + +- Use your favourite browser and open the [Azure UI Definition Sandbox](https://portal.azure.com/?feature.customPortal=false#blade/Microsoft_Azure_CreateUIDef/SandboxBlade). + +- Clear the content of Azure UI Definition Sandbox, and replace with the contents of this file: [createUiDefinition.json]({{ armTemplateBasePath }}createUiDefinition.json). + +- Select **Preview**. + +- Fill in the appropriate values. For guidance, see [running Oracle WebLogic Server on Azure Kuberneters Service document](https://oracle.github.io/weblogic-kubernetes-operator/userguide/aks/). + + - In the **Basics** blade, configure the credentials for {{ site.data.var.wlsFullBrandName }}. + + - If you are updating an {{ site.data.var.wlsFullBrandName }} cluster, make sure you have right domain UID and domain name. + + - In the **Configure AKS cluter** blade, configure the AKS cluster, image selection and Java EE application selection. + + - If you are updating an {{ site.data.var.wlsFullBrandName }} cluster, make sure you have selected the right AKS cluster and ACR. + + - In the **TLS/SSL configuration** blade, configure TLS/SSL certificates for Identity Key Store and Trust Key Store, which will be applied to the {{ site.data.var.wlsFullBrandName }} cluster. + + - In the **Networking** blade, configure Standard Load Balancer service and Application Gateway Ingress Controller. + + - In the **DNS configuration** blade, configure custom DNS alias for {{ site.data.var.wlsFullBrandName }} Administration Console portal and cluster. + + - In the **Database** blade, configure data source connection. If you want to enable other database, select `Other` in **Choose database type** and finish the required inputs. + +- Select **Review+create**, the Azure UI Definition Sandbox will validate the inputs, you must resolve any errors before proceeding. + + You will find a message "Validation Passed". **You are now done with the Sandbox.** + +- Select **View outputs payload**, copy the payload and save it to a file named `parameters.json` + +### Configure advanced parameters + +Now that you have a syntactically and semantically correct `parameters.json`, you must add some additional parameters, depending on the features you want to configure. + +| Advanced parameter Name | Explanation | +|----------------|-------------| +| `_artifactsLocation`| Required. See below for details. | +| `aciResourcePermissions`| Optinal. Boolean value.
The parameter activates when Azure Container Insights is enabled. If `false`: Set the workspace to workspace-context permissions. This is the default setting if the flag isn't set. If `true`: Set the workspace to resource-context permissions. See [Azure Monitor access control mode](https://docs.microsoft.com/en-us/azure/azure-monitor/logs/manage-access#configure-access-control-mode) | +| `aciRetentionInDays`| Optinal. Integer value.
Number of days to retain data in Azure Monitor workspace. | +| `aciWorkspaceSku`| Optinal. Enum value.
For the set of valid values for this parameter, see the **sku** property in [Resource Manager template samples for Log Analytics workspaces in Azure Monitor](https://docs.microsoft.com/en-us/azure/azure-monitor/logs/resource-manager-workspace#template-file) | +| `aksAgentPoolName` | Optinal. String value.
The name for this node pool. Node pool must contain only lowercase letters and numbers. For Linux node pools the name cannot be longer than 12 characters. | +| `aksVersion`| Optinal. String value.
Version of Azure Kubernetes Service. Use default version if no specified value. | +| `enableAdminT3Tunneling`| Optinal. Boolean value.
Configure a custom channel in Admin Server for the T3 protocol that enables HTTP tunneling. | +| `enableClusterT3Tunneling` | Optinal. Boolean value.
Configure a custom channel in the {{ site.data.var.wlsFullBrandName }} cluster for the T3 protocol that enables HTTP tunneling. | +| `t3ChannelAdminPort` | Optinal. Integer value, 1-65535.
Sepcify cublic port of the custom T3 channel in admin server. | +| `t3ChannelClusterPort` | Optinal. Integer value, 1-65535.
Specify public port of the custom T3 channel in the {{ site.data.var.wlsFullBrandName }} cluster. | +| `wlsCPU` | Optinal. String value.
Sepcify CPU requests for admin server and managed server pods. See [Managing Resources for Containers](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/)| +| `wlsMemory` | Optinal. String value.
Specify memory requests for admin server and managed server pods. See [Managing Resources for Containers](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/)| + + +#### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateBasePath }} +``` + +Append the expected advanced parameter to `parameters.json`. And make sure `_artifactsLocation` is present with the value shown above in `parameters.json`. + +#### Example Parameters JSON + +This is a sample to create an {{ site.data.var.wlsFullBrandName }} cluster with custom T3 channel, and expose the T3 channel via Azure Load Balancer Service. +The parameters using default value haven't been shown for brevity. + +```json +{ + "_artifactsLocation": { + "value": "{{ armTemplateBasePath }}" + }, + "acrName": { + "value": "sampleacr" + }, + "aksClusterName": { + "value": "sampleaks" + }, + "aksClusterRGName": { + "value": "sampleaksgroup" + }, + "createACR": { + "value": false + }, + "createAKSCluster": { + "value": false + }, + "enableAdminT3Tunneling": { + "value": true + }, + "enableClusterT3Tunneling": { + "value": true + }, + "lbSvcValues": { + "value": [ + { + "colName": "domain1-admin-t3", + "colTarget": "adminServerT3", + "colPort": "7005" + }, + { + "colName": "domain-cluster-t3", + "colTarget": "cluster1T3", + "colPort": "8011" + } + ] + }, + "location": { + "value": "eastus" + }, + "ocrSSOPSW": { + "value": "Secret123!" + }, + "ocrSSOUser": { + "value": "sample@foo.com" + }, + "wdtRuntimePassword": { + "value": "Secret123!" + }, + "wlsPassword": { + "value": "Secret123!" + }, + "wlsUserName": { + "value": "weblogic" + } + } +``` diff --git a/_includes/sub-template-datasource-connection-url.md b/_includes/sub-template-datasource-connection-url.md new file mode 100644 index 000000000..1a4b9c2f2 --- /dev/null +++ b/_includes/sub-template-datasource-connection-url.md @@ -0,0 +1,57 @@ +#### Oracle Database: + +The following is the format of the JDBC connection string for Oracle Database: + +```bash +jdbc:oracle:thin:@HOSTNAME:1521/DATABASENAME +``` + +For example: + +```bash +jdbc:oracle:thin:@benqoiz.southeastasia.cloudapp.azure.com:1521/pdb1 +``` + +#### Azure Database for PostgreSQL: + +Deploy an Azure Database PostgreSQL as described in [Create an Azure Database for PostgreSQL server in the Azure portal](https://docs.microsoft.com/en-us/azure/postgresql/quickstart-create-server-database-portal). + +1. Access the [Azure portal](https://portal.azure.com), and go to the service instance. + +2. Click **Connection Strings** under **Settings**. + +3. Locate the **JDBC** section and click the copy icon on the right to copy the JDBC connection string to the clipboard. The JDBC connection string will be similar to the following: + +```bash +jdbc:postgresql://20191015cbfgterfdy.postgres.database.azure.com:5432/{your_database}?user=jroybtvp@20191015cbfgterfdy&password={your_password}&sslmode=require +``` + +When passing this value to the ARM template, remove the database user and password values from the connection string, and let them be the parameters `dbUser` and `dbPassword`. In the above JDBC connection string sample, the value for `dsConnectionURL` argument after removing the database user and password, will be: + +```bash +jdbc:postgresql://20191015cbfgterfdy.postgres.database.azure.com:5432/{your_database}?sslmode=require +``` + +Finally, replace `{your_database}` with the name of your database, typically `postgres`. + +#### Azure SQL Server + +Deploy Azure SQL Server as described in [Create a single database in Azure SQL Database using the Azure portal, PowerShell, and Azure CLI](https://docs.microsoft.com/en-us/azure/sql-database/sql-database-single-database-get-started?tabs=azure-portal). + +1. Access the [Azure portal](https://portal.azure.com) and go to the service instance. + +2. Click **Connection Strings** under **Settings**. + +3. Locate the **JDBC** section and click the copy icon on the right to copy the JDBC connection string to the clipboard. The JDBC connection string will be similar to the following: + +```bash +jdbc:sqlserver://rwo102804.database.windows.net:1433;database=rwo102804;user=jroybtvp@rwo102804;password={your_password_here};encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30; +``` + +When passing this value to the ARM template, remove the database user and password values, let them be the parameters `dbUser` and `dbPassword`. In the above JDBC connection string sample, the value for `dsConnectionURL` argument after removing the database user and password, will be: + +```bash +jdbc:sqlserver://rwo102804.database.windows.net:1433;database={your_database};encrypt=true;tr +``` + +Finally, replace `{your_database}` with the name of your database. \ No newline at end of file diff --git a/_includes/sub-template-datasource-mysql-connection-url.md b/_includes/sub-template-datasource-mysql-connection-url.md new file mode 100644 index 000000000..1266d8967 --- /dev/null +++ b/_includes/sub-template-datasource-mysql-connection-url.md @@ -0,0 +1,19 @@ +#### MySQL + +Deploy Azure Database for MySQL as described in [Create an Azure Database for MySQL server by using the Azure portal](https://docs.microsoft.com/en-us/azure/mysql/single-server/quickstart-create-mysql-server-database-using-azure-portal). + +1. Access the [Azure portal](https://portal.azure.com) and go to the service instance. + +2. Note that, for Azure Database for MySQL, you need to add @\ to the admin user name, similar to `weblogic@contoso`. + +3. Click **Connection Strings** under **Settings**. + +4. Locate the **JDBC** section and click the copy icon on the right to copy the JDBC connection script to the clipboard. The JDBC connection string will be the value of **url**, similar to the following: + +```bash +jdbc:mysql://contoso.mysql.database.azure.com:3306/{your_database}?useSSL=true&requireSSL=false +``` + +Next, replace `{your_database}` with the name of your database. + +You have to append arguments according to the WLS version you are using. \ No newline at end of file diff --git a/_includes/sub-template-dnszone.md b/_includes/sub-template-dnszone.md new file mode 100644 index 000000000..0673ba42f --- /dev/null +++ b/_includes/sub-template-dnszone.md @@ -0,0 +1,37 @@ + + + +### Custom DNS (optional) + +#### Registered Domain Name + +You need to buy a domain name to create a custom DNS alias. + +#### Azure DNS Zone + +If you create the DNS alias on an existing [Azure DNS Zone](https://docs.microsoft.com/en-us/azure/dns/dns-overview), make sure you have perfomed the [Azure DNS Delegation](https://docs.microsoft.com/en-us/azure/dns/dns-domain-delegation). After you have completed the delegation, you can verify it with `nslookup`. For example, assuming your domain name is **contoso.com**, this output shows a correct delegation. + +```bash +$ nslookup -type=SOA contoso.com +Server: 172.29.80.1 +Address: 172.29.80.1#53 + +Non-authoritative answer: +contoso.com + origin = ns1-01.azure-dns.com + mail addr = azuredns-hostmaster.microsoft.com + serial = 1 + refresh = 3600 + retry = 300 + expire = 2419200 + minimum = 300 +Name: ns1-01.azure-dns.com +Address: 40.90.4.1 +Name: ns1-01.azure-dns.com +Address: 2603:1061::1 +``` + +We strongly recommand you create an Azure DNS Zone for domain management and reuse it for other perpose. To create an Azure DNS Zone, follow the steps in [Quickstart: Create an Azure DNS zone and record using the Azure portal](https://docs.microsoft.com/en-us/azure/dns/dns-getstarted-portal). diff --git a/_includes/sub-template-obtain-msi.md b/_includes/sub-template-obtain-msi.md new file mode 100644 index 000000000..53f06556f --- /dev/null +++ b/_includes/sub-template-obtain-msi.md @@ -0,0 +1,24 @@ +### Obtain the Managed Identity + +The parameter `dbIdentity` stands for Managed Identity that can connect to database. + +Firstly, obtain Managed Identity Id with command: + +```bash +resourceID=$(az identity show --resource-group myResourceGroup --name myManagedIdentity --query id --output tsv) +``` + +The value muse be the following: + +```json +{ + "dbIdentity": { + "value": { + "type": "UserAssigned", + "userAssignedIdentities": { + "${resourceID}": {} + } + } + } +} +``` \ No newline at end of file diff --git a/_includes/sub-template-prerequisites-db.md b/_includes/sub-template-prerequisites-db.md new file mode 100644 index 000000000..24f555a22 --- /dev/null +++ b/_includes/sub-template-prerequisites-db.md @@ -0,0 +1,11 @@ +### Database Instance (optional) + +If you are going to apply a database with {{ site.data.var.wlsFullBrandName }}, +you must have an existing database instance to use. + +This template builds with data source driver for three popular Azure databases: [Oracle](https://ms.portal.azure.com/#blade/Microsoft_Azure_Marketplace/MarketplaceOffersBlade/selectedMenuItemId/home/searchQuery/oracle%20database), +[Azure SQL Server](https://docs.microsoft.com/en-us/azure/azure-sql/), [Azure Database for PostgreSQL](https://docs.microsoft.com/en-us/azure/azure-sql/database/single-database-create-quickstart?WT.mc_id=gallery&tabs=azure-portal). If you do not have an instance, please create one from the Azure portal. + +If you want to use any other databse, you must provide a running database instance. +Make sure the database is accessible from Azure. Specify a data source driver url via `dbDriverLibrariesUrls `, data source driver name via `dbDriverName` and test table name `dbTestTableName`, see [Database](https://oracle.github.io/weblogic-kubernetes-operator/userguide/aks/#database) for more information. + diff --git a/_includes/sub-template-prerequisites-sp.md b/_includes/sub-template-prerequisites-sp.md new file mode 100644 index 000000000..212fd6f78 --- /dev/null +++ b/_includes/sub-template-prerequisites-sp.md @@ -0,0 +1,6 @@ +### Azure Service Principal (optional) + +If you are going to enable the Azure Application Gateway Ingress Controller, you are required to input a Base64 encoded JSON string for the service principal for the selected subscription. + +You can generate one with command `az ad sp create-for-rbac --sdk-auth | base64 -w0`. **Note: on macOS, omit the `-w0` flag**. + diff --git a/_includes/sub-template-prerequisites-storage.md b/_includes/sub-template-prerequisites-storage.md new file mode 100644 index 000000000..1fdf9298d --- /dev/null +++ b/_includes/sub-template-prerequisites-storage.md @@ -0,0 +1,11 @@ +### Azure Storage account + +If you are deploying a Java EE application or using your own JDBC data source driver, you are required to +have application packages and JDBC libraries uploaded to a blob storage container in an Azure Storage Account. + +To create Azure Storage Account and blobs, follow the steps in [Quickstart: Upload, download, and list blobs with the Azure portal](https://docs.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-portal). + +Upload your application packages (.jar, .war, .ear files) to the blob. + +Upload your JDBC drivers (.jar files) to the blob. + diff --git a/_includes/sub-template-prerequisites-uami.md b/_includes/sub-template-prerequisites-uami.md new file mode 100644 index 000000000..06c25431d --- /dev/null +++ b/_includes/sub-template-prerequisites-uami.md @@ -0,0 +1,7 @@ +### Azure Managed Identity + +You are required to input the ID of a user-assigned managed identity that has the **Contributor** at the subscription level of the current subscription. + +To create a user-assigned managed identity, follow the steps in [Manage user-assigned managed identities](https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/how-to-manage-ua-identity-portal). + +You will need the resource ID of the identity. To obtain ID of the identity: go to Azure Portal; open the identity **Overview** page; select **JSON View** and copy the **Resource ID**. diff --git a/_includes/sub-template-prerequisites-wls.md b/_includes/sub-template-prerequisites-wls.md new file mode 100644 index 000000000..819c4a868 --- /dev/null +++ b/_includes/sub-template-prerequisites-wls.md @@ -0,0 +1,3 @@ +### WebLogic Server Instance + +The database ARM template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). diff --git a/_includes/sub-template-prerequisites.md b/_includes/sub-template-prerequisites.md new file mode 100644 index 000000000..ad074c551 --- /dev/null +++ b/_includes/sub-template-prerequisites.md @@ -0,0 +1,9 @@ +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +{% include sub-template-prerequisites-storage.md %} + +{% include sub-template-prerequisites-db.md %} + +{% include sub-template-dnszone.md %} diff --git a/_includes/toc.html b/_includes/toc.html new file mode 100644 index 000000000..fad7e7998 --- /dev/null +++ b/_includes/toc.html @@ -0,0 +1,5 @@ + diff --git a/_includes/variables.md b/_includes/variables.md new file mode 100644 index 000000000..ffe8f013e --- /dev/null +++ b/_includes/variables.md @@ -0,0 +1,51 @@ + + +{% comment %} +Account for variability in the repo paths. +{% endcomment %} + +{% assign pageDirName = page.dir | replace: "/", "" %} +{% capture pageDir %}{{ pageDirName }}{% endcapture %} + +{% if pageDir contains "admin" %} + {% capture armTemplateBasePath %}{{ site.data.var.artifactsLocationBase }}/{{ site.data.var.artifactsLocationTag }}/{{site.data.var.artifactsLocationSubPathForVM}}{{ pageDir }}/src/main/arm/{% endcapture %} + + {% comment %} + something like https://raw.githubusercontent.com/galiacheng/weblogic-azure/2021-10-13-01-Q4/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/ + {% endcomment %} + +{% elsif pageDir == "aks" %} + {% capture armTemplateBasePath %}{{ site.data.var.artifactsLocationBase }}/{{ site.data.var.artifactsLocationTag }}/{{site.data.var.artifactsLocationSubPathForAks}}/src/main/arm/{% endcapture %} + {% comment %} + something like https://raw.githubusercontent.com/galiacheng/weblogic-azure/2021-10-13-01-Q4/weblogic-azure-aks/src/main/arm/ + {% endcomment %} +{% else %} + {% assign repoPrefix = site.data.var.repoPrefix %} + {% capture armTemplateBasePath %}{{ site.data.var.artifactsLocationBase }}/{{ site.data.var.artifactsLocationTag }}/{{site.data.var.artifactsLocationSubPathForVM}}{{ pageDir }}{{ repoPrefix }}{{ pageDir }}/src/main/arm/{% endcapture %} + + {% comment %} + something like https://raw.githubusercontent.com/galiacheng/weblogic-azure/2021-10-13-01-Q4/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/ + {% endcomment %} + + {% capture armTemplateDeleteNodeBasePath %}{{ site.data.var.artifactsLocationBase }}/{{ site.data.var.artifactsLocationTag }}/{{site.data.var.artifactsLocationSubPathForVM}}{{ pageDir }}/deletenode/src/main/{% endcapture %} + + {% comment %} + something like https://raw.githubusercontent.com/galiacheng/weblogic-azure/2021-10-13-01-Q4/weblogic-azure-vm/arm-oraclelinux-wls-cluster/deletenode/src/main/ + {% endcomment %} + + {% capture armTemplateAddNodeBasePath %}{{ site.data.var.artifactsLocationBase }}/{{ site.data.var.artifactsLocationTag }}/{{site.data.var.artifactsLocationSubPathForVM}}{{ pageDir }}/addnode/src/main/{% endcapture %} + + {% comment %} + something like https://raw.githubusercontent.com/galiacheng/weblogic-azure/2021-10-13-01-Q4/weblogic-azure-vm/arm-oraclelinux-wls-cluster/addnode/src/main/ + {% endcomment %} + + {% capture armTemplateAddCacheNodeBasePath %}{{ site.data.var.artifactsLocationBase }}/{{ site.data.var.artifactsLocationTag }}/{{site.data.var.artifactsLocationSubPathForVM}}{{ pageDir }}/addnode-coherence/src/main/{% endcapture %} + + {% comment %} + something like https://raw.githubusercontent.com/galiacheng/weblogic-azure/2021-10-13-01-Q4/weblogic-azure-vm/arm-oraclelinux-wls-cluster/addnode=-coherence/src/main/ + {% endcomment %} + +{% endif %} diff --git a/_layouts/default.html b/_layouts/default.html new file mode 100644 index 000000000..059e9fda8 --- /dev/null +++ b/_layouts/default.html @@ -0,0 +1,35 @@ + + + + + + + + {% seo title=false %} + {{ site.data.var.wlsFullBrandName }} on Azure + + + +
+ + {{ content }} + + {% if site.github.private != true and site.github.license %} + + {% endif %} +
+ + + {% if site.google_analytics %} + + {% endif %} + + diff --git a/admin/aadNestedTemplate.md b/admin/aadNestedTemplate.md new file mode 100644 index 000000000..403a45f51 --- /dev/null +++ b/admin/aadNestedTemplate.md @@ -0,0 +1,309 @@ + + +{% include variables.md %} + +# Apply Azure Active Directory ARM Template to {{ site.data.var.wlsFullBrandName }} + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} with an existing Azure Active Directory Domain Service (AAD DS) using Azure CLI. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The AAD ARM template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Azure Active Directory LDAP Instance + +To apply AAD to {{ site.data.var.wlsFullBrandName }}, you must have an existing Azure Active Directory LDAP instance to use. If you don't have AAD LADP instance, please follow the steps in the tutorial [Configure secure LDAP for an Azure Active Directory Domain Services managed domain](https://docs.microsoft.com/en-us/azure/active-directory-domain-services/tutorial-configure-ldaps). + +## Prepare the Parameters JSON file + +You must construct a parameters JSON file containing the parameters to the AAD ARM template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. We must specify the information of the existing {{ site.data.var.wlsFullBrandName }} and AAD instance. This section shows how to obtain the values for the following required properties. + +| Parameter Name | Explanation | +|----------------|-------------| +| `_artifactsLocation`| See below for details. | +| `aadsPortNumber` | (optional) The LDAP port number, defaults to 636. | +| `aadsPublicIP` | The IP address of the LDAP server | +| `aadsServerHost` | The hostname of the Active Directory Domain Services server. | +| `adminVMName`| At deployment time, if this value was changed from its default value, the value used at deployment time must be used. Otherwise, this parameter should be omitted. | +| `location` | Must be the same region into which the server was initially deployed. | +| `wlsDomainName` | The name of the {{ site.data.var.wlsFullBrandName }} domain. | +| `wlsLDAPGroupBaseDN` | The base distinguished name (DN) of the tree in the LDAP directory that contains groups. | +| `wlsLDAPPrincipalPassword` | The credential (usually a password) used to connect to the LDAP server. | +| `wlsLDAPPrincipal` | The Distinguished Name (DN) of the LDAP user that {{ site.data.var.wlsFullBrandName }} should use to connect to the LDAP server. | +| `wlsLDAPProviderName` | (optional) The value used for creating authentication provider name of WebLogic Server. | +| `wlsLDAPSSLCertificate` | Client certificate that will be imported to trust store of SSL. | +| `wlsLDAPSSLCertificate` | See below for details. | +| `wlsLDAPUserBaseDN` | The base distinguished name (DN) of the tree in the LDAP directory that contains users. | +| `wlsPassword` | Must be the same value provided at deployment time. | +| `wlsUserName` | Must be the same value provided at deployment time. | + +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateBasePath }} +``` + +### `wlsLDAPSSLCertificate` + +Use base64 to encode your existing SSL certificate. + +```bash +base64 your-certificate.cer -w 0 >temp.txt +``` + +Use the content as this file as the value of the `wlsLDAPSSLCertificate` parameter. + +#### Example Parameters JSON + +Here is a fully filled out parameters file. + +{{ site.data.var.passwordInFileNote }} + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "_artifactsLocation": { + "value": "{{ armTemplateBasePath }}" + }, + "aadsPublicIP": { + "value": "1.2.3.4" + }, + "aadsServerHost": { + "value": "ladps.fabrikam.com" + }, + "location": { + "value": "eastus" + }, + "wlsDomainName": { + "value": "adminDomain" + }, + "wlsLDAPGroupBaseDN": { + "value": "OU=AADDC Users,DC=fabrikam,DC=com" + }, + "wlsLDAPPrincipal": { + "value": "CN=WLSTest,OU=AADDC Users,DC=fabrikam,DC=com" + }, + "wlsLDAPPrincipalPassword": { + "value": "Secret123!" + }, + "wlsLDAPSSLCertificate": { + "value": "MIIKQQIBAz....EkAgIIAA==" + }, + "wlsLDAPUserBaseDN": { + "value": "OU=AADDC Users,DC=fabrikam,DC=com" + }, + "wlsPassword": { + "value": "welcome1" + }, + "wlsUserName": { + "value": "weblogic" + } + } +} +``` + +## Invoke the ARM template + +Assume your parameters file is available in the current directory and is named `parameters.json`. This section shows the commands to configure your {{ site.data.var.wlsFullBrandName }} deployment with the specified AAD. Replace `yourResourceGroup` with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +### First, validate your parameters file + +The `az group deployment validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az group deployment validate --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/aadNestedTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Next, execute the template + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az group deployment create --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/aadNestedTemplate.json +``` + +As with the validate command, if the command returns with an exit status other than `0`, inspect the output and resolve the problem. + +This is an example output of successful deployment. Look for `"provisioningState": "Succeeded"` in your output. + +```json +{ + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-06082/providers/Microsoft.Resources/deployments/cli", + "location": null, + "name": "cli", + "properties": { + "correlationId": "6d98e1c8-0778-4fa5-a30a-8f10bbbb6818", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-06082/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-admin-06082", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-06082/providers/Microsoft.Resources/deployments/pid-8295df19-fe6b-5745-ad24-51ef66522b24", + "resourceGroup": "oraclevm-admin-06082", + "resourceName": "pid-8295df19-fe6b-5745-ad24-51ef66522b24", + "resourceType": "Microsoft.Resources/deployments" + } + ], + "duration": "PT2M59.6052694S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputResources": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-06082/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-admin-06082" + } + ], + "outputs": { + "artifactsLocationPassedIn": { + "type": "String", + "value": "https://raw.githubusercontent.com/galiacheng/arm-oraclelinux-wls-admin/deploy/src/main/arm/" + } + }, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "https://raw.githubusercontent.com/galiacheng/arm-oraclelinux-wls-admin/deploy/src/main/arm/" + }, + "_artifactsLocationAADTemplate": { + "type": "String", + "value": "https://raw.githubusercontent.com/galiacheng/arm-oraclelinux-wls-admin/deploy/src/main/arm/" + }, + "_artifactsLocationSasToken": { + "type": "SecureString" + }, + "aadsPortNumber": { + "type": "String", + "value": "636" + }, + "aadsPublicIP": { + "type": "String", + "value": "40.76.11.111" + }, + "aadsServerHost": { + "type": "String", + "value": "ladps.wls-security.com" + }, + "adminVMName": { + "type": "String", + "value": "adminVM" + }, + "location": { + "type": "String", + "value": "eastus" + }, + "wlsDomainName": { + "type": "String", + "value": "adminDomain" + }, + "wlsLDAPGroupBaseDN": { + "type": "String", + "value": "OU=AADDC Users,DC=wls-security,DC=com" + }, + "wlsLDAPPrincipal": { + "type": "String", + "value": "CN=WLSTest,OU=AADDC Users,DC=wls-security,DC=com" + }, + "wlsLDAPPrincipalPassword": { + "type": "SecureString" + }, + "wlsLDAPProviderName": { + "type": "String", + "value": "AzureActiveDirectoryProvider" + }, + "wlsLDAPSSLCertificate": { + "type": "String", + "value": "LS0tLS1...LQ0K" + }, + "wlsLDAPUserBaseDN": { + "type": "String", + "value": "OU=AADDC Users,DC=wls-security,DC=com" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "2818584196763146470", + "templateLink": null, + "timestamp": "2020-06-09T07:07:03.444046+00:00" + }, + "resourceGroup": "oraclevm-admin-06082", + "type": "Microsoft.Resources/deployments" +} + +``` + +## Verify AAD Integration + +Follow the steps to check if AAD is enabled. + +* Visit the {{ site.data.var.wlsFullBrandName }} Admin console. +* In the left navigator, expand the tree to select **Security Realms** -> **myrealm** -> **Providers**. +* If the integration was successful, you will find the AAD provider for example `AzureActiveDirectoryProvider`. +* In the left navigator, expand the tree to select **Security Realms** -> **myrealm** -> **Users and Groups**. +* If the integration was successful, you will find users from the AAD provider. diff --git a/admin/customDNSTemplate.md b/admin/customDNSTemplate.md new file mode 100644 index 000000000..59ab2a1ad --- /dev/null +++ b/admin/customDNSTemplate.md @@ -0,0 +1,158 @@ + + +{% include variables.md %} + +# Configure DNS alias to {{ site.data.var.wlsFullBrandName }} + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} with a custom DNS alias. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The DNS Configuration ARM template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Registered Domain Name + +You need to buy a domain name to create a custom DNS alias. + +### Azure DNS Zone + +If you create the DNS alias on an existing [Azure DNS Zone](https://docs.microsoft.com/en-us/azure/dns/dns-overview), make sure you have performed the [Azure DNS Delegation](https://docs.microsoft.com/en-us/azure/dns/dns-domain-delegation). After you have completed the delegation, you can verify it with `nslookup`. For example, assuming your domain name is **contoso.com**, this output shows a correct delegation. + +```bash +$ nslookup -type=SOA contoso.com +Server: 172.29.80.1 +Address: 172.29.80.1#53 + +Non-authoritative answer: +contoso.com + origin = ns1-01.azure-dns.com + mail addr = azuredns-hostmaster.microsoft.com + serial = 1 + refresh = 3600 + retry = 300 + expire = 2419200 + minimum = 300 +Name: ns1-01.azure-dns.com +Address: 40.90.4.1 +Name: ns1-01.azure-dns.com +Address: 2603:1061::1 +``` + +We strongly recommend you create an Azure DNS Zone for domain management and reuse it for other purpose. Follow the [guide](https://docs.microsoft.com/en-us/azure/dns/dns-getstarted-portal) to create an Azure DNS Zone. + +## Prepare the Parameters + +We provide an automation shell script for DNS configuration. You must specify the information of the existing Oracle WebLogic Server. This section shows how to obtain the values for the following required properties. + +| Parameter Name             | Explanation | +|----------------|-------------| +| `--admin-vm-name`| Required. Name of virtual machine that hosts {{ site.data.var.wlsFullBrandName }} admin server. Must be the same value provided at initial deployment time.| +| `--admin-console-label` | Required. Label for {{ site.data.var.wlsFullBrandName }} admin console. Used to generate subdomain of admin console. | +| `--artifact-location`| Required. See below for details. | +| `--resource-group` | Required. Name of resource group that has an {{ site.data.var.wlsFullBrandName }} cluster deployed. | +| `--location ` | Required. Must be the same region into which the server was initially deployed. | +| `--zone-name ` | Required. Azure DNS Zone name. | +| `--zone-resource-group` | Optional. Name of resource group that has Azure DNS Zone deployed. The parameter is only required if you are creating DNS alias on an existing DNS Zone. | +| `--help` | Help. | + +### Artifacts location + +This value must be the following. + +```bash +{{ armTemplateBasePath }} +``` + +## Invoke the Automation Script + +We provide an automation script to configure a custom DNS alias. The script lets you do the following: + + * If you have an Azure DNS Zone, it will create a DNS alias for the admin console on the existing DNS Zone. + * If you don't have an Azure DNS Zone, it will create the DNS Zone in the same resource group as the {{ site.data.var.wlsFullBrandName }} cluster, then create the DNS alias for the admin console. + +### Configure DNS Alias on an Existing Azure DNS Zone + +To configure a DNS alias on an existing Azure DNS Zone, in addition to the required parameters, you must also specify an Azure user-assigned managed identity ID and the resource group name in which your DNS Zone is deployed. + +This is an example to create a DNS alias `admin.contoso.com` for the admin console in an existing Azure DNS Zone. + +```bash +$ curl -fsSL {{ site.data.var.artifactsLocationBase }}/{{ site.data.var.artifactsLocationTag }}/{{site.data.var.artifactsLocationSubPathForVM}}{{ pageDir }}/cli-scripts/custom-dns-alias-cli.sh \ + | /bin/bash -s -- \ + --resource-group `yourResourceGroup` \ + --admin-vm-name adminVM \ + --admin-console-label admin \ + --artifact-location {{ armTemplateBasePath }} \ + --location eastus \ + --zone-name contoso.com \ + --zone-resource-group `yourDNSZoneResourceGroup` +``` + +An example output: + +```text +Done! + +Custom DNS alias: + Resource group: contoso-dns-doc + WebLogic Server Administration Console URL: http://admin.contoso.com:7001/console + WebLogic Server Administration Console secured URL: https://admin.contoso.com:7002/console + +``` + + +### Configure DNS Alias on a New Azure DNS Zone + +To configure a DNS alias on a new Azure DNS Zone, you must specify the required parameters. + +This is an example of creating an Azure DNS Zone, then creating a DNS alias `admin.contoso.com` for the admin console. + +```bash +$ curl -fsSL {{ site.data.var.artifactsLocationBase }}/{{ site.data.var.artifactsLocationTag }}/{{site.data.var.artifactsLocationSubPathForVM}}{{ pageDir }}/cli-scripts/custom-dns-alias-cli.sh \ + | /bin/bash -s -- \ + --resource-group `yourResourceGroup` \ + --admin-vm-name adminVM \ + --admin-console-label admin \ + --artifact-location {{ armTemplateBasePath }} \ + --location eastus \ + --zone-name contoso.com +``` + +An example output: + +```text +DONE! + + +Action required: + Complete Azure DNS delegation to make the alias accessible. + Reference: https://aka.ms/dns-domain-delegation + Name servers: + [ + "ns1-02.azure-dns.com.", + "ns2-02.azure-dns.net.", + "ns3-02.azure-dns.org.", + "ns4-02.azure-dns.info." + ] + +Custom DNS alias: + Resource group: contoso-dns-doc + WebLogic Server Administration Console URL: http://admin.contoso.com:7001/console + WebLogic Server Administration Console secured URL: https://admin.contoso.com:7002/console +``` + +**Note:** The DNS aliases are not accessible now, you must perform Azure DNS delegation after the deployment. Follow [Delegation of DNS zones with Azure DNS](https://aka.ms/dns-domain-delegation) to complete the Azure DNS delegation. + + +## Verify the Custom Alias + +Access the URL from output to verify if the custom alias works. diff --git a/admin/dbTemplate.md b/admin/dbTemplate.md new file mode 100644 index 000000000..54041387a --- /dev/null +++ b/admin/dbTemplate.md @@ -0,0 +1,294 @@ + + +{% include variables.md %} + +# Apply Database ARM Template to {{ site.data.var.wlsFullBrandName }} + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} with an existing Azure database using Azure CLI. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The database ARM template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Database Instance + +To apply configure a database with {{ site.data.var.wlsFullBrandName }}, +you must have an existing database instance to use. This template +supports three popular Azure databases: [Oracle](https://ms.portal.azure.com/#blade/Microsoft_Azure_Marketplace/MarketplaceOffersBlade/selectedMenuItemId/home/searchQuery/oracle%20database), [Azure SQL Server](https://docs.microsoft.com/en-us/azure/azure-sql/), [Azure Database for PostgreSQL](https://docs.microsoft.com/en-us/azure/azure-sql/database/single-database-create-quickstart?WT.mc_id=gallery&tabs=azure-portal) and [MySQL](https://learn.microsoft.com/en-us/azure/mysql/single-server/quickstart-create-mysql-server-database-using-azure-portal). If you do not have an instance, please +create one from the Azure portal. + +{% include sub-template-connect-db-with-msi.md %} + +### Apply multiple databases + +You can deploy different databases using the database ARM template, by changing the ARM parameters file and invoking the template again with Azure CLI. + +To apply multiple databases, you have to remove the previous virtual machine extension. Last ARM parameters file is cached, it will block you from configuring the new database. + +Use the following command to remove virtual machine extension: + +```bash +# remove existing vm extension +az vm extension delete -g ${yourResourceGroup} --vm-name ${adminVMName} --name newuserscript +``` + +## Prepare the Parameters JSON file + +You must construct a parameters JSON file containing the parameters to the database ARM template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. We must specify the information of the existing {{ site.data.var.wlsFullBrandName }} and database instance. This section shows how to obtain the values for the following required properties. + +| Parameter Name | Explanation | +|----------------|-------------| +| `_artifactsLocation`| See below for details. | +| `adminVMName`| At deployment time, if this value was changed from its default value, the value used at deployment time must be used. Otherwise, this parameter should be omitted. | +| `databaseType`| Must be one of `postgresql`, `oracle`, `sqlserver` and `mysql` | +| `dbIdentity` | See below for details. You must provide this value if `enablePswlessConnection` is `true`.| +| `dbGlobalTranPro` | Determines the transaction protocol (global transaction processing behavior) for the data source. Must be one of `TwoPhaseCommit`, `LoggingLastResource`, `EmulateTwoPhaseCommit`, `OnePhaseCommit` or `None`. | +| `dbIdentity` | See below for details. You must provide this value if `enablePswlessConnection` is `true`.| +| `dbPassword`| See below for details. You don't need to input this value if `enablePswlessConnection` is `false`.| +| `dbUser` | See below for details. | +| `dsConnectionURL`| See below for details. | +| `enablePswlessConnection` | True to enable passwordless datasource connection. Default value is `false`.| +| `jdbcDataSourceName`| Must be the JNDI name for the JDBC data source. | +| `location` | Must be the same region into which the server was initially deployed. | +| `wlsDomainName` | Must be the same value provided at deployment time. | +| `wlsPassword` | Must be the same value provided at deployment time. | +| `wlsUserName` | Must be the same value provided at deployment time. | + +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateBasePath }} +``` + +### Obtain the JDBC Connection String, Database User, and Database Password + +The parameter `dsConnectionURL` stands for JDBC connection string. The connection string is database specific. + +{% include sub-template-datasource-connection-url.md %} + +{% include sub-template-obtain-msi.md%} + +#### Example Parameters JSON + +Here is a fully filled out parameters file. Note that we keep default value for `adminVMName` and `wlsDomainName`. + +{{ site.data.var.passwordInFileNote }} + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "_artifactsLocation":{ + "value": "{{ armTemplateBasePath }}" + }, + "location": { + "value": "eastus" + }, + "databaseType": { + "value": "postgresql" + }, + "dsConnectionURL": { + "value": "jdbc:postgresql://ejb060801p.postgres.database.azure.com:5432/postgres?sslmode=require" + }, + "dbPassword": { + "value": "Secret123!" + }, + "dbUser": { + "value": "postgres@ejb060801p" + }, + "jdbcDataSourceName": { + "value": "jdbc/ejb060801p" + }, + "wlsPassword": { + "value": "welcome1" + }, + "wlsUserName": { + "value": "weblogic" + } + } +} +``` + + + +## Invoke the ARM template + +Assume your parameters file is available in the current directory and is named `parameters.json`. This section shows the commands to configure your {{ site.data.var.wlsFullBrandName }} deployment with the specified database. Replace `yourResourceGroup` with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +### First, validate your parameters file + +The `az group deployment validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az group deployment validate --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/dbTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Next, execute the template + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az group deployment create --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/dbTemplate.json +``` + +As with the validate command, if the command returns with an exit status other than `0`, inspect the output and resolve the problem. + +This is an example output of successful deployment. Look for `"provisioningState": "Succeeded"` in your output. + +```json +{ + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-0602/providers/Microsoft.Resources/deployments/db", + "location": null, + "name": "db", + "properties": { + "correlationId": "6fc805b9-1c47-4b32-b9b0-59745a21e559", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-0602/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-admin-0602", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-0602/providers/Microsoft.Resources/deployments/3b35b279-0e94-5264-85f5-0d9d662f8a38", + "resourceGroup": "oraclevm-admin-0602", + "resourceName": "3b35b279-0e94-5264-85f5-0d9d662f8a38", + "resourceType": "Microsoft.Resources/deployments" + } + ], + "duration": "PT17.4377546S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputResources": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-0602/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-admin-0602" + } + ], + "outputs": { + "artifactsLocationPassedIn": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + } + }, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + }, + "_artifactsLocationDbTemplate": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + } + "adminVMName": { + "type": "String", + "value": "adminVM" + }, + "databaseType": { + "type": "String", + "value": "postgresql" + }, + "dbPassword": { + "type": "SecureString" + }, + "dbUser": { + "type": "String", + "value": "weblogic@oraclevm" + }, + "dsConnectionURL": { + "type": "String", + "value": "jdbc:postgresql://oraclevm.postgres.database.azure.com:5432/postgres" + }, + "jdbcDataSourceName": { + "type": "String", + "value": "jdbc/WebLogicCafeDB" + }, + "location": { + "type": "String", + "value": "eastus" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "6381424766408193665", + "templateLink": null, + "timestamp": "2020-06-02T06:05:03.141828+00:00" + }, + "resourceGroup": "oraclevm-admin-0602", + "type": "Microsoft.Resources/deployments" +} +``` + +## Verify Database Connection + +Follow the steps to check if the database has successfully been connected. + +* Visit the {{ site.data.var.wlsFullBrandName }} Admin console. +* In the left navigation pane, expand the **Services** tree node and the **DataSources** child node. +* Select the row for the JDBC database name, for example `jdbc/WebLogicDB`. +* Select the **Monitoring** tab and the **Testing** sub-tab. +* Select `admin` and select **Test Data Source** +* If the database is enabled, you will see a message similar to "Test of jdbc/WebLogicDB on server admin was successful." diff --git a/admin/elkNestedTemplate.md b/admin/elkNestedTemplate.md new file mode 100644 index 000000000..42bb37e86 --- /dev/null +++ b/admin/elkNestedTemplate.md @@ -0,0 +1,292 @@ + + +{% include variables.md %} + +# Land {{ site.data.var.wlsFullBrandName }} logs to Elasticsearch and Kibana + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} to land logs to Elasticsearch and Kibana using Azure CLI. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The ELK ARM template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Virtual machine size requirement +Ensure the virtual machines that have been deployed have at least **2.5GB** of memory. The default virtual machine size for WLS does not have enough memory. Use at least `Standard_A2_v2`. + +### Elasticsearch instance + +Refer to [Create an an Elastic on Azure instance](https://aka.ms/arm-oraclelinux-wls-elk#create-an-an-elastic-on-azure-instance) + +## Prepare the Parameters JSON file + +You must construct a parameters JSON file containing the parameters to the ELK ARM template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. + +We must specify the information of the existing {{ site.data.var.wlsFullBrandName }} and Elasticsearch instance. This section shows how to obtain the values for the following required properties. + +| Parameter Name | Explanation | +|----------------|-------------| +| `_artifactsLocation`| See below for details. | +| `adminVMName`| Virtual machine name of which hosts the {{ site.data.var.wlsFullBrandName }} admin server. | +| `elasticsearchEndpoint` | The Elasticsearch endpoint. | +| `elasticsearchPassword` | Password of the Elasticsearch account. Used to distibute message with REST API to Elasticsearch instance. | +| `elasticsearchUserName` | User name of the Elasticsearch account. | +| `location` | Must be the same region into which the server was initially deployed. | +| `logsToIntegrate` | Specify the WebLogic logs to export to Elasticsearch, you must select at least one log. | +| `wlsDomainName` | Must be the same value provided at initial deployment time. | +| `wlsPassword` | Must be the same value provided at initial deployment time. | +| `wlsUserName` | Must be the same value provided at initial deployment time. | + +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateBasePath }} +``` + +#### Example Parameters JSON + +Here is a fully filled out parameters file. We will leave values of `adminUsername`, `authenticationType`, `dnsLabelPrefix`, and `usePreviewImage` as default value. + +{{ site.data.var.passwordInFileNote }} + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "_artifactsLocation": { + "value": "{{ armTemplateBasePath }}" + }, + "adminVMName": { + "value": "adminVM" + }, + "elasticsearchEndpoint": { + "value": "https://example.eastus2.azure.elastic-cloud.com:9243" + }, + "elasticsearchPassword": { + "value": "wlkpsw" + }, + "elasticsearchUserName": { + "value": "elastic" + }, + "location": { + "value": "eastus" + }, + "wlsDomainName": { + "value": "adminDomain" + }, + "wlsPassword": { + "value": "welcome1" + }, + "wlsUserName": { + "value": "weblogic" + } + } +} +``` + +## Invoke the ARM template + +Assume your parameters file is available in the current directory and is named `parameters.json`. This section shows the commands to configure your {{ site.data.var.wlsFullBrandName }} deployment to connect to Elasticsearch and Kinaba intance. Replace `yourResourceGroup` with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +### First, validate your parameters file + +The `az group deployment validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az deployment group validate --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/elkNestedTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Next, execute the template + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az deployment group create --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/elkNestedTemplate.json +``` + +As with the validate command, if the command returns with an exit status other than `0`, inspect the output and resolve the problem. + +This is an example output of successful deployment. Look for `"provisioningState": "Succeeded"` in your output. + +```json +{ + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-admin-elk/providers/Microsoft.Resources/deployments/elkNestedTemplate", + "location": null, + "name": "elkNestedTemplate", + "properties": { + "correlationId": "61a46b43-27d0-4478-baba-c288059892d5", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-admin-elk/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "haiche-admin-elk", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-admin-elk/providers/Microsoft.Resources/deployments/pid-e4165284-b017-5df9-9b91-3f11dd8a72e5", + "resourceGroup": "haiche-admin-elk", + "resourceName": "pid-e4165284-b017-5df9-9b91-3f11dd8a72e5", + "resourceType": "Microsoft.Resources/deployments" + }, + ], + "duration": "PT8M54.4785762S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputResources": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-admin-elk/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "haiche-admin-elk" + } + ], + "outputs": { + "artifactsLocationPassedIn": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + }, + "logIndex": { + "type": "String", + "value": "azure-weblogic-admin-b4e465d5-6ffc-49cf-b1d9-b4dbf6455d0a" + } + }, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + }, + "_artifactsLocationELKTemplate": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + }, + "_artifactsLocationSasToken": { + "type": "SecureString" + }, + "adminVMName": { + "type": "String", + "value": "adminVM" + }, + "elasticsearchEndpoint": { + "type": "String", + "value": "https://example.eastus2.azure.elastic-cloud.com:9243" + }, + "elasticsearchPassword": { + "type": "SecureString" + }, + "elasticsearchUserName": { + "type": "String", + "value": "elastic" + }, + "guidValue": { + "type": "String", + "value": "b4e465d5-6ffc-49cf-b1d9-b4dbf6455d0a" + }, + "location": { + "type": "String", + "value": "eastus" + }, + "logsToIntegrate": { + "type": "Array", + "value": [ + "HTTPAccessLog", + "ServerLog", + "DomainLog", + "DataSourceLog", + "StandardErrorAndOutput", + "NodeManagerLog" + ] + }, + "wlsDomainName": { + "type": "String", + "value": "wlsd" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "10060935779116645392", + "templateLink": null, + "timestamp": "2020-11-11T07:29:42.336797+00:00" + }, + "resourceGroup": "haiche-admin-elk", + "type": "Microsoft.Resources/deployments" +} +``` + +## Verify ELK connection + +Follow the steps to check if WebLogic Server logs are exported to Elasticsearch. + +* Go to Azure portal +* Copy log index from your resource group -> deployments -> elkNestedTemplate -> output -> logIndex . +* Go to Elasticsearch cloud and launch Kibana. +* Create index + * Go to Kibana -> Management -> Kibana -> Index Patterns + * Click `Create index Patterns` + * Input the log index you copy from output in Index pattern + * There should be an index you can select, otherwise, the ELK deployment failed + * Next step + * Select `@timestamp` in Time Filter and hit `Create index pattern` +* View logs + * Go to Kibana -> Discover + * Select the index you just created + * You will find the WebLogic Server logs listed diff --git a/admin/index.md b/admin/index.md new file mode 100644 index 000000000..e074f5857 --- /dev/null +++ b/admin/index.md @@ -0,0 +1,18 @@ + + +# Single Node {{ site.data.var.wlsFullBrandName }} with Admin Server + +{% include sub-template-01.md %} + +Templates available for working with [{{ site.data.var.wlsFullBrandName }} with Admin Server](https://portal.azure.com/#create/oracle.20191009-arm-oraclelinux-wls-admin20191009-arm-oraclelinux-wls-admin): + +* [Configure a database connection](dbTemplate.md) + +* [Configure Azure Active Directory](aadNestedTemplate.md) + +* [Configure custom DNS alias](customDNSTemplate.md) + +* [Configure Elasticsearch and Kibana](elkNestedTemplate.md) diff --git a/aks/dbTemplate.md b/aks/dbTemplate.md new file mode 100644 index 000000000..93cd4f951 --- /dev/null +++ b/aks/dbTemplate.md @@ -0,0 +1,209 @@ + + +{% include variables.md %} + +# Apply Database ARM Template to existing {{ site.data.var.wlsFullBrandName }} + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} with an existing Azure database using Azure CLI. + +You can invoke the database ARM template to: + + - Create a new data source connection, you can have multiple data source connections in your cluster. + + - Update an existing data source connection. + + - Delete an existing data source connection. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +{% include sub-template-prerequisites-uami.md %} + +{% include sub-template-prerequisites-wls.md %} + +If you are using your own data source driver, make sure the data source driver is uploaded during the WebLogic Server instance provisioning. + +You can create an {{ site.data.var.wlsFullBrandName }} cluster with data source driver library with steps: + + - Open [WebLogic on AKS marketplace offer](https://portal.azure.com/?feature.customPortal=false#create/oracle.20210620-wls-on-aks20210620-wls-on-aks) + + - Input values to **Basics** and **Config AKS cluster** blade + + - In the Database blade, select **Yes** to connect to database. For **Choose databse type**, select **Other**, upload data source driver in **data source driver**. + + - Finish other inputs, create **Review + create** to provison a cluster. + +You will get an {{ site.data.var.wlsFullBrandName }} cluster with your data source driver built in the image. + +### Database Instance + +To apply a database with {{ site.data.var.wlsFullBrandName }}, +you must have an existing database instance to use. + +#### Work with built-in data source driver + +The marketplace offer ships with database driver for [Oracle](https://ms.portal.azure.com/#blade/Microsoft_Azure_Marketplace/MarketplaceOffersBlade/selectedMenuItemId/home/searchQuery/oracle%20database), [Azure SQL Server](https://docs.microsoft.com/en-us/azure/azure-sql/), [Azure Database for PostgreSQL](https://docs.microsoft.com/en-us/azure/azure-sql/database/single-database-create-quickstart?WT.mc_id=gallery&tabs=azure-portal) and [MySQL](https://www.mysql.com/). You can invoke the dbTemplate to create data source connection for those database. +If you do not have an instance, please create one from Azure portal. You are able to provision a MySQL instance quickly using [Azure Database for MySQL](https://docs.microsoft.com/en-us/azure/mysql/). + +#### Bring your own data source driver + +Besides [Oracle](https://ms.portal.azure.com/#blade/Microsoft_Azure_Marketplace/MarketplaceOffersBlade/selectedMenuItemId/home/searchQuery/oracle%20database), [Azure SQL Server](https://docs.microsoft.com/en-us/azure/azure-sql/), [Azure Database for PostgreSQL](https://docs.microsoft.com/en-us/azure/azure-sql/database/single-database-create-quickstart?WT.mc_id=gallery&tabs=azure-portal) and [MySQL](https://www.mysql.com/), you are able to create data source connection using other databases, such as [IBM Informix](https://www.ibm.com/products/informix) and [MariaDB](https://mariadb.org/), but you have to follow those steps to achieve that: + + - Create your database server, and make sure the database is accessible from Azure. + + - Ship your database driver to the {{ site.data.var.wlsFullBrandName }} cluster. The only approach to upload a data source driver is using [marketplace offer](https://portal.azure.com/?feature.customPortal=false#create/oracle.20210620-wls-on-aks20210620-wls-on-aks). The offer enables you to bring your own data source driver. See [WebLogic Server Instance](#webLogic-server-instance) + + - Invoke the dbTemplate to update an existing data source connection or create another new data source connection. + +### Apply multiple data source + +You may want to enable multiple data source in your cluster for the following usage: + - Create multiple data source connections using the same database + - Create multiple data source connections using different databases + +You can deploy different data source connections using the database ARM template, by changing the ARM parameters file and invoking the template again with Azure CLI. + +To deploy data source using your own data source driver, we assume the data source driver has been uploaded to the cluster. See [WebLogic Server Instance](#webLogic-server-instance) + +## Prepare the Parameters JSON file + +| Advanced parameter Name | Explanation | +|----------------|-------------| +| `_artifactsLocation`| Required. See below for details. | +| `aksClusterName`| Required. String value.
Name of the AKS cluster. Must be the same value provided at deployment time. | +| `dbPassword`| Required. String value.
Password for the data source connection. | +| `dbUser`| Required. String value.
User id for the data source connection. | +| `dsConnectionURL` | Required. String value.
JDBC connection string. | +| `identity` | Required. Object value.
Azure user managed identity used, make sure the identity has permission to create/update/delete Azure resources. It's recommended to assign "Contributor" role. | +| `jdbcDataSourceName` | Required. String value.
JDBC name for the data source connection. | +| `wlsDomainUID` | Required. String value.
UID of the domain that you are going to update. Make sure it's the same with the initial cluster deployment. | +| `wlsPassword` | Required. String value.
Password for WebLogic Administrator. Make sure it's the same with the initial cluster deployment. | +| `wlsUserName` | Required. String value.
User name for WebLogic Administrator. Make sure it's the same with the initial cluster deployment. | +| `databaseType`| Optinal. Enum value.
Defaults by `oracle`.
`oracle`: will provision a [Oracle](https://ms.portal.azure.com/#blade/Microsoft_Azure_Marketplace/MarketplaceOffersBlade/selectedMenuItemId/home/searchQuery/oracle%20database) datasoruce connection.
`postgresql`: will provision a [Azure Database for PostgreSQL](https://docs.microsoft.com/en-us/azure/azure-sql/database/single-database-create-quickstart?WT.mc_id=gallery&tabs=azure-portal) data source connection.
`sqlserver`: will provision a [Azure SQL Server](https://docs.microsoft.com/en-us/azure/azure-sql/) data source connection.
`mysql`: will provision a [MySQL](https://www.mysql.com/) data source connection. | +| `dbConfigurationType`| Optinal. Enum value.
Defaults by `createOrUpdate`.
`createOrUpdate`: the deployment will create a new data source connection if there is no data source has the same name with `jdbcDataSourceName`, otherwise, will update the expected data source with new inputs.
`delete`: the deployment will delete a data source connection that has name `jdbcDataSourceName` | +| `dbGlobalTranPro` | Optinal. Enum value.
Defaults by `OnePhaseCommit`. The transaction protocol (global transaction processing behavior) for the data source. You may use one from: `["TwoPhaseCommit", "LoggingLastResource", "OnePhaseCommit", "None"]`| + +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateBasePath }} +``` + +### Obtain the JDBC Connection String, Database User, and Database Password + +The parameter `dsConnectionURL` stands for JDBC connection string. The connection string is database specific. + +{% include sub-template-datasource-connection-url.md %} + +{% include sub-template-datasource-mysql-connection-url.md %} + +* If you are using **Patched WebLogic Server Images** from [Oracle Container Registry](https://container-registry.oracle.com/) **middleware/weblogic_cpu** repository, you have to specify **serverTimezone**, like the following: + + ```bash + jdbc:mysql://contoso.mysql.database.azure.com:3306/guest?useSSL=true&requireSSL=false&serverTimezone=UTC + ``` + +* If you are using **General WebLogic Server Images** from [Oracle Container Registry](https://container-registry.oracle.com/) **middleware/weblogic** repository, you have to specify **serverTimezone** and **enabledTLSProtocols**, like the following: + + ```bash + jdbc:mysql://contoso.mysql.database.azure.com:3306/guest?useSSL=true&requireSSL=false&serverTimezone=UTC&enabledTLSProtocols=TLSv1.2 + ``` + +#### Example Parameters JSON + +```json +{ + "_artifactsLocation": { + "value": "{{ armTemplateBasePath }}" + }, + "aksClusterName": { + "value": "aks-sample" + }, + "databaseType": { + "value": "postgresql" + }, + "dbConfigurationType": { + "value": "createOrUpdate" + }, + "dbPassword": { + "value": "Secret123!" + }, + "dbUser": { + "value": "postgres@sampledb" + }, + "dsConnectionURL": { + "value": "jdbc:postgresql://sampledb.postgres.database.azure.com:5432/postgres?sslmode=require" + }, + "identity": { + "value": { + "type": "UserAssigned", + "userAssignedIdentities": { + "/subscriptions/subscription-id/resourceGroups/samples/providers/Microsoft.ManagedIdentity/userAssignedIdentities/azure_wls_aks": {} + } + } + }, + "jdbcDataSourceName": { + "value": "jdbc/WebLogicDB" + }, + "wlsDomainUID": { + "value": "sample-domain1" + }, + "wlsPassword": { + "value": "Secret123!" + }, + "wlsUserName": { + "value": "weblogic" + } + } +``` + +## Invoke the ARM template + +Assume your parameters file is available in the current directory and is named `parameters.json`. This section shows the commands to configure your {{ site.data.var.wlsFullBrandName }} deployment with the specified database. Replace `yourResourceGroup` with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +### Validate your parameters file + +The `az group deployment validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az deployment group validate --verbose \ + --resource-group `yourResourceGroup` \ + --parameters @parameters.json \ + --template-uri {{ armTemplateBasePath }}dbTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Execute the template + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az deployment group create --verbose \ + --resource-group `yourResourceGroup` \ + --parameters @parameters.json \ + --template-uri {{ armTemplateBasePath }}dbTemplate.json +``` + +As with the validate command, if the command returns with an exit status other than `0`, inspect the output and resolve the problem. + +For a successful deployment, you should find `"provisioningState": "Succeeded"` in your output. + +## Verify Database Connection + +Follow the steps to check if the database has successfully been connected. + +* Visit the {{ site.data.var.wlsFullBrandName }} Admin console. +* In the left navigation pane, expand the **Services** tree node and the **DataSources** child node. +* Select the row for the JDBC database name, for example `jdbc/WebLogicDB`. +* Select the **Monitoring** tab and the **Testing** sub-tab. +* Select `admin` and select **Test Data Source** +* If the database is enabled, you will see a message similar to "Test of jdbc/WebLogicDB on server admin was successful." \ No newline at end of file diff --git a/aks/index.md b/aks/index.md new file mode 100644 index 000000000..a33109762 --- /dev/null +++ b/aks/index.md @@ -0,0 +1,16 @@ + + +# Run {{ site.data.var.wlsFullBrandName }} on {{ site.data.var.aksFullName }} + +Templates available for working with [{{ site.data.var.wlsFullBrandName }} on {{ site.data.var.aksFullName }}](https://portal.azure.com/?feature.customPortal=false#create/oracle.20210620-wls-on-aks20210620-wls-on-aks): + +* [Create WebLogic Server cluster with advanced configuration](mainTemplate.md) + +* [Update WebLogic Server cluster with advanced configuration](updateClusterTemplate.md) + +* [Configure a database connection](dbTemplate.md) + +* [Update Java EE application](updateAppTemplate.md) \ No newline at end of file diff --git a/aks/mainTemplate.md b/aks/mainTemplate.md new file mode 100644 index 000000000..2210894cb --- /dev/null +++ b/aks/mainTemplate.md @@ -0,0 +1,79 @@ + + +{% include variables.md %} + +# Advanced actions with Oracle WebLogic Server cluster on {{ site.data.var.aksFullName }} + +This document describes how to create an {{ site.data.var.wlsFullBrandName }} cluster on {{ site.data.var.aksFullName }} using the Azure CLI. + +## Introduction + +{% include sub-template-advanced-usage.md %} + +This document will guide you to create a WebLogic Server cluster in ways that supplement and enhance the capabilities offered by the Azure Marketplace offer. The techniques described in this document go beyond what you can configure using the Azure Marketplace offer. + +## Prerequisites + +This section lists several prerequisites for activating the features as described in the guidance. Optional prerequisites are marked as (optional) + +{% include sub-template-prerequisites.md %} + +{% include sub-template-create-update-wls-on-aks.md %} + +## Invoke the ARM template + +Assume your parameters file is available in the current directory and is named `parameters.json`. +This section shows the commands to create an {{ site.data.var.wlsFullBrandName }} cluster on AKS. + +Use the command to create a resoruce group. + +```shell +resourceGroupName="hello-wls-aks" +az group create --name ${resourceGroupName} -l eastus +``` + +### Validate your parameters file + +The `az group deployment validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az deployment group validate --verbose \ + --resource-group ${resourceGroupName} \ + --parameters @parameters.json \ + --template-uri {{ armTemplateBasePath }}mainTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Execute the template + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az deployment group create --verbose \ + --resource-group ${resourceGroupName} \ + --name advanced-deployment \ + --parameters @parameters.json \ + --template-uri {{ armTemplateBasePath }}mainTemplate.json +``` + +As with the validate command, if the command returns with an exit status other than `0`, inspect the output and resolve the problem. + +After a successful deployment, you should find `"provisioningState": "Succeeded"` in your output. + + +## Verify deployment + +The sample has set up custom T3 channel for Administration Server and cluster, you should be able to access Administration Console portal +using the public address of T3 channel. + +Obtain the address from deployment output: + + - Open your resource group from Azure portal. + - Click **Settings** -> **Deployments** -> the deployment with name `advanced-deployment`, listed in the bottom. + - Click **Outputs** of the deployment, copy the value of `adminServerT3ExternalUrl` + +Get public IP and port from `adminServerT3ExternalUrl`, access `http://:/console` from browser, you should find the login page. diff --git a/aks/updateAppTemplate.md b/aks/updateAppTemplate.md new file mode 100644 index 000000000..2bff0f43e --- /dev/null +++ b/aks/updateAppTemplate.md @@ -0,0 +1,260 @@ + + +{% include variables.md %} + +# Update the Java application in an existing {{ site.data.var.wlsFullBrandName }} cluster + +This page documents how to update an existing deployment of {{ site.data.var.wlsFullBrandName }} with a Java EE applications using Azure CLI. + +You can invoke this ARM template to: + +- Update a running Java EE application with new version. + +- Remove a running Java EE application. + +- Deploy a new Java EE application. + +The template will only update the application deployments in the {{ site.data.var.wlsFullBrandName }} cluster, without any change to other configuration. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +{% include sub-template-prerequisites-uami.md %} + +{% include sub-template-prerequisites-wls.md %} + +{% include sub-template-prerequisites-storage.md %} + +## Prepare the Parameters JSON file + +| Advanced parameter Name | Explanation | +|----------------|-------------| +| `_artifactsLocation`| Required. See below for details. | +| `acrName` | Required. String value.
Name of Azure Container Registry that is used to managed the WebLogic domain images. | +| `aksClusterName`| Required. String value.
Name of the AKS cluster. Must be the same value provided at deployment time. | +| `aksClusterRGName` | Required. String value.
Name of resource group that contains the (AKS) instance, probably the resource group you are working on. It's recommended to run this template in the same resource group that runs AKS. | +| `identity` | Required. Object value.
Azure user managed identity used, make sure the identity has permission to create/update/delete Azure resources. It's recommended to assign "Contributor" role. | +| `wlsDomainName` | Required. String value.
Password for WebLogic Administrator. Make sure it's the same with the initial cluster deployment. | +| `wlsDomainUID` | Required. String value.
User name for WebLogic Administrator. Make sure it's the same with the initial cluster deployment. | +| `appPackageUrls`| Optinal. Array.
String array of Java EE applciation location, which can be downloaded using "curl". Currently, only support URLs of Azure Storage Account blob. | +| `appPackageFromStorageBlob`| Optinal. Object value.
Key `storageAccountName` specify the storage account name, the template will download application package from this storage account.
Key `containerName` specify the container name that stores the Java EE application. | +| `ocrSSOPSW` | Optional. String value.
Password for Oracle SSO account. | +| `ocrSSOUser` | Optional. String value.
User name for Oracle SSO account. | +| `wlsImageTag` | Optional. String value.
Docker tag that comes after "container-registry.oracle.com/middleware/weblogic:". | +| `userProvidedAcr` | Optional. String value.
User provided ACR for base image. | +| `userProvidedImagePath` | Optional. String value.
User provided base image path. | +| `useOracleImage` | Optional. Boolean value.
`true`: use Oracle standard images from Oracle Container Registry.
`false`: use user provided images from Azure Container Registry. | + +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateBasePath }} +``` + + +### Java EE application location + +The template supports two approaches to specify the location of Java EE application. +The template will update the cluter with applications specified in `appPackageUrls` and `appPackageFromStorageBlob`. + +#### SAS URLs + +You can specify the application URLs via `appPackageUrls`. The template only supports url from Azure Storage Account. +Make sure the URLs are accessible from public network. +You may want to update one application, but you must include all the application SAS URLs in the parameter. +If you are removing an application, do not include the application url. + +Steps to obtain SAS URLs: + + * Open your Storage Account from Azure portal. If you don't have, please follow this [guide](https://docs.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-portal) to create one. + + * Open your container. If you don't have, please follow this [guide](https://docs.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-portal) to create one. + + * You should find your application listed. If not, please upload your application package to the container: + + * Click **Upload** + + * Select the application file + + * Click **Upload** + + * Click your application, and click **Generate SAS**. + + * Signing method: Account key + + * Signing key: Key 1 + + * Permisson: Read + + * Click **Generate SAS token and URL** + + * Copy the **Blob SAS URL** and save it to a file. + + * Repeat step 4 for other applicatios. + + * Now you have all the URLs. `appPackageUrls` will be value like `["sasUrl1", "sasUrl2"]`. + + It should present in parameters.json like: + + ```json + { + "appPackageUrls": { + "value": [ + "sasUrl1", + "sasUrl2" + ] + } + } + ``` + +#### Storage Account Blob + +You can also specify the contaier of Storage Account. The template will download all the .jar, .war. .ear files from the container. + +You may want to update one application, but you must include all the application in the container. +If you want to remove an application, do not include the application. + +Steps to upload your applications to blob: + * Open your storage account from Azure portal. If you don't have, please follow [guide](https://docs.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-portal) to create one. + + * Create a new container follow [guide](https://docs.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-portal) you may name it `javaeeapps`. + + * Upload your application to the container. + + * Now you can specify the value of storage blob: + + * `storageAccountName`: name of your Storage Account + + * `containerName`: container name, should be `javaeeapps` if you use the name in step 2. + + It should present in parameters.json like: + + ```json + { + "appPackageFromStorageBlob": { + "value": { + "storageAccountName": "", + "containerName": "" + } + } + } + ``` + +You can define the application location using both approaches, but it'not suggested. The template will download +applications from `appPackageUrls` and `appPackageFromStorageBlob`. + +### Base image location + +The template supports two kinds of base image: + + - Oracle Standard image from Oracle Container Registry (OCR) + + - User provided image from Azure Container Registry (ACR) + +#### Oracle Standard image + +If you are using Oracle Standard image, you must provide the following parameters: + + - `ocrSSOPSW`: Password for Oracle SSO account. The template will use the account to pull image from OCR. + + - `ocrSSOUser`: User id for Oracle SSO account. The template will use the account to pull image from OCR. + + - `wlsImageTag`: weblogic image tag, the available tags are listed in [Oracle WebLogic Server images](https://container-registry.oracle.com/ords/f?p=113:4:3004995055779:::RP,4:P4_REPOSITORY,AI_REPOSITORY,P4_REPOSITORY_NAME,AI_REPOSITORY_NAME:5,5,Oracle%20WebLogic%20Server,Oracle%20WebLogic%20Server&cs=3ESIKaQQ31HlQbmvX7rymOn1zTwhKyMi5Y3TGWtMC0_2pGBgoBq1i3laSr5it036HJbbmsNugZLvrWuqQYU3T9A). Default value is `12.2.1.4`. + +#### User provided image + +If you are bringing your own image, you must provide the following parameters: + + - `userProvidedAcr`: ACR name that contains your image. The `acrName` should be the same ACR name. + + - `userProvidedImagePath`: image path in ACR. + + - `useOracleImage`: `false` + +#### Example Parameters JSON + +This is an example to deploy Java EE application in `samplecontainer` to the {{ site.data.var.wlsFullBrandName }} cluster, using Oracle base image. +The parameters using default value haven't been shown for brevity. + +```json +{ + "_artifactsLocation": { + "value": "{{ armTemplateBasePath }}" + }, + "acrName": { + "value": "sampleacr" + }, + "aksClusterRGName": { + "value": "sampleaksgroup" + }, + "aksClusterName": { + "value": "sampleaks" + }, + "appPackageFromStorageBlob": { + "value": { + "storageAccountName": "samplestorage", + "containerName": "samplecontainer" + } + }, + "identity": { + "value": { + "type": "UserAssigned", + "userAssignedIdentities": { + "/subscriptions/subscription-id/resourceGroups/samples/providers/Microsoft.ManagedIdentity/userAssignedIdentities/azure_wls_aks": {} + } + } + }, + "ocrSSOPSW": { + "value": "Secret123!" + }, + "ocrSSOUser": { + "value": "foo@example.com" + } + } + +``` + +## Invoke the ARM template + +Assume your parameters file is available in the current directory and is named `parameters.json`. This section shows the commands to configure your {{ site.data.var.wlsFullBrandName }} deployment with the specified database. Replace `yourResourceGroup` with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +### Validate your parameters file + +The `az group deployment validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az deployment group validate --verbose \ + --resource-group `yourResourceGroup` \ + --parameters @parameters.json \ + --template-uri {{ armTemplateBasePath }}updateAppTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Execute the template + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az deployment group create --verbose \ + --resource-group `yourResourceGroup` \ + --parameters @parameters.json \ + --template-uri {{ armTemplateBasePath }}updateAppTemplate.json +``` + +As with the validate command, if the command returns with an exit status other than `0`, inspect the output and resolve the problem. + +For a successful deployment, you should find `"provisioningState": "Succeeded"` in your output. + +## Verify application + +Visit the application via cluster address, you should find your application have been updated. + diff --git a/aks/updateClusterTemplate.md b/aks/updateClusterTemplate.md new file mode 100644 index 000000000..6e91ba338 --- /dev/null +++ b/aks/updateClusterTemplate.md @@ -0,0 +1,143 @@ + + +{% include variables.md %} + +# Post deployment actions for {{ site.data.var.wlsFullBrandName }} cluster on {{ site.data.var.aksFullName }} + +This page documents how to update the {{ site.data.var.wlsFullBrandName }} cluster on {{ site.data.var.aksFullName }} with advanced configuration using Azure CLI. + +## Introduction + +{% include sub-template-advanced-usage.md %} + +While, there are some limitations: + +- No support to update an {{ site.data.var.wlsFullBrandName }} cluster using older weblogic version, for example, you can not downgrade a 14.1.1.0 cluster to 12.2.1.4. + +- If you have enabled Azure Application Gatway Ingress Controller, you can not update the {{ site.data.var.wlsFullBrandName }} cluster with TLS/SSL enabled to a cluster without TLS/SSL, otherwise, ingress will fail, you have to create new ingress for HTTP access. + +- You have to specify all required parameters, even though you are not going to update some of them. + +This document will guide you to update an {{ site.data.var.wlsFullBrandName }} cluster using the advanced configurations. + +## Prerequisites + +{% include sub-template-prerequisites.md %} + +## Updating the existing {{ site.data.var.wlsFullBrandName }} cluster + +The template will apply the new configuration in `parameters.json` to the running {{ site.data.var.wlsFullBrandName }} cluster, please double check that you have specified: + +- The same credentials for WebLogic +- The same domain name and domain UID. +- The same AKS and ACR. + +Parameters to specify WebLogic credentials: + +```json +{ + "wdtRuntimePassword": { + "value": "Secret123!" + }, + "wlsPassword": { + "value": "Secret123!" + }, + "wlsUserName": { + "value": "weblogic" + } +} +``` + +Parameters for AKS and ACR should look like: + +```json +{ + "acrName": { + "value": "" + }, + "aksClusterName": { + "value": "" + }, + "aksClusterRGName": { + "value": "" + }, + "createACR": { + "value": false + }, + "createAKSCluster": { + "value": false + } +} +``` + +Parameters for domain should look like, ignore them if you used the default values: + +```json +{ + "wlsDomainName": { + "value": "domain2" + }, + "wlsDomainUID": { + "value": "sample-domain2" + } +} +``` + +{% include sub-template-create-update-wls-on-aks.md %} + +## Invoke the ARM template + +Assume your parameters file is available in the current directory and is named `parameters.json`. +This section shows the commands to create an {{ site.data.var.wlsFullBrandName }} cluster on AKS. + +Set resource group name, should be the one running your AKS cluster. + +```shell +resourceGroupName="hello-wls-aks" +``` + +### Validate your parameters file + +The `az group deployment validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az deployment group validate --verbose \ + --resource-group ${resourceGroupName} \ + --parameters @parameters.json \ + --template-uri {{ armTemplateBasePath }}mainTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Execute the template + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az deployment group create --verbose \ + --resource-group ${resourceGroupName} \ + --name advanced-deployment \ + --parameters @parameters.json \ + --template-uri {{ armTemplateBasePath }}mainTemplate.json +``` + +As with the validate command, if the command returns with an exit status other than `0`, inspect the output and resolve the problem. + +After a successful deployment, you should find `"provisioningState": "Succeeded"` in your output. + + +## Verify deployment + +The sample has set up custom T3 channel for Administration Server and cluster, you should be able to access Administration Console portal +using the public address of T3 channel. + +Obtain the address from deployment output: + + - Open your resource group from Azure portal. + - Click **Settings** -> **Deployments** -> the deployment with name `advanced-deployment`, listed in the bottom. + - Click **Outputs** of the deployment, copy the value of `adminServerT3ExternalUrl` + +Get public IP and port from `adminServerT3ExternalUrl`, access `http://:/console` from browser, you should find the login page. diff --git a/arm-oraclelinux-wls/src/main/scripts/create_datasource.py b/arm-oraclelinux-wls/src/main/scripts/create_datasource.py new file mode 100644 index 000000000..0cd81692c --- /dev/null +++ b/arm-oraclelinux-wls/src/main/scripts/create_datasource.py @@ -0,0 +1,36 @@ +# Copyright (c) 2021, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. + +connect('weblogic','gumby1234','t3://ejb1024010-ejb102401rg-ejb102401.eastus.cloudapp.azure.com:7001') +edit("Edwards-MacBook-Pro.local") +startEdit() +cd('/') +try: + cmo.createJDBCSystemResource('postgreSQL-0') + cd('/JDBCSystemResources/postgreSQL-0/JDBCResource/postgreSQL-0') + cmo.setName('postgreSQL-0') + cd('/JDBCSystemResources/postgreSQL-0/JDBCResource/postgreSQL-0/JDBCDataSourceParams/postgreSQL-0') + set('JNDINames',jarray.array([String('jndi/postgreSQL-0')], String)) + cd('/JDBCSystemResources/postgreSQL-0/JDBCResource/postgreSQL-0') + cmo.setDatasourceType('GENERIC') + cd('/JDBCSystemResources/postgreSQL-0/JDBCResource/postgreSQL-0/JDBCDriverParams/postgreSQL-0') + cmo.setUrl('jdbc:postgresql://20191015postgresql.postgres.database.azure.com:5432/wls20191015?sslmode=require') + cmo.setDriverName('org.postgresql.Driver') + cmo.setPassword('wlsEng@2019') + cd('/JDBCSystemResources/postgreSQL-0/JDBCResource/postgreSQL-0/JDBCConnectionPoolParams/postgreSQL-0') + cmo.setTestTableName('SQL ISVALID\r\n\r\n\r\n\r\n') + cd('/JDBCSystemResources/postgreSQL-0/JDBCResource/postgreSQL-0/JDBCDriverParams/postgreSQL-0/Properties/postgreSQL-0') + cmo.createProperty('user') + cd('/JDBCSystemResources/postgreSQL-0/JDBCResource/postgreSQL-0/JDBCDriverParams/postgreSQL-0/Properties/postgreSQL-0/Properties/user') + cmo.setValue('weblogic@20191015postgresql') + cd('/JDBCSystemResources/postgreSQL-0/JDBCResource/postgreSQL-0/JDBCDataSourceParams/postgreSQL-0') + cmo.setGlobalTransactionsProtocol('EmulateTwoPhaseCommit') + cd('/JDBCSystemResources/postgreSQL-0') + set('Targets',jarray.array([ObjectName('com.bea:Name=cluster1,Type=Cluster')], ObjectName)) + save() + resolve() + activate() +except Exception, e: + print "Already datasource with name postgreSQL-0 exists" +destroyEditSession("Edwards-MacBook-Pro.local",force = true) +disconnect() diff --git a/assets/css/style.scss b/assets/css/style.scss new file mode 100644 index 000000000..480ee1d3e --- /dev/null +++ b/assets/css/style.scss @@ -0,0 +1,5 @@ +--- +--- + +@import "{{ site.theme }}"; + diff --git a/cluster/aadNestedTemplate.md b/cluster/aadNestedTemplate.md new file mode 100644 index 000000000..8796d07c3 --- /dev/null +++ b/cluster/aadNestedTemplate.md @@ -0,0 +1,315 @@ + + +{% include variables.md %} + +# Apply Azure Active Directory ARM Template to {{ site.data.var.wlsFullBrandName }} + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} with an existing Azure Active Directory Domain Service (AAD DS) using Azure CLI. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The AAD ARM template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Azure Active Directory LDAP Instance + +To apply AAD to {{ site.data.var.wlsFullBrandName }}, you must have an existing Azure Active Directory LDAP instance to use. If you don't have AAD LADP instance, please follow the steps in the tutorial [Configure secure LDAP for an Azure Active Directory Domain Services managed domain](https://docs.microsoft.com/en-us/azure/active-directory-domain-services/tutorial-configure-ldaps). + +## Prepare the Parameters JSON file + +You must construct a parameters JSON file containing the parameters to the AAD ARM template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. We must specify the information of the existing {{ site.data.var.wlsFullBrandName }} and AAD instance. This section shows how to obtain the values for the following required properties. + +| Parameter Name | Explanation | +|----------------|-------------| +| `_artifactsLocation`| See below for details. | +| `aadsPortNumber` | (optional) The LDAP port number, defaults to 636. | +| `aadsPublicIP` | The IP address of the LDAP server | +| `aadsServerHost` | The hostname of the Active Directory Domain Services server. | +| `adminVMName`| At deployment time, if this value was changed from its default value, the value used at deployment time must be used. Otherwise, this parameter should be omitted. | +| `location` | Must be the same region into which the server was initially deployed. | +| `managedServerPrefix` | Must be the same managed server prefix with that in initial deployed. | +| `numberOfInstances` | Numbers of Virtual Machines that have been deployed, including Virtual Machine that hosts Administration Server. | +| `wlsDomainName` | The name of the {{ site.data.var.wlsFullBrandName }} domain. | +| `wlsLDAPGroupBaseDN` | The base distinguished name (DN) of the tree in the LDAP directory that contains groups. | +| `wlsLDAPPrincipalPassword` | The credential (usually a password) used to connect to the LDAP server. | +| `wlsLDAPPrincipal` | The Distinguished Name (DN) of the LDAP user that {{ site.data.var.wlsFullBrandName }} should use to connect to the LDAP server. | +| `wlsLDAPProviderName` | (optional) The value used for creating authentication provider name of WebLogic Server. | +| `wlsLDAPSSLCertificate` | Client certificate that will be imported to trust store of SSL. | +| `wlsLDAPSSLCertificate` | See below for details. | +| `wlsLDAPUserBaseDN` | The base distinguished name (DN) of the tree in the LDAP directory that contains users. | +| `wlsPassword` | Must be the same value provided at deployment time. | +| `wlsUserName` | Must be the same value provided at deployment time. | + +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateBasePath }} +``` + +### `wlsLDAPSSLCertificate` + +Use base64 to encode your existing SSL certificate. + +```bash +base64 your-certificate.cer -w 0 >temp.txt +``` + +Use the content as this file as the value of the `wlsLDAPSSLCertificate` parameter. + +### `numberOfInstances` + +The number of existing nodes, includeing Administration Server node. It should equal to existing Virtual Machine number. + +#### Example Parameters JSON + +Here is a fully filled out parameters file. Note that we did not include values for parameters that have a default value. Pay attention to the value of `numberOfInstances`. + +{{ site.data.var.passwordInFileNote }} + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "_artifactsLocation": { + "value": "{{ armTemplateBasePath }}" + }, + "aadsPublicIP": { + "value": "1.2.3.4" + }, + "aadsServerHost": { + "value": "ladps.fabrikam.com" + }, + "location": { + "value": "eastus" + }, + "wlsDomainName": { + "value": "wlsd" + }, + "wlsLDAPGroupBaseDN": { + "value": "OU=AADDC Users,DC=fabrikam,DC=com" + }, + "wlsLDAPPrincipal": { + "value": "CN=WLSTest,OU=AADDC Users,DC=fabrikam,DC=com" + }, + "wlsLDAPPrincipalPassword": { + "value": "Secret123!" + }, + "wlsLDAPSSLCertificate": { + "value": "MIIKQQIBAz....EkAgIIAA==" + }, + "wlsLDAPUserBaseDN": { + "value": "OU=AADDC Users,DC=fabrikam,DC=com" + }, + "wlsPassword": { + "value": "welcome1" + }, + "wlsUserName": { + "value": "weblogic" + } + } +} +``` + +## Invoke the ARM template + +Assume your parameters file is available in the current directory and is named `parameters.json`. This section shows the commands to configure your {{ site.data.var.wlsFullBrandName }} deployment with the specified AAD. Replace `yourResourceGroup` with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +### First, validate your parameters file + +The `az group deployment validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az group deployment validate --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/aadNestedTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Next, execute the template + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az group deployment create --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/aadNestedTemplate.json +``` + +As with the validate command, if the command returns with an exit status other than `0`, inspect the output and resolve the problem. + +This is an example output of successful deployment. Look for `"provisioningState": "Succeeded"` in your output. + +```json +{ + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-06082/providers/Microsoft.Resources/deployments/cli", + "location": null, + "name": "cli", + "properties": { + "correlationId": "6d98e1c8-0778-4fa5-a30a-8f10bbbb6818", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-06082/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-admin-06082", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-06082/providers/Microsoft.Resources/deployments/pid-8295df19-fe6b-5745-ad24-51ef66522b24", + "resourceGroup": "oraclevm-admin-06082", + "resourceName": "pid-8295df19-fe6b-5745-ad24-51ef66522b24", + "resourceType": "Microsoft.Resources/deployments" + } + ], + "duration": "PT2M59.6052694S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputResources": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-06082/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-admin-06082" + } + ], + "outputs": { + "artifactsLocationPassedIn": { + "type": "String", + "value": "https://raw.githubusercontent.com/galiacheng/arm-oraclelinux-wls-admin/deploy/src/main/arm/" + } + }, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "https://raw.githubusercontent.com/galiacheng/arm-oraclelinux-wls-admin/deploy/src/main/arm/" + }, + "_artifactsLocationAADTemplate": { + "type": "String", + "value": "https://raw.githubusercontent.com/galiacheng/arm-oraclelinux-wls-admin/deploy/src/main/arm/" + }, + "_artifactsLocationSasToken": { + "type": "SecureString" + }, + "aadsPortNumber": { + "type": "String", + "value": "636" + }, + "aadsPublicIP": { + "type": "String", + "value": "40.76.11.111" + }, + "aadsServerHost": { + "type": "String", + "value": "ladps.wls-security.com" + }, + "adminVMName": { + "type": "String", + "value": "adminVM" + }, + "location": { + "type": "String", + "value": "eastus" + }, + "wlsDomainName": { + "type": "String", + "value": "adminDomain" + }, + "wlsLDAPGroupBaseDN": { + "type": "String", + "value": "OU=AADDC Users,DC=wls-security,DC=com" + }, + "wlsLDAPPrincipal": { + "type": "String", + "value": "CN=WLSTest,OU=AADDC Users,DC=wls-security,DC=com" + }, + "wlsLDAPPrincipalPassword": { + "type": "SecureString" + }, + "wlsLDAPProviderName": { + "type": "String", + "value": "AzureActiveDirectoryProvider" + }, + "wlsLDAPSSLCertificate": { + "type": "String", + "value": "LS0tLS1...LQ0K" + }, + "wlsLDAPUserBaseDN": { + "type": "String", + "value": "OU=AADDC Users,DC=wls-security,DC=com" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "2818584196763146470", + "templateLink": null, + "timestamp": "2020-06-09T07:07:03.444046+00:00" + }, + "resourceGroup": "oraclevm-admin-06082", + "type": "Microsoft.Resources/deployments" +} + +``` + +## Verify AAD Integration + +Follow the steps to check if AAD is enabled. + +* Visit the {{ site.data.var.wlsFullBrandName }} Admin console. +* In the left navigator, expand the tree to select **Security Realms** -> **myrealm** -> **Providers**. +* If the integration was successful, you will find the AAD provider for example `AzureActiveDirectoryProvider`. +* In the left navigator, expand the tree to select **Security Realms** -> **myrealm** -> **Users and Groups**. +* If the integration was successful, you will find users from the AAD provider. diff --git a/cluster/addnode-coherence.md b/cluster/addnode-coherence.md new file mode 100644 index 000000000..f208cade4 --- /dev/null +++ b/cluster/addnode-coherence.md @@ -0,0 +1,577 @@ + + +{% include variables.md %} + +# Add cache managed server to {{ site.data.var.wlsFullBrandName }} Coherence cluster + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} to add new managed cache server using Azure CLI. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The `addnode-coherence.json` template will be applied to an existing {{ site.data.var.wlsFullBrandName }} **Coherence** cluster. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Coherence cluster + +You can configure Coherence cluster from Azure portal or running Coherence sub template. + +* Configure Coherence cluster from Azure portal + + Select `yes` in Coherence section and input required settings, the Azure WebLogic IaaS offer will configure a Coherence cluster automatically. + +* Configure Coherence cluster via Coherence sub template + + Refer to [Configure Coherence cluster](coherenceTemplate.html). + +## Prepare the Parameters JSON file + +You must construct a parameters JSON file containing the parameters to `addnode-coherence.json` template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. You must specify the information of the existing {{ site.data.var.wlsFullBrandName }} and nodes that to be added. This section shows how to obtain the values for the following required properties. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Parameter NameExplanation
_artifactsLocationSee below for details.
elkSettingsOptional. JSON object type. You can specify this parameters for Elasticsearch and Kibana(ELK) connection. If enable is true, must specify other properties. See the page WebLogic with Elastic on Azure for further information.
enableIf enable is true, must specify all properties of the elkSettings.
elasticsearchEndpointEndpoint of the Elasticsearch instance.
elasticsearchPasswordPassword for Elasticsearch account.
elasticsearchUserNameUser name for Elasticsearch account.
logIndexMust be the same value output at ELK deployment time.
logsToIntegrateArray with string value. Specify the expeted logs to integrate, you must input at least one log.
adminPasswordOrKeyPassword of administration account for the new Virtual Machine that host new nodes.
adminVMNameVirtual machine name of which hosts the {{ site.data.var.wlsFullBrandName }} admin server, for example: adminVM.
enableCoherenceWebLocalStorageSpecifies whether Local Storage is enabled for the Coherence*Web cluster tier.
locationMust be the same region into which the server was initially deployed.
managedServerPrefixMust be the same prefix with which the cluster was initially deployed.
numberOfExistingCacheNodesNumber of existing Coherence cache servers, used to name new virtual machines and new managed server.
numberOfNewCacheNodesNumber of new Coherence cahce servers, used to create Virtual Machines and Managed Server.
skuUrnVersionMust be the same urn with which the cluster was initially deployed.
storageAccountNameThe name of an existing storage account.
vmSizeSelect appropriate VM Size for Coherence cache servers.
wlsDomainNameMust be the same value provided at deployment time.
wlsPasswordMust be the same value provided at deployment time.
wlsUserNameMust be the same value provided at deployment time.
+ +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateAddCacheNodeBasePath }} +``` + +### Existing cache nodes +To differentiate functionality of managed cache servers, we use **managed application server** to represent managed servers that host Java EE application, and use **managed cache server** to represent managed servers that used for cache. + +You can get the existing managed cache servers with the following command: + +```shell +$ resourceGroup= +$ managedServerPrefix= +$ numberOfExistingCacheNodes=$(az resource list -g ${resourceGroup} --resource-type Microsoft.Compute/virtualMachines --query [*].name | grep "${managedServerPrefix}StorageVM[0-9]" | sed -e 's/[^0-9]/ /g' -e 's/^ *//g' -e 's/ *$//g' | tr -s ' ' | sed 's/ /\n/g' | sort -nr | head -n1) +$ echo ${numberOfExistingCacheNodes} +``` + +### Log index + +If you configured ELK in your cluster to export WebLogic Server logs to ELK, please input the value of Kibana log index, this template will set up ELK connection and export logs to specified index. + +You can get the value from Azure portal with the following steps: + +* Go to Azure portal. +* Open you resource group and click **Deployments**. +* Open the ELK deployment, and click **Output**. +* Copy the value of `logIndex`. + +Alternatively, use Azure CLI command to list log index inside the resource group deployments: + +```shell +$ az deployment group list -g 'yourResourceGroup' --query [*].properties.outputs.logIndex.value +[ + "azure-weblogic-cluster-f984df74-ab4d-4c17-a532-7f248659fb28" +] +``` + +### Storage account + +Each Storage Account handles up to 20,000 IOPS, and 500TB of data. If you use a storage account for Standard Virtual Machines, you can store until 40 virtual disks. + +We have two disks for one Virtual Machine, it's suggested no more than 20 Virtual Machines share the same storage account. Number of virtual machines that hosting managed servers should be less than or equal to 20. + +You can get the name of storage account from Azure portal with steps: + + * Go to Azure portal + * Go to the your resource group + * Find storage account resource and copy its name + +Alternatively, use Azure CLI command to list storage account inside a resource group: + +```shell +$ az resource list -g 'yourResourceGroup' --resource-type Microsoft.Storage/storageAccounts --query [*].name +[ + "219846olvm" +] +``` + +#### Example Parameters JSON + +Here is a fully filled out parameters file. We will leave values of `adminUsername`, `authenticationType`, `dnsLabelPrefix`, `usePreviewImage` and `vmSize` as default value. + +{{ site.data.var.passwordInFileNote }} + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "_artifactsLocation": { + "value": "{{ armTemplateAddCacheNodeBasePath }}" + }, + "adminPasswordOrKey": { + "value": "jyfRat@nht2019" + }, + "adminVMName": { + "value": "adminVM" + }, + "elkSettings": { + "value": { + "enable": true, + "elasticsearchEndpoint":"https://example.eastus2.azure.elastic-cloud.com:9243", + "elasticsearchPassword": "Secret123!", + "elasticsearchUserName":"elastic", + "logIndex": "azure-weblogic-dynamic-cluster-11122020", + "logsToIntegrate": ["HTTPAccessLog", "ServerLog", "DomainLog", "DataSourceLog", "StandardErrorAndOutput", "NodeManagerLog"] + } + }, + "enableCoherenceWebLocalStorage": { + "value": true + }, + "location": { + "value": "eastus" + }, + "managedServerPrefix": { + "value": "msp" + }, + "numberOfExistingCacheNodes": { + "value": 1 + }, + "numberOfNewCacheNodes": { + "value": 1 + }, + "skuUrnVersion": { + "value": "owls-122140-8u251-ol76;Oracle:weblogic-122140-jdk8u251-ol76:owls-122140-8u251-ol7;latest" + }, + "storageAccountName": { + "value": "d40140olvm" + }, + "wlsDomainName": { + "value": "wlsd" + }, + "wlsPassword": { + "value": "welcome1" + }, + "wlsUserName": { + "value": "weblogic" + } + } +} +``` + +## Invoke the ARM template + +Assume your parameters file is available in the current directory and is named `parameters.json`. This section shows the commands to configure your {{ site.data.var.wlsFullBrandName }} deployment to add new nodes. Replace `yourResourceGroup` with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +### First, validate your parameters file + +The `az deployment group validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az deployment group validate --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateAddCacheNodeBasePath }}arm/mainTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Next, execute the template + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az deployment group create --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateAddCacheNodeBasePath }}arm/mainTemplate.json +``` + +As with the validate command, if the command returns with an exit status other than `0`, inspect the output and resolve the problem. + +This is an example output of successful deployment. Look for `"provisioningState": "Succeeded"` in your output. + +```bash +{ + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Resources/deployments/mainTemplate", + "location": null, + "name": "mainTemplate", + "properties": { + "correlationId": "19040fc8-2b74-4e64-9dd9-59a5a3ce401a", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM2/extensions/newuserscript", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM2/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Resources/deployments/pid-157ea8ac-12ae-11eb-adc1-0242ac120002", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "pid-157ea8ac-12ae-11eb-adc1-0242ac120002", + "resourceType": "Microsoft.Resources/deployments" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Network/publicIPAddresses/mspStorageVM2_PublicIP", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM2_PublicIP", + "resourceType": "Microsoft.Network/publicIPAddresses" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Network/networkInterfaces/mspStorageVM2_NIC", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM2_NIC", + "resourceType": "Microsoft.Network/networkInterfaces" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Network/networkInterfaces/mspStorageVM2_NIC", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM2_NIC", + "resourceType": "Microsoft.Network/networkInterfaces" + }, + { + "apiVersion": "2019-06-01", + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Storage/storageAccounts/33f2e3olvm", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "33f2e3olvm", + "resourceType": "Microsoft.Storage/storageAccounts" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM2", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM2", + "resourceType": "Microsoft.Compute/virtualMachines" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM2", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM2", + "resourceType": "Microsoft.Compute/virtualMachines" + }, + { + "actionName": "listKeys", + "apiVersion": "2019-04-01", + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Storage/storageAccounts/33f2e3olvm", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "33f2e3olvm", + "resourceType": "Microsoft.Storage/storageAccounts" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM2/extensions/newuserscript", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM2/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "duration": "PT10M24.4018847S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputResources": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM2", + "resourceGroup": "haiche-cluster-1106" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM2/extensions/newuserscript", + "resourceGroup": "haiche-cluster-1106" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Network/networkInterfaces/mspStorageVM2_NIC", + "resourceGroup": "haiche-cluster-1106" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Network/publicIPAddresses/mspStorageVM2_PublicIP", + "resourceGroup": "haiche-cluster-1106" + } + ], + "outputs": { + "artifactsLocationPassedIn": { + "type": "String", + "value": "{{ armTemplateAddCacheNodeBasePath }}" + } + }, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "{{ armTemplateAddCacheNodeBasePath }}" + }, + "_artifactsLocationSasToken": { + "type": "SecureString" + }, + "adminPasswordOrKey": { + "type": "SecureString" + }, + "adminUsername": { + "type": "String", + "value": "weblogic" + }, + "adminVMName": { + "type": "String", + "value": "adminVM" + }, + "authenticationType": { + "type": "String", + "value": "password" + }, + "dnsLabelPrefix": { + "type": "String", + "value": "wls" + }, + "enableCoherenceWebLocalStorage": { + "type": "Bool", + "value": true + }, + "guidValue": { + "type": "String", + "value": "d5dde421-44b0-48df-9d12-db02374654d3" + }, + "location": { + "type": "String", + "value": "eastus" + }, + "managedServerPrefix": { + "type": "String", + "value": "msp" + }, + "numberOfExistingCacheNodes": { + "type": "Int", + "value": 1 + }, + "numberOfNewCacheNodes": { + "type": "Int", + "value": 1 + }, + "skuUrnVersion": { + "type": "String", + "value": "owls-122130-8u131-ol74;Oracle:weblogic-122130-jdk8u131-ol74:owls-122130-8u131-ol7;latest" + }, + "storageAccountName": { + "type": "String", + "value": "33f2e3olvm" + }, + "usePreviewImage": { + "type": "Bool", + "value": false + }, + "vmSize": { + "type": "String", + "value": "Standard_A1" + }, + "wlsDomainName": { + "type": "String", + "value": "wlsd" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Network", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "publicIPAddresses" + }, + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "networkInterfaces" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines" + }, + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "16596437850900945013", + "templateLink": null, + "timestamp": "2020-11-09T06:28:40.936524+00:00" + }, + "resourceGroup": "haiche-cluster-1106", + "type": "Microsoft.Resources/deployments" +} +``` + +## Verify + +### Verify if new cache nodes are added to the WebLogic Server instance. + +* Go to the {{ site.data.var.wlsFullBrandName }} Administration Console. +* Go to **Environment** -> **Machines**. + + You should see logical machines with name parttern `^{managedServerPrefix}StorageVM[0-9]+$`, machine names with number suffix from `numberOfExistingCacheNodes` to `numberOfExistingCacheNodes + numberOfNewCacheNodes` are added. +* Go to **Environment** -> **Servers** + + You should see servers with name parttern `^{managedServerPrefix}Storage[0-9]+$`, server names with number suffix from `numberOfExistingCacheNodes` to `numberOfExistingCacheNodes + numberOfNewNodes` are added to `storage1`. + +### Verify if Azure resources are added + +* Go to [Azure Portal](https://ms.portal.azure.com/). +* Go to resource group that the {{ site.data.var.wlsFullBrandName }} is deployed. + + You should see corresponding Vitual Machines, Disks, Network Interfaces, Public IPs have been added. diff --git a/cluster/addnode.md b/cluster/addnode.md new file mode 100644 index 000000000..b4bc4baf5 --- /dev/null +++ b/cluster/addnode.md @@ -0,0 +1,741 @@ + + +{% include variables.md %} + +# Add nodes to {{ site.data.var.wlsFullBrandName }} + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} to add new managed application server using Azure CLI. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Azure Active Directory LDAP Instance + +Refer to [Azure Active Directory(AAD) LDAP Instance](aadNestedTemplate.html#azure-active-directory-ldap-instance). + +### Certificate for SSL Termination +Refer to [Configure Azure Application Gateway#Certificate for SSL Termination](appGatewayNestedTemplate.html#certificate-for-ssl-termination). + +### Administering Security for Oracle WebLogic Server & Configuring KeyStores +Refer to [Configuring Keystores](https://docs.oracle.com/en/middleware/fusion-middleware/weblogic-server/12.2.1.4/secmg/identity_trust.html). + +### Generate Base64 string for a given ssl certificate/keystore file + +Use the following command to generate a Base64 string for a given ssl certificate/keystore file, to be used as input in the parameters JSON file + +
base64 /my/path/your-certificate.cer -w 0 >temp.txt
+ + +## Prepare the Parameters JSON file + +You must construct a parameters JSON file containing the parameters to the add-node ARM template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. You must specify the information of the existing {{ site.data.var.wlsFullBrandName }} and nodes that to be added. This section shows how to obtain the values for the following required properties. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Parameter NameExplanation
_artifactsLocationSee below for details.
aadsSettingsOptional. JSON object type. You can specify this parameters for Azure Active Directory integration. If enable is true, must specify other properties.
enableIf enable is true, must specify all properties of the aadSettings.
publicIPThe public IP address of Azure Active Directory LDAP server.
serverHostThe server host of Azure Active Directory LDAP server.
certificateBase64StringThe based64 string of LADP client certificate that will be imported to trust store of WebLogic Server to enable SSL connection of AD provider.
adminPasswordOrKeyPassword of administration account for the new Virtual Machine that host new nodes.
adminURLThe URL of WebLogic Administration Server, usually made up with Virtual Machine name and port, for example: adminVM:7001.
appGatewaySettingsOptional. JSON object type. You can specify these parameters for application gateway configuration. If enable is true, you must specify other properties. If enable is false, the other properties are ignored. See the page Migrate a WebLogic Server cluster to Azure with Azure Application Gateway as a load balancer for further information.
enableIf enable is true, must specify all properties of the appGatewaySettings.
publicIPNameAzure resource name of application gateway public IP, default value is gwip
certificateBase64StringBase64 string of server certificate for application gateway.
certificatePasswordPassword of server certificate.
elkSettingsOptional. JSON object type. You can specify this parameters for Elasticsearch and Kibana(ELK) connection. If enable is true, must specify other properties. See the page WebLogic with Elastic on Azure for further information.
enableIf enable is true, must specify all properties of the elkSettings.
elasticsearchEndpointEndpoint of the Elasticsearch instance.
elasticsearchPasswordPassword for Elasticsearch account.
elasticsearchUserNameUser name for Elasticsearch account.
logIndexMust be the same value output at ELK deployment time.
logsToIntegrateArray with string value. Specify the expeted logs to integrate, you must input at least one log.
enableCoherenceIf true, create application managed server and add to the Coherence cluster application tier.
numberOfExistingNodesThe number of existing managed application servers, used to generate new virtual machine name.
numberOfNewNodesThe number of application managed server to add.
storageAccountNameThe name of an existing storage account.
wlsDomainNameMust be the same value provided at deployment time.
wlsUserNameMust be the same value provided at deployment time.
wlsPasswordMust be the same value provided at deployment time.
customSSLSettingsOptional. JSON object type. You can specify this parameters for configuring Custom SSL Settings for WebLogic Administration Server. If enable is true, must specify other properties. See the page Administering Security for Oracle WebLogic Server and Configuring Keystores for further information.
enableIf enable is true, must specify all properties of the customSSLSettings. +   Set to false by default.
customIdentityKeyStoreBase64StringThe based64 string of the custom identity keystore file that will be configured in the WebLogic Administration Server to enable SSL connection.
customIdentityKeyStorePassPhraseThe identity keystore pass phrase
customIdentityKeyStoreTypeIdentity Key Store Type. This can be either JKS or PKCS12
customTrustKeyStoreBase64StringThe based64 string of the custom trust keystore file that will be configured in the WebLogic Administration Server to enable SSL connection.
customTrustKeyStorePassPhraseThe trust keystore pass phrase
customTrustKeyStoreTypeTrust Key Store Type. This can be either JKS or PKCS12
privateKeyAliasThe private key alias
privateKeyPassPhraseThe private Key Pass phrase.
+ +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateAddNodeBasePath }} +``` + +### Enable SSH Authentication to VMs +If the cluster was deployed with SSH Authentication to VMs enabled, add this variable to your parameter file and fill in the base64 decoded public SSH key string to the `adminPasswordOrKey` field: +``` + "authenticationType": { + "value": "sshPublicKey" + }, + "adminPasswordOrKey": { + "value": "ssh-rsa ...." + }, +``` + +### Enable coherence +If `enableCoherence` is `true`, the template will create Azure resources to host new managed servers, and configure new application nodes to Coherence cluster. If your cluster is not Coherence cluster, please do not set this parameter `true`. + +### Existing managed application servers +To differentiate functionality of managed servers, we use **managed application server** to represent managed servers that host Java EE application, and use **managed cache server** to represent managed servers that used for cache. + +You can get the existing managed application servers with the following command: + +```shell +$ resourceGroup= +$ managedServerPrefix= +$ numberOfExistingNodes=$(az resource list -g ${resourceGroup} --resource-type Microsoft.Compute/virtualMachines --query [*].name | grep "${managedServerPrefix}VM[0-9]" | sed -e 's/[^0-9]/ /g' -e 's/^ *//g' -e 's/ *$//g' | tr -s ' ' | sed 's/ /\n/g' | sort -nr | head -n1) +$ echo ${numberOfExistingNodes} +``` + +### Log index + +If you configured ELK in your cluster to export WebLogic Server logs to ELK, please input the value of Kibana log index, this template will set up ELK connection and export logs to specified index. + +You can get the value from Azure portal with the following steps: + +* Go to Azure portal. +* Open you resource group and click **Deployments**. +* Open the ELK deployment, and click **Output**. +* Copy the value of `logIndex`. + +Alternatively, use Azure CLI command to list log index inside the resource group deployments: + +```shell +$ az deployment group list -g 'yourResourceGroup' --query [*].properties.outputs.logIndex.value +[ + "azure-weblogic-cluster-f984df74-ab4d-4c17-a532-7f248659fb28" +] +``` + +### Storage account + +Each Storage Account handles up to 20,000 IOPS, and 500TB of data. If you use a storage account for Standard Virtual Machines, you can store until 40 virtual disks. + +We have two disks for one Virtual Machine, it's suggested no more than 20 Virtual Machines share the same storage account. Number of virtual machines that hosting managed servers should be less than or equal to 20. + +You can get the name of storage account from Azure portal with steps: + + * Go to Azure portal + * Go to the your resource group + * Find storage account resource and copy its name + +Alternatively, use Azure CLI command to list storage account inside a resource group: + +```shell +$ az resource list -g 'yourResourceGroup' --resource-type Microsoft.Storage/storageAccounts --query [*].name +[ + "219846olvm" +] +``` + +#### Example Parameters JSON + +Here is a fully filled out parameters file, with Azure Active Directory enabled. We will leave values of `adminUsername`, `authenticationType`, `dnsLabelPrefix`, `managedServerPrefix`, `skuUrnVersion`, `usePreviewImage` and `vmSize` as default value. + +{{ site.data.var.passwordInFileNote }} + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "_artifactsLocation": { + "value": "{{ armTemplateAddNodeBasePath }}" + }, + "aadsSettings": { + "value": { + "enable": true, + "publicIP":"13.68.244.90", + "serverHost": "ladps.wls-security.com", + "certificateBase64String":"LS0tLS1C...tLS0tLQ0K" + } + }, + "adminPasswordOrKey": { + "value": "Secret123!" + }, + "adminURL":{ + "value": "adminVM:7001" + }, + "appGatewaySettings": { + "value": { + "enable": true, + "publicIPName": "gwip", + "certificateBase64String": "MIIKQQI...gIIAA==", + "certificatePassword": "Secret123!" + } + }, + "elkSettings": { + "value": { + "enable": true, + "elasticsearchEndpoint":"https://example.eastus2.azure.elastic-cloud.com:9243", + "elasticsearchPassword": "Secret123!", + "elasticsearchUserName":"elastic", + "logIndex": "azure-weblogic-dynamic-cluster-11122020", + "logsToIntegrate": ["HTTPAccessLog", "ServerLog", "DomainLog", "DataSourceLog", "StandardErrorAndOutput", "NodeManagerLog"] + } + }, + "location": { + "value": "eastus" + }, + "numberOfExistingNodes": { + "value": 4 + }, + "numberOfNewNodes": { + "value": 3 + }, + "storageAccountName": { + "value": "496dfdolvm" + }, + "wlsDomainName": { + "value": "wlsd" + }, + "wlsUserName": { + "value": "weblogic" + }, + "wlsPassword": { + "value": "welcome1" + }, + "customSSLSettings": { + "value": { + "enable": true, + "customIdentityKeyStoreBase64String": "/u3+7QAAAAIAAAABAAAAAQAKc2VydmV....QZL24ljJLq", + "customIdentityKeyStorePassPhrase": "mypassword", + "customIdentityKeyStoreType": "JKS", + "customTrustKeyStoreBase64String": "/u3+7QAAAAIAAAABAAAAAgAJdHJ1c3R....Td4bYVnONyS0PC7k=", + "customTrustKeyStorePassPhrase": "mypassword", + "customTrustKeyStoreType": "JKS", + "privateKeyAlias": "servercert", + "privateKeyPassPhrase": "mypassword" + } + } + } +} +``` + +## Invoke the ARM template + +Assume your parameters file is available in the current directory and is named `parameters.json`. This section shows the commands to configure your {{ site.data.var.wlsFullBrandName }} deployment to add new nodes. Replace `yourResourceGroup` with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +### First, validate your parameters file + +The `az group deployment validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az group deployment validate --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateAddNodeBasePath }}arm/mainTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Next, execute the template + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az group deployment create --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateAddNodeBasePath }}arm/mainTemplate.json +``` + +As with the validate command, if the command returns with an exit status other than `0`, inspect the output and resolve the problem. + +This is an example output of successful deployment. Look for `"provisioningState": "Succeeded"` in your output. + +```bash +{ + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Resources/deployments/mainTemplate", + "location": null, + "name": "mainTemplate", + "properties": { + "correlationId": "54517529-a1c4-422f-a539-23b9a5129e80", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Compute/virtualMachines/mspVM7/extensions/newuserscript", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "mspVM7/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Resources/deployments/pid-c7671c10-ae59-5ec5-bff3-c60db22d7ea4", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "pid-c7671c10-ae59-5ec5-bff3-c60db22d7ea4", + "resourceType": "Microsoft.Resources/deployments" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Network/publicIPAddresses/mspVM7_PublicIP", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "mspVM7_PublicIP", + "resourceType": "Microsoft.Network/publicIPAddresses" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Network/networkInterfaces/mspVM7_NIC", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "mspVM7_NIC", + "resourceType": "Microsoft.Network/networkInterfaces" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Network/networkInterfaces/mspVM7_NIC", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "mspVM7_NIC", + "resourceType": "Microsoft.Network/networkInterfaces" + }, + { + "apiVersion": "2019-06-01", + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Storage/storageAccounts/09b943olvm", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "09b943olvm", + "resourceType": "Microsoft.Storage/storageAccounts" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Compute/virtualMachines/mspVM7", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "mspVM7", + "resourceType": "Microsoft.Compute/virtualMachines" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Compute/virtualMachines/mspVM7", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "mspVM7", + "resourceType": "Microsoft.Compute/virtualMachines" + }, + { + "actionName": "listKeys", + "apiVersion": "2019-04-01", + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Storage/storageAccounts/09b943olvm", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "09b943olvm", + "resourceType": "Microsoft.Storage/storageAccounts" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Compute/virtualMachines/mspVM7/extensions/newuserscript", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "mspVM7/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "duration": "PT9M6.8098765S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputResources": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Compute/virtualMachines/mspVM7", + "resourceGroup": "oraclevm-dcluster-0727" + }, + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Compute/virtualMachines/mspVM7/extensions/newuserscript", + "resourceGroup": "oraclevm-dcluster-0727" + }, + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Network/networkInterfaces/mspVM7_NIC", + "resourceGroup": "oraclevm-dcluster-0727" + }, + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Network/publicIPAddresses/mspVM7_PublicIP", + "resourceGroup": "oraclevm-dcluster-0727" + } + ], + "outputs": { + "wlsDomainLocation": { + "type": "String", + "value": "/u01/domains/wlsd" + } + }, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "{{ armTemplateAddNodeBasePath }}" + }, + "_artifactsLocationSasToken": { + "type": "SecureString" + }, + "aadsSettings": { + "type": "Object", + "value": { + "certificateBase64String": "LS0tLS1C...S0tLQ0K", + "enable": true, + "publicIP": "40.76.11.111", + "serverHost": "ladps.wls-security.com" + } + }, + "adminPasswordOrKey": { + "type": "SecureString" + }, + "adminURL": { + "type": "String", + "value": "adminVM:7001" + }, + "adminUsername": { + "type": "String", + "value": "weblogic" + }, + "authenticationType": { + "type": "String", + "value": "password" + }, + "dnsLabelPrefix": { + "type": "String", + "value": "wls" + }, + "guidValue": { + "type": "String", + "value": "67657ba3-6248-46e5-bedc-53e16ac82571" + }, + "location": { + "type": "String", + "value": "eastus" + }, + "managedServerPrefix": { + "type": "String", + "value": "msp" + }, + "numberOfExistingNodes": { + "type": "Int", + "value": 7 + }, + "numberOfNewNodes": { + "type": "Int", + "value": 1 + }, + "skuUrnVersion": { + "type": "String", + "value": "owls-122130-8u131-ol74;Oracle:weblogic-122130-jdk8u131-ol74:owls-122130-8u131-ol7;1.1.1" + }, + "storageAccountName": { + "type": "String", + "value": "09b943olvm" + }, + "usePreviewImage": { + "type": "Bool", + "value": false + }, + "vmSize": { + "type": "String", + "value": "Standard_A3" + }, + "wlsDomainName": { + "type": "String", + "value": "wlsd" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + }, + "customSSLSettings": { + "type": "Object", + "value": { + "enable": true, + "customIdentityKeyStoreBase64String": "/u3+7QAAAAIAAAABAAAAAQAKc2VydmV....QZL24ljJLq", + "customIdentityKeyStorePassPhrase": "mypassword", + "customIdentityKeyStoreType": "JKS", + "customTrustKeyStoreBase64String": "/u3+7QAAAAIAAAABAAAAAgAJdHJ1c3R....Td4bYVnONyS0PC7k=", + "customTrustKeyStorePassPhrase": "mypassword", + "customTrustKeyStoreType": "JKS", + "privateKeyAliasSecret": "servercert", + "privateKeyPassPhraseSecret": "mypassword" + } + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Network", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "publicIPAddresses" + }, + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "networkInterfaces" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines" + }, + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "15879952829017360289", + "templateLink": { + "contentVersion": "1.0.0.0", + "uri": "{{ armTemplateAddNodeBasePath }}arm/mainTemplate.json" + }, + "timestamp": "2020-07-27T12:37:03.733682+00:00" + }, + "resourceGroup": "oraclevm-dcluster-0727", + "type": "Microsoft.Resources/deployments" +} +``` + +## Verify + +### Verify if new nodes are added to the WebLogic Server instance. + +* Go to the {{ site.data.var.wlsFullBrandName }} Administration Console. +* Go to **Environment** -> **Machines**. + + You should see logical machines with name parttern `^{managedServerPrefix}VM[0-9]+`, machine names with number suffix from `numberOfExistingNodes` to `numberOfExistingNodes + numberOfNewNodes` are added. +* Go to **Environment** -> **Servers** + + You should see servers with name parttern `^{managedServerPrefix}[0-9]+$`, server names with number suffix from `numberOfExistingNodes` to `numberOfExistingNodes + numberOfNewNodes` are added to `cluster1`. + + +### Verify if the newly added server has SSL configured successfully +* If the input parameter customSSLSettings.enable is set to true and the required custom SSL configuration values have been provided, then you should see the SSL configuration for the newly added server under **Environment** -> **Servers** -> **New Server** -> **Keystores** + +### Verify if Azure resources are added + +* Go to [Azure Portal](https://ms.portal.azure.com/). +* Go to resource group that the {{ site.data.var.wlsFullBrandName }} is deployed. + + You should see corresponding Vitual Machines, Disks, Network Interfaces, Public IPs have been added. + +### Verify AAD Integration + +Verify AAD integration by delpoying a simple Java EE applciation with basic authentication. + +* Go to Administration Server Console and deploy [testing application](../resources/basicauth.war). + * Select **Deployments**. + * Select **Install**. + * Select file `basicauth.war`. + * Select **Next**. Choose "Install this deployment as an application". + * Select **Next**. Select "cluster-1" and "All servers in the cluster". + * Keep configuration as default and select **Finish**. + * Select **Activate Changes** + * In the left navigation pane, select **Deployments**. + * Select **Control** + * Select `basicauth` + * Select **Start** + * Select **Servicing all requests** + +* Access the sample application + * Go to Administration Server Console + * Go to **Environment -> Machines**. Click one of the new machines, make sure there are servers running on that machine. Click **Node Manager** and make note of the machine host in **Listen Address**, here named it as `machineName`. Click **Servers** and make note of **Listen Port**, here named it as `port`. + * Go to [Azure Portal](https://ms.portal.azure.com/), and get DNS name from Virtual Machine has the same name of `machineName`, named it `machineDNS` + * Go to `http://${machineDNS}:${port}/basicauth`, the browser will prompt up to ask for credentials, input one of AAD users from group **AAD DC Administrators**, note that use name should be **sAMAccountName**, for example `wlstest` for user `wlstest@javaeehotmailcom.onmicrosoft.com`. + * Expected result, you can access the sample application without error. diff --git a/cluster/appGatewayNestedTemplate.md b/cluster/appGatewayNestedTemplate.md new file mode 100644 index 000000000..73d4a0f6b --- /dev/null +++ b/cluster/appGatewayNestedTemplate.md @@ -0,0 +1,372 @@ + + +{% include variables.md %} + +# Apply Azure App Gateway ARM Template to {{ site.data.var.wlsFullBrandName }} + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} with Azure Application Gateway using the Azure CLI. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The Application Gateway ARM tempate will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Certificate for SSL Termination + +Because the Application Gateway serves as the front end load balancer for the {{ site.data.var.wlsFullBrandName }} cluster, it must be provided with a certificate to allow browsers to connect via SSL. + +When deploying the {{ site.data.var.wlsFullBrandName }} offer from the Azure Portal, you can configure the deployment to fetch the SSL certificate and its password from a pre-existing Azure Key Vault. For a high-level introduction to SSL Certificates with Azure Key Vault see [Get started with Key Vault certificates](https://docs.microsoft.com/en-us/azure/key-vault/certificates/certificate-scenarios). For an overview of TLS termination with Application Gateway see [Overview of TLS termination and end to end TLS with Application Gateway](https://docs.microsoft.com/en-us/azure/application-gateway/ssl-overview). When configuring the Application Gateway after deployment, you must base64 encode the certificate and also know the password for the certificate. + +## Prepare the Parameters JSON file + +You must construct a parameters JSON file containing the parameters to the database ARM template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. We must specify the information of the existing SSL certificate. This section shows how to obtain the values for the following required properties. + +| Parameter Name | Explanation | +|----------------|-------------| +| `_artifactsLocation`| See below for details. | +| `adminVMName`| At deployment time, if this value was changed from its default value, the value used at deployment time must be used. Otherwise, this parameter should be omitted. | +| `customDomainName`| Specify a custome domain name if want to override application gateway hostname. You are required to input the value if you use a pre-assigned SSL for application gateway. | +| `appGatewaySSLCertificateData`| See below for details. | +| `appGatewaySSLCertificatePassword`| See below for details. | +| `dnsNameforApplicationGateway`| (optional) A prefix value for the dns name of the Application Gateway. | +| `gatewayPublicIPAddressName` | (optional) A prefix value for the public IP address of the Application Gateway. | +| `location` | Must be the same region into which the server was initially deployed. | +| `managedServerPrefix` | At deployment time, if this value was changed from its default value, the value used at deployment time must be used. Otherwise, this parameter should be omitted. | +| `numberOfInstances` | The number of instances in the cluster. Must be the same as the value used at deployment time. | +| `overrideHostName` | If `true` the template will override the application gateway hostname with value of `customDomainName`. The vaule should be `true` if you use a pre-assigned SSL for application gateway. | +| `wlsDomainName` | At deployment time, if this value was changed from its default value, the value used at deployment time must be used. Otherwise, this parameter should be omitted. | +| `wlsPassword` | Must be the same value provided at deployment time. | +| `wlsUserName` | Must be the same value provided at deployment time. | + +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateBasePath }} +``` + +### SSL Certificate Data and Password + +Use base64 to encode your existing PFX format certificate. + +```bash +base64 your-certificate.pfx -w 0 >temp.txt +``` + +Use the content as this file as the value of the `appGatewaySSLCertificateData` parameter. + +It is assumed that you have the password for the certificate. Use this as the value of the `appGatewaySSLCertificatePassword` parameter. + +#### Example Parameters JSON + +Here is a fully filled out parameters file. Note that we did not include any optional parameters, assuming the {{ site.data.var.wlsFullBrandName }} was deployed accepting the default values. + +{{ site.data.var.passwordInFileNote }} + + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "_artifactsLocation":{ + "value": "{{ armTemplateBasePath }}" + }, + "appGatewaySSLCertificateData": { + "value": "MIIKCQIB...sOr3QICCAA=" + }, + "appGatewaySSLCertificatePassword": { + "value": "myPasswordInClearText" + }, + "numberOfInstances": { + "value": 3 + }, + "location": { + "value": "eastus" + }, + "wlsPassword": { + "value": "welcome1" + }, + "wlsUserName": { + "value": "weblogic" + } + } +} +``` + +## Invoke the ARM template + +Assume your parameters file is available in the current directory and is named `parameters.json`. This section shows the commands to configure your {{ site.data.var.wlsFullBrandName }} deployment with the specified database. Replace `yourResourceGroup` with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +### First, validate your parameters file + +The `az group deployment validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az group deployment validate --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/appGatewayNestedTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Next, execute the template + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az group deployment create --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/appGatewayNestedTemplate.json +``` + +As with the validate command, if the command returns with an exit status other than `0`, inspect the output and resolve the problem. + +This is an example output of successful deployment. Look for `"provisioningState": "Succeeded"` in your output. + +```json +{ + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-0604/providers/Microsoft.Resources/deployments/cli", + "location": null, + "name": "cli", + "properties": { + "correlationId": "4cc63f27-0f43-4244-9d89-a09bf417e943", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-0604/providers/Microsoft.Network/publicIPAddresses/gwip", + "resourceGroup": "oraclevm-cluster-0604", + "resourceName": "gwip", + "resourceType": "Microsoft.Network/publicIPAddresses" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-0604/providers/Microsoft.Network/applicationGateways/myAppGateway", + "resourceGroup": "oraclevm-cluster-0604", + "resourceName": "myAppGateway", + "resourceType": "Microsoft.Network/applicationGateways" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-0604/providers/Microsoft.Network/applicationGateways/myAppGateway", + "resourceGroup": "oraclevm-cluster-0604", + "resourceName": "myAppGateway", + "resourceType": "Microsoft.Network/applicationGateways" + }, + { + "apiVersion": "2019-11-01", + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-0604/providers/Microsoft.Network/publicIPAddresses/gwip", + "resourceGroup": "oraclevm-cluster-0604", + "resourceName": "gwip", + "resourceType": "Microsoft.Network/publicIPAddresses" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-0604/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-cluster-0604", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-0604/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-cluster-0604", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-0604/providers/Microsoft.Resources/deployments/pid-36deb858-08fe-5c07-bc77-ba957a59a080", + "resourceGroup": "oraclevm-cluster-0604", + "resourceName": "pid-36deb858-08fe-5c07-bc77-ba957a59a080", + "resourceType": "Microsoft.Resources/deployments" + } + ], + "duration": "PT8M41.2104793S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputResources": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-0604/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-cluster-0604" + }, + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-0604/providers/Microsoft.Network/applicationGateways/myAppGateway", + "resourceGroup": "oraclevm-cluster-0604" + }, + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-0604/providers/Microsoft.Network/publicIPAddresses/gwip", + "resourceGroup": "oraclevm-cluster-0604" + } + ], + "outputs": { + "appGatewayURL": { + "type": "String", + "value": "http://wlsgw9e6ed1-oraclevm-cluster-0604-wlsd.eastus.cloudapp.azure.com" + } + }, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + }, + "_artifactsLocationAGWTemplate": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + }, + "_artifactsLocationSasToken": { + "type": "SecureString" + }, + "adminVMName": { + "type": "String", + "value": "adminVM" + }, + "appGatewaySSLCertificateData": { + "type": "String", + "value": "MIIKQQIBAz....EkAgIIAA==" + }, + "appGatewaySSLCertificatePassword": { + "type": "String", + "value": "myRedactedPassword" + }, + "dnsNameforApplicationGateway": { + "type": "String", + "value": "wlsgw" + }, + "gatewayPublicIPAddressName": { + "type": "String", + "value": "gwip" + }, + "guidValue": { + "type": "String", + "value": "9e6ed15b-d386-4cb9-a617-3cb6f785f6a0" + }, + "location": { + "type": "String", + "value": "eastus" + }, + "managedServerPrefix": { + "type": "String", + "value": "msp" + }, + "numberOfInstances": { + "type": "Int", + "value": 4 + }, + "wlsDomainName": { + "type": "String", + "value": "wlsd" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Network", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "publicIPAddresses" + }, + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "applicationGateways" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "12239709219097081949", + "templateLink": null, + "timestamp": "2020-06-04T03:17:01.168329+00:00" + }, + "resourceGroup": "oraclevm-cluster-0604", + "type": "Microsoft.Resources/deployments" +} +``` + +## Verify Application Gateway + +We will deploy a testing application to verify if the appliaction gateway is enabled. + +Go to Admin Server Console and deploy [webtestapp.war](../resources/webtestapp.war). + +* Visit the {{ site.data.var.wlsFullBrandName }} Admin console. +* Select **Deployments**. +* Select **Install**. +* Select file `webtestapp.war`. +* Select **Next**. Choose "Install this deployment as an application". +* Select **Next**. Select "cluster-1" and "All servers in the cluster". +* Keep configuration as default and select **Finish**. +* Select **Activate Changes** +* In the left navigation pane, select **Deployments**. +* Select **Control** +* Select `webtestapp` +* Select **Start** +* Select **Servicing all requests** + +Then access the application with `/webtestapp`, you will get a page with server host information if application gateway was successfully enabled. diff --git a/cluster/coherenceTemplate.md b/cluster/coherenceTemplate.md new file mode 100644 index 000000000..401c1ec9a --- /dev/null +++ b/cluster/coherenceTemplate.md @@ -0,0 +1,533 @@ + + +{% include variables.md %} + +# Configure Coherence cluster to {{ site.data.var.wlsFullBrandName }} + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} with a Coherence cluster using Azure CLI. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The Coherence ARM template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +**Note:** if you have enabled Coherence in the initial offer deployment from Azure portal, the Coherence cluster has been set up, you don't need to run Coherence tempalte. + +### Elasticsearch instance + +Optional. + +Refer to [Create an an Elastic on Azure instance](https://aka.ms/arm-oraclelinux-wls-elk#create-an-an-elastic-on-azure-instance) + +## Prepare the Parameters JSON file + +You must construct a parameters JSON file containing the parameters to the Coherence ARM template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. + +The deployment of coherenceTemplate.json will: + * Provision Azure resources, including virtual machine, network interface, disk, public IP to host new Coherence cache servers. + * Configure WebLogic Coherence cluster, including: + * Create Coherence cluster `myCoherence` + * Create data tier `storage1` cluster. + * Associate `cluster1` and `storage1` to `myCoherence` cluster. + * Create cache servers and assign them to `storage1` cluster. + +We must specify the information of the existing {{ site.data.var.wlsFullBrandName }}. This section shows how to obtain the values for the following required properties. + +| Parameter Name | Explanation | +|----------------|-------------| +| `_artifactsLocation`| See below for details. | +| `adminPasswordOrKey` | SSH Key or password for the Virtual Machine. SSH key is recommended. | +| `adminVMName`| Virtual machine name of which hosts the {{ site.data.var.wlsFullBrandName }} admin server. | +| `elasticsearchEndpoint` | The Elasticsearch endpoint. | +| `elasticsearchPassword` | Password for the Elasticsearch account. | +| `elasticsearchUserName` | User name for the Elasticsearch account. | +| `enableCoherenceWebLocalStorage` | Specifies whether Local Storage is enabled for the Coherence*Web cluster tier. | +| `enableELK` | If true, use the supplied parameters to distribute WebLogic Server logs to the Elasticsearch instance. | +| `location` | Must be the same region into which the server was initially deployed. | +| `logIndex` | Elasticsearch index you expect to export the logs to. Must be the same value with output from initial ELK deployment. | +| `logsToIntegrate` | Specify the WebLogic logs to export to Elasticsearch, you must select at least one log. | +| `managedServerPrefix` | Must be the same prefix with which the cluster was initially deployed. | +| `numberOfCoherenceCacheInstances` | Number of Coherence cache servers, used to create Virtual Machines and Managed Server. | +| `skuUrnVersion` | Must be the same urn with which the cluster was initially deployed. | +| `storageAccountName` | The name of an existing storage account. | +| `vmSizeSelectForCoherence` | Select appropriate VM Size for Coherence cache servers. | +| `wlsDomainName` | Must be the same value provided at initial deployment time. | +| `wlsPassword` | Must be the same value provided at initial deployment time. | +| `wlsUserName` | Must be the same value provided at initial deployment time. | + +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateBasePath }} +``` + +### Log index + +If you configured ELK in your cluster to export WebLogic Server logs to ELK, please input the value of Kibana log index, this template will set up ELK connection and export logs to specified index. + +You can get the value from Azure portal with the following steps: + +* Go to Azure portal. +* Open you resource group and click **Deployments**. +* Open the ELK deployment, and click **Output**. +* Copy the value of `logIndex`. + +Alternatively, use Azure CLI command to list log index inside the resource group deployments: + +```shell +$ az deployment group list -g 'yourResourceGroup' --query [*].properties.outputs.logIndex.value +[ + "azure-weblogic-cluster-f984df74-ab4d-4c17-a532-7f248659fb28" +] +``` + +### Storage account + +Each Storage Account handles up to 20,000 IOPS, and 500TB of data. If you use a storage account for Standard Virtual Machines, you can store until 40 virtual disks. + +We have two disks for one Virtual Machine, it's suggested no more than 20 Virtual Machines share the same storage account. Number of virtual machines that hosting managed servers should be less than or equal to 20. + +You can get the name of storage account from Azure portal with steps: + + * Go to Azure portal + * Go to the your resource group + * Find storage account resource and copy its name + +Alternatively, use Azure CLI command to list storage account inside a resource group: + +```shell +$ az resource list -g 'yourResourceGroup' --resource-type Microsoft.Storage/storageAccounts --query [*].name +[ + "219846olvm" +] +``` + +#### Example Parameters JSON + +Here is a fully filled out parameters file. This is an example to set up Coherence*Web. We will leave values of `adminUsername`, `authenticationType`, `dnsLabelPrefix`, and `usePreviewImage` as default value. + +{{ site.data.var.passwordInFileNote }} + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "_artifactsLocation": { + "value": "{{ armTemplateBasePath }}" + }, + "adminPasswordOrKey": { + "value": "jyfRat@nht2019" + }, + "adminVMName": { + "value": "adminVM" + }, + "elasticsearchEndpoint": { + "value": "https://example.eastus2.azure.elastic-cloud.com:9243" + }, + "elasticsearchPassword": { + "value": "Secret123!" + }, + "elasticsearchUserName": { + "value": "elastic" + }, + "enableCoherenceWebLocalStorage": { + "value": true + }, + "enableELK": { + "value": true + }, + "managedServerPrefix": { + "value": "msp" + }, + "location": { + "value": "eastus" + }, + "logIndex": { + "value": "azure-weblogic-cluster-11122020" + }, + "logsToIntegrate": { + "value": ["HTTPAccessLog", "ServerLog", "DomainLog", "DataSourceLog", "StandardErrorAndOutput","NodeManagerLog"] + }, + "numberOfCoherenceCacheInstances": { + "value": 1 + }, + "skuUrnVersion": { + "value": "owls-122140-8u251-ol76;Oracle:weblogic-122140-jdk8u251-ol76:owls-122140-8u251-ol7;latest" + }, + "storageAccountName": { + "value": "d40140olvm" + }, + "vmSizeSelectForCoherence": { + "value": "Standard_A1" + }, + "wlsDomainName": { + "value": "wlsd" + }, + "wlsPassword": { + "value": "welcome1" + }, + "wlsUserName": { + "value": "weblogic" + } + } +} +``` + +## Invoke the ARM template + +Assume your parameters file is available in the current directory and is named `parameters.json`. This section shows the commands to configure your {{ site.data.var.wlsFullBrandName }} deployment with a Coherence cluster. Replace `yourResourceGroup` with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +### First, validate your parameters file + +The `az deployment group validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az deployment group validate --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/coherenceTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Next, execute the template + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az deployment group create --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/coherenceTemplate.json +``` + +As with the validate command, if the command returns with an exit status other than `0`, inspect the output and resolve the problem. + +This is an example output of successful deployment. Look for `"provisioningState": "Succeeded"` in your output. + +```json +{ + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Resources/deployments/coherenceTemplate", + "location": null, + "name": "coherenceTemplate", + "properties": { + "correlationId": "07555c54-2384-4ca3-b427-6cf7d8b53052", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM1/extensions/newuserscript", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM1/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Resources/deployments/pid-157eaa6e-12ae-11eb-adc1-0242ac120002", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "pid-157eaa6e-12ae-11eb-adc1-0242ac120002", + "resourceType": "Microsoft.Resources/deployments" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Network/publicIPAddresses/mspStorageVM1_PublicIP", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM1_PublicIP", + "resourceType": "Microsoft.Network/publicIPAddresses" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Network/networkInterfaces/mspStorageVM1_NIC", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM1_NIC", + "resourceType": "Microsoft.Network/networkInterfaces" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Network/networkInterfaces/mspStorageVM1_NIC", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM1_NIC", + "resourceType": "Microsoft.Network/networkInterfaces" + }, + { + "apiVersion": "2019-06-01", + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Storage/storageAccounts/33f2e3olvm", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "33f2e3olvm", + "resourceType": "Microsoft.Storage/storageAccounts" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM1", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM1", + "resourceType": "Microsoft.Compute/virtualMachines" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM1", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM1", + "resourceType": "Microsoft.Compute/virtualMachines" + }, + { + "actionName": "listKeys", + "apiVersion": "2019-06-01", + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Storage/storageAccounts/33f2e3olvm", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "33f2e3olvm", + "resourceType": "Microsoft.Storage/storageAccounts" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM1", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM1", + "resourceType": "Microsoft.Compute/virtualMachines" + }, + { + "actionName": "listKeys", + "apiVersion": "2019-06-01", + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Storage/storageAccounts/33f2e3olvm", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "33f2e3olvm", + "resourceType": "Microsoft.Storage/storageAccounts" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM1/extensions/newuserscript", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM1/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "duration": "PT9M26.6278882S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputResources": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "haiche-cluster-1106" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM1", + "resourceGroup": "haiche-cluster-1106" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM1/extensions/newuserscript", + "resourceGroup": "haiche-cluster-1106" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Network/networkInterfaces/mspStorageVM1_NIC", + "resourceGroup": "haiche-cluster-1106" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Network/publicIPAddresses/mspStorageVM1_PublicIP", + "resourceGroup": "haiche-cluster-1106" + } + ], + "outputs": { + "artifactsLocationPassedIn": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + } + }, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + }, + "_artifactsLocationCoherenceTemplate": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + }, + "_artifactsLocationSasToken": { + "type": "SecureString" + }, + "adminPasswordOrKey": { + "type": "SecureString" + }, + "adminUsername": { + "type": "String", + "value": "weblogic" + }, + "adminVMName": { + "type": "String", + "value": "adminVM" + }, + "authenticationType": { + "type": "String", + "value": "password" + }, + "dnsLabelPrefix": { + "type": "String", + "value": "wls" + }, + "enableCoherenceWebLocalStorage": { + "type": "Bool", + "value": true + }, + "guidValue": { + "type": "String", + "value": "b4c17707-b932-43f0-a4cc-6d6990bb850f" + }, + "location": { + "type": "String", + "value": "eastus" + }, + "managedServerPrefix": { + "type": "String", + "value": "msp" + }, + "numberOfCoherenceCacheInstances": { + "type": "Int", + "value": 1 + }, + "skuUrnVersion": { + "type": "String", + "value": "owls-122130-8u131-ol74;Oracle:weblogic-122130-jdk8u131-ol74:owls-122130-8u131-ol7;latest" + }, + "storageAccountName": { + "type": "String", + "value": "33f2e3olvm" + }, + "usePreviewImage": { + "type": "Bool", + "value": false + }, + "vmSizeSelectForCoherence": { + "type": "String", + "value": "Standard_A1" + }, + "wlsDomainName": { + "type": "String", + "value": "wlsd" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Network", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "publicIPAddresses" + }, + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "networkInterfaces" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines" + }, + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "7840329080326569798", + "templateLink": null, + "timestamp": "2020-11-06T08:48:57.229200+00:00" + }, + "resourceGroup": "haiche-cluster-1106", + "type": "Microsoft.Resources/deployments" +} +``` + +## Verify Coherence cluster + +Follow the steps to check if Coherence*Web is enabled. + +* Follow the example parameters to set up Coherence*Web. +* Go to admin console portal. +* Deploy [coherence-sample.war](../resources/coherence-sample.war) to `cluster1`. + Please select `cluster1` in the Targets page. +* Start `coherence-sample`. +* Open the sample with browser, click "add session" to add session infomation. Click "test session" to verify. + +If the Coherence cluster does not set up successfully, the application deployment will fail. + +If the cache server does not work correctly, session can not be saved, as we disabled local storage in application servers. diff --git a/cluster/customDNSTemplate.md b/cluster/customDNSTemplate.md new file mode 100644 index 000000000..dd7a3c2c2 --- /dev/null +++ b/cluster/customDNSTemplate.md @@ -0,0 +1,168 @@ + + +{% include variables.md %} + +# Configure DNS alias to {{ site.data.var.wlsFullBrandName }} + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} with a custom DNS alias. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The DNS Configuraton ARM template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Registered Domain Name + +You need to buy a domain name to create a custom DNS alias. + +### Azure DNS Zone + +If you create the DNS alias on an existing [Azure DNS Zone](https://docs.microsoft.com/en-us/azure/dns/dns-overview), make sure you have perfomed the [Azure DNS Delegation](https://docs.microsoft.com/en-us/azure/dns/dns-domain-delegation). After you have completed the delegation, you can verify it with `nslookup`. For example, assuming your domain name is **contoso.com**, this output shows a correct delegation. + +```bash +$ nslookup -type=SOA contoso.com +Server: 172.29.80.1 +Address: 172.29.80.1#53 + +Non-authoritative answer: +contoso.com + origin = ns1-01.azure-dns.com + mail addr = azuredns-hostmaster.microsoft.com + serial = 1 + refresh = 3600 + retry = 300 + expire = 2419200 + minimum = 300 +Name: ns1-01.azure-dns.com +Address: 40.90.4.1 +Name: ns1-01.azure-dns.com +Address: 2603:1061::1 +``` + +We strongly recommand you create an Azure DNS Zone for domain management and reuse it for other perpose. Follow the [guide](https://docs.microsoft.com/en-us/azure/dns/dns-getstarted-portal) to create an Azure DNS Zone. + +## Prepare the Parameters + +We provide an automation shell script for DNS configuration. You must specify the information of the existing Oracle WebLogic Server. This section shows how to obtain the values for the following required properties. + +| Parameter Name             | Explanation | +|----------------|-------------| +| `--admin-vm-name`| Required. Name of vitual machine that hosts {{ site.data.var.wlsFullBrandName }} admin server. Must be the same value provided at initial deployment time.| +| `--admin-console-label` | Required. Label for {{ site.data.var.wlsFullBrandName }} admin console. Used to generate subdomain of admin console. | +| `--artifact-location`| Required. See below for details. | +| `--resource-group` | Required. Name of resource group that has an {{ site.data.var.wlsFullBrandName }} cluster deployed. | +| `--location ` | Required. Must be the same region into which the server was initially deployed. | +| `--zone-name ` | Required. Azure DNS Zone name. | +| `--gateway-label` | Optional. Label for applciation gateway. Used to generate subdomain of application gateway. The parameter is only required if you want to create DNS alias for application gateway.| +| `--zone-resource-group` | Optional. Name of resource group that has Azure DNS Zone deployed. The parameter is only required if you are creating DNS alias on an existing DNS Zone. | +| `--help` | Help. | + +### Artifacts location + +This value must be the following. + +```bash +{{ armTemplateBasePath }} +``` + +## Invoke the Automation Script + +We provide an automation script to configure a custom DNS alias. The script lets you do the following: + + * If you have an Azure DNS Zone, it will create a DNS alias for the admin console and application gateway on the existing DNS Zone. + * If you don't have an Azure DNS Zone, it will create the DNS Zone in the same resource group as the {{ site.data.var.wlsFullBrandName }} cluster, then create the DNS alias for the admin console and application gateway. + +### Configure DNS Alias on an Existing Azure DNS Zone + +To configure a DNS alias on an existing Azure DNS Zone, in addition to the required parameters, you must also specify an Azure user-assigned managed identity ID and the resource group name in which your DNS Zone is deployed. + +This is an example to create a DNS alias `admin.contoso.com` for the admin console and `applciations.contoso.com` for the application gateway on an existing Azure DNS Zone. + +```bash +$ curl -fsSL {{ site.data.var.artifactsLocationBase }}/{{ site.data.var.artifactsLocationTag }}/{{site.data.var.artifactsLocationSubPathForVM}}{{ pageDir }}/cli-scripts/custom-dns-alias-cli.sh \ + | /bin/bash -s -- \ + --resource-group `yourResourceGroup` \ + --admin-vm-name adminVM \ + --admin-console-label admin \ + --artifact-location {{ armTemplateBasePath }} \ + --location eastus \ + --zone-name contoso.com \ + --gateway-label applications \ + --zone-resource-group `yourDNSZoneResourceGroup` +``` + +An example output: + +```text +Done! + +Custom DNS alias: + Resource group: haiche-dns-doc + WebLogic Server Administration Console URL: http://admin.contoso.com:7001/console + WebLogic Server Administration Console secured URL: https://admin.contoso.com:7002/console + + + Application Gateway URL: http://applications.contoso.com + Application Gateway secured URL: https://applications.contoso.com +``` + + +### Configure DNS Alias on a New Azure DNS Zone + +To configure a DNS alias on a new Azure DNS Zone, you must specify the required parameters. + +This is an example of creating an Azure DNS Zone, then creating a DNS alias `admin.contoso.com` for the admin console and `applications.contoso.com` for application gateway. + +```bash +$ curl -fsSL {{ site.data.var.artifactsLocationBase }}/{{ site.data.var.artifactsLocationTag }}/{{site.data.var.artifactsLocationSubPathForVM}}{{ pageDir }}/cli-scripts/custom-dns-alias-cli.sh \ + | /bin/bash -s -- \ + --resource-group `yourResourceGroup` \ + --admin-vm-name adminVM \ + --admin-console-label admin \ + --artifact-location {{ armTemplateBasePath }} \ + --location eastus \ + --zone-name contoso.com \ + --gateway-label applications +``` + +An example output: + +```text +DONE! + + +Action required: + Complete Azure DNS delegation to make the alias accessible. + Reference: https://aka.ms/dns-domain-delegation + Name servers: + [ + "ns1-02.azure-dns.com.", + "ns2-02.azure-dns.net.", + "ns3-02.azure-dns.org.", + "ns4-02.azure-dns.info." + ] + +Custom DNS alias: + Resource group: haiche-dns-doc + WebLogic Server Administration Console URL: http://admin.contoso.com:7001/console + WebLogic Server Administration Console secured URL: https://admin.contoso.com:7002/console + + + Application Gateway URL: http://applications.contoso.com + Application Gateway secured URL: https://applications.contoso.com +``` + +**Note:** The DNS aliases are not accessible now, you must perform Azure DNS delegation after the deployment. Follow [Delegation of DNS zones with Azure DNS](https://aka.ms/dns-domain-delegation) to complete the Azure DNS delegation. + + +## Verify the Custom Alias + +Access the URL from output to verify if the custom alias works. diff --git a/cluster/dbTemplate.md b/cluster/dbTemplate.md new file mode 100644 index 000000000..ea0775c1a --- /dev/null +++ b/cluster/dbTemplate.md @@ -0,0 +1,295 @@ + + +{% include variables.md %} + +# Apply Database ARM Template to {{ site.data.var.wlsFullBrandName }} + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} with an existing Azure database using Azure CLI. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The database ARM template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Database Instance + +To apply configure a database with {{ site.data.var.wlsFullBrandName }}, +you must have an existing database instance to use. This template +supports three popular Azure databases: [Oracle](https://ms.portal.azure.com/#blade/Microsoft_Azure_Marketplace/MarketplaceOffersBlade/selectedMenuItemId/home/searchQuery/oracle%20database), [Azure SQL Server](https://docs.microsoft.com/en-us/azure/azure-sql/), [Azure Database for PostgreSQL](https://docs.microsoft.com/en-us/azure/azure-sql/database/single-database-create-quickstart?WT.mc_id=gallery&tabs=azure-portal) and [MySQL](https://learn.microsoft.com/en-us/azure/mysql/single-server/quickstart-create-mysql-server-database-using-azure-portal). If you do not have an instance, please +create one from the Azure portal. + +{% include sub-template-connect-db-with-msi.md %} + +### Apply multiple databases + +You can deploy different databases using the database ARM template, by changing the ARM parameters file and invoking the template again with Azure CLI. + +To apply multiple databases, you have to remove the previous virtual machine extension. Last ARM parameters file is cached, it will block you from configuring the new database. + +Use the following command to remove virtual machine extension: + +```bash +# remove existing vm extension +az vm extension delete -g ${yourResourceGroup} --vm-name ${adminVMName} --name newuserscript +``` + +## Prepare the Parameters JSON file + +You must construct a parameters JSON file containing the parameters to the database ARM template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. We must specify the information of the existing {{ site.data.var.wlsFullBrandName }} and database instance. This section shows how to obtain the values for the following required properties. + +| Parameter Name | Explanation | +|----------------|-------------| +| `_artifactsLocation`| See below for details. | +| `adminVMName`| At deployment time, if this value was changed from its default value, the value used at deployment time must be used. Otherwise, this parameter should be omitted. | +| `databaseType`| Must be one of `postgresql`, `oracle`, `sqlserver` and `mysql` | +| `dbGlobalTranPro` | Determines the transaction protocol (global transaction processing behavior) for the data source. Must be one of `TwoPhaseCommit`, `LoggingLastResource`, `EmulateTwoPhaseCommit`, `OnePhaseCommit` or `None`. | +| `dbIdentity` | See below for details. You must provide this value if `enablePswlessConnection` is `true`.| +| `dbPassword`| See below for details. You don't need to input this value if `enablePswlessConnection` is `false`.| +| `dbUser` | See below for details. | +| `dsConnectionURL`| See below for details. | +| `enablePswlessConnection` | True to enable passwordless datasource connection. Default value is `false`.| +| `jdbcDataSourceName`| Must be the JNDI name for the JDBC data source. | +| `location` | Must be the same region into which the server was initially deployed. | +| `managedServerPrefix` | Must be the same value provided at deployment time. | +| `numberOfManagedApplicationInstances` | Numbers of managed servers. Must be the same value provided at deployment time. | +| `wlsDomainName` | Must be the same value provided at deployment time. | +| `wlsPassword` | Must be the same value provided at deployment time. | +| `wlsUserName` | Must be the same value provided at deployment time. | + +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateBasePath }} +``` + +### Obtain the JDBC Connection String, Database User, and Database Password + +The parameter `dsConnectionURL` stands for JDBC connection string. The connection string is database specific. + +{% include sub-template-datasource-connection-url.md %} + +{% include sub-template-obtain-msi.md%} + +#### Example Parameters JSON + +Here is a fully filled out parameters file. Note that we keep default value for `adminVMName`, `managedServerPrefix`, `numberOfManagedApplicationInstances` and `wlsDomainName`. + +{{ site.data.var.passwordInFileNote }} + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "_artifactsLocation":{ + "value": "{{ armTemplateBasePath }}" + }, + "location": { + "value": "eastus" + }, + "databaseType": { + "value": "postgresql" + }, + "dsConnectionURL": { + "value": "jdbc:postgresql://ejb060801p.postgres.database.azure.com:5432/postgres?sslmode=require" + }, + "dbPassword": { + "value": "Secret123!" + }, + "dbUser": { + "value": "postgres@ejb060801p" + }, + "jdbcDataSourceName": { + "value": "jdbc/ejb060801p" + }, + "wlsPassword": { + "value": "welcome1" + }, + "wlsUserName": { + "value": "weblogic" + } + } +} +``` + + + +## Invoke the ARM template + +Assume your parameters file is available in the current directory and is named `parameters.json`. This section shows the commands to configure your {{ site.data.var.wlsFullBrandName }} deployment with the specified database. Replace `yourResourceGroup` with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +### First, validate your parameters file + +The `az group deployment validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az group deployment validate --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/dbTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Next, execute the template + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az group deployment create --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/dbTemplate.json +``` + +As with the validate command, if the command returns with an exit status other than `0`, inspect the output and resolve the problem. + +This is an example output of successful deployment. Look for `"provisioningState": "Succeeded"` in your output. + +```json +{ + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-0602/providers/Microsoft.Resources/deployments/db", + "location": null, + "name": "db", + "properties": { + "correlationId": "6fc805b9-1c47-4b32-b9b0-59745a21e559", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-0602/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-admin-0602", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-0602/providers/Microsoft.Resources/deployments/3b35b279-0e94-5264-85f5-0d9d662f8a38", + "resourceGroup": "oraclevm-admin-0602", + "resourceName": "3b35b279-0e94-5264-85f5-0d9d662f8a38", + "resourceType": "Microsoft.Resources/deployments" + } + ], + "duration": "PT17.4377546S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputResources": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-0602/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-admin-0602" + } + ], + "outputs": { + "artifactsLocationPassedIn": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + } + }, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + }, + "_artifactsLocationDbTemplate": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + } + "adminVMName": { + "type": "String", + "value": "adminVM" + }, + "databaseType": { + "type": "String", + "value": "postgresql" + }, + "dbPassword": { + "type": "SecureString" + }, + "dbUser": { + "type": "String", + "value": "weblogic@oraclevm" + }, + "dsConnectionURL": { + "type": "String", + "value": "jdbc:postgresql://oraclevm.postgres.database.azure.com:5432/postgres" + }, + "jdbcDataSourceName": { + "type": "String", + "value": "jdbc/WebLogicCafeDB" + }, + "location": { + "type": "String", + "value": "eastus" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "6381424766408193665", + "templateLink": null, + "timestamp": "2020-06-02T06:05:03.141828+00:00" + }, + "resourceGroup": "oraclevm-admin-0602", + "type": "Microsoft.Resources/deployments" +} +``` + +## Verify Database Connection + +Follow the steps to check if the database has successfully been connected. + +* Visit the {{ site.data.var.wlsFullBrandName }} Admin console. +* In the left navigation pane, expand the **Services** tree node and the **DataSources** child node. +* Select the row for the JDBC database name, for example `jdbc/WebLogicDB`. +* Select the **Monitoring** tab and the **Testing** sub-tab. +* Select `admin` and select **Test Data Source** +* If the database is enabled, you will see a message similar to "Test of jdbc/WebLogicDB on server admin was successful." diff --git a/cluster/deletenode.md b/cluster/deletenode.md new file mode 100644 index 000000000..f02442b19 --- /dev/null +++ b/cluster/deletenode.md @@ -0,0 +1,542 @@ + + +{% include variables.md %} + +# Delete nodes from {{ site.data.var.wlsFullBrandName }} + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} to delete nodes using Azure CLI. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +## Prepare the Parameters JSON file + +You must construct a parameters JSON file containing the parameters to the delete-node ARM template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. You must specify the information of the existing {{ site.data.var.wlsFullBrandName }} and nodes to be deleted. This section shows how to obtain the values for the following required properties. + +| Parameter Name | Explanation | +|----------------|-------------| +| `_artifactsLocation`| See below for details. | +| `adminVMName`| At deployment time, if this value was changed from its default value, the value used at deployment time must be used. Otherwise, this parameter should be omitted. | +| `deletingManagedServerNames` | The names of managed server that you want to delete. | +| `deletingManagedServerMachineNames`| The resource names of Azure Virtual Machine hosting managed servers that you want to delete. | +| `wlsPassword` | Must be the same value provided at deployment time. | +| `wlsUserName` | Must be the same value provided at deployment time. | + +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateDeleteNodeBasePath }} +``` + +### `deletingManagedServerNames` + +This value must be an array of strings, for example: `["msp1", "msp2"]`. + +You can get the server names from WebLogic Server Administration Console, following the steps: + +* Go to WebLogic Server Administration Console, http://admin-host:7001/console. + +* Go to **Environment** -> **Servers**. + + You will find all available servers. Server names are listed in **Name** column. + + Make note of the machine for the deleting servers, you need to find out corresponding Azure Virtual Machine names of those machines. + +### `deletingManagedServerMachineNames` + +This value must be an array of strings, for example: `["mspVM1", "mspVM2"]`. + +You can get the server names from WebLogic Server Administration Console, following the steps: + +* Go to WebLogic Server Administration Console, http://admin-host:7001/console. + +* Go to **Environment** -> **Machines**. + + Open the machine you noted down in step `deletingManagedServerNames`. + + Click **Configuration** -> **Node Manager**, you will get compute name from **Listen Address**. + + The Azure Virtual Machine name was set with the same value of compute name during {{ site.data.var.wlsFullBrandName }} deployment. + +#### Example Parameters JSON + +Here is a fully filled out parameters file. Note that here we do not include `adminVMName`. + +{{ site.data.var.passwordInFileNote }} + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "_artifactsLocation": { + "value": "{{ armTemplateDeleteNodeBasePath }}" + }, + "deletingManagedServerNames": { + "value": [ + "msp4", + "mspStorage2" + ] + }, + "deletingManagedServerMachineNames": { + "value": [ + "mspVM4", + "mspStorageVM2" + ] + }, + "wlsPassword": { + "value": "welcome1" + }, + "wlsUserName": { + "value": "weblogic" + } + } +} +``` + +## Invoke the delete-node script + +To delete managed nodes completely, you have to delete managed servers logically from the WebLogic Server instance, and physically release Azure resources that host the managed servers. We realize the two purposes in different ways: + * Delete managed servers and machines logically from WebLogic Server instance by deploying delete-node ARM template with Azure CLI. You have to specify the parameters file. + * Release corresponding Azure resources by running Azure CLI commands. The following resources will be removed: + * Virtual Machines that host managed servers that will be deleted. + * Data disks attached to the Virtual Machines + * OS disks attached to the Virtual Machines + * Network Interfaces added to the Virtual Machines + * Public IPs attached to the Virtual Machines + * If the Application Gateway is deployed, will remove the manged server hosts from gateway. + +We have provided an automation script for above two purposes, you can delete managed nodes easily with the following instructions. + +### Invoke the script + +Assume your parameters file is available in the current directory and is named `parameters.json`. Replace `yourResourceGroup` with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +The following command runs the script in silent mode with option `-s`, this mode will delete managed nodes logically and physically. + +If you want to keep Azure resources, refer to [advanced usage](#advanced-usage) for further information. + +```bash +$ curl -fsSL {{ armTemplateDeleteNodeBasePath }}scripts/deletenode-cli.sh | /bin/bash -s -- -s -g `yourResourceGroup` -u {{ armTemplateDeleteNodeBasePath }}arm/mainTemplate.json -p parameters.json +``` + +The script will validate the template with your parameters file; deploy the template to delete managed servers from WebLogic Server cluster; run Azure CLI commands to delete corresponding Azure resources. + +This is an example output of successful deployment, the {{ site.data.var.wlsFullBrandName }} is deployed with Application Gateway. Look for `Completed!` in your output. + +```bash +{ + "error": null, + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Resources/deployments/mainTemplate", + "name": "mainTemplate", + "properties": { + "correlationId": "cbfaa443-3a72-4217-83e1-cc91485597fa", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-cluster-07232", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Resources/deployments/pid-4b263220-3cc6-53b9-aef3-23ad10c45d52", + "resourceGroup": "oraclevm-cluster-07232", + "resourceName": "pid-4b263220-3cc6-53b9-aef3-23ad10c45d52", + "resourceType": "Microsoft.Resources/deployments" + } + ], + "duration": "PT0S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputs": null, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "{{ armTemplateDeleteNodeBasePath }}" + }, + "_artifactsLocationSasToken": { + "type": "SecureString" + }, + "adminVMName": { + "type": "String", + "value": "adminVM" + }, + "deletingManagedServerMachineNames": { + "type": "Array", + "value": [ + "mspVM2" + ] + }, + "deletingManagedServerNames": { + "type": "Array", + "value": [ + "msp2" + ] + }, + "location": { + "type": "String", + "value": "eastus" + }, + "wlsForceShutDown": { + "type": "String", + "value": "true" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "3171958496378517565", + "templateLink": { + "contentVersion": "1.0.0.0", + "uri": "{{ armTemplateDeleteNodeBasePath }}arm/mainTemplate.json" + }, + "timestamp": "2020-07-23T07:44:38.977624+00:00", + "validatedResources": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Resources/deployments/pid-7d4ae6d6-17c5-5168-b7d2-e0bf33a1e878", + "resourceGroup": "oraclevm-cluster-07232" + }, + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-cluster-07232" + }, + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Resources/deployments/pid-4b263220-3cc6-53b9-aef3-23ad10c45d52", + "resourceGroup": "oraclevm-cluster-07232" + } + ] + }, + "resourceGroup": "oraclevm-cluster-07232", + "type": "Microsoft.Resources/deployments" +} +Accepted: newuserscript (Microsoft.Compute/virtualMachines/extensions) +Accepted: deletenode-1595490274 (Microsoft.Resources/deployments) +Command ran in 102.719 seconds (init: 0.061, invoke: 102.658) +Extension 'resource-graph' is already installed. +List resource Ids to be deleted: +/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Compute/virtualMachines/mspVM2 +/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Network/networkInterfaces/mspVM2_NIC +/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Network/publicIPAddresses/mspVM2_PublicIP +/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/ORACLEVM-CLUSTER-07232/providers/Microsoft.Compute/disks/mspVM2_OsDisk_1_e6d8ffb0e73649a4a713acf5e6ca7099 +/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/ORACLEVM-CLUSTER-07232/providers/Microsoft.Compute/disks/mspVM2_lun_0_2_942609646fdc4e1dab06b23ffeee650f +Are you sure to delete these resources (y/n)?Deleting managed resources...Please do not stop. +[ + null, + null, + null, + null, + null +] +Command ran in 112.375 seconds (init: 0.062, invoke: 112.313) +Check if application gateway has deployed... +Removing mspVM2 from application gateway, please do not stop. +{ + "backendAddresses": [ + { + "fqdn": "mspVM1", + "ipAddress": null + }, + { + "fqdn": "mspVM3", + "ipAddress": null + } + ], + "backendIpConfigurations": null, + "etag": "W/\"23399346-e17b-4f56-bda4-5e77c1d82195\"", + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Network/applicationGateways/myAppGateway/backendAddressPools/myGatewayBackendPool", + "name": "myGatewayBackendPool", + "provisioningState": "Succeeded", + "resourceGroup": "oraclevm-cluster-07232", + "type": "Microsoft.Network/applicationGateways/backendAddressPools" +} + +Complete! +``` + +### Advanced usage + +If you want to learn more about the script and run it manually, follow the advanced instructions to interact with the ternimal. + + * Download the script + + ```bash + $ curl -fsSL {{ armTemplateDeleteNodeBasePath }}scripts/deletenode-cli.sh + ``` + + You will get a shell script named `deletenode-cli.sh` in your current directory. Usage of the script: + + ```bash + ./deletenode-cli.sh -h + usage: deletenode-cli.sh -g resource-group [-f template-file] [-u template-url] -p paramter-file [-h] + -g Azure Resource Group of the Vitural Machines that host deleting manages servers, must be specified. + -f Path of ARM template to delete nodes, must be specified -f option or -u option. + -u URL of ARM template, must be specified -f option or -u option. + -p Path of ARM parameter, must be specified. + -s Execute the script in silent mode. The script will input y automatically for the prompt. + -h Help + ``` + + You can not only run the script with a local template file by specifying `-f` option, but also with a templatle URL using `-u` option. + + * Run the script + + Run the script with your parameters file in your current directory. The following command runs with a template URL: + + ```bash + ./deletenode-cli.sh -g yourResourceGroup -u {{ armTemplateDeleteNodeBasePath }}arm/mainTemplate.json -p parameters.json + ``` + + Before deleting any Azure resource, the script will prompt up message **Are you sure to delete these resources (y/n)?** to comfirm if you want to delete Azure resources. If you input `Y/y`, the Azure resources will be deleted. Otherwise, keep the resource and exit. + + This is an example output of deployment that will not delete Azure resources from your resource group, the {{ site.data.var.wlsFullBrandName }} is deployed with Application Gateway. Look for `Completed!` in your output. + + ```bash + { + "error": null, + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Resources/deployments/mainTemplate", + "name": "mainTemplate", + "properties": { + "correlationId": "4b15b45b-fb1f-4def-ad32-d96201000ac1", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-cluster-07232", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Resources/deployments/pid-4b263220-3cc6-53b9-aef3-23ad10c45d52", + "resourceGroup": "oraclevm-cluster-07232", + "resourceName": "pid-4b263220-3cc6-53b9-aef3-23ad10c45d52", + "resourceType": "Microsoft.Resources/deployments" + } + ], + "duration": "PT0S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputs": null, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "{{ armTemplateDeleteNodeBasePath }}" + }, + "_artifactsLocationSasToken": { + "type": "SecureString" + }, + "adminVMName": { + "type": "String", + "value": "adminVM" + }, + "deletingManagedServerMachineNames": { + "type": "Array", + "value": [ + "mspVM3" + ] + }, + "deletingManagedServerNames": { + "type": "Array", + "value": [ + "msp3" + ] + }, + "location": { + "type": "String", + "value": "eastus" + }, + "wlsForceShutDown": { + "type": "String", + "value": "true" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "3171958496378517565", + "templateLink": { + "contentVersion": "1.0.0.0", + "uri": "{{ armTemplateDeleteNodeBasePath }}arm/mainTemplate.json" + }, + "timestamp": "2020-07-24T04:17:38.500948+00:00", + "validatedResources": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Resources/deployments/pid-7d4ae6d6-17c5-5168-b7d2-e0bf33a1e878", + "resourceGroup": "oraclevm-cluster-07232" + }, + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-cluster-07232" + }, + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Resources/deployments/pid-4b263220-3cc6-53b9-aef3-23ad10c45d52", + "resourceGroup": "oraclevm-cluster-07232" + } + ] + }, + "resourceGroup": "oraclevm-cluster-07232", + "type": "Microsoft.Resources/deployments" +} +Succeeded: pid-7d4ae6d6-17c5-5168-b7d2-e0bf33a1e878 (Microsoft.Resources/deployments) +Accepted: deletenode-1595564252 (Microsoft.Resources/deployments) +Accepted: newuserscript (Microsoft.Compute/virtualMachines/extensions) +Command ran in 102.182 seconds (init: 0.089, invoke: 102.092) +Extension 'resource-graph' is already installed. +List resource Ids to be deleted: +/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Compute/virtualMachines/mspVM3 +/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Network/networkInterfaces/mspVM3_NIC +/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Network/publicIPAddresses/mspVM3_PublicIP +/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/ORACLEVM-CLUSTER-07232/providers/Microsoft.Compute/disks/mspVM3_OsDisk_1_d5e69682dbff491e97b7a04eea3896eb +/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/ORACLEVM-CLUSTER-07232/providers/Microsoft.Compute/disks/mspVM3_lun_0_2_f5bfbf93870f4ed3b1d90a8b953818e7 +Are you sure to delete these resources (y/n)?n +Check if application gateway has deployed... +Removing mspVM3 from application gateway, please do not stop. +{ + "backendAddresses": [ + { + "fqdn": "mspVM1", + "ipAddress": null + } + ], + "backendIpConfigurations": null, + "etag": "W/\"b6f76f57-be98-406d-ac9c-d11035fd3b5b\"", + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Network/applicationGateways/myAppGateway/backendAddressPools/myGatewayBackendPool", + "name": "myGatewayBackendPool", + "provisioningState": "Succeeded", + "resourceGroup": "oraclevm-cluster-07232", + "type": "Microsoft.Network/applicationGateways/backendAddressPools" +} + +Complete! + ``` + +## Verify + +### Verify if the managed servers are deleted from WebLogic Server instance. + +* Go to the {{ site.data.var.wlsFullBrandName }} Administration Console. +* Go to **Environment** -> **Servers**. + You should see no server names that have been deleted listed in **Name** column. +* Go to **Environment -> Machines**. + You should see logical machines that host the servers that have been deleted are removed. + +### Verify if the Azure resources are deleted + +* Go to [Azure Portal](https://ms.portal.azure.com/). +* Go to resource group that the {{ site.data.var.wlsFullBrandName }} is deployed. + You should see corresponding Vitual Machines, Disks, Network Interfaces, Public IPs have been removed. + + For example, I want to delete managed server `msp1`, corresponding Virtual Machine name is `mspVM1`, Azure resource names are: + * Virtual Machine: `mspVM1` + * Data Disk: `mspVM1_lun_0_2_9d41e2c965744665adb6965625c20d9a` + * OS Disk: `mspVM1_OsDisk_1_05a8d81f5d01419a97ee17a45f974dca` + * Network Interface: `mspVM1_NIC` + * Public IP: `mspVM1_PublicIP` + + All of these resource should be deleted after the script finishes, unless you don't expect to delete them without specifying "Y/y" to the prompt. diff --git a/cluster/elkNestedTemplate.md b/cluster/elkNestedTemplate.md new file mode 100644 index 000000000..acce72ef2 --- /dev/null +++ b/cluster/elkNestedTemplate.md @@ -0,0 +1,407 @@ + + +{% include variables.md %} + +# Land {{ site.data.var.wlsFullBrandName }} logs to Elasticsearch and Kibana + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} to land logs to Elasticsearch and Kibana using Azure CLI. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The ELK ARM template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Virtual machine size requirement +Ensure the virtual machines that have been deployed have at least **2.5GB** of memory. The default virtual machine size for WLS does not have enough memory. Use at least `Standard_A2_v2`. + +### Elasticsearch instance + +Refer to [Create an an Elastic on Azure instance](https://aka.ms/arm-oraclelinux-wls-elk#create-an-an-elastic-on-azure-instance) + +## Prepare the Parameters JSON file + +You must construct a parameters JSON file containing the parameters to the ELK ARM template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. + +We must specify the information of the existing {{ site.data.var.wlsFullBrandName }} and Elasticsearch instance. This section shows how to obtain the values for the following required properties. + +| Parameter Name | Explanation | +|----------------|-------------| +| `_artifactsLocation`| See below for details. | +| `adminVMName`| Virtual machine name of which hosts the {{ site.data.var.wlsFullBrandName }} admin server. | +| `elasticsearchEndpoint` | The Elasticsearch endpoint. | +| `elasticsearchPassword` | Password of the Elasticsearch account. Used to distibute message with REST API to Elasticsearch instance. | +| `elasticsearchUserName` | User name of the Elasticsearch account. | +| `location` | Must be the same region into which the server was initially deployed. | +| `logsToIntegrate` | Specify the WebLogic logs to export to Elasticsearch, you must select at least one log. | +| `managedServerPrefix` | Must be the same prefix with which the cluster was initially deployed. | +| `numberOfManagedApplicationInstances` | Number of VMs that have been deployed to host managed application server. | +| `numberOfManagedCacheInstances` | Number of VMs that have been deployed to host managed cache server, please set the value if your cluster is Coherence cluster. | +| `wlsDomainName` | Must be the same value provided at initial deployment time. | +| `wlsPassword` | Must be the same value provided at initial deployment time. | +| `wlsUserName` | Must be the same value provided at initial deployment time. | + +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateBasePath }} +``` + +### Number of Managed application instances + +You can get the existing Managed application instances number with the following command using Azure CLI. + +```shell +$ resourceGroup= +$ managedServerPrefix= +$ numberOfManagedApplicationInstances=$(az resource list -g ${resourceGroup} --resource-type Microsoft.Compute/virtualMachines --query [*].name | grep "${managedServerPrefix}VM[0-9]" | sed -e 's/[^0-9]/ /g' -e 's/^ *//g' -e 's/ *$//g' | tr -s ' ' | sed 's/ /\n/g' | sort -nr | head -n1) +$ echo ${numberOfManagedApplicationInstances} +``` + +### Number of Managed cache instances + +This parameter works for Coherence cluster. If your cluster is not Coherence cluter, keep it with default value `0`. + +You can get the existing Managed cache instances number with the following command using Azure CLI. It should be `0` if no value returned. + +```shell +$ resourceGroup= +$ managedServerPrefix= +$ numberOfManagedCacheInstances=$(az resource list -g ${resourceGroup} --resource-type Microsoft.Compute/virtualMachines --query [*].name | grep "${managedServerPrefix}StorageVM[0-9]" | sed -e 's/[^0-9]/ /g' -e 's/^ *//g' -e 's/ *$//g' | tr -s ' ' | sed 's/ /\n/g' | sort -nr | head -n1) +$ echo ${numberOfManagedCacheInstances} +``` + +#### Example Parameters JSON + +Here is a fully filled out parameters file. We will leave values of `adminUsername`, `authenticationType`, `dnsLabelPrefix`, and `usePreviewImage` as default value. + +{{ site.data.var.passwordInFileNote }} + + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "_artifactsLocation": { + "value": "{{ armTemplateBasePath }}" + }, + "adminVMName": { + "value": "adminVM" + }, + "elasticsearchEndpoint": { + "value": "https://example.eastus2.azure.elastic-cloud.com:9243" + }, + "elasticsearchPassword": { + "value": "wlkpsw" + }, + "elasticsearchUserName": { + "value": "elastic" + }, + "location": { + "value": "eastus" + }, + "managedServerPrefix": { + "value": "msp" + }, + "numberOfManagedApplicationInstances": { + "value": 2 + }, + "numberOfManagedCacheInstances": { + "value": 0 + }, + "wlsDomainName": { + "value": "wlsd" + }, + "wlsPassword": { + "value": "welcome1" + }, + "wlsUserName": { + "value": "weblogic" + } + } +} +``` + +## Invoke the ARM template + +Assume your parameters file is available in the current directory and is named `parameters.json`. This section shows the commands to configure your {{ site.data.var.wlsFullBrandName }} deployment to connect to Elasticsearch and Kinaba intance. Replace `yourResourceGroup` with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +### First, validate your parameters file + +The `az group deployment validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az deployment group validate --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/elkNestedTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Next, execute the template + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az deployment group create --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/elkNestedTemplate.json +``` + +As with the validate command, if the command returns with an exit status other than `0`, inspect the output and resolve the problem. + +This is an example output of successful deployment. Look for `"provisioningState": "Succeeded"` in your output. + +```json +{ + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Resources/deployments/elkNestedTemplate", + "location": null, + "name": "elkNestedTemplate", + "properties": { + "correlationId": "61a46b43-27d0-4478-baba-c288059892d5", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/mspVM1/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "mspVM1/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/mspVM2/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "mspVM2/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/mspStorageVM1/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "mspStorageVM1/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Resources/deployments/pid-e4165284-b017-5df9-9b91-3f11dd8a72e5", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "pid-e4165284-b017-5df9-9b91-3f11dd8a72e5", + "resourceType": "Microsoft.Resources/deployments" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/mspVM1/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "mspVM1/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/mspVM2/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "mspVM2/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/mspStorageVM1/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "mspStorageVM1/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "duration": "PT8M54.4785762S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputResources": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/mspStorageVM1/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/mspVM1/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/mspVM2/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk" + } + ], + "outputs": { + "artifactsLocationPassedIn": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + }, + "logIndex": { + "type": "String", + "value": "azure-weblogic-cluster-b4e465d5-6ffc-49cf-b1d9-b4dbf6455d0a" + } + }, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + }, + "_artifactsLocationELKTemplate": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + }, + "_artifactsLocationSasToken": { + "type": "SecureString" + }, + "adminVMName": { + "type": "String", + "value": "adminVM" + }, + "elasticsearchEndpoint": { + "type": "String", + "value": "https://example.eastus2.azure.elastic-cloud.com:9243" + }, + "elasticsearchPassword": { + "type": "SecureString" + }, + "elasticsearchUserName": { + "type": "String", + "value": "elastic" + }, + "guidValue": { + "type": "String", + "value": "b4e465d5-6ffc-49cf-b1d9-b4dbf6455d0a" + }, + "location": { + "type": "String", + "value": "eastus" + }, + "logsToIntegrate": { + "type": "Array", + "value": [ + "HTTPAccessLog", + "ServerLog", + "DomainLog", + "DataSourceLog", + "StandardErrorAndOutput", + "NodeManagerLog" + ] + }, + "managedServerPrefix": { + "type": "String", + "value": "msp" + }, + "numberOfManagedApplicationInstances": { + "type": "Int", + "value": 2 + }, + "numberOfManagedCacheInstances": { + "type": "Int", + "value": 1 + }, + "wlsDomainName": { + "type": "String", + "value": "wlsd" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "10060935779116645392", + "templateLink": null, + "timestamp": "2020-11-11T07:29:42.336797+00:00" + }, + "resourceGroup": "haiche-cluster-elk", + "type": "Microsoft.Resources/deployments" +} +``` + +## Verify ELK connection + +Follow the steps to check if WebLogic Server logs are exported to Elasticsearch. + +* Go to Azure portal +* Copy log index from your resource group -> deployments -> elkNestedTemplate -> output -> logIndex . +* Go to Elasticsearch cloud and launch Kibana. +* Create index + * Go to Kibana -> Management -> Kibana -> Index Patterns + * Click `Create index Patterns` + * Input the log index you copy from output in Index pattern + * There should be an index you can select, otherwise, the ELK deployment failed + * Next step + * Select `@timestamp` in Time Filter and hit `Create index pattern` +* View logs + * Go to Kibana -> Discover + * Select the index you just created + * You will find the WebLogic Server logs listed diff --git a/cluster/index.md b/cluster/index.md new file mode 100644 index 000000000..5b4270ef7 --- /dev/null +++ b/cluster/index.md @@ -0,0 +1,30 @@ + + +# {{ site.data.var.wlsFullBrandName }} Cluster + +{% include sub-template-01.md %} + +Templates available for working with [{{ site.data.var.wlsFullBrandName }} Cluster](https://portal.azure.com/#create/oracle.20191007-arm-oraclelinux-wls-cluster20191007-arm-oraclelinux-wls-cluster): + +* [Add Managed application servers](addnode.md) + +* [Add Managed Coherence cache servers](addnode-coherence.md) + +* [Configure a database connection](dbTemplate.md) + +* [Configure Azure Active Directory](aadNestedTemplate.md) + +* [Configure Azure Application Gateway](appGatewayNestedTemplate.md) + +* [Configure Coherence cluster](coherenceTemplate.md) + +* [Configure custom DNS alias](customDNSTemplate.md) + +* [Configure Elasticsearch and Kibana](elkNestedTemplate.md) + +* [Configure Azure Network Security Group rules](nsgRulesTemplate.md) + +* [Delete nodes](deletenode.md) \ No newline at end of file diff --git a/cluster/nsgRulesTemplate.md b/cluster/nsgRulesTemplate.md new file mode 100644 index 000000000..71c76350d --- /dev/null +++ b/cluster/nsgRulesTemplate.md @@ -0,0 +1,86 @@ + + +{% include variables.md %} + +# Apply Azure Network Security Rule ARM Template to {{ site.data.var.wlsFullBrandName }} + +This page documents how to append addtional security rules to an existing Azure Network Security Group deployed with {{ site.data.var.wlsFullBrandName }} using the Azure CLI. + +## Prerequisies + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### Azure Network Security Group + +The Azure Network Security Rule ARM template will be applied to an existing Azure Network Security Group (NSG) instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Prepare the Parameters JSON file + +You must construct a parameter JSON file containing the parameters to the NSG template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. The options to this template declare the desired configuration of the NSG. + +| Parameter Name | Description | +| `denyPublicTrafficForAdminServer` | Deny public tranffic for the admin server on port 7001, 7002. | +| `denyPublicTrafficForManagedServer` | Deny public tranffic for the managed servers on port 8001. | +| `enableAppGateway` | We deal with the configuration for managed servers when the Application Gateway is enabled. | +| `networkSecurityGroupName` | The name of the NSG. | + +#### Example Parameters JSON file + +Here is a fully filled out parameters file, assuming the {{ site.data.var.wlsFullBrandName }} was deployed accepting the default values. + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "denyPublicTrafficForManagedServer": { + "value": true + }, + "denyPublicTrafficForAdminServer": { + "value": false + }, + "enableAppGateway": { + "value": true + }, + "networkSecurityGroupName": { + "value": "wls-nsg" + } + } +} +``` + +## Invoke the ARM template + +This section shows how to kick off the deployment step-by-step. After the deployment, your existing NSG will append two additional Inbound Rules for admin and managed servers. Here we assume you have the parameter file in the current directory, the file is named `parameters.json`, and your NSG is named `wls-nsg`. Don't forget to replace `yourResourceGroup` with the Azure resource group in which the NSG is created. + +### First, validate your parameters file + +The `az group deployment validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az group deployment validate --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/nsgNestedTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Next, execute the template with it + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az group deployment create --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/nsgNestedTemplate.json +``` + +## Verify the rules have been appended to the Azure Network Security Group successfully + +When the deployment is completed, you can verify the appended rules via Azure Portal +* Visit the Azure Network Security Group under your resource group used above. +* Go to `Settings -> Inbound security rules`. +* Verify there is a rule named `WebLogicAdminPortsAllowed` with **Priority = '210'; Port = '7001, 7002'; Protocol = 'TCP'; Source = '10.0.0.0/24'; Aciton = 'Allow'**. +* Verify there is a rule named `WebLogicManagedPortsDenied` with **Priority = '221'; Port = '8001'; Protocol = '*'; Aciton = 'Deny'**. + diff --git a/dynamic-cluster/aadNestedTemplate.md b/dynamic-cluster/aadNestedTemplate.md new file mode 100644 index 000000000..9dacb7df1 --- /dev/null +++ b/dynamic-cluster/aadNestedTemplate.md @@ -0,0 +1,315 @@ + + +{% include variables.md %} + +# Apply Azure Active Directory ARM Template to {{ site.data.var.wlsFullBrandName }} + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} with an existing Azure Active Directory Domain Service (AAD DS) using Azure CLI. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The AAD ARM template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Azure Active Directory LDAP Instance + +To apply AAD to {{ site.data.var.wlsFullBrandName }}, you must have an existing Azure Active Directory LDAP instance to use. If you don't have AAD LADP instance, please follow the steps in the tutorial [Configure secure LDAP for an Azure Active Directory Domain Services managed domain](https://docs.microsoft.com/en-us/azure/active-directory-domain-services/tutorial-configure-ldaps). + +## Prepare the Parameters JSON file + +You must construct a parameters JSON file containing the parameters to the AAD ARM template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. We must specify the information of the existing {{ site.data.var.wlsFullBrandName }} and AAD instance. This section shows how to obtain the values for the following required properties. + +| Parameter Name | Explanation | +|----------------|-------------| +| `_artifactsLocation`| See below for details. | +| `aadsPortNumber` | (optional) The LDAP port number, defaults to 636. | +| `aadsPublicIP` | The IP address of the LDAP server | +| `aadsServerHost` | The hostname of the Active Directory Domain Services server. | +| `adminVMName`| At deployment time, if this value was changed from its default value, the value used at deployment time must be used. Otherwise, this parameter should be omitted. | +| `dynamicClusterSize` | Size of the dynamic cluster. | +| `location` | Must be the same region into which the server was initially deployed. | +| `managedServerPrefix` | Must be the same managed server prefix with that in initial deployed. | +| `wlsDomainName` | The name of the {{ site.data.var.wlsFullBrandName }} domain. | +| `wlsLDAPGroupBaseDN` | The base distinguished name (DN) of the tree in the LDAP directory that contains groups. | +| `wlsLDAPPrincipalPassword` | The credential (usually a password) used to connect to the LDAP server. | +| `wlsLDAPPrincipal` | The Distinguished Name (DN) of the LDAP user that {{ site.data.var.wlsFullBrandName }} should use to connect to the LDAP server. | +| `wlsLDAPProviderName` | (optional) The value used for creating authentication provider name of WebLogic Server. | +| `wlsLDAPSSLCertificate` | Client certificate that will be imported to trust store of SSL. | +| `wlsLDAPSSLCertificate` | See below for details. | +| `wlsLDAPUserBaseDN` | The base distinguished name (DN) of the tree in the LDAP directory that contains users. | +| `wlsPassword` | Must be the same value provided at deployment time. | +| `wlsUserName` | Must be the same value provided at deployment time. | + +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateBasePath }} +``` + +### `wlsLDAPSSLCertificate` + +Use base64 to encode your existing SSL certificate. + +```bash +base64 your-certificate.cer -w 0 >temp.txt +``` + +Use the content as this file as the value of the `wlsLDAPSSLCertificate` parameter. + +### `dynamicClusterSize` + +Size of the dynamic cluster, it should equal to numbers of Virtual Machines that have names starting with `msp`. + +#### Example Parameters JSON + +Here is a fully filled out parameters file. Note that we did not include values for parameters that have a default value. Pay attention to the value of `dynamicClusterSize`. + +{{ site.data.var.passwordInFileNote }} + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "_artifactsLocation": { + "value": "{{ armTemplateBasePath }}" + }, + "aadsPublicIP": { + "value": "1.2.3.4" + }, + "aadsServerHost": { + "value": "ladps.fabrikam.com" + }, + "location": { + "value": "eastus" + }, + "wlsDomainName": { + "value": "wlsd" + }, + "wlsLDAPGroupBaseDN": { + "value": "OU=AADDC Users,DC=fabrikam,DC=com" + }, + "wlsLDAPPrincipal": { + "value": "CN=WLSTest,OU=AADDC Users,DC=fabrikam,DC=com" + }, + "wlsLDAPPrincipalPassword": { + "value": "Secret123!" + }, + "wlsLDAPSSLCertificate": { + "value": "MIIKQQIBAz....EkAgIIAA==" + }, + "wlsLDAPUserBaseDN": { + "value": "OU=AADDC Users,DC=fabrikam,DC=com" + }, + "wlsPassword": { + "value": "welcome1" + }, + "wlsUserName": { + "value": "weblogic" + } + } +} +``` + +## Invoke the ARM template + +Assume your parameters file is available in the current directory and is named `parameters.json`. This section shows the commands to configure your {{ site.data.var.wlsFullBrandName }} deployment with the specified AAD. Replace `yourResourceGroup` with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +### First, validate your parameters file + +The `az group deployment validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az group deployment validate --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/aadNestedTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Next, execute the template + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az group deployment create --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/aadNestedTemplate.json +``` + +As with the validate command, if the command returns with an exit status other than `0`, inspect the output and resolve the problem. + +This is an example output of successful deployment. Look for `"provisioningState": "Succeeded"` in your output. + +```json +{ + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-06082/providers/Microsoft.Resources/deployments/cli", + "location": null, + "name": "cli", + "properties": { + "correlationId": "6d98e1c8-0778-4fa5-a30a-8f10bbbb6818", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-06082/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-admin-06082", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-06082/providers/Microsoft.Resources/deployments/pid-8295df19-fe6b-5745-ad24-51ef66522b24", + "resourceGroup": "oraclevm-admin-06082", + "resourceName": "pid-8295df19-fe6b-5745-ad24-51ef66522b24", + "resourceType": "Microsoft.Resources/deployments" + } + ], + "duration": "PT2M59.6052694S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputResources": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-06082/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-admin-06082" + } + ], + "outputs": { + "artifactsLocationPassedIn": { + "type": "String", + "value": "https://raw.githubusercontent.com/galiacheng/arm-oraclelinux-wls-admin/deploy/src/main/arm/" + } + }, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "https://raw.githubusercontent.com/galiacheng/arm-oraclelinux-wls-admin/deploy/src/main/arm/" + }, + "_artifactsLocationAADTemplate": { + "type": "String", + "value": "https://raw.githubusercontent.com/galiacheng/arm-oraclelinux-wls-admin/deploy/src/main/arm/" + }, + "_artifactsLocationSasToken": { + "type": "SecureString" + }, + "aadsPortNumber": { + "type": "String", + "value": "636" + }, + "aadsPublicIP": { + "type": "String", + "value": "40.76.11.111" + }, + "aadsServerHost": { + "type": "String", + "value": "ladps.wls-security.com" + }, + "adminVMName": { + "type": "String", + "value": "adminVM" + }, + "location": { + "type": "String", + "value": "eastus" + }, + "wlsDomainName": { + "type": "String", + "value": "adminDomain" + }, + "wlsLDAPGroupBaseDN": { + "type": "String", + "value": "OU=AADDC Users,DC=wls-security,DC=com" + }, + "wlsLDAPPrincipal": { + "type": "String", + "value": "CN=WLSTest,OU=AADDC Users,DC=wls-security,DC=com" + }, + "wlsLDAPPrincipalPassword": { + "type": "SecureString" + }, + "wlsLDAPProviderName": { + "type": "String", + "value": "AzureActiveDirectoryProvider" + }, + "wlsLDAPSSLCertificate": { + "type": "String", + "value": "LS0tLS1...LQ0K" + }, + "wlsLDAPUserBaseDN": { + "type": "String", + "value": "OU=AADDC Users,DC=wls-security,DC=com" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "2818584196763146470", + "templateLink": null, + "timestamp": "2020-06-09T07:07:03.444046+00:00" + }, + "resourceGroup": "oraclevm-admin-06082", + "type": "Microsoft.Resources/deployments" +} + +``` + +## Verify AAD Integration + +Follow the steps to check if AAD is enabled. + +* Visit the {{ site.data.var.wlsFullBrandName }} Admin console. +* In the left navigator, expand the tree to select **Security Realms** -> **myrealm** -> **Providers**. +* If the integration was successful, you will find the AAD provider for example `AzureActiveDirectoryProvider`. +* In the left navigator, expand the tree to select **Security Realms** -> **myrealm** -> **Users and Groups**. +* If the integration was successful, you will find users from the AAD provider. diff --git a/dynamic-cluster/addnode-coherence.md b/dynamic-cluster/addnode-coherence.md new file mode 100644 index 000000000..f208cade4 --- /dev/null +++ b/dynamic-cluster/addnode-coherence.md @@ -0,0 +1,577 @@ + + +{% include variables.md %} + +# Add cache managed server to {{ site.data.var.wlsFullBrandName }} Coherence cluster + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} to add new managed cache server using Azure CLI. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The `addnode-coherence.json` template will be applied to an existing {{ site.data.var.wlsFullBrandName }} **Coherence** cluster. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Coherence cluster + +You can configure Coherence cluster from Azure portal or running Coherence sub template. + +* Configure Coherence cluster from Azure portal + + Select `yes` in Coherence section and input required settings, the Azure WebLogic IaaS offer will configure a Coherence cluster automatically. + +* Configure Coherence cluster via Coherence sub template + + Refer to [Configure Coherence cluster](coherenceTemplate.html). + +## Prepare the Parameters JSON file + +You must construct a parameters JSON file containing the parameters to `addnode-coherence.json` template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. You must specify the information of the existing {{ site.data.var.wlsFullBrandName }} and nodes that to be added. This section shows how to obtain the values for the following required properties. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Parameter NameExplanation
_artifactsLocationSee below for details.
elkSettingsOptional. JSON object type. You can specify this parameters for Elasticsearch and Kibana(ELK) connection. If enable is true, must specify other properties. See the page WebLogic with Elastic on Azure for further information.
enableIf enable is true, must specify all properties of the elkSettings.
elasticsearchEndpointEndpoint of the Elasticsearch instance.
elasticsearchPasswordPassword for Elasticsearch account.
elasticsearchUserNameUser name for Elasticsearch account.
logIndexMust be the same value output at ELK deployment time.
logsToIntegrateArray with string value. Specify the expeted logs to integrate, you must input at least one log.
adminPasswordOrKeyPassword of administration account for the new Virtual Machine that host new nodes.
adminVMNameVirtual machine name of which hosts the {{ site.data.var.wlsFullBrandName }} admin server, for example: adminVM.
enableCoherenceWebLocalStorageSpecifies whether Local Storage is enabled for the Coherence*Web cluster tier.
locationMust be the same region into which the server was initially deployed.
managedServerPrefixMust be the same prefix with which the cluster was initially deployed.
numberOfExistingCacheNodesNumber of existing Coherence cache servers, used to name new virtual machines and new managed server.
numberOfNewCacheNodesNumber of new Coherence cahce servers, used to create Virtual Machines and Managed Server.
skuUrnVersionMust be the same urn with which the cluster was initially deployed.
storageAccountNameThe name of an existing storage account.
vmSizeSelect appropriate VM Size for Coherence cache servers.
wlsDomainNameMust be the same value provided at deployment time.
wlsPasswordMust be the same value provided at deployment time.
wlsUserNameMust be the same value provided at deployment time.
+ +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateAddCacheNodeBasePath }} +``` + +### Existing cache nodes +To differentiate functionality of managed cache servers, we use **managed application server** to represent managed servers that host Java EE application, and use **managed cache server** to represent managed servers that used for cache. + +You can get the existing managed cache servers with the following command: + +```shell +$ resourceGroup= +$ managedServerPrefix= +$ numberOfExistingCacheNodes=$(az resource list -g ${resourceGroup} --resource-type Microsoft.Compute/virtualMachines --query [*].name | grep "${managedServerPrefix}StorageVM[0-9]" | sed -e 's/[^0-9]/ /g' -e 's/^ *//g' -e 's/ *$//g' | tr -s ' ' | sed 's/ /\n/g' | sort -nr | head -n1) +$ echo ${numberOfExistingCacheNodes} +``` + +### Log index + +If you configured ELK in your cluster to export WebLogic Server logs to ELK, please input the value of Kibana log index, this template will set up ELK connection and export logs to specified index. + +You can get the value from Azure portal with the following steps: + +* Go to Azure portal. +* Open you resource group and click **Deployments**. +* Open the ELK deployment, and click **Output**. +* Copy the value of `logIndex`. + +Alternatively, use Azure CLI command to list log index inside the resource group deployments: + +```shell +$ az deployment group list -g 'yourResourceGroup' --query [*].properties.outputs.logIndex.value +[ + "azure-weblogic-cluster-f984df74-ab4d-4c17-a532-7f248659fb28" +] +``` + +### Storage account + +Each Storage Account handles up to 20,000 IOPS, and 500TB of data. If you use a storage account for Standard Virtual Machines, you can store until 40 virtual disks. + +We have two disks for one Virtual Machine, it's suggested no more than 20 Virtual Machines share the same storage account. Number of virtual machines that hosting managed servers should be less than or equal to 20. + +You can get the name of storage account from Azure portal with steps: + + * Go to Azure portal + * Go to the your resource group + * Find storage account resource and copy its name + +Alternatively, use Azure CLI command to list storage account inside a resource group: + +```shell +$ az resource list -g 'yourResourceGroup' --resource-type Microsoft.Storage/storageAccounts --query [*].name +[ + "219846olvm" +] +``` + +#### Example Parameters JSON + +Here is a fully filled out parameters file. We will leave values of `adminUsername`, `authenticationType`, `dnsLabelPrefix`, `usePreviewImage` and `vmSize` as default value. + +{{ site.data.var.passwordInFileNote }} + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "_artifactsLocation": { + "value": "{{ armTemplateAddCacheNodeBasePath }}" + }, + "adminPasswordOrKey": { + "value": "jyfRat@nht2019" + }, + "adminVMName": { + "value": "adminVM" + }, + "elkSettings": { + "value": { + "enable": true, + "elasticsearchEndpoint":"https://example.eastus2.azure.elastic-cloud.com:9243", + "elasticsearchPassword": "Secret123!", + "elasticsearchUserName":"elastic", + "logIndex": "azure-weblogic-dynamic-cluster-11122020", + "logsToIntegrate": ["HTTPAccessLog", "ServerLog", "DomainLog", "DataSourceLog", "StandardErrorAndOutput", "NodeManagerLog"] + } + }, + "enableCoherenceWebLocalStorage": { + "value": true + }, + "location": { + "value": "eastus" + }, + "managedServerPrefix": { + "value": "msp" + }, + "numberOfExistingCacheNodes": { + "value": 1 + }, + "numberOfNewCacheNodes": { + "value": 1 + }, + "skuUrnVersion": { + "value": "owls-122140-8u251-ol76;Oracle:weblogic-122140-jdk8u251-ol76:owls-122140-8u251-ol7;latest" + }, + "storageAccountName": { + "value": "d40140olvm" + }, + "wlsDomainName": { + "value": "wlsd" + }, + "wlsPassword": { + "value": "welcome1" + }, + "wlsUserName": { + "value": "weblogic" + } + } +} +``` + +## Invoke the ARM template + +Assume your parameters file is available in the current directory and is named `parameters.json`. This section shows the commands to configure your {{ site.data.var.wlsFullBrandName }} deployment to add new nodes. Replace `yourResourceGroup` with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +### First, validate your parameters file + +The `az deployment group validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az deployment group validate --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateAddCacheNodeBasePath }}arm/mainTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Next, execute the template + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az deployment group create --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateAddCacheNodeBasePath }}arm/mainTemplate.json +``` + +As with the validate command, if the command returns with an exit status other than `0`, inspect the output and resolve the problem. + +This is an example output of successful deployment. Look for `"provisioningState": "Succeeded"` in your output. + +```bash +{ + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Resources/deployments/mainTemplate", + "location": null, + "name": "mainTemplate", + "properties": { + "correlationId": "19040fc8-2b74-4e64-9dd9-59a5a3ce401a", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM2/extensions/newuserscript", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM2/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Resources/deployments/pid-157ea8ac-12ae-11eb-adc1-0242ac120002", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "pid-157ea8ac-12ae-11eb-adc1-0242ac120002", + "resourceType": "Microsoft.Resources/deployments" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Network/publicIPAddresses/mspStorageVM2_PublicIP", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM2_PublicIP", + "resourceType": "Microsoft.Network/publicIPAddresses" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Network/networkInterfaces/mspStorageVM2_NIC", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM2_NIC", + "resourceType": "Microsoft.Network/networkInterfaces" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Network/networkInterfaces/mspStorageVM2_NIC", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM2_NIC", + "resourceType": "Microsoft.Network/networkInterfaces" + }, + { + "apiVersion": "2019-06-01", + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Storage/storageAccounts/33f2e3olvm", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "33f2e3olvm", + "resourceType": "Microsoft.Storage/storageAccounts" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM2", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM2", + "resourceType": "Microsoft.Compute/virtualMachines" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM2", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM2", + "resourceType": "Microsoft.Compute/virtualMachines" + }, + { + "actionName": "listKeys", + "apiVersion": "2019-04-01", + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Storage/storageAccounts/33f2e3olvm", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "33f2e3olvm", + "resourceType": "Microsoft.Storage/storageAccounts" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM2/extensions/newuserscript", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM2/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "duration": "PT10M24.4018847S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputResources": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM2", + "resourceGroup": "haiche-cluster-1106" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM2/extensions/newuserscript", + "resourceGroup": "haiche-cluster-1106" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Network/networkInterfaces/mspStorageVM2_NIC", + "resourceGroup": "haiche-cluster-1106" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Network/publicIPAddresses/mspStorageVM2_PublicIP", + "resourceGroup": "haiche-cluster-1106" + } + ], + "outputs": { + "artifactsLocationPassedIn": { + "type": "String", + "value": "{{ armTemplateAddCacheNodeBasePath }}" + } + }, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "{{ armTemplateAddCacheNodeBasePath }}" + }, + "_artifactsLocationSasToken": { + "type": "SecureString" + }, + "adminPasswordOrKey": { + "type": "SecureString" + }, + "adminUsername": { + "type": "String", + "value": "weblogic" + }, + "adminVMName": { + "type": "String", + "value": "adminVM" + }, + "authenticationType": { + "type": "String", + "value": "password" + }, + "dnsLabelPrefix": { + "type": "String", + "value": "wls" + }, + "enableCoherenceWebLocalStorage": { + "type": "Bool", + "value": true + }, + "guidValue": { + "type": "String", + "value": "d5dde421-44b0-48df-9d12-db02374654d3" + }, + "location": { + "type": "String", + "value": "eastus" + }, + "managedServerPrefix": { + "type": "String", + "value": "msp" + }, + "numberOfExistingCacheNodes": { + "type": "Int", + "value": 1 + }, + "numberOfNewCacheNodes": { + "type": "Int", + "value": 1 + }, + "skuUrnVersion": { + "type": "String", + "value": "owls-122130-8u131-ol74;Oracle:weblogic-122130-jdk8u131-ol74:owls-122130-8u131-ol7;latest" + }, + "storageAccountName": { + "type": "String", + "value": "33f2e3olvm" + }, + "usePreviewImage": { + "type": "Bool", + "value": false + }, + "vmSize": { + "type": "String", + "value": "Standard_A1" + }, + "wlsDomainName": { + "type": "String", + "value": "wlsd" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Network", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "publicIPAddresses" + }, + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "networkInterfaces" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines" + }, + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "16596437850900945013", + "templateLink": null, + "timestamp": "2020-11-09T06:28:40.936524+00:00" + }, + "resourceGroup": "haiche-cluster-1106", + "type": "Microsoft.Resources/deployments" +} +``` + +## Verify + +### Verify if new cache nodes are added to the WebLogic Server instance. + +* Go to the {{ site.data.var.wlsFullBrandName }} Administration Console. +* Go to **Environment** -> **Machines**. + + You should see logical machines with name parttern `^{managedServerPrefix}StorageVM[0-9]+$`, machine names with number suffix from `numberOfExistingCacheNodes` to `numberOfExistingCacheNodes + numberOfNewCacheNodes` are added. +* Go to **Environment** -> **Servers** + + You should see servers with name parttern `^{managedServerPrefix}Storage[0-9]+$`, server names with number suffix from `numberOfExistingCacheNodes` to `numberOfExistingCacheNodes + numberOfNewNodes` are added to `storage1`. + +### Verify if Azure resources are added + +* Go to [Azure Portal](https://ms.portal.azure.com/). +* Go to resource group that the {{ site.data.var.wlsFullBrandName }} is deployed. + + You should see corresponding Vitual Machines, Disks, Network Interfaces, Public IPs have been added. diff --git a/dynamic-cluster/addnode.md b/dynamic-cluster/addnode.md new file mode 100644 index 000000000..a00b830ad --- /dev/null +++ b/dynamic-cluster/addnode.md @@ -0,0 +1,691 @@ + + +{% include variables.md %} + +# Add nodes to {{ site.data.var.wlsFullBrandName }} + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} to add add new managed application nodes using Azure CLI. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Azure Active Directory LDAP Instance + +Refer to [Azure Active Directory(AAD) LDAP Instance](aadNestedTemplate.html#azure-active-directory-ldap-instance). + +### Administering Security for Oracle WebLogic Server & Configuring KeyStores + +Refer to [Configuring Keystores](https://docs.oracle.com/en/middleware/fusion-middleware/weblogic-server/12.2.1.4/secmg/identity_trust.html). + +### Generate Base64 string for a given ssl certificate/keystore file + +Use the following command to generate a Base64 string for a given ssl certificate/keystore file, to be used as input in the parameters JSON file + +
base64 /my/path/your-certificate.cer -w 0 >temp.txt
+ + +## Prepare the Parameters JSON file + +You must construct a parameters JSON file containing the parameters to the add-node ARM template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. You must specify the information of the existing {{ site.data.var.wlsFullBrandName }} and nodes that to be added. This section shows how to obtain the values for the following required properties. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Parameter NameExplanation
_artifactsLocationSee below for details.
aadsSettingsOptional. JSON object type. You can specify this parameters for Azure Active Directory integration. If enable is true, must specify other properties.
enableIf enable is true, must specify all properties of the aadSettings.
publicIPThe public IP address of Azure Active Directory LDAP server.
serverHostThe server host of Azure Active Directory LDAP server.
certificateBase64StringThe based64 string of LADP client certificate that will be imported to trust store of WebLogic Server to enable SSL connection of AD provider.
adminPasswordOrKeyPassword of administration account for the new Virtual Machine that host new nodes.
adminURLThe URL of WebLogic Administration Server, usually made up with Virtual Machine name and port, for example: adminVM:7001.
elkSettingsOptional. JSON object type. You can specify this parameters for Elasticsearch and Kibana(ELK) connection. If enable is true, must specify other properties. See the page WebLogic with Elastic on Azure for further information.
enableIf enable is true, must specify all properties of the elkSettings.
elasticsearchEndpointEndpoint of the Elasticsearch instance.
elasticsearchPasswordPassword for Elasticsearch account.
elasticsearchUserNameUser name for Elasticsearch account.
logIndexMust be the same value output at ELK deployment time.
logsToIntegrateArray with string value. Specify the expeted logs to integrate, you must input at least one log.
numberOfExistingNodesThe number of existing managed application nodes, used to generate new virtual machine name,.
numberOfNewNodesThe number of nodes to add.
storageAccountNameThe name of an existing storage account.
wlsDomainNameMust be the same value provided at deployment time.
wlsUserNameMust be the same value provided at deployment time.
wlsPasswordMust be the same value provided at deployment time.
customSSLSettingsOptional. JSON object type. You can specify this parameters for configuring Custom SSL Settings for WebLogic Administration Server. If enable is true, must specify other properties. See the page Administering Security for Oracle WebLogic Server and Configuring Keystores for further information.
enableIf enable is true, must specify all properties of the customSSLSettings. +  Set to false by default.
customIdentityKeyStoreBase64StringThe based64 string of the custom identity keystore file that will be configured in the WebLogic Administration Server to enable SSL connection.
customIdentityKeyStorePassPhraseThe identity keystore pass phrase
customIdentityKeyStoreTypeIdentity Key Store Type. This can be either JKS or PKCS12
customTrustKeyStoreBase64StringThe based64 string of the custom trust keystore file that will be configured in the WebLogic Administration Server to enable SSL connection.
customTrustKeyStorePassPhraseThe trust keystore pass phrase
customTrustKeyStoreTypeTrust Key Store Type. This can be either JKS or PKCS12
privateKeyAliasThe private key alias
privateKeyPassPhraseThe private Key Pass phrase.
+ +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateAddNodeBasePath }} +``` + +### Existing managed application servers +To differentiate functionality of managed servers, we use **managed application server** to represent managed servers that host Java EE application, and use **managed cache server** to represent managed servers that used for cache. + +You can get the existing managed application nodes with the following command: + +```shell +$ resourceGroup= +$ managedServerPrefix= +$ numberOfExistingNodes=$(az resource list -g ${resourceGroup} --resource-type Microsoft.Compute/virtualMachines --query [*].name | grep "${managedServerPrefix}VM[0-9]" | sed -e 's/[^0-9]/ /g' -e 's/^ *//g' -e 's/ *$//g' | tr -s ' ' | sed 's/ /\n/g' | sort -nr | head -n1) +$ echo ${numberOfExistingNodes} +``` + +### Log index + +If you configured ELK in your cluster to export WebLogic Server logs to ELK, please input the value of Kibana log index, this template will set up ELK connection and export logs to specified index. + +You can get the value from Azure portal with the following steps: + +* Go to Azure portal. +* Open you resource group and click **Deployments**. +* Open the ELK deployment, and click **Output**. +* Copy the value of `logIndex`. + +Alternatively, use Azure CLI command to list log index inside the resource group deployments: + +```shell +$ az deployment group list -g 'yourResourceGroup' --query [*].properties.outputs.logIndex.value +[ + "azure-weblogic-cluster-f984df74-ab4d-4c17-a532-7f248659fb28" +] +``` + +### Storage account + +Each Storage Account handles up to 20,000 IOPS, and 500TB of data. If you use a storage account for Standard Virtual Machines, you can store until 40 virtual disks. + +We have two disks for one Virtual Machine, it's suggested no more than 20 Virtual Machines share the same storage account. Number of virtual machines that hosting managed servers should be less than or equal to 20. + +You can get the name of storage account from Azure portal with steps: + + * Go to Azure portal + * Go to the your resource group + * Find storage account resource and copy its name + +Alternatively, use Azure CLI command to list storage account inside a resource group: + +```shell +$ az resource list -g 'yourResourceGroup' --resource-type Microsoft.Storage/storageAccounts --query [*].name +[ + "219846olvm" +] +``` + +#### Example Parameters JSON + +Here is a fully filled out parameters file, with Azure Active Directory enabled. We will leave values of `adminUsername`, `authenticationType`, `dnsLabelPrefix`, `managedServerPrefix`, `skuUrnVersion`, `usePreviewImage` and `vmSize` as default value. + +{{ site.data.var.passwordInFileNote }} + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "_artifactsLocation": { + "value": "{{ armTemplateAddNodeBasePath }}" + }, + "aadsSettings": { + "value": { + "enable": true, + "publicIP":"13.68.244.90", + "serverHost": "ladps.wls-security.com", + "certificateBase64String":"LS0tLS1C...tLS0tLQ0K" + } + }, + "adminPasswordOrKey": { + "value": "Secret123!" + }, + "adminURL":{ + "value": "adminVM:7001" + }, + "elkSettings": { + "value": { + "enable": true, + "elasticsearchEndpoint":"https://example.eastus2.azure.elastic-cloud.com:9243", + "elasticsearchPassword": "Secret123!", + "elasticsearchUserName":"elastic", + "logIndex": "azure-weblogic-dynamic-cluster-11122020", + "logsToIntegrate": ["HTTPAccessLog", "ServerLog", "DomainLog", "DataSourceLog", "StandardErrorAndOutput", "NodeManagerLog"] + } + }, + "location": { + "value": "eastus" + }, + "numberOfExistingNodes": { + "value": 4 + }, + "numberOfNewNodes": { + "value": 3 + }, + "storageAccountName": { + "value": "496dfdolvm" + }, + "wlsDomainName": { + "value": "wlsd" + }, + "wlsUserName": { + "value": "weblogic" + }, + "wlsPassword": { + "value": "welcome1" + }, + "customSSLSettings": { + "value": { + "enable": true, + "customIdentityKeyStoreBase64String": "/u3+7QAAAAIAAAABAAAAAQAKc2VydmV....QZL24ljJLq", + "customIdentityKeyStorePassPhrase": "mypassword", + "customIdentityKeyStoreType": "JKS", + "customTrustKeyStoreBase64String": "/u3+7QAAAAIAAAABAAAAAgAJdHJ1c3R....Td4bYVnONyS0PC7k=", + "customTrustKeyStorePassPhrase": "mypassword", + "customTrustKeyStoreType": "JKS", + "privateKeyAliasSecret": "servercert", + "privateKeyPassPhraseSecret": "mypassword" + } + } + } +} +``` + +## Invoke the ARM template + +Assume your parameters file is available in the current directory and is named `parameters.json`. This section shows the commands to configure your {{ site.data.var.wlsFullBrandName }} deployment to add new nodes. Replace `yourResourceGroup` with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +### First, validate your parameters file + +The `az group deployment validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az group deployment validate --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateAddNodeBasePath }}arm/mainTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Next, execute the template + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az group deployment create --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateAddNodeBasePath }}arm/mainTemplate.json +``` + +As with the validate command, if the command returns with an exit status other than `0`, inspect the output and resolve the problem. + +This is an example output of successful deployment. Look for `"provisioningState": "Succeeded"` in your output. + +```bash +{ + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Resources/deployments/mainTemplate", + "location": null, + "name": "mainTemplate", + "properties": { + "correlationId": "54517529-a1c4-422f-a539-23b9a5129e80", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Compute/virtualMachines/mspVM7/extensions/newuserscript", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "mspVM7/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Resources/deployments/pid-c7671c10-ae59-5ec5-bff3-c60db22d7ea4", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "pid-c7671c10-ae59-5ec5-bff3-c60db22d7ea4", + "resourceType": "Microsoft.Resources/deployments" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Network/publicIPAddresses/mspVM7_PublicIP", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "mspVM7_PublicIP", + "resourceType": "Microsoft.Network/publicIPAddresses" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Network/networkInterfaces/mspVM7_NIC", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "mspVM7_NIC", + "resourceType": "Microsoft.Network/networkInterfaces" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Network/networkInterfaces/mspVM7_NIC", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "mspVM7_NIC", + "resourceType": "Microsoft.Network/networkInterfaces" + }, + { + "apiVersion": "2019-06-01", + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Storage/storageAccounts/09b943olvm", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "09b943olvm", + "resourceType": "Microsoft.Storage/storageAccounts" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Compute/virtualMachines/mspVM7", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "mspVM7", + "resourceType": "Microsoft.Compute/virtualMachines" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Compute/virtualMachines/mspVM7", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "mspVM7", + "resourceType": "Microsoft.Compute/virtualMachines" + }, + { + "actionName": "listKeys", + "apiVersion": "2019-04-01", + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Storage/storageAccounts/09b943olvm", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "09b943olvm", + "resourceType": "Microsoft.Storage/storageAccounts" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Compute/virtualMachines/mspVM7/extensions/newuserscript", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "mspVM7/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "duration": "PT9M6.8098765S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputResources": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Compute/virtualMachines/mspVM7", + "resourceGroup": "oraclevm-dcluster-0727" + }, + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Compute/virtualMachines/mspVM7/extensions/newuserscript", + "resourceGroup": "oraclevm-dcluster-0727" + }, + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Network/networkInterfaces/mspVM7_NIC", + "resourceGroup": "oraclevm-dcluster-0727" + }, + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Network/publicIPAddresses/mspVM7_PublicIP", + "resourceGroup": "oraclevm-dcluster-0727" + } + ], + "outputs": { + "wlsDomainLocation": { + "type": "String", + "value": "/u01/domains/wlsd" + } + }, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "{{ armTemplateAddNodeBasePath }}" + }, + "_artifactsLocationSasToken": { + "type": "SecureString" + }, + "aadsSettings": { + "type": "Object", + "value": { + "certificateBase64String": "LS0tLS1C...S0tLQ0K", + "enable": true, + "publicIP": "40.76.11.111", + "serverHost": "ladps.wls-security.com" + } + }, + "adminPasswordOrKey": { + "type": "SecureString" + }, + "adminURL": { + "type": "String", + "value": "adminVM:7001" + }, + "adminUsername": { + "type": "String", + "value": "weblogic" + }, + "authenticationType": { + "type": "String", + "value": "password" + }, + "dnsLabelPrefix": { + "type": "String", + "value": "wls" + }, + "guidValue": { + "type": "String", + "value": "67657ba3-6248-46e5-bedc-53e16ac82571" + }, + "location": { + "type": "String", + "value": "eastus" + }, + "managedServerPrefix": { + "type": "String", + "value": "msp" + }, + "numberOfExistingNodes": { + "type": "Int", + "value": 7 + }, + "numberOfNewNodes": { + "type": "Int", + "value": 1 + }, + "skuUrnVersion": { + "type": "String", + "value": "owls-122130-8u131-ol74;Oracle:weblogic-122130-jdk8u131-ol74:owls-122130-8u131-ol7;1.1.1" + }, + "storageAccountName": { + "type": "String", + "value": "09b943olvm" + }, + "usePreviewImage": { + "type": "Bool", + "value": false + }, + "vmSize": { + "type": "String", + "value": "Standard_A3" + }, + "wlsDomainName": { + "type": "String", + "value": "wlsd" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + }, + "customSSLSettings": { + "type": "Object", + "value": { + "enable": true, + "customIdentityKeyStoreBase64String": "/u3+7QAAAAIAAAABAAAAAQAKc2VydmV....QZL24ljJLq", + "customIdentityKeyStorePassPhrase": "mypassword", + "customIdentityKeyStoreType": "JKS", + "customTrustKeyStoreBase64String": "/u3+7QAAAAIAAAABAAAAAgAJdHJ1c3R....Td4bYVnONyS0PC7k=", + "customTrustKeyStorePassPhrase": "mypassword", + "customTrustKeyStoreType": "JKS", + "privateKeyAliasSecret": "servercert", + "privateKeyPassPhraseSecret": "mypassword" + } + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Network", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "publicIPAddresses" + }, + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "networkInterfaces" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines" + }, + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "15879952829017360289", + "templateLink": { + "contentVersion": "1.0.0.0", + "uri": "{{ armTemplateAddNodeBasePath }}arm/mainTemplate.json" + }, + "timestamp": "2020-07-27T12:37:03.733682+00:00" + }, + "resourceGroup": "oraclevm-dcluster-0727", + "type": "Microsoft.Resources/deployments" +} +``` + +## Verify + +### Verify if new nodes are added to the WebLogic Server instance. + +* Go to the {{ site.data.var.wlsFullBrandName }} Administration Console. +* Go to **Environment -> Machines**. + You should see logical machines with suffix from `numberOfExistingNodes` to `numberOfExistingNodes + numberOfNewNodes` are added. + Make note of the total number of machines. + +* Scale up to check if the machines work + * Go to **Environment** -> **Cluster** -> `cluster1` -> **Control** -> **Scaling**. + + Input value to **Desired Number of Running Servers** with the total number of machines, saved in last step. + * Save and activate. + * Go to **Environment** -> **Servers**. + + Expected result: the running managed server number is the same as machine total number. And there are servers running on the new managed nodes. + +### Verify if Azure resources are added + +* Go to [Azure Portal](https://ms.portal.azure.com/). +* Go to resource group that the {{ site.data.var.wlsFullBrandName }} is deployed. + + You should see corresponding Vitual Machines, Disks, Network Interfaces, Public IPs have been added. + +### Verify AAD Integration + +Verify AAD integration by delpoying a simple Java EE applciation with basic authentication. + +* Go to Administration Server Console and deploy [testing application](../resources/basicauth.war). + * Select **Deployments**. + * Select **Install**. + * Select file `basicauth.war`. + * Select **Next**. Choose "Install this deployment as an application". + * Select **Next**. Select "cluster-1" and "All servers in the cluster". + * Keep configuration as default and select **Finish**. + * Select **Activate Changes** + * In the left navigation pane, select **Deployments**. + * Select **Control** + * Select `basicauth` + * Select **Start** + * Select **Servicing all requests** + +* Access the sample application + * Go to Administration Server Console + * Go to **Environment -> Machines**. Click one of the new machines, make sure there are servers running on that machine. Click **Node Manager** and make note of the machine host in **Listen Address**, here named it as `machineName`. Click **Servers** and make note of **Listen Port**, here named it as `port`. + * Go to [Azure Portal](https://ms.portal.azure.com/), and get DNS name from Virtual Machine has the same name of `machineName`, named it `machineDNS` + * Go to `http://${machineDNS}:${port}/basicauth`, the browser will prompt up to ask for credentials, input one of AAD users from group **AAD DC Administrators**, note that use name should be **sAMAccountName**, for example `wlstest` for user `wlstest@javaeehotmailcom.onmicrosoft.com`. + * Expected result, you can access the sample application without error. diff --git a/dynamic-cluster/coherenceTemplate.md b/dynamic-cluster/coherenceTemplate.md new file mode 100644 index 000000000..401c1ec9a --- /dev/null +++ b/dynamic-cluster/coherenceTemplate.md @@ -0,0 +1,533 @@ + + +{% include variables.md %} + +# Configure Coherence cluster to {{ site.data.var.wlsFullBrandName }} + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} with a Coherence cluster using Azure CLI. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The Coherence ARM template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +**Note:** if you have enabled Coherence in the initial offer deployment from Azure portal, the Coherence cluster has been set up, you don't need to run Coherence tempalte. + +### Elasticsearch instance + +Optional. + +Refer to [Create an an Elastic on Azure instance](https://aka.ms/arm-oraclelinux-wls-elk#create-an-an-elastic-on-azure-instance) + +## Prepare the Parameters JSON file + +You must construct a parameters JSON file containing the parameters to the Coherence ARM template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. + +The deployment of coherenceTemplate.json will: + * Provision Azure resources, including virtual machine, network interface, disk, public IP to host new Coherence cache servers. + * Configure WebLogic Coherence cluster, including: + * Create Coherence cluster `myCoherence` + * Create data tier `storage1` cluster. + * Associate `cluster1` and `storage1` to `myCoherence` cluster. + * Create cache servers and assign them to `storage1` cluster. + +We must specify the information of the existing {{ site.data.var.wlsFullBrandName }}. This section shows how to obtain the values for the following required properties. + +| Parameter Name | Explanation | +|----------------|-------------| +| `_artifactsLocation`| See below for details. | +| `adminPasswordOrKey` | SSH Key or password for the Virtual Machine. SSH key is recommended. | +| `adminVMName`| Virtual machine name of which hosts the {{ site.data.var.wlsFullBrandName }} admin server. | +| `elasticsearchEndpoint` | The Elasticsearch endpoint. | +| `elasticsearchPassword` | Password for the Elasticsearch account. | +| `elasticsearchUserName` | User name for the Elasticsearch account. | +| `enableCoherenceWebLocalStorage` | Specifies whether Local Storage is enabled for the Coherence*Web cluster tier. | +| `enableELK` | If true, use the supplied parameters to distribute WebLogic Server logs to the Elasticsearch instance. | +| `location` | Must be the same region into which the server was initially deployed. | +| `logIndex` | Elasticsearch index you expect to export the logs to. Must be the same value with output from initial ELK deployment. | +| `logsToIntegrate` | Specify the WebLogic logs to export to Elasticsearch, you must select at least one log. | +| `managedServerPrefix` | Must be the same prefix with which the cluster was initially deployed. | +| `numberOfCoherenceCacheInstances` | Number of Coherence cache servers, used to create Virtual Machines and Managed Server. | +| `skuUrnVersion` | Must be the same urn with which the cluster was initially deployed. | +| `storageAccountName` | The name of an existing storage account. | +| `vmSizeSelectForCoherence` | Select appropriate VM Size for Coherence cache servers. | +| `wlsDomainName` | Must be the same value provided at initial deployment time. | +| `wlsPassword` | Must be the same value provided at initial deployment time. | +| `wlsUserName` | Must be the same value provided at initial deployment time. | + +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateBasePath }} +``` + +### Log index + +If you configured ELK in your cluster to export WebLogic Server logs to ELK, please input the value of Kibana log index, this template will set up ELK connection and export logs to specified index. + +You can get the value from Azure portal with the following steps: + +* Go to Azure portal. +* Open you resource group and click **Deployments**. +* Open the ELK deployment, and click **Output**. +* Copy the value of `logIndex`. + +Alternatively, use Azure CLI command to list log index inside the resource group deployments: + +```shell +$ az deployment group list -g 'yourResourceGroup' --query [*].properties.outputs.logIndex.value +[ + "azure-weblogic-cluster-f984df74-ab4d-4c17-a532-7f248659fb28" +] +``` + +### Storage account + +Each Storage Account handles up to 20,000 IOPS, and 500TB of data. If you use a storage account for Standard Virtual Machines, you can store until 40 virtual disks. + +We have two disks for one Virtual Machine, it's suggested no more than 20 Virtual Machines share the same storage account. Number of virtual machines that hosting managed servers should be less than or equal to 20. + +You can get the name of storage account from Azure portal with steps: + + * Go to Azure portal + * Go to the your resource group + * Find storage account resource and copy its name + +Alternatively, use Azure CLI command to list storage account inside a resource group: + +```shell +$ az resource list -g 'yourResourceGroup' --resource-type Microsoft.Storage/storageAccounts --query [*].name +[ + "219846olvm" +] +``` + +#### Example Parameters JSON + +Here is a fully filled out parameters file. This is an example to set up Coherence*Web. We will leave values of `adminUsername`, `authenticationType`, `dnsLabelPrefix`, and `usePreviewImage` as default value. + +{{ site.data.var.passwordInFileNote }} + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "_artifactsLocation": { + "value": "{{ armTemplateBasePath }}" + }, + "adminPasswordOrKey": { + "value": "jyfRat@nht2019" + }, + "adminVMName": { + "value": "adminVM" + }, + "elasticsearchEndpoint": { + "value": "https://example.eastus2.azure.elastic-cloud.com:9243" + }, + "elasticsearchPassword": { + "value": "Secret123!" + }, + "elasticsearchUserName": { + "value": "elastic" + }, + "enableCoherenceWebLocalStorage": { + "value": true + }, + "enableELK": { + "value": true + }, + "managedServerPrefix": { + "value": "msp" + }, + "location": { + "value": "eastus" + }, + "logIndex": { + "value": "azure-weblogic-cluster-11122020" + }, + "logsToIntegrate": { + "value": ["HTTPAccessLog", "ServerLog", "DomainLog", "DataSourceLog", "StandardErrorAndOutput","NodeManagerLog"] + }, + "numberOfCoherenceCacheInstances": { + "value": 1 + }, + "skuUrnVersion": { + "value": "owls-122140-8u251-ol76;Oracle:weblogic-122140-jdk8u251-ol76:owls-122140-8u251-ol7;latest" + }, + "storageAccountName": { + "value": "d40140olvm" + }, + "vmSizeSelectForCoherence": { + "value": "Standard_A1" + }, + "wlsDomainName": { + "value": "wlsd" + }, + "wlsPassword": { + "value": "welcome1" + }, + "wlsUserName": { + "value": "weblogic" + } + } +} +``` + +## Invoke the ARM template + +Assume your parameters file is available in the current directory and is named `parameters.json`. This section shows the commands to configure your {{ site.data.var.wlsFullBrandName }} deployment with a Coherence cluster. Replace `yourResourceGroup` with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +### First, validate your parameters file + +The `az deployment group validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az deployment group validate --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/coherenceTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Next, execute the template + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az deployment group create --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/coherenceTemplate.json +``` + +As with the validate command, if the command returns with an exit status other than `0`, inspect the output and resolve the problem. + +This is an example output of successful deployment. Look for `"provisioningState": "Succeeded"` in your output. + +```json +{ + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Resources/deployments/coherenceTemplate", + "location": null, + "name": "coherenceTemplate", + "properties": { + "correlationId": "07555c54-2384-4ca3-b427-6cf7d8b53052", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM1/extensions/newuserscript", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM1/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Resources/deployments/pid-157eaa6e-12ae-11eb-adc1-0242ac120002", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "pid-157eaa6e-12ae-11eb-adc1-0242ac120002", + "resourceType": "Microsoft.Resources/deployments" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Network/publicIPAddresses/mspStorageVM1_PublicIP", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM1_PublicIP", + "resourceType": "Microsoft.Network/publicIPAddresses" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Network/networkInterfaces/mspStorageVM1_NIC", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM1_NIC", + "resourceType": "Microsoft.Network/networkInterfaces" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Network/networkInterfaces/mspStorageVM1_NIC", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM1_NIC", + "resourceType": "Microsoft.Network/networkInterfaces" + }, + { + "apiVersion": "2019-06-01", + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Storage/storageAccounts/33f2e3olvm", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "33f2e3olvm", + "resourceType": "Microsoft.Storage/storageAccounts" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM1", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM1", + "resourceType": "Microsoft.Compute/virtualMachines" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM1", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM1", + "resourceType": "Microsoft.Compute/virtualMachines" + }, + { + "actionName": "listKeys", + "apiVersion": "2019-06-01", + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Storage/storageAccounts/33f2e3olvm", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "33f2e3olvm", + "resourceType": "Microsoft.Storage/storageAccounts" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM1", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM1", + "resourceType": "Microsoft.Compute/virtualMachines" + }, + { + "actionName": "listKeys", + "apiVersion": "2019-06-01", + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Storage/storageAccounts/33f2e3olvm", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "33f2e3olvm", + "resourceType": "Microsoft.Storage/storageAccounts" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM1/extensions/newuserscript", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM1/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "duration": "PT9M26.6278882S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputResources": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "haiche-cluster-1106" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM1", + "resourceGroup": "haiche-cluster-1106" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM1/extensions/newuserscript", + "resourceGroup": "haiche-cluster-1106" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Network/networkInterfaces/mspStorageVM1_NIC", + "resourceGroup": "haiche-cluster-1106" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Network/publicIPAddresses/mspStorageVM1_PublicIP", + "resourceGroup": "haiche-cluster-1106" + } + ], + "outputs": { + "artifactsLocationPassedIn": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + } + }, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + }, + "_artifactsLocationCoherenceTemplate": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + }, + "_artifactsLocationSasToken": { + "type": "SecureString" + }, + "adminPasswordOrKey": { + "type": "SecureString" + }, + "adminUsername": { + "type": "String", + "value": "weblogic" + }, + "adminVMName": { + "type": "String", + "value": "adminVM" + }, + "authenticationType": { + "type": "String", + "value": "password" + }, + "dnsLabelPrefix": { + "type": "String", + "value": "wls" + }, + "enableCoherenceWebLocalStorage": { + "type": "Bool", + "value": true + }, + "guidValue": { + "type": "String", + "value": "b4c17707-b932-43f0-a4cc-6d6990bb850f" + }, + "location": { + "type": "String", + "value": "eastus" + }, + "managedServerPrefix": { + "type": "String", + "value": "msp" + }, + "numberOfCoherenceCacheInstances": { + "type": "Int", + "value": 1 + }, + "skuUrnVersion": { + "type": "String", + "value": "owls-122130-8u131-ol74;Oracle:weblogic-122130-jdk8u131-ol74:owls-122130-8u131-ol7;latest" + }, + "storageAccountName": { + "type": "String", + "value": "33f2e3olvm" + }, + "usePreviewImage": { + "type": "Bool", + "value": false + }, + "vmSizeSelectForCoherence": { + "type": "String", + "value": "Standard_A1" + }, + "wlsDomainName": { + "type": "String", + "value": "wlsd" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Network", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "publicIPAddresses" + }, + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "networkInterfaces" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines" + }, + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "7840329080326569798", + "templateLink": null, + "timestamp": "2020-11-06T08:48:57.229200+00:00" + }, + "resourceGroup": "haiche-cluster-1106", + "type": "Microsoft.Resources/deployments" +} +``` + +## Verify Coherence cluster + +Follow the steps to check if Coherence*Web is enabled. + +* Follow the example parameters to set up Coherence*Web. +* Go to admin console portal. +* Deploy [coherence-sample.war](../resources/coherence-sample.war) to `cluster1`. + Please select `cluster1` in the Targets page. +* Start `coherence-sample`. +* Open the sample with browser, click "add session" to add session infomation. Click "test session" to verify. + +If the Coherence cluster does not set up successfully, the application deployment will fail. + +If the cache server does not work correctly, session can not be saved, as we disabled local storage in application servers. diff --git a/dynamic-cluster/customDNSTemplate.md b/dynamic-cluster/customDNSTemplate.md new file mode 100644 index 000000000..a4ee6364d --- /dev/null +++ b/dynamic-cluster/customDNSTemplate.md @@ -0,0 +1,172 @@ + + +{% include variables.md %} + +# Configure DNS alias to {{ site.data.var.wlsFullBrandName }} + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} with a custom DNS alias. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The DNS Configuration ARM template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Registered Domain Name + +You need to buy a domain name to create a custom DNS alias. + +### Azure DNS Zone + +If you create the DNS alias on an existing [Azure DNS Zone](https://docs.microsoft.com/en-us/azure/dns/dns-overview), make sure you have performed the [Azure DNS Delegation](https://docs.microsoft.com/en-us/azure/dns/dns-domain-delegation). After you have completed the delegation, you can verify it with `nslookup`. For example, assuming your domain name is **contoso.com**, this output shows a correct delegation. + +```bash +$ nslookup -type=SOA contoso.com +Server: 172.29.80.1 +Address: 172.29.80.1#53 + +Non-authoritative answer: +contoso.com + origin = ns1-01.azure-dns.com + mail addr = azuredns-hostmaster.microsoft.com + serial = 1 + refresh = 3600 + retry = 300 + expire = 2419200 + minimum = 300 +Name: ns1-01.azure-dns.com +Address: 40.90.4.1 +Name: ns1-01.azure-dns.com +Address: 2603:1061::1 +``` + +We strongly recommand you create an Azure DNS Zone for domain management and reuse it for other perpose. Follow the [guide](https://docs.microsoft.com/en-us/azure/dns/dns-getstarted-portal) to create an Azure DNS Zone. + + +## Prepare the Parameters + +We provide an automation shell script for DNS configuration. You must specify the information of the existing Oracle WebLogic Server. This section shows how to obtain the values for the following required properties. + +| Parameter Name             | Explanation | +|----------------|-------------| +| `--admin-vm-name`| Required. Name of vitual machine that hosts {{ site.data.var.wlsFullBrandName }} admin server. Must be the same value provided at initial deployment time.| +| `--admin-console-label` | Required. Label for {{ site.data.var.wlsFullBrandName }} admin console. Used to generate subdomain of admin console. | +| `--artifact-location`| Required. See below for details. | +| `--resource-group` | Required. Name of resource group that has an {{ site.data.var.wlsFullBrandName }} cluster deployed. | +| `--location` | Required. Must be the same region into which the server was initially deployed. | +| `--zone-name` | Required. Azure DNS Zone name. | +| `--ohs-vm-name` | Optional. Specify name of the VM that hosts the Oracle HTTP Server Load Balancer. | +| `--loadbalancer-label` | Optional. Label for Load Balancer. Used to generate subdomain of application gateway. The parameter is only required if you want to create DNS alias for application gateway.| +| `--zone-resource-group` | Optional. Name of resource group that has Azure DNS Zone deployed. The parameter is only required if you are creating DNS alias on an existing DNS Zone. | +| `--help` | Help. | + +### Artifacts location + +This value must be the following. + +```bash +{{ armTemplateBasePath }} +``` + +## Invoke the Automation Script + +We provide an automation script to configure a custom DNS alias. The script lets you do the following: + + * If you have an Azure DNS Zone, it will create a DNS alias for the admin console and application gateway on the existing DNS Zone. + * If you don't have an Azure DNS Zone, it will create the DNS Zone in the same resource group as the {{ site.data.var.wlsFullBrandName }} cluster, then create the DNS alias for the admin console and application gateway. + +### Configure DNS Alias on an Existing Azure DNS Zone + +To configure a DNS alias on an existing Azure DNS Zone, in addition to the required parameters, you must also specify an Azure user-assigned managed identity ID and the resource group name in which your DNS Zone is deployed. + +This is an example to create a DNS alias `admin.contoso.com` for the admin console and `applciations.contoso.com` for the application gateway on an existing Azure DNS Zone. + +```bash +$ curl -fsSL {{ site.data.var.artifactsLocationBase }}/{{ site.data.var.artifactsLocationTag }}/{{site.data.var.artifactsLocationSubPathForVM}}{{ pageDir }}/cli-scripts/custom-dns-alias-cli.sh \ + | /bin/bash -s -- \ + --resource-group `yourResourceGroup` \ + --admin-vm-name adminVM \ + --admin-console-label admin \ + --artifact-location {{ armTemplateBasePath }} \ + --location eastus \ + --zone-name contoso.com \ + --ohs-vm-name ohsVM \ + --loadbalancer-label applications \ + --zone-resource-group `yourDNSZoneResourceGroup` +``` + +An example output: + +```text +Done! + +Custom DNS alias: + Resource group: haiche-dns-doc + WebLogic Server Administration Console URL: http://admin.contoso.com:7001/console + WebLogic Server Administration Console secured URL: https://admin.contoso.com:7002/console + + + Application Gateway URL: http://applications.contoso.com:7777 + Application Gateway secured URL: https://applications.contoso.com:4444 +``` + + +### Configure DNS Alias on a New Azure DNS Zone + +To configure a DNS alias on a new Azure DNS Zone, you must specify the required parameters. + +This is an example of creating an Azure DNS Zone, then creating a DNS alias `admin.contoso.com` for the admin console and `applications.contoso.com` for application gateway. + +```bash +$ curl -fsSL {{ site.data.var.artifactsLocationBase }}/{{ site.data.var.artifactsLocationTag }}/{{site.data.var.artifactsLocationSubPathForVM}}{{ pageDir }}/cli-scripts/custom-dns-alias-cli.sh \ + | /bin/bash -s -- \ + --resource-group `yourResourceGroup` \ + --admin-vm-name adminVM \ + --admin-console-label admin \ + --artifact-location {{ armTemplateBasePath }} \ + --location eastus \ + --zone-name contoso.com \ + --ohs-vm-name ohsVM \ + --loadbalancer-label applications +``` + +An example output: + +```text +DONE! + + +Action required: + Complete Azure DNS delegation to make the alias accessible. + Reference: https://aka.ms/dns-domain-delegation + Name servers: + [ + "ns1-02.azure-dns.com.", + "ns2-02.azure-dns.net.", + "ns3-02.azure-dns.org.", + "ns4-02.azure-dns.info." + ] + +Custom DNS alias: + Resource group: haiche-dns-doc + WebLogic Server Administration Console URL: http://admin.contoso.com:7001/console + WebLogic Server Administration Console secured URL: https://admin.contoso.com:7002/console + + + Application Gateway URL: http://applications.contoso.com:7777 + Application Gateway secured URL: https://applications.contoso.com:4444 +``` + +**Note:** The DNS aliases are not accessible now, you must perform Azure DNS delegation after the deployment. Follow [Delegation of DNS zones with Azure DNS](https://aka.ms/dns-domain-delegation) to complete the Azure DNS delegation. + + +## Verify the Custom Alias + +Access the URL from output to verify if the custom alias works. diff --git a/dynamic-cluster/dbTemplate.md b/dynamic-cluster/dbTemplate.md new file mode 100644 index 000000000..ea0775c1a --- /dev/null +++ b/dynamic-cluster/dbTemplate.md @@ -0,0 +1,295 @@ + + +{% include variables.md %} + +# Apply Database ARM Template to {{ site.data.var.wlsFullBrandName }} + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} with an existing Azure database using Azure CLI. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The database ARM template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Database Instance + +To apply configure a database with {{ site.data.var.wlsFullBrandName }}, +you must have an existing database instance to use. This template +supports three popular Azure databases: [Oracle](https://ms.portal.azure.com/#blade/Microsoft_Azure_Marketplace/MarketplaceOffersBlade/selectedMenuItemId/home/searchQuery/oracle%20database), [Azure SQL Server](https://docs.microsoft.com/en-us/azure/azure-sql/), [Azure Database for PostgreSQL](https://docs.microsoft.com/en-us/azure/azure-sql/database/single-database-create-quickstart?WT.mc_id=gallery&tabs=azure-portal) and [MySQL](https://learn.microsoft.com/en-us/azure/mysql/single-server/quickstart-create-mysql-server-database-using-azure-portal). If you do not have an instance, please +create one from the Azure portal. + +{% include sub-template-connect-db-with-msi.md %} + +### Apply multiple databases + +You can deploy different databases using the database ARM template, by changing the ARM parameters file and invoking the template again with Azure CLI. + +To apply multiple databases, you have to remove the previous virtual machine extension. Last ARM parameters file is cached, it will block you from configuring the new database. + +Use the following command to remove virtual machine extension: + +```bash +# remove existing vm extension +az vm extension delete -g ${yourResourceGroup} --vm-name ${adminVMName} --name newuserscript +``` + +## Prepare the Parameters JSON file + +You must construct a parameters JSON file containing the parameters to the database ARM template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. We must specify the information of the existing {{ site.data.var.wlsFullBrandName }} and database instance. This section shows how to obtain the values for the following required properties. + +| Parameter Name | Explanation | +|----------------|-------------| +| `_artifactsLocation`| See below for details. | +| `adminVMName`| At deployment time, if this value was changed from its default value, the value used at deployment time must be used. Otherwise, this parameter should be omitted. | +| `databaseType`| Must be one of `postgresql`, `oracle`, `sqlserver` and `mysql` | +| `dbGlobalTranPro` | Determines the transaction protocol (global transaction processing behavior) for the data source. Must be one of `TwoPhaseCommit`, `LoggingLastResource`, `EmulateTwoPhaseCommit`, `OnePhaseCommit` or `None`. | +| `dbIdentity` | See below for details. You must provide this value if `enablePswlessConnection` is `true`.| +| `dbPassword`| See below for details. You don't need to input this value if `enablePswlessConnection` is `false`.| +| `dbUser` | See below for details. | +| `dsConnectionURL`| See below for details. | +| `enablePswlessConnection` | True to enable passwordless datasource connection. Default value is `false`.| +| `jdbcDataSourceName`| Must be the JNDI name for the JDBC data source. | +| `location` | Must be the same region into which the server was initially deployed. | +| `managedServerPrefix` | Must be the same value provided at deployment time. | +| `numberOfManagedApplicationInstances` | Numbers of managed servers. Must be the same value provided at deployment time. | +| `wlsDomainName` | Must be the same value provided at deployment time. | +| `wlsPassword` | Must be the same value provided at deployment time. | +| `wlsUserName` | Must be the same value provided at deployment time. | + +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateBasePath }} +``` + +### Obtain the JDBC Connection String, Database User, and Database Password + +The parameter `dsConnectionURL` stands for JDBC connection string. The connection string is database specific. + +{% include sub-template-datasource-connection-url.md %} + +{% include sub-template-obtain-msi.md%} + +#### Example Parameters JSON + +Here is a fully filled out parameters file. Note that we keep default value for `adminVMName`, `managedServerPrefix`, `numberOfManagedApplicationInstances` and `wlsDomainName`. + +{{ site.data.var.passwordInFileNote }} + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "_artifactsLocation":{ + "value": "{{ armTemplateBasePath }}" + }, + "location": { + "value": "eastus" + }, + "databaseType": { + "value": "postgresql" + }, + "dsConnectionURL": { + "value": "jdbc:postgresql://ejb060801p.postgres.database.azure.com:5432/postgres?sslmode=require" + }, + "dbPassword": { + "value": "Secret123!" + }, + "dbUser": { + "value": "postgres@ejb060801p" + }, + "jdbcDataSourceName": { + "value": "jdbc/ejb060801p" + }, + "wlsPassword": { + "value": "welcome1" + }, + "wlsUserName": { + "value": "weblogic" + } + } +} +``` + + + +## Invoke the ARM template + +Assume your parameters file is available in the current directory and is named `parameters.json`. This section shows the commands to configure your {{ site.data.var.wlsFullBrandName }} deployment with the specified database. Replace `yourResourceGroup` with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +### First, validate your parameters file + +The `az group deployment validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az group deployment validate --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/dbTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Next, execute the template + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az group deployment create --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/dbTemplate.json +``` + +As with the validate command, if the command returns with an exit status other than `0`, inspect the output and resolve the problem. + +This is an example output of successful deployment. Look for `"provisioningState": "Succeeded"` in your output. + +```json +{ + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-0602/providers/Microsoft.Resources/deployments/db", + "location": null, + "name": "db", + "properties": { + "correlationId": "6fc805b9-1c47-4b32-b9b0-59745a21e559", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-0602/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-admin-0602", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-0602/providers/Microsoft.Resources/deployments/3b35b279-0e94-5264-85f5-0d9d662f8a38", + "resourceGroup": "oraclevm-admin-0602", + "resourceName": "3b35b279-0e94-5264-85f5-0d9d662f8a38", + "resourceType": "Microsoft.Resources/deployments" + } + ], + "duration": "PT17.4377546S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputResources": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-0602/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-admin-0602" + } + ], + "outputs": { + "artifactsLocationPassedIn": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + } + }, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + }, + "_artifactsLocationDbTemplate": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + } + "adminVMName": { + "type": "String", + "value": "adminVM" + }, + "databaseType": { + "type": "String", + "value": "postgresql" + }, + "dbPassword": { + "type": "SecureString" + }, + "dbUser": { + "type": "String", + "value": "weblogic@oraclevm" + }, + "dsConnectionURL": { + "type": "String", + "value": "jdbc:postgresql://oraclevm.postgres.database.azure.com:5432/postgres" + }, + "jdbcDataSourceName": { + "type": "String", + "value": "jdbc/WebLogicCafeDB" + }, + "location": { + "type": "String", + "value": "eastus" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "6381424766408193665", + "templateLink": null, + "timestamp": "2020-06-02T06:05:03.141828+00:00" + }, + "resourceGroup": "oraclevm-admin-0602", + "type": "Microsoft.Resources/deployments" +} +``` + +## Verify Database Connection + +Follow the steps to check if the database has successfully been connected. + +* Visit the {{ site.data.var.wlsFullBrandName }} Admin console. +* In the left navigation pane, expand the **Services** tree node and the **DataSources** child node. +* Select the row for the JDBC database name, for example `jdbc/WebLogicDB`. +* Select the **Monitoring** tab and the **Testing** sub-tab. +* Select `admin` and select **Test Data Source** +* If the database is enabled, you will see a message similar to "Test of jdbc/WebLogicDB on server admin was successful." diff --git a/dynamic-cluster/deletenode.md b/dynamic-cluster/deletenode.md new file mode 100644 index 000000000..1fc614491 --- /dev/null +++ b/dynamic-cluster/deletenode.md @@ -0,0 +1,489 @@ + + +{% include variables.md %} + +# Delete nodes from {{ site.data.var.wlsFullBrandName }} + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} to delete nodes using Azure CLI. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +## Prepare the Parameters JSON file + +You must construct a parameters JSON file containing the parameters that to the delete-node ARM template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. You must specify the information of the existing {{ site.data.var.wlsFullBrandName }} and nodes that to be deleted. This section shows how to obtain the values for the following required properties. + +| Parameter Name | Explanation | +|----------------|-------------| +| `_artifactsLocation`| See below for details. | +| `adminVMName`| At deployment time, if this value was changed from its default value, the value used at deployment time must be used. Otherwise, this parameter should be omitted. | +| `deletingCacheServerNames`| (Optional) Names of cache servers to be deleted, comma delimited. Please ignore this parameter if you are not deleting cache servers. | +| `deletingManagedServerMachineNames`| The resource names of Azure Virtual Machine hosting managed nodes that you want to delete. | +| `wlsPassword` | Must be the same value provided at deployment time. | +| `wlsUserName` | Must be the same value provided at deployment time. | + +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateDeleteNodeBasePath }} +``` + +### Server names + +This value must be an array of strings, with pattern `^${managedServerPrefix}Storage[0-9]+$`, for example: `["mspStorage1", "mspStorage2"]`. + +You can get the server names from WebLogic Server Administration Console, following the steps: + +* Go to WebLogic Server Administration Console, http://admin-host:7001/console. + +* Go to **Environment** -> **Servers**. + + Server names are listed in the first column. + + If you want to remove coresponding virtual machine, please go to [Machine names](#machine-names) to obtain machine names. + +### Machine names + +This value must be an array of strings, for example: `["mspVM1", "mspVM2", "mspStorageVM2"]`. + +You can get the machine names from WebLogic Server Administration Console, following the steps: + +* Go to WebLogic Server Administration Console, http://admin-host:7001/console. + +* Go to **Environment** -> **Machines**. + + Open the machine you want to delete. + + Click **Configuration** -> **Node Manager**, you will get compute name from **Listen Address**. + + The Azure Virtual Machine name was set with the same value of compute name during {{ site.data.var.wlsFullBrandName }} deployment. + +#### Example Parameters JSON + +Here is a fully filled out parameters file. Note that we do not include `adminVMName`. + +{{ site.data.var.passwordInFileNote }} + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "_artifactsLocation": { + "value": "{{ armTemplateDeleteNodeBasePath }}" + }, + "deletingCacheServerNames": { + "value": [ + "mspStorage2" + ] + }, + "deletingManagedServerMachineNames": { + "value": [ + "mspVM4", + "mspStorageVM2" + ] + }, + "wlsPassword": { + "value": "welcome1" + }, + "wlsUserName": { + "value": "weblogic" + } + } +} +``` + +## Invoke the delete-node script + +To delete managed nodes completely, you have to delete managed nodes logically from the WebLogic Server instance, and physically release Azure resources that host the managed nodes. We realize the two purposes in different ways: + * Delete machines logically from WebLogic Server instance by deploying delete-node ARM template with Azure CLI. You have to specify the parameters file. + The cluster will restart after deleting the machines, and manages servers may be reallocated to another existing machine. + * Release corresponding Azure resources by running Azure CLI commands. The following resources will be removed: + * Virtual Machines that host managed nodes that will be deleted. + * Data disks attached to the Virtual Machines + * OS disks attached to the Virtual Machines + * Network Interfaces added to the Virtual Machines + * Public IPs attached to the Virtual Machines + +We have provided an automation script for above two purposes, you can delete managed nodes easily with the following instructions. + +### Invoke the script + +Assume your parameters file is available in the current directory and is named `parameters.json`. Replace `yourResourceGroup` with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +The following command runs the script in silent mode with option `-s`, this mode will delete managed nodes logically and physically. + +If you want to keep Azure resources, refer to [advanced usage](#advanced-usage) for further information. + +```bash +$ curl -fsSL {{ armTemplateDeleteNodeBasePath }}scripts/deletenode-cli.sh | /bin/bash -s -- -s -g `yourResourceGroup` -u {{ armTemplateDeleteNodeBasePath }}arm/mainTemplate.json -p parameters.json +``` + +The script will validate the template with your parameters file; deploy the template to delete managed servers from WebLogic Server cluster; run Azure CLI commands to delete corresponding Azure resources. + +This is an example output of successful deployment, the {{ site.data.var.wlsFullBrandName }} is deployed with Application Gateway. Look for `Completed!` in your output. + +```bash +{ + "error": null, + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/oraclevm-dcluster-07222/providers/Microsoft.Resources/deployments/mainTemplate", + "name": "mainTemplate", + "properties": { + "correlationId": "be24f5de-1fdf-4fc6-be97-ac53af3ccd3c", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/oraclevm-dcluster-07222/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-dcluster-07222", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/oraclevm-dcluster-07222/providers/Microsoft.Resources/deployments/pid-db9aa5e4-1e77-5f54-af38-9a7515cd27ab", + "resourceGroup": "oraclevm-dcluster-07222", + "resourceName": "pid-db9aa5e4-1e77-5f54-af38-9a7515cd27ab", + "resourceType": "Microsoft.Resources/deployments" + } + ], + "duration": "PT0S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputs": null, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "{{ armTemplateDeleteNodeBasePath }}" + }, + "_artifactsLocationSasToken": { + "type": "SecureString" + }, + "adminVMName": { + "type": "String", + "value": "adminVM" + }, + "deletingManagedServerMachineNames": { + "type": "Array", + "value": [ + "mspVM1" + ] + }, + "location": { + "type": "String", + "value": "eastus" + }, + "wlsForceShutDown": { + "type": "String", + "value": "true" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "17905048512558945100", + "templateLink": { + "contentVersion": "1.0.0.0", + "uri": "{{ armTemplateDeleteNodeBasePath }}arm/mainTemplate.json" + }, + "timestamp": "2020-07-23T08:36:10.953240+00:00", + "validatedResources": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/oraclevm-dcluster-07222/providers/Microsoft.Resources/deployments/pid-a816a607-eb8a-5aa1-9475-c3fba6994679", + "resourceGroup": "oraclevm-dcluster-07222" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/oraclevm-dcluster-07222/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-dcluster-07222" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/oraclevm-dcluster-07222/providers/Microsoft.Resources/deployments/pid-db9aa5e4-1e77-5f54-af38-9a7515cd27ab", + "resourceGroup": "oraclevm-dcluster-07222" + } + ] + }, + "resourceGroup": "oraclevm-dcluster-07222", + "type": "Microsoft.Resources/deployments" +} +Command ran in 46.180 seconds (init: 0.064, invoke: 46.116) +Extension 'resource-graph' is already installed. +List resource Ids to be deleted: +/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/oraclevm-dcluster-07222/providers/Microsoft.Compute/virtualMachines/mspVM1 +/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/oraclevm-dcluster-07222/providers/Microsoft.Network/networkInterfaces/mspVM1NIC +/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/oraclevm-dcluster-07222/providers/Microsoft.Network/publicIPAddresses/mspVM1PublicIP +/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/ORACLEVM-DCLUSTER-07222/providers/Microsoft.Compute/disks/mspVM1_OsDisk_1_e490d8e72ef14081aea596eab709efef +/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/ORACLEVM-DCLUSTER-07222/providers/Microsoft.Compute/disks/mspVM1_lun_0_2_bb9f86a391c34e2d8dbe3b1b408d4952 +Are you sure to delete these resources (y/n)?Deleting managed resources...Please do not stop. +Deleting managed resources...Please do not stop. +[ + null, + null, + null, + null, + null +] +Command ran in 99.764 seconds (init: 0.068, invoke: 99.696) + +Complete! +``` + +### Advanced usage + +If you want to learn more about the script and run it manually, follow the advanced instructions to interact with the ternimal. + + * Download the script + + ```bash + $ curl -fsSL {{ armTemplateDeleteNodeBasePath }}scripts/deletenode-cli.sh + ``` + + You will get a shell script named `deletenode-cli.sh` in your current directory. Usage of the script: + + ```bash + ./deletenode-cli.sh -h + usage: deletenode-cli.sh -g resource-group [-f template-file] [-u template-url] -p paramter-file [-h] + -g Azure Resource Group of the Vitural Machines that host deleting manages servers, must be specified. + -f Path of ARM template to delete nodes, must be specified -f option or -u option. + -u URL of ARM template, must be specified -f option or -u option. + -p Path of ARM parameter, must be specified. + -s Execute the script in silent mode. The script will input y automatically for the prompt. + -h Help + ``` + + You can not only run the script with a local template file by specifying `-f` option, but also with a templatle URL using `-u` option. + + * Run the script + + Run the script with your parameters file in your current directory. The following command runs with a template URL: + + ```bash + ./deletenode-cli.sh -g yourResourceGroup -u {{ armTemplateDeleteNodeBasePath }}arm/mainTemplate.json -p parameters.json + ``` + + Before deleting any Azure resource, the script will prompt up message **Are you sure to delete these resources (y/n)?** to comfirm if you want to delete Azure resources. If you input `Y/y`, the Azure resources will be deleted. Otherwise, keep the resource and exit. + + This is an example output of deployment that will not delete Azure resources from your resource group, the {{ site.data.var.wlsFullBrandName }} is deployed with Application Gateway. Look for `Completed!` in your output. + + ```bash + { + "error": null, + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/oraclevm-dcluster-07222/providers/Microsoft.Resources/deployments/mainTemplate", + "name": "mainTemplate", + "properties": { + "correlationId": "be24f5de-1fdf-4fc6-be97-ac53af3ccd3c", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/oraclevm-dcluster-07222/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-dcluster-07222", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/oraclevm-dcluster-07222/providers/Microsoft.Resources/deployments/pid-db9aa5e4-1e77-5f54-af38-9a7515cd27ab", + "resourceGroup": "oraclevm-dcluster-07222", + "resourceName": "pid-db9aa5e4-1e77-5f54-af38-9a7515cd27ab", + "resourceType": "Microsoft.Resources/deployments" + } + ], + "duration": "PT0S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputs": null, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "{{ armTemplateDeleteNodeBasePath }}" + }, + "_artifactsLocationSasToken": { + "type": "SecureString" + }, + "adminVMName": { + "type": "String", + "value": "adminVM" + }, + "deletingManagedServerMachineNames": { + "type": "Array", + "value": [ + "mspVM1" + ] + }, + "location": { + "type": "String", + "value": "eastus" + }, + "wlsForceShutDown": { + "type": "String", + "value": "true" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "17905048512558945100", + "templateLink": { + "contentVersion": "1.0.0.0", + "uri": "{{ armTemplateDeleteNodeBasePath }}arm/mainTemplate.json" + }, + "timestamp": "2020-07-23T08:36:10.953240+00:00", + "validatedResources": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/oraclevm-dcluster-07222/providers/Microsoft.Resources/deployments/pid-a816a607-eb8a-5aa1-9475-c3fba6994679", + "resourceGroup": "oraclevm-dcluster-07222" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/oraclevm-dcluster-07222/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-dcluster-07222" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/oraclevm-dcluster-07222/providers/Microsoft.Resources/deployments/pid-db9aa5e4-1e77-5f54-af38-9a7515cd27ab", + "resourceGroup": "oraclevm-dcluster-07222" + } + ] + }, + "resourceGroup": "oraclevm-dcluster-07222", + "type": "Microsoft.Resources/deployments" +} +Command ran in 46.180 seconds (init: 0.064, invoke: 46.116) +Extension 'resource-graph' is already installed. +List resource Ids to be deleted: +/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/oraclevm-dcluster-07222/providers/Microsoft.Compute/virtualMachines/mspVM1 +/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/oraclevm-dcluster-07222/providers/Microsoft.Network/networkInterfaces/mspVM1NIC +/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/oraclevm-dcluster-07222/providers/Microsoft.Network/publicIPAddresses/mspVM1PublicIP +/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/ORACLEVM-DCLUSTER-07222/providers/Microsoft.Compute/disks/mspVM1_OsDisk_1_e490d8e72ef14081aea596eab709efef +/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/ORACLEVM-DCLUSTER-07222/providers/Microsoft.Compute/disks/mspVM1_lun_0_2_bb9f86a391c34e2d8dbe3b1b408d4952 +Are you sure to delete these resources (y/n)?n + +Complete! + ``` + +## Verify + +### Verify if the managed servers are deleted from WebLogic Server instance. + +* Go to the {{ site.data.var.wlsFullBrandName }} Administration Console. +* Go to **Environment** -> **Machines**. + + You should see the logical machine names (e.g. `machine-mspVM1`) that have been deleted is not listed in **Name** column. + +### Verify if the Azure resources are deleted + +* Go to Azure Portal, https://ms.portal.azure.com/. +* Go to resource group that the {{ site.data.var.wlsFullBrandName }} is deployed. + + You should see corresponding Vitual Machines, Disks, Network Interfaces, Public IPs have been removed. + + For example, I want to delete managed server `msp1`, corresponding Virtual Machine name is `mspVM1`, Azure resource names are: + * Virtual Machine: `mspVM1` + * Data Disk: `mspVM1_lun_0_2_9d41e2c965744665adb6965625c20d9a` + * OS Disk: `mspVM1_OsDisk_1_05a8d81f5d01419a97ee17a45f974dca` + * Network Interface: `mspVM1_NIC` + * Public IP: `mspVM1_PublicIP` + + All of these resource should be deleted after the script finishes, unless you don't expect to delete them without specifying "Y/y" to the prompt. + + diff --git a/dynamic-cluster/elkNestedTemplate.md b/dynamic-cluster/elkNestedTemplate.md new file mode 100644 index 000000000..f3b1f2ff9 --- /dev/null +++ b/dynamic-cluster/elkNestedTemplate.md @@ -0,0 +1,413 @@ + + +{% include variables.md %} + +# Land {{ site.data.var.wlsFullBrandName }} logs to Elasticsearch and Kibana + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} to land logs to Elasticsearch and Kibana using Azure CLI. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The ELK ARM template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Virtual machine size requirement +Ensure the virtual machines that have been deployed have at least **2.5GB** of memory. The default virtual machine size for WLS does not have enough memory. Use at least `Standard_A2_v2`. + +### Elasticsearch instance + +Refer to [Create an an Elastic on Azure instance](https://aka.ms/arm-oraclelinux-wls-elk#create-an-an-elastic-on-azure-instance) + +## Prepare the Parameters JSON file + +You must construct a parameters JSON file containing the parameters to the ELK ARM template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. + +We must specify the information of the existing {{ site.data.var.wlsFullBrandName }} and Elasticsearch instance. This section shows how to obtain the values for the following required properties. + +| Parameter Name | Explanation | +|----------------|-------------| +| `_artifactsLocation`| See below for details. | +| `adminVMName`| Virtual machine name of which hosts the {{ site.data.var.wlsFullBrandName }} admin server. | +| `elasticsearchEndpoint` | The Elasticsearch endpoint. | +| `elasticsearchPassword` | Password for the Elasticsearch account. | +| `elasticsearchUserName` | User name for the Elasticsearch account. | +| `location` | Must be the same region into which the server was initially deployed. | +| `logsToIntegrate` | Specify the WebLogic logs to export to Elasticsearch, you must select at least one log. | +| `managedServerPrefix` | Must be the same prefix with which the cluster was initially deployed. | +| `maxDynamicClusterSize` | Must be the same value with which the cluster was initially deployed. | +| `numberOfManagedApplicationInstances` | Number of VMs that have been deployed to host managed application server. | +| `numberOfManagedCacheInstances` | Number of VMs that have been deployed to host managed cache server, please set the value if your cluster is Coherence cluster. | +| `wlsDomainName` | Must be the same value provided at initial deployment time. | +| `wlsPassword` | Must be the same value provided at initial deployment time. | +| `wlsUserName` | Must be the same value provided at initial deployment time. | + +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateBasePath }} +``` + +### Number of Managed application instances + +You can get the existing Managed application instances number with the following command using Azure CLI. + +```shell +$ resourceGroup= +$ managedServerPrefix= +$ numberOfManagedApplicationInstances=$(az resource list -g ${resourceGroup} --resource-type Microsoft.Compute/virtualMachines --query [*].name | grep "${managedServerPrefix}VM[0-9]" | sed -e 's/[^0-9]/ /g' -e 's/^ *//g' -e 's/ *$//g' | tr -s ' ' | sed 's/ /\n/g' | sort -nr | head -n1) +$ echo ${numberOfManagedApplicationInstances} +``` + +### Number of Managed cache instances + +This parameter works for Coherence cluster. If your cluster is not Coherence cluter, keep it with default value `0`. + +You can get the existing Managed cache instances number with the following command using Azure CLI. It should be `0` if no value returned. + +```shell +$ resourceGroup= +$ managedServerPrefix= +$ numberOfManagedCacheInstances=$(az resource list -g ${resourceGroup} --resource-type Microsoft.Compute/virtualMachines --query [*].name | grep "${managedServerPrefix}StorageVM[0-9]" | sed -e 's/[^0-9]/ /g' -e 's/^ *//g' -e 's/ *$//g' | tr -s ' ' | sed 's/ /\n/g' | sort -nr | head -n1) +$ echo ${numberOfManagedCacheInstances} +``` + +#### Example Parameters JSON + +Here is a fully filled out parameters file. We will leave values of `adminUsername`, `authenticationType`, `dnsLabelPrefix`, and `usePreviewImage` as default value. + +{{ site.data.var.passwordInFileNote }} + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "_artifactsLocation": { + "value": "{{ armTemplateBasePath }}" + }, + "adminVMName": { + "value": "adminVM" + }, + "elasticsearchEndpoint": { + "value": "https://example.eastus2.azure.elastic-cloud.com:9243" + }, + "elasticsearchPassword": { + "value": "wlkpsw" + }, + "elasticsearchUserName": { + "value": "elastic" + }, + "location": { + "value": "eastus" + }, + "managedServerPrefix": { + "value": "msp" + }, + "maxDynamicClusterSize": { + "value": 8 + }, + "numberOfManagedApplicationInstances": { + "value": 3 + }, + "numberOfManagedCacheInstances": { + "value": 0 + }, + "wlsDomainName": { + "value": "wlsd" + }, + "wlsPassword": { + "value": "welcome1" + }, + "wlsUserName": { + "value": "weblogic" + } + } +} +``` + +## Invoke the ARM template + +Assume your parameters file is available in the current directory and is named `parameters.json`. This section shows the commands to configure your {{ site.data.var.wlsFullBrandName }} deployment to connect to Elasticsearch and Kinaba intance. Replace `yourResourceGroup` with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +### First, validate your parameters file + +The `az group deployment validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az deployment group validate --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/elkNestedTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Next, execute the template + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az deployment group create --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/elkNestedTemplate.json +``` + +As with the validate command, if the command returns with an exit status other than `0`, inspect the output and resolve the problem. + +This is an example output of successful deployment. Look for `"provisioningState": "Succeeded"` in your output. + +```json +{ + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Resources/deployments/elkNestedTemplate", + "location": null, + "name": "elkNestedTemplate", + "properties": { + "correlationId": "61a46b43-27d0-4478-baba-c288059892d5", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/mspVM1/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "mspVM1/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/mspVM2/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "mspVM2/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/mspStorageVM1/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "mspStorageVM1/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Resources/deployments/pid-e4165284-b017-5df9-9b91-3f11dd8a72e5", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "pid-e4165284-b017-5df9-9b91-3f11dd8a72e5", + "resourceType": "Microsoft.Resources/deployments" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/mspVM1/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "mspVM1/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/mspVM2/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "mspVM2/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/mspStorageVM1/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "mspStorageVM1/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "duration": "PT8M54.4785762S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputResources": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/mspStorageVM1/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/mspVM1/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/mspVM2/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk" + } + ], + "outputs": { + "artifactsLocationPassedIn": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + }, + "logIndex": { + "type": "String", + "value": "azure-weblogic-cluster-b4e465d5-6ffc-49cf-b1d9-b4dbf6455d0a" + } + }, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + }, + "_artifactsLocationELKTemplate": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + }, + "_artifactsLocationSasToken": { + "type": "SecureString" + }, + "adminVMName": { + "type": "String", + "value": "adminVM" + }, + "elasticsearchEndpoint": { + "type": "String", + "value": "https://example.eastus2.azure.elastic-cloud.com:9243" + }, + "elasticsearchPassword": { + "type": "SecureString" + }, + "elasticsearchUserName": { + "type": "String", + "value": "elastic" + }, + "guidValue": { + "type": "String", + "value": "b4e465d5-6ffc-49cf-b1d9-b4dbf6455d0a" + }, + "location": { + "type": "String", + "value": "eastus" + }, + "logsToIntegrate": { + "type": "Array", + "value": [ + "HTTPAccessLog", + "ServerLog", + "DomainLog", + "DataSourceLog", + "StandardErrorAndOutput", + "NodeManagerLog" + ] + }, + "managedServerPrefix": { + "type": "String", + "value": "msp" + }, + "maxDynamicClusterSize": { + "value": 8 + }, + "numberOfManagedApplicationInstances": { + "type": "Int", + "value": 2 + }, + "numberOfManagedCacheInstances": { + "type": "Int", + "value": 1 + }, + "wlsDomainName": { + "type": "String", + "value": "wlsd" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "10060935779116645392", + "templateLink": null, + "timestamp": "2020-11-11T07:29:42.336797+00:00" + }, + "resourceGroup": "haiche-cluster-elk", + "type": "Microsoft.Resources/deployments" +} +``` + +## Verify ELK connection + +Follow the steps to check if WebLogic Server logs are exported to Elasticsearch. + +* Go to Azure portal +* Copy log index from your resource group -> deployments -> elkNestedTemplate -> output -> logIndex . +* Go to Elasticsearch cloud and launch Kibana. +* Create index + * Go to Kibana -> Management -> Kibana -> Index Patterns + * Click `Create index Patterns` + * Input the log index you copy from output in Index pattern + * There should be an index you can select, otherwise, the ELK deployment failed + * Next step + * Select `@timestamp` in Time Filter and hit `Create index pattern` +* View logs + * Go to Kibana -> Discover + * Select the index you just created + * You will find the WebLogic Server logs listed diff --git a/dynamic-cluster/index.md b/dynamic-cluster/index.md new file mode 100644 index 000000000..66c84fec9 --- /dev/null +++ b/dynamic-cluster/index.md @@ -0,0 +1,31 @@ + + +# {{ site.data.var.wlsFullBrandName }} Dynamic Cluster + +{% include sub-template-01.md %} + +Templates available for working with [{{ site.data.var.wlsFullBrandName }} Dynamic Cluster](https://portal.azure.com/#create/oracle.20191021-arm-oraclelinux-wls-dynamic-cluster20191021-arm-oraclelinux-wls-dynamic-cluster): + +* [Add Managed application nodes](addnode.md) + +* [Add Managed Coherence cache nodes](addnode-coherence.md) + +* [Configure a database connection](dbTemplate.md) + +* [Configure Azure Active Directory](aadNestedTemplate.md) + +* [Configure Coherence cluster](coherenceTemplate.md) + +* [Configure custom DNS alias](customDNSTemplate.md) + +* [Configure Elasticsearch and Kibana](elkNestedTemplate.md) + +* [Configure Azure Network Security Group rules](nsgRulesTemplate.md) + +* [Configure Oracle HTTP Server load balancer](ohsNestedTemplate.md) + +* [Delete nodes](deletenode.md) + diff --git a/dynamic-cluster/nsgRulesTemplate.md b/dynamic-cluster/nsgRulesTemplate.md new file mode 100644 index 000000000..e47262537 --- /dev/null +++ b/dynamic-cluster/nsgRulesTemplate.md @@ -0,0 +1,86 @@ + + +{% include variables.md %} + +# Apply Azure Network Security Rule ARM Template to {{ site.data.var.wlsFullBrandName }} + +This page documents how to append addtional security rules to an existing Azure Network Security Group deployed with {{ site.data.var.wlsFullBrandName }} using the Azure CLI. + +## Prerequisies + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### Azure Network Security Group + +The Azure Network Security Rule ARM template will be applied to an existing Azure Network Security Group (NSG) instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Prepare the Parameters JSON file + +You must construct a parameter JSON file containing the parameters to the NSG template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. The options to this template declare the desired configuration of the NSG. + +| Parameter Name | Description | +| `denyPublicTrafficForAdminServer` | Deny public tranffic for the admin server on port 7001, 7002. | +| `denyPublicTrafficForManagedServer` | Deny public tranffic for the managed servers on port 8001. | +| `enableOHS` | We deal with the configuration for managed servers when the OHS load balancer is enabled. | +| `networkSecurityGroupName` | The name of the NSG. | + +#### Example Parameters JSON file + +Here is a fully filled out parameters file, assuming the {{ site.data.var.wlsFullBrandName }} was deployed accepting the default values. + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "denyPublicTrafficForManagedServer": { + "value": true + }, + "denyPublicTrafficForAdminServer": { + "value": false + }, + "enableOHS": { + "value": true + }, + "networkSecurityGroupName": { + "value": "wls-nsg" + } + } +} +``` + +## Invoke the ARM template + +This section shows how to kick off the deployment step-by-step. After the deployment, your existing NSG will append two additional Inbound Rules for admin and managed servers. Here we assume you have the parameter file in the current directory, the file is named `parameters.json`, and your NSG is named `wls-nsg`. Don't forget to replace `yourResourceGroup` with the Azure resource group in which the NSG is created. + +### First, validate your parameters file + +The `az group deployment validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az group deployment validate --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/nsgNestedTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Next, execute the template with it + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az group deployment create --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/nsgNestedTemplate.json +``` + +## Verify the rules have been appended to the Azure Network Security Group successfully + +When the deployment is completed, you can verify the appended rules via Azure Portal +* Visit the Azure Network Security Group under your resource group used above. +* Go to `Settings -> Inbound security rules`. +* Verify there is a rule named `WebLogicAdminPortsAllowed` with **Priority = '210'; Port = '7001, 7002'; Protocol = 'TCP'; Source = '10.0.0.0/24'; Aciton = 'Allow'**. +* Verify there is a rule named `WebLogicManagedPortsDenied` with **Priority = '221'; Port = '8001'; Protocol = '*'; Aciton = 'Deny'**. + diff --git a/dynamic-cluster/ohsNestedTemplate.md b/dynamic-cluster/ohsNestedTemplate.md new file mode 100644 index 000000000..89503b001 --- /dev/null +++ b/dynamic-cluster/ohsNestedTemplate.md @@ -0,0 +1,215 @@ + + +{% include variables.md %} + +# Apply OHS ARM Template to {{ site.data.var.wlsFullBrandName }} + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} with a Oracle HTTP Server using Azure CLI. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Certificate for SSL Termination + +Oracle HTTP Server serves as the front end load balancer for the {{ site.data.var.wlsFullBrandName }} dynamic cluster, hence it must be provided with a certificate to allow browsers to connect via SSL. + +#### Creating Self-signed certificate + +This section describes how to create a self-signed certificate in the format expected by Oracle HTTP server. The example provided below is one of the ways to create self-signed certificates. Note that such self-signed certificates created should only be used for testing purpose and it is not recommended for production purpose. + +* JKS format certificate + + ```bash + keytool -genkey -keyalg RSA -alias selfsigned -keystore keyStore.jks -storepass password -validity 360 -keysize 2048 + ``` + + Provide all information prompted and store in a file. + +* PKCS12 format certificate + + ```bash + openssl req -newkey rsa:2048 -x509 -keyout key.pem -out out.pem -days 3650 + ``` + + Provide all information prompted and store in a file. + +## Prepare the Parameters JSON file + +You must construct a parameters JSON file containing the parameters to the OHS ARM template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. We must specify the information of the existing SSL certificate. This section shows how to obtain the values for the following required properties. + +| Parameter Name | Explanation | +|----------------|-------------| +| `_artifactsLocation`| See below for details. | +|`adminPasswordOrKey`|Password of administration account for the new Virtual Machine that hosts Oracle HTTP Server.| +|`adminUsername`| Username of administration account for the new Virtual Machine that hosts Oracle HTTP Server.| +|`adminRestMgmtURL`| WebLogic Server admin REST management URL. It should be in the format `http://admincomputername:adminport/management/weblogic/latest`.Example `http://adminVM:7001/management/weblogic/latest` or `http://adminVM:7005/management/weblogic/latest` | +|`dnsLabelPrefix`| Must be the same `dnsLabelPrefix` value with which WebLogic Dynamic cluster deployment is made. This value is used for fetching existing deployment `dnsLabelPrefix-nsg` NSG value. | +|`location`| Must be the same region into which the WebLogic dynamic cluster deployment is made.| +|`ohsComponentName` | Oracle HTTP Server component name to be configured as part of domain. At deployment, if this value is changed from its default value, the value used at deployment time must be used.| +|`ohsDomainName`| Oracle HTTP Server standalone domain name. At deployment, if this value is changed from its default value, the value used at deployment time must be used. | +|`ohsNMPassword`| Oracle HTTP Server NodeManager password configured as part of the domain. | +|`ohsNMUser`| Oracle HTTP Server NodeManager user name configured as part of the domain.| +|`keyType` | Certificate format supported for configuring Oracle HTTP Server SSL configuration. Supported format is `JKS` and `PKCS12`. Default value is `PKCS12`| +|`ohsSSLKeystoreData`| base64 bit encoded value of JKS/PKCS12 certificate contents. See below for details| +|`ohsSSLKeystorePassword`|The keystore stored password | +|`ohsSkuUrnVersion`| Oracle HTTP Server base images provided by publisher Oracle. Refer [Azure Marketplace OHS Base Images](https://azuremarketplace.microsoft.com/en-us/marketplace/apps?search=oracle%20ohs%20base%20image) | +|`ohsVMName`|At deployment time, if this value is changed from its default value, the value used at deployment time must be used. Otherwise, this parameter should be omitted.| +|`ohshttpPort` | Http server port configured using which application can be accessed via Oracle HTTP Server.At deployment, if this value is changed from its default value, the value used at deployment time must be used.| +|`ohshttpsPort`| Https server port configured using which application can be accessed via Oracle HTTP Server.At deployment, if this value is changed from its default value, the value used at deployment time must be used.| +|`oracleVaultPswd` | Password for Oracle wallet/vault, to add certificates supplied for OHS.| +|`storageAccountName`| The name of an existing storage account. Must be the same storage account name avilable in existing deployed WebLogic dynamic cluster| +|`virtualNetworkName`| The name of an existing virtual network name. Must be the same virtual network name available in existing deployed WebLogic dynamic cluster| +|`wlsUserName` |Must be the same value provided at deployment time for WebLogic dynamic cluster deployment time.| +|`wlsPassword` |Must be the same value provided at deployment time WebLogic dynamic cluster deployment time.| + + +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateBasePath }} +``` + +### `ohsSSLKeystoreData` +Use base64 to encode your existing SSL certificate. + + base64 your-JKS/PKCS12-certificate-contents -w 0 > temp.txt + +Use temp.txt contents to set the value for ohsSSLKeystoreData + +#### Example Parameters JSON + +Here is a fully filled out parameters file. Note that we did not include any optional parameters, assuming the {{ site.data.var.wlsFullBrandName }} was deployed accepting the default values. + +{{ site.data.var.passwordInFileNote }} + +```json +{ + "_artifactsLocation": { + "value": "{{ armTemplateBasePath }}" + }, + "adminPasswordOrKey": { + "value": "Azure123456!" + }, + "adminRestMgmtURL": { + "value": "http://adminVM:7001/management/weblogic/latest" + }, + "adminUsername": { + "value": "azureuser" + }, + "dnsLabelPrefix": { + "value": "wls" + }, + "keyType": { + "value": "JKS" + }, + "location": { + "value": "eastus" + }, + "ohsComponentName": { + "value": "ohs_component" + }, + "ohsDomainName": { + "value": "ohsStandaloneDomain" + }, + "ohsNMPassword": { + "value": "Nmpswd1234567" + }, + "ohsNMUser": { + "value": "weblogic" + }, + "ohsSSLKeystoreData": { + "value": "/u3+7QAAAAIAAAABAAAAAQAKc2VsZnNpZ25lZAAAAX ...." + }, + "ohsSSLKeystorePassword": { + "value": "azure123!" + }, + "ohsSkuUrnVersion": { + "value": "ohs-122140-jdk8-ol76;ohs-122140-jdk8-ol76;latest" + }, + "ohsVMName": { + "value": "ohsVM" + }, + "ohshttpPort": { + "value": "7777" + }, + "ohshttpsPort": { + "value": "4444" + }, + "oracleVaultPswd": { + "value": "Welcome1234567" + }, + "storageAccountName": { + "value": "6be282olvm" + }, + "virtualNetworkName": { + "value": "wlsd_VNET" + }, + "wlsPassword": { + "value": "Welcome1234567" + }, + "wlsUserName": { + "value": "weblogic" + } +} +``` + +### Invoke the ARM template +Assume your parameters file is available in the current directory and is named parameters.json. This section shows the commands to configure your {{ site.data.var.wlsFullBrandName }} deployment with a Oracle HTTP Server. Replace yourResourceGroup with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +### First, validate your parameters file +The `az deployment group validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az deployment group validate --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/ohsNestedTemplate.json +``` +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Next, execute the template +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az deployment group create --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/ohsNestedTemplate.json +``` +As with the validate command, if the command returns with an exit status other than 0, inspect the output and resolve the problem. + +This is an example output of successful deployment. Look for `"provisioningState": "Succeeded"` in your output. + +```bash + "provisioningState": "Succeeded", + "template": null, + "templateHash": "13760326614657528322", +``` + +## Verify Oracle HTTP Server setup + +Successful deployment provides Oracle HTTP Server access url in your output, similar to below. + +```json + "ohsAccessURL": { + "type": "String", + "value": "http://wls-5ff4cab395-loadbalancer.eastus.cloudapp.azure.com:7777" + }, + "ohsSecureAccessURL": { + "type": "String", + "value": "https://wls-5ff4cab395-loadbalancer.eastus.cloudapp.azure.com:4444" + } +``` + +Follow the steps to verify Oracle HTTP Server. +* Visit the {{ site.data.var.wlsFullBrandName }} Admin console. +* In the left navigator, expand the tree to select **Deployments**, install some sample application targeted to the {{ site.data.var.wlsFullBrandName }} cluster and start the service. +* Access your application using ohsAccessURL/application +* Access your application using ohsSecureAccessURL/application + diff --git a/index.html b/index.html new file mode 100644 index 000000000..a21e7ef4f --- /dev/null +++ b/index.html @@ -0,0 +1,5 @@ + + +Redirecting to https://docs.oracle.com/en/middleware/standalone/weblogic-server/wlazu/ + + diff --git a/pom.xml b/pom.xml deleted file mode 100644 index 86ebc6a4c..000000000 --- a/pom.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - - - 4.0.0 - - - com.microsoft.azure.iaas - azure-javaee-iaas-parent - 1.0.22 - - - com.oracle.weblogic.azure - weblogic-azure - pom - 1.0.0 - ${project.artifactId} - https://github.com/oracle/weblogic-azure - - - - github - GitHub Packages - https://maven.pkg.github.com/azure-javaee/azure-javaee-iaas - - - - - - github - GitHub Packages - https://maven.pkg.github.com/azure-javaee/azure-javaee-iaas - - - - - - - 1.0.87 - - 1.0.31 - 1.0.56 - 1.0.730000 - 1.0.54 - - 1.0.7 - 1.0.3 - 1.0.3 - - 1.0.28 - 1.0.3 - 1.0.3 - - - - main - - weblogic-azure - - oracle - - https://raw.githubusercontent.com/${git.repo.owner}/${git.repo}/${git.tag}/weblogic-azure-vm - - ${project.basedir} - - ${module.basedir}/../arm-ttk/arm-ttk - - file:///${module.basedir}/resources/azure-common.properties - file:///${module.basedir}/resources/pid.properties - file:///${module.basedir}/resources/microsoft-pid.properties - - - - - true - - true - - true - - - - - - weblogic-azure-aks - weblogic-azure-vm - - - diff --git a/release-notes/index.md b/release-notes/index.md new file mode 100644 index 000000000..0d509bb6b --- /dev/null +++ b/release-notes/index.md @@ -0,0 +1,105 @@ + + +# Release Notes + +## 2020-Q2 + +### Features that apply to all offers + +* Choice of five different base images. + + | WebLogic Server Version | Oracle JDK Version | Oracle Linux Version | + |-------------------------|--------------------|----------------------| + | 12.2.1.3.0 | 8 | 7.4 | + | 12.2.1.3.0 | 8 | 7.3 | + | 12.2.1.4.0 | 8 | 7.6 | + | 14.1.1.0.0 | 8 | 7.6 | + | 14.1.1.0.0 | 11 | 7.6 | + +### arm-oraclelinux-wls + +* No additional new features. + +### arm-oraclelinux-wls-admin + +* Database integration from portal. + +* Azure Active Directory Domain Services LDAP integration from portal. + +### arm-oraclelinux-wls-cluster + +* Database integration from portal. + +* Azure Active Directory Domain Services LDAP integration from portal. + +* Azure App Gateway integration from portal. + +### arm-oraclelinux-wls-dynamic-cluster + +* Database integration from portal. + +* Azure Active Directory Domain Services (Azure AD DS) LDAP integration from portal. + +### Known Issues + +* Azure AD DS integration does not work for WebLogic Server 14. + +* For cluster offers, the maximum recommended number of VMs per deployment is 20. This is due to the default limits for storage accounts. For more information see [Azure subscription and service limits, quotas, and constraints](https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-subscription-service-limits#storage-limits). + * Customers may experience Azure IaaS VM performance issues if too many OS and/or data disk VHD files are stored in each Storage Account + * Storage Accounts are limited to **20,000 IOPS** + * We expect each disk to experience up to **500 IOPS** + * We can determine approximately how many OS and data disk VHD files, as a maximum number, should reside in each storage account + * 20,000 IOPS / 500 per-disk IOPS = 40 VHDs max per Storage Account + * Each VM uses two VHDs, therefore 20 VMs. + +### Source Tags and Marketplace Bundle Versions + +| Repository Name | GitHub Tag Link | Corresponding Marketplace Bundle Version | +|-----------------|-----------------|------------------------------------------| +| arm-oracle-linux-wls | [v1.0.0](https://github.com/wls-eng/arm-oraclelinux-wls/releases/tag/v1.0.0) | 1.0.17 | +| arm-oraclelinux-wls-admin | [v1.0.0](https://github.com/wls-eng/arm-oraclelinux-wls-admin/releases/tag/v1.0.0) | 1.0.21 | +| arm-oraclelinux-wls-cluster | [v1.0.0](https://github.com/wls-eng/arm-oraclelinux-wls-cluster/releases/tag/v1.0.0) | 1.0.290000 | +| arm-oraclelinux-wls-dynamic-cluster | [v1.0.0](https://github.com/wls-eng/arm-oraclelinux-wls-dynamic-cluster/releases/tag/v1.0.0) | 1.0.19 | + +----------------------------------------------------------------- + +## 2019-Q4 + +### Features that apply to all offers + +* Network Security Group pre-created with correct ports for WebLogic Server. + +### arm-oraclelinux-wls + +* Single node with no domain pre-created. + +### arm-oraclelinux-wls-admin + +* Single node with domain pre-created with admin server running. + +* Database integration via script execution on admin server. + +### arm-oraclelinux-wls-cluster + +* Configured cluster with arbitrary number of nodes. + +* Database integration via script execution on admin server. + +### arm-oraclelinux-wls-dynamic-cluster + +* Dynamic cluster with arbitrary number of nodes. + +* Database integration via script execution on admin server. + +### Source Tags and Marketplace Bundle Versions + +| Repository Name | GitHub Tag Link | Corresponding Marketplace Bundle Version | +|-----------------|-----------------|------------------------------------------| +| arm-oracle-linux-wls | [v0.6.0](https://github.com/wls-eng/arm-oraclelinux-wls/releases/tag/v0.6.0) | 1.0.16 | +| arm-oraclelinux-wls-admin | [v0.6.0](https://github.com/wls-eng/arm-oraclelinux-wls-admin/releases/tag/v0.6.0) | 1.0.14 | +| arm-oraclelinux-wls-cluster | [v0.6.0](https://github.com/wls-eng/arm-oraclelinux-wls-cluster/releases/tag/v0.6.0) | 1.0.17 | +| arm-oraclelinux-wls-dynamic-cluster | [v0.6.0](https://github.com/wls-eng/arm-oraclelinux-wls-dynamic-cluster/releases/tag/v0.6.0) | 1.0.11 | + diff --git a/resources/azure-common.properties b/resources/azure-common.properties deleted file mode 100644 index dcbfae78e..000000000 --- a/resources/azure-common.properties +++ /dev/null @@ -1,76 +0,0 @@ -# Microsoft.Authorization/roleAssignments -azure.apiVersionForRoleAssignment=2022-04-01 -# Microsoft.Authorization/roleDefinitions -azure.apiVersionForRoleDefinitions=2022-04-01 -# Microsoft.ContainerRegistry/registries -azure.apiVersionForContainerRegistries=2023-07-01 -# Microsoft.ContainerService/managedClusters -azure.apiVersionForManagedClusters=2023-08-01 -# Microsoft.Compute/availabilitySets -azure.apiVersionForAvailabilitySets=2023-07-01 -# Microsoft.Compute/virtualMachines -azure.apiVersionForVirtualMachines=2023-07-01 -# Microsoft.KeyVault/vaults -azure.apiVersionForKeyVault=2024-11-01 -# Microsoft.KeyVault/vaults/secrets -azure.apiVersionForKeyVaultSecrets=2024-11-01 -# Microsoft.ManagedIdentity/userAssignedIdentities -azure.apiVersionForIdentity=2023-01-31 -# Microsoft.Network/networkInterfaces -azure.apiVersionForNetworkInterfaces=2023-06-01 -# Microsoft.Network/networkSecurityGroups -azure.apiVersionForNetworkSecurityGroups=2023-06-01 -# Microsoft.Network/privateEndpoints -azure.apiVersionForPrivateEndpoint=2023-06-01 -# Microsoft.Network/publicIPAddresses -azure.apiVersionForPublicIPAddresses=2023-06-01 -# Microsoft.Network/applicationGateways -azure.apiVersionForApplicationGateways=2023-06-01 -# Microsoft.Network/dnszones -azure.apiVersionForDNSZone=2023-07-01-preview -# Microsoft.Network/virtualNetworks -azure.apiVersionForVirtualNetworks=2023-06-01 -# Microsoft.OperationalInsights/workspaces -azure.apiVersionForInsightsWorkspaces=2022-10-01 -# Microsoft.Resources/deploymentScripts -azure.apiVersionForDeploymentScript=2023-08-01 -# Microsoft.Resources/deployments -azure.apiVersionForDeployment=2023-07-01 -# Microsoft.Resources/tags -azure.apiVersionForTags=2023-07-01 -# Microsoft.Storage/storageAccounts -azure.apiVersionForStorage=2023-05-01 -# Microsoft.Storage/storageAccounts/fileServices -azure.apiVersionForStorageFileService=2023-05-01 -# Microsoft.Monitor/accounts -azure.apiVersionForMonitorAccount=2023-04-03 - -# AzureAzCLI version -azure.cli.version=2.53.0 -# AzurePowerShell version -azure.powershell.version=11.5 - -# These filters are used to implement tags for resources. Other occurrences of these resource type identifiers -# are intentionally not filtered because doing so would unnecessarily complicate the code. -identifier.accounts=Microsoft.Monitor/accounts -identifier.applicationGateways=Microsoft.Network/applicationGateways -identifier.availabilitySets=Microsoft.Compute/availabilitySets -identifier.dnszones=Microsoft.Network/dnszones -identifier.managedClusters=Microsoft.ContainerService/managedClusters -identifier.networkInterfaces=Microsoft.Network/networkInterfaces -identifier.networkSecurityGroups=Microsoft.Network/networkSecurityGroups -identifier.publicIPAddresses=Microsoft.Network/publicIPAddresses -identifier.privateEndpoints=Microsoft.Network/privateEndpoints -identifier.registries=Microsoft.ContainerRegistry/registries -identifier.storageAccounts=Microsoft.Storage/storageAccounts -identifier.vaults=Microsoft.KeyVault/vaults -identifier.virtualNetworks=Microsoft.Network/virtualNetworks -identifier.virtualMachines=Microsoft.Compute/virtualMachines -identifier.virtualMachinesExtensions=Virtual machine extension -identifier.workspaces=Microsoft.OperationalInsights/workspaces -identifier.deploymentScripts=Microsoft.Resources/deploymentScripts -identifier.userAssignedIdentities=Microsoft.ManagedIdentity/userAssignedIdentities -identifier.resourcesDeployment=Microsoft resources deployment -label.tagsLabel=Tags for the resources. - -azure.armBased.vmSize.list="Standard_D2plds_v5","Standard_D4plds_v5","Standard_D8plds_v5","Standard_D16plds_v5","Standard_D32plds_v5","Standard_D48plds_v5","Standard_D64plds_v5","Standard_D2pls_v5","Standard_D4pls_v5","Standard_D8pls_v5","Standard_D16pls_v5","Standard_D32pls_v5","Standard_D48pls_v5","Standard_D64pls_v5","Standard_D2pds_v5","Standard_D4pds_v5","Standard_D8pds_v5","Standard_D16pds_v5","Standard_D32pds_v5","Standard_D48pds_v5","Standard_D64pds_v5","Standard_D2ps_v5","Standard_D4ps_v5","Standard_D8ps_v5","Standard_D16ps_v5","Standard_D32ps_v5","Standard_D48ps_v5","Standard_D64ps_v5","Standard_E2pds_v5","Standard_E4pds_v5","Standard_E8pds_v5","Standard_E16pds_v5","Standard_E20pds_v5","Standard_E32pds_v5","Standard_E2ps_v5","Standard_E4ps_v5","Standard_E8ps_v5","Standard_E16ps_v5","Standard_E20ps_v5","Standard_E32ps_v5","Standard_B2pls_v2","Standard_B2ps_v2","Standard_B2pts_v2","Standard_B4pls_v2","Standard_B4ps_v2","Standard_B8pls_v2","Standard_B8ps_v2","Standard_B16pls_v2","Standard_B16ps_v2","Standard_D2pls_v6","Standard_D4pls_v6","Standard_D8pls_v6","Standard_D16pls_v6","Standard_D32pls_v6","Standard_D48pls_v6","Standard_D64pls_v6","Standard_D96pls_v6","Standard_D2pds_v6","Standard_D4pds_v6","Standard_D8pds_v6","Standard_D16pds_v6","Standard_D32pds_v6","Standard_D48pds_v6","Standard_D64pds_v6","Standard_D96pds_v6","Standard_D2plds_v6","Standard_D4plds_v6","Standard_D8plds_v6","Standard_D16plds_v6","Standard_D32plds_v6","Standard_D48plds_v6","Standard_D64plds_v6","Standard_D96plds_v6","Standard_D2ps_v6","Standard_D4ps_v6","Standard_D8ps_v6","Standard_D16ps_v6","Standard_D32ps_v6","Standard_D48ps_v6","Standard_D64ps_v6","Standard_D96ps_v6","Standard_E2ps_v6","Standard_E4ps_v6","Standard_E8ps_v6","Standard_E16ps_v6","Standard_E32ps_v6","Standard_E48ps_v6","Standard_E64ps_v6","Standard_E96ps_v6","Standard_E2pds_v6","Standard_E4pds_v6","Standard_E8pds_v6","Standard_E16pds_v6","Standard_E32pds_v6","Standard_E48pds_v6","Standard_E64pds_v6","Standard_E96pds_v6" diff --git a/resources/basicauth.war b/resources/basicauth.war new file mode 100644 index 000000000..8583b11ac Binary files /dev/null and b/resources/basicauth.war differ diff --git a/resources/coherence-sample.war b/resources/coherence-sample.war new file mode 100644 index 000000000..324c3b334 Binary files /dev/null and b/resources/coherence-sample.war differ diff --git a/resources/doc/guidance-for-tagging-resource.md b/resources/doc/guidance-for-tagging-resource.md deleted file mode 100644 index ab2ec4c1c..000000000 --- a/resources/doc/guidance-for-tagging-resource.md +++ /dev/null @@ -1,201 +0,0 @@ - -# Guidance on Applying Tags in Solution Templates - -## What are Tags in this context and why are they useful? - -Tags are arbitrary name=value pairs that can be associated with most Azure resources. Azure features such as Azure Policy can use Tags to enforce cloud governance policies. For more about tags, see [Use tags to organize your Azure resources and management hierarchy](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/tag-resources). - -## Step 1: Audit Resources Created in the Offer - -To determine the resources that will be created in your offer, use the following commands based on the template type: - -### For ARM Templates: -Use the command below to list resource types: - -```bash -# Navigate to the offer folder -cd offer-folder -grep -rh "\"type\": \"Microsoft" --exclude="createUiDefinition.json" | sort | uniq | sed 's/^[ \t]*//' -``` - -### For Bicep Templates: -Use the command below to list resource types and remove duplicates: - -```bash -# Navigate to the offer folder -cd offer-folder -grep -rh "^resource" | grep "Microsoft." | sort | uniq | sed 's/^[ \t]*//' -``` - -Identify which resources support tags and which do not. For resources not listed below, consult the ARM definition at [Azure Resource Manager templates](https://learn.microsoft.com/en-us/azure/templates/) to determine if tagging is supported. If the definition does not include a tags property, the resource does not support tags and tagging is not required for deployments. - -### Resources that Support Tags: - -The top-level resources will be listed in the Tag UI control. Sub-resources will inherit the same tags as their parent resources. - -For example, in the UI definition, customers can specify tags for `Microsoft.KeyVault/vaults`, but not for `Microsoft.KeyVault/vaults/secrets`. For the deployment of `Microsoft.KeyVault/vaults/secrets`, the same tags applied to `Microsoft.KeyVault/vaults` will be used. This approach ensures a consistent tagging experience with Key Vault deployments in the Azure portal. - -- Microsoft.Network/dnszones -- Microsoft.Network/networkInterfaces -- Microsoft.Network/networkSecurityGroups -- Microsoft.Network/publicIPAddresses -- Microsoft.Network/privateEndpoints -- Microsoft.Storage/storageAccounts -- Microsoft.KeyVault/vaults - - Microsoft.KeyVault/vaults/secrets -- Microsoft.Network/virtualNetworks -- Microsoft.Compute/virtualMachines -- Microsoft.Compute/virtualMachines/extensions -- Microsoft.Resources/deploymentScripts -- Microsoft.ManagedIdentity/userAssignedIdentities -- Microsoft.Resources/deployments -- Microsoft.Network/applicationGateways - -### Resources that Do Not Support Tags: - -- Microsoft.Storage/storageAccounts/fileServices -- Microsoft.Storage/storageAccounts/fileServices/shares -- Microsoft.Network/networkSecurityGroups/securityRules -- Microsoft.Network/dnsZones/A -- Microsoft.Network/dnszones/CNAME -- Microsoft.Network/virtualNetworks/subnets -- Microsoft.Authorization/roleAssignments -- Microsoft.Network/loadBalancers/backendAddressPools -- Microsoft.Network/applicationGateways/backendHttpSettingsCollection -- Microsoft.Network/applicationGateways/frontendIPConfigurations -- Microsoft.Network/applicationGateways/frontendPorts -- Microsoft.Network/applicationGateways/gatewayIPConfigurations -- Microsoft.Network/applicationGateways/httpListeners -- Microsoft.Network/applicationGateways/probes -- Microsoft.Network/applicationGateways/requestRoutingRules - -## Step 2: Tag UI Control - -Incorporate the [Microsoft.Common.TagsByResource UI element](https://learn.microsoft.com/en-us/azure/azure-resource-manager/managed-applications/microsoft-common-tagsbyresource?WT.mc_id=Portal-Microsoft_Azure_CreateUIDef0) to include resources that support tags. - -## Step 3: Update the Template - -Refer to this [pull request](https://github.com/oracle/weblogic-azure/pull/327/) as a guide for how to apply tags to the resource deployments. - -Notes: - -For AKS, make sure the tag is applied to agent pool and node pool. The whole structure looks like: - -```bicep -resource symbolicname 'Microsoft.ContainerService/managedClusters@2024-06-02-preview' = { - name: 'string' - location: 'string' - tags: { - tagName1: 'tagValue1' - tagName2: 'tagValue2' - } - - ... - - agentPoolProfiles: { - - ... - - tags: { - tagName1: 'tagValue1' - tagName2: 'tagValue2' - } - } -} - -``` - -See [Microsoft.ContainerService managedClusters - Bicep](https://learn.microsoft.com/en-us/azure/templates/microsoft.containerservice/managedclusters?pivots=deployment-language-bicep) for more information. - -## Step 4: Testing - -1. **Create a Test Offer:** Set up a test offer to validate the tagging process. - -2. **Tag Settings:** - - Apply a uniform tag to all resources. - - Create specific tags for each resource, setting the tag value to the resource type (e.g., "tag1=storage account"). - -3. **Deploy the Offer:** - -4. **Verify Tags:** Use the following command to verify that the resources have the correct tags applied: - - ```bash - az resource list --resource-group --query "[].{Name:name, Type:type, Tags:tags}" -o json - ``` - - For example: - - ```shell - az resource list --resource-group haiche-sn-tag-test --query "[].{Name:name, Type:type, Tags:tags}" -o json - [ - { - "Name": "0733ecolvm", - "Tags": { - "Tag0": "All", - "Tag6": "storage account" - }, - "Type": "Microsoft.Storage/storageAccounts" - }, - { - "Name": "olvm_PublicIP", - "Tags": { - "Tag0": "All", - "Tag4": "public ip address" - }, - "Type": "Microsoft.Network/publicIPAddresses" - }, - { - "Name": "wls-nsg", - "Tags": { - "Tag0": "All", - "Tag3": "network security group" - }, - "Type": "Microsoft.Network/networkSecurityGroups" - }, - { - "Name": "olvm_VNET", - "Tags": { - "Tag0": "All", - "Tag8": "virtual network" - }, - "Type": "Microsoft.Network/virtualNetworks" - }, - { - "Name": "olvm_NIC", - "Tags": { - "Tag0": "All", - "Tag2": "network interface" - }, - "Type": "Microsoft.Network/networkInterfaces" - }, - { - "Name": "WeblogicServerVM", - "Tags": { - "Tag0": "All", - "Tag7": "virtual machine" - }, - "Type": "Microsoft.Compute/virtualMachines" - }, - { - "Name": "WeblogicServerVM_OsDisk_1_d1fed748ccaa4cac81df9179e6dff325", - "Tags": { - "Tag0": "All", - "Tag7": "virtual machine" - }, - "Type": "Microsoft.Compute/disks" - } - ] - ``` - -## Step 4: Known issues - -The tag is not applied to resources that are not deployed through our template, so we cannot apply tags to them from the template. - -Known resources: - -- Microsoft.Compute/virtualMachines/extensions - - OmsAgentForLinux - - MDE.Linux -- Microsoft.AlertsManagement/prometheusRuleGroups -- Microsoft.Insights/dataCollectionEndpoints -- Microsoft.Insights/dataCollectionRules diff --git a/resources/microsoft-pid.properties b/resources/microsoft-pid.properties deleted file mode 100644 index 5ec76ad03..000000000 --- a/resources/microsoft-pid.properties +++ /dev/null @@ -1,125 +0,0 @@ -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Values in this file are read at build time for the other Azure Marketplace offer repositories - -# This file is for pids used when testing the offers in the Microsoft internal Marketplace account. -# Pids used in https://github.com/oracle/weblogic-azure/tree/main/weblogic-azure-vm/arm-oraclelinux-wls - -end=4590f705-3e93-5945-95c3-eeb88b976091 -start=7908d405-18b6-5394-988e-fb4cabdbf5e5 - -# Pids used in https://github.com/oracle/weblogic-azure/tree/main/weblogic-azure-vm/arm-oraclelinux-wls-admin - -admin.aad.end=8295df19-fe6b-5745-ad24-51ef66522b24 -admin.aad.start=fc7e031d-111d-5a3a-8b5a-e08602237dca -admin.admin.end=be93a897-f205-5faa-8998-a0bb2014a5ac -admin.admin.start=49fcd66a-88f9-5699-9235-597fd9ed7065 -admin.database.end=3b35b279-0e94-5264-85f5-0d9d662f8a38 -admin.database.start=4bc6e9ac-72bb-5224-b9be-79d074dc9bec -admin.elk.end=1e26d5dd-cc3f-5308-a858-cf3257a486ca -admin.elk.start=3dc18163-180b-56eb-adf2-501f97c88c7c -admin.end=08e3f14d-2362-5c43-8269-133a0045d223 -admin.start=4b4d5bab-1032-530c-88db-ac3f7caf440d -admin.ssl.end=5a18b3b0-d993-51b6-ac78-dbc87bb7ba65 -admin.ssl.start=2e7d27a3-f61f-54ee-bdfd-89f597d6d70c -admin.pswless.database.end=7ebb9b3e-3465-5116-99f9-e9e092bb6198 -admin.pswless.database.start=8b595cf2-9481-5466-be25-0d1b832f22b8 - -# Pids used in https://github.com/oracle/weblogic-azure/tree/main/weblogic-azure-vm/arm-oraclelinux-wls-cluster - -cluster.aad.end=3fa6990d-1fcb-54e3-95b2-1ccd1ec50e37 -cluster.aad.start=a714884a-c4a6-5cfd-b014-97e7618b79c1 -cluster.addnode.end=279e1f09-14b3-5569-8f1f-bf2185a4c96a -cluster.addnode.start=4455d9f3-3a4c-54d2-99f8-f727c3f3dda2 -cluster.addnode.coherence.end=157eac12-12ae-11eb-adc1-0242ac120002 -cluster.addnode.coherence.start=157eacda-12ae-11eb-adc1-0242ac120002 -cluster.appgateway.custom.certificate=031f5ed3-892c-5efb-bd36-6db31717732d -cluster.appgateway.end=36deb858-08fe-5c07-bc77-ba957a59a080 -cluster.appgateway.start=391adcc9-6421-5bf8-8960-aec850ef7b0e -cluster.appgateway.keyvault.start=512d14f0-3590-5dcb-ac53-db440d59ff3c -cluster.appgateway.keyvault.end=39609365-7a7f-5480-baec-494e9cc07a25 -cluster.cluster.end=0d9bfe65-0950-54b9-b9d4-a28224b27748 -cluster.cluster.start=397378f1-5700-551f-84d2-24744c56bf21 -cluster.coherence.end=157eadac-12ae-11eb-adc1-0242ac120002 -cluster.coherence.start=157eb090-12ae-11eb-adc1-0242ac120002 -cluster.database.end=33dbeec4-3997-5759-9086-558c5e38974d -cluster.database.start=d3bbfd0e-c6f1-5bc5-a4ca-4656260bf049 -cluster.deletenode.end=4a2ba562-fbca-552d-9f02-51e88844a911 -cluster.deletenode.start=f5215b75-9465-51b6-9b1d-69bc41e3e6f4 -cluster.dns.end=916943db-498f-59d7-a410-4cf37e9ed1ad -cluster.dns.start=aa030ff6-c680-53de-8891-8dd16ce08aa6 -cluster.elk.end=e4165284-b017-5df9-9b91-3f11dd8a72e5 -cluster.elk.start=6890699c-97ad-5d76-91d3-3a3b7d64013f -cluster.ssl.end=63f1d185-d25c-55db-aa31-6d732d445f61 -cluster.ssl.start=eff0c5cb-3417-5745-a20d-cf5455fd5d39 -cluster.end=55160205-2f03-52c5-ae30-507952c0c4ea -cluster.pswless.database.end=ae2f6529-815a-5d13-b6c2-91b92d267d7a -cluster.pswless.database.start=527a8646-465b-56c7-b495-6383eeb76e2e -cluster.start=ca5e3350-ff62-5d92-83a3-acaaeae87c03 - -# Pids to indicate which database was chosen. No difference in these -# between Oracle and Microsoft - -database.oracle=692b2d84-72f5-5992-a15d-0d5bcfef040d -database.postgresql=935df06e-a5d5-5bf1-af66-4c1eb71dac7a -database.sqlserver=3569588c-b89d-5567-84ee-a2c633c7204c -database.mysql=de95ae02-f841-4c48-a69e-4bf09c4271bb - -# Pids used in https://github.com/oracle/weblogic-azure/tree/main/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster - -dynamic.aad.end=6449f9a2-0713-5a81-a886-dce6d8d5c137 -dynamic.aad.start=6245e080-ab9b-5e42-ac14-fc38cc610a11 -dynamic.addnode.end=c7671c10-ae59-5ec5-bff3-c60db22d7ea4 -dynamic.addnode.start=846e8e7a-e531-5b3d-b29f-4d298ea25de6 -dynamic.addnode.coherence.end=157eb176-12ae-11eb-adc1-0242ac120002 -dynamic.addnode.coherence.start=157eb23e-12ae-11eb-adc1-0242ac120002 -dynamic.cluster.end=eedac070-39c0-5947-a4d7-cfc864417b49 -dynamic.cluster.start=88e1c590-988c-51bb-bbd3-4929629bfb9c -dynamic.coherence.end=157eb310-12ae-11eb-adc1-0242ac120002 -dynamic.coherence.start=157eb3d8-12ae-11eb-adc1-0242ac120002 -dynamic.database.end=4a2ba562-fbca-552d-9f02-51e88844a911 -dynamic.database.start=f5215b75-9465-51b6-9b1d-69bc41e3e6f4 -dynamic.deletenode.start=a816a607-eb8a-5aa1-9475-c3fba6994679 -dynamic.deletenode.end=db9aa5e4-1e77-5f54-af38-9a7515cd27ab -dynamic.elk.end=6303dcc8-4ec9-5dd8-91f9-e829e86fa330 -dynamic.elk.start=cf939c33-1ebe-5dbb-95d2-fbe2d5cc6a4e -dynamic.end=40a6f402-31ee-536a-a006-729105f55003 -dynamic.start=07bf10d5-da4e-5113-b1c2-b8d802bda651 -dynamic.ssl.end=6714568e-9598-5cc9-8b42-3e4516c90e29 -dynamic.ssl.start=82efa164-f4e6-5dc1-93a4-51543e810225 -dynamic.pswless.database.end=b8114488-9109-5f46-a877-e86ef18d16e4 -dynamic.pswless.database.start=25b7acd8-5b7d-57c9-9c34-ad14837c39a6 - -# Pids to indicate which base image was chosen. No difference in these -# between Oracle and Microsoft - -#from.owls-122130-8u131-ol74=caa3ea2b-cdec-55ee-8510-854ed10d7ebe -#from.owls-122130-8u131-ol73=bf1d0f1a-cb9a-5453-bf70-42b4efe8c15e -from.owls-122140-8u251-ol76=bde756bb-ce96-54d5-a478-04d9bd87e9db -from.owls-141100-8u251-ol76=b6f00a34-1478-5a10-9a84-49c4051b57b8 -from.owls-141100-11_07-ol76=afc8f9c5-8c5d-5d1b-ab4d-3116ca908bfd - -# Pids to indicate which latest base image was chosen. No difference in these -# between Oracle and Microsoft -#from.owls-122130-jdk8-ol74=caa3ea2b-cdec-55ee-8510-854ed10d7ebe -#from.owls-122130-jdk8-ol73=bf1d0f1a-cb9a-5453-bf70-42b4efe8c15e -from.owls-122140-jdk8-ol76=bde756bb-ce96-54d5-a478-04d9bd87e9db -from.owls-141100-jdk8-ol76=b6f00a34-1478-5a10-9a84-49c4051b57b8 -from.owls-141100-jdk11-ol76=afc8f9c5-8c5d-5d1b-ab4d-3116ca908bfd -from.owls-122140-jdk8-ol87=cc7ee628-3750-489c-97f5-1e484d710e69 -from.owls-122140-jdk8-ol91=92f40d92-0786-4812-8918-a6f9dcc1b4ec -from.owls-141100-jdk8-ol87=5d011fae-34c1-4004-bd19-c2d2bccd30a4 -from.owls-141100-jdk8-ol91=9d76fbe1-3bbc-4a2b-a209-7427ad1db4ab -from.owls-141100-jdk11-ol87=459c178d-aec6-4bb5-8e80-66291f0ee6a8 -from.owls-141100-jdk11-ol91=5ce9afe5-c458-41b6-9b46-4899cde11806 - - -# Pids to indicate which latest base image was chosen. No difference in these -# between Oracle and Microsoft -from.owls-122140-jdk8-rhel76=0a52f317-8b40-4a77-9f3c-7607fc3ebfb7wls -from.owls-141100-jdk8-rhel76=26ec5cf5-dd84-4764-97cf-4f830facbf66wls -from.owls-141100-jdk11-rhel76=ada2e3e6-faef-4339-aaac-40bcdc4484ecwls -from.owls-122140-jdk8-rhel87=6250babf-50f9-4462-a0c5-ebb8dc1ce5a7 -from.owls-141100-jdk8-rhel87=544e3e2c-d0a5-4615-87ff-2eadd5fefe5d -from.owls-141100-jdk11-rhel87=7c4a9f1d-ecdf-4fd3-bb68-0a28d8bea751 \ No newline at end of file diff --git a/resources/pid.properties b/resources/pid.properties deleted file mode 100644 index dcf615e9e..000000000 --- a/resources/pid.properties +++ /dev/null @@ -1,124 +0,0 @@ -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Values in this file are read at build time for the other Azure Marketplace offer repositories - -# Pids used in https://github.com/oracle/weblogic-azure/tree/main/weblogic-azure-vm/arm-oraclelinux-wls - -end=pid-a63dea86-f8db-4e75-a231-1145d4f3ab6e-partnercenter -start=b446fe15-5d43-5549-858d-4775741cd0ba - -# Pids used in https://github.com/oracle/weblogic-azure/tree/main/weblogic-azure-vm/arm-oraclelinux-wls-admin - -admin.aad.end=d273da6e-9128-5163-a8e7-9f76505ae5cc -admin.aad.start=0a77c1d0-cf1e-5185-89ad-230ffe24d0f8 -admin.admin.end=1176aa69-c0c4-5651-8c66-25cbfd8de483 -admin.admin.start=47c1a398-7527-53f0-abc7-13a206844885 -admin.database.end=e4549cf7-1f1e-5add-a543-0dfcc627976b -admin.database.start=6b253477-1753-5eb1-9448-506ab47494d7 -admin.elk.end=78d94c2d-7401-52a9-be03-4cf1cc4e8f00 -admin.elk.start=f3c3b847-89ea-54c8-904e-10ff8eba14fa -admin.end=057f09cd-6f90-5c1c-b655-3aba168aef35 -admin.start=pid-7e52c2b6-1acb-416f-af55-5837ff783eb7-partnercenter -admin.ssl.end=7185f788-ab74-5158-8f83-4146d01cec9d -admin.ssl.start=2730ced3-52c2-501c-94b1-bfcffa5b5bc0 -admin.pswless.database.end=89d5d2a9-16b8-5b3d-b5f7-1fb8a6cfdfc5 -admin.pswless.database.start=53e099bf-8148-5463-a51d-0272520bac60 - -# Pids used in https://github.com/oracle/weblogic-azure/tree/main/weblogic-azure-vm/arm-oraclelinux-wls-cluster - -cluster.aad.end=3031eeaf-f67e-5f61-8bf1-aad6006eaf6d -cluster.aad.start=cae84e84-407c-5cef-b2a0-cd95d4ff8824 -cluster.addnode.end=2452bb0e-13d9-5ad3-816b-d645ba5198c4 -cluster.addnode.start=ffa02caf-ecb9-59df-82ce-74b9b0247c50 -cluster.addnode.coherence.end=157ea8ac-12ae-11eb-adc1-0242ac120002 -cluster.addnode.coherence.start=157ea992-12ae-11eb-adc1-0242ac120002 -cluster.appgateway.custom.certificate=d7c730b9-494c-5cc2-9695-cc1057da3e0b -cluster.appgateway.end=b626bee4-b322-5418-990f-6463a799be3c -cluster.appgateway.start=4f85ce49-6de4-5925-b77c-3eb15ba97921 -cluster.appgateway.keyvault.start=ed922d8d-975f-55d4-b33a-28fbace13f76 -cluster.appgateway.keyvault.end=b29b66f4-5623-586e-96a2-663ac0d84e35 -cluster.cluster.end=f05658d8-329d-55e8-9077-5761b8279b31 -cluster.cluster.start=07bfd1f7-83ff-50cd-bd74-61b00a2a6808 -cluster.coherence.end=157eaa6e-12ae-11eb-adc1-0242ac120002 -cluster.coherence.start=157eab40-12ae-11eb-adc1-0242ac120002 -cluster.database.end=a1760bef-276e-53eb-bea2-e150d7638b49 -cluster.database.start=9e8f86ad-dcf5-5acd-a1f5-26d62358f218 -cluster.deletenode.end=4b263220-3cc6-53b9-aef3-23ad10c45d52 -cluster.deletenode.start=7d4ae6d6-17c5-5168-b7d2-e0bf33a1e878 -cluster.dns.end=022d99e3-8ba3-5822-b6d5-bcec64518286 -cluster.dns.start=c40d7aa8-9fe7-51c6-86de-27e1b1678735 -cluster.elk.end=cb84f8ed-d270-5036-8240-08b6bb4f2bd6 -cluster.elk.start=c9bac63c-67eb-52e1-a8c1-2ba57f65cfbc -cluster.ssl.end=4f29ea52-dfd6-5537-8a38-4ad9fec1b2eb -cluster.ssl.start=e09585b6-b7cb-5437-a600-c95c88ac37b3 -cluster.end=0fa14086-2d46-54a4-8aba-470addc3dce6 -cluster.pswless.database.end=b4d91140-fb26-50de-9358-147b9dd25f7a -cluster.pswless.database.start=340f5265-6de7-5b6f-aad3-9f179736cde0 -cluster.start=pid-7363cd91-937d-4469-a7a8-ecbeddfb7a0f-partnercenter - -# Pids to indicate which database was chosen. No difference in these -# between Oracle and Microsoft - -database.oracle=692b2d84-72f5-5992-a15d-0d5bcfef040d -database.postgresql=935df06e-a5d5-5bf1-af66-4c1eb71dac7a -database.sqlserver=3569588c-b89d-5567-84ee-a2c633c7204c -database.mysql=41c353ae-6f7b-442f-b903-996cb42c1bbe - -# Pids used in https://github.com/oracle/weblogic-azure/tree/main/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster - -dynamic.aad.end=f5a60b13-efd6-551a-a40f-3923804e475d -dynamic.aad.start=7dcc8904-9a8a-5b71-a73d-6caa9edb78ef -dynamic.addnode.start=5f68f633-701b-58b0-83c2-399c6d1d8414 -dynamic.addnode.end=449e677a-5fc3-55cb-9193-4b225f42e646 -dynamic.addnode.coherence.end=157ea1ea-12ae-11eb-adc1-0242ac120002 -dynamic.addnode.coherence.start=157ea410-12ae-11eb-adc1-0242ac120002 -dynamic.cluster.addnode.end=e9ac3048-2c62-5ae4-8a6d-fa6cc0d756ac -dynamic.cluster.addnode.start=9697621e-54df-51da-8169-ffcb58cb0a0c -dynamic.cluster.end=515d22ac-ff8c-5faa-aca1-3605ab5d2034 -dynamic.cluster.start=22e98104-2229-5ec7-9a90-12edca3d88e7 -dynamic.coherence.end=157ea51e-12ae-11eb-adc1-0242ac120002 -dynamic.coherence.start=157ea604-12ae-11eb-adc1-0242ac120002 -dynamic.database.end=699d05c7-41f8-5512-aeef-f68651e247c2 -dynamic.database.start=488f2f70-6999-5970-bae9-251097c2d0b6 -dynamic.deletenode.start=931c2901-224a-5cc6-b235-41fa162b7532 -dynamic.deletenode.end=3eb27f94-d1c3-572c-a7da-0d7f26f6a20e -dynamic.elk.end=d154e480-15e2-5cf7-bdd5-6219c1793967 -dynamic.elk.start=bc636673-2dca-5e40-a2aa-6891c344aa17 -dynamic.end=93da13bf-11f6-5bfb-9b51-7deb152a21c3 -dynamic.start=pid-89d7f595-f164-4cbd-abbb-e46cd0b342e8-partnercenter -dynamic.ssl.end=325d251a-fcba-5bd8-ad50-5682b3565ef5 -dynamic.ssl.start=f6e45a7a-d491-58a1-a951-fad252e1a396 -dynamic.pswless.database.end=fd30aea8-ec77-557b-ba12-4de15018a64a -dynamic.pswless.database.start=2d02881c-c7d2-5e16-b9b8-c48ebf70d2ab - -# Pids to indicate which base image was chosen. No difference in these -# between Oracle and Microsoft - -#from.owls-122130-8u131-ol74=ac3571f9-c12d-5caa-b886-85734693ab63 -#from.owls-122130-8u131-ol73=2bd71be8-b31c-5fbf-96ba-61fde622586d -from.owls-122140-8u251-ol76=dd07bd44-828b-566a-8dc6-b84bf301bf1d -from.owls-141100-8u251-ol76=cb2af004-23c3-5c85-87b9-9de767c7a61e -from.owls-141100-11_07-ol76=632e8fde-e61f-57bf-af9d-5804bf00ecb3 - -# Pids to indicate which latest base image was chosen. -#from.owls-122130-jdk8-ol74=40fe0044-5739-466c-96aa-0c82ab465d0b -#from.owls-122130-jdk8-ol73=799fc764-af80-45c3-aea1-599f55901e73 -from.owls-122140-jdk8-ol76=6637154a-06d2-4ac0-82ab-2a1d7e391eab -from.owls-141100-jdk8-ol76=060d9c3f-cc20-4380-a383-fd20594e5b2a -from.owls-141100-jdk11-ol76=3220431f-33d4-416a-8df7-a0fcc23a25e4 -from.owls-122140-jdk8-ol87=f2ae4133-abd1-4711-ae74-aeb6e498f2c0 -from.owls-122140-jdk8-ol91=2b7d87a9-981a-44af-bf71-b2b479841ed9 -from.owls-141100-jdk8-ol87=d58854b4-a612-4fbf-b095-f2d2178a88df -from.owls-141100-jdk8-ol91=76d4dbe8-0679-4772-ad2e-461fac83dfd7 -from.owls-141100-jdk11-ol87=c8f1b07d-1660-4f6a-be97-3925645e8817 -from.owls-141100-jdk11-ol91=cd48f178-52a3-415e-88bb-caa45f615b94 - -# Pids to indicate which latest base image was chosen. No difference in these -# between Oracle and Microsoft -from.owls-122140-jdk8-rhel76=0a52f317-8b40-4a77-9f3c-7607fc3ebfb7wls -from.owls-141100-jdk8-rhel76=26ec5cf5-dd84-4764-97cf-4f830facbf66wls -from.owls-141100-jdk11-rhel76=ada2e3e6-faef-4339-aaac-40bcdc4484ecwls -from.owls-122140-jdk8-rhel87=0799976a-84a5-4a59-b74b-bd67c4d37aa5 -from.owls-141100-jdk8-rhel87=2e471204-8cbe-4aec-9c64-4d0f5f8d590d -from.owls-141100-jdk11-rhel87=b1f76ba8-078d-43bc-b35c-9a4952eb00c9 \ No newline at end of file diff --git a/resources/webtestapp.war b/resources/webtestapp.war new file mode 100644 index 000000000..7eb9c92d5 Binary files /dev/null and b/resources/webtestapp.war differ diff --git a/sbom_generation.yaml b/sbom_generation.yaml deleted file mode 100644 index 24f757d1d..000000000 --- a/sbom_generation.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. - -# This OCI DevOps build specification file [1] generates a Software Bill of Materials (SBOM) of the repository. -# The file is needed to run checks for third-party vulnerabilities and business approval according to Oracle’s GitHub policies. -# [1] https://docs.oracle.com/en-us/iaas/Content/devops/using/build_specs.htm - -version: 0.1 -component: build -timeoutInSeconds: 1000 -shell: bash - -steps: - - type: Command - name: "Run Maven cycloneDX plugin command" - command: | - # For more details, visit https://github.com/CycloneDX/cyclonedx-maven-plugin/blob/master/README.md - mvn org.cyclonedx:cyclonedx-maven-plugin:2.7.9:makeAggregateBom -DincludeRuntimeScope=true -DincludeCompileScope=true -DincludeProvidedScope=false -DincludeSystemScope=false -DincludeTestScope=false -DoutputFormat=json -DoutputName=artifactSBOM -DschemaVersion=1.4 - mv target/artifactSBOM.json ${OCI_PRIMARY_SOURCE_DIR}/artifactSBOM.json -outputArtifacts: - - name: artifactSBOM - type: BINARY - location: ${OCI_PRIMARY_SOURCE_DIR}/artifactSBOM.json diff --git a/subtemplate-src/addnode-coherence.md b/subtemplate-src/addnode-coherence.md new file mode 100644 index 000000000..f208cade4 --- /dev/null +++ b/subtemplate-src/addnode-coherence.md @@ -0,0 +1,577 @@ + + +{% include variables.md %} + +# Add cache managed server to {{ site.data.var.wlsFullBrandName }} Coherence cluster + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} to add new managed cache server using Azure CLI. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The `addnode-coherence.json` template will be applied to an existing {{ site.data.var.wlsFullBrandName }} **Coherence** cluster. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Coherence cluster + +You can configure Coherence cluster from Azure portal or running Coherence sub template. + +* Configure Coherence cluster from Azure portal + + Select `yes` in Coherence section and input required settings, the Azure WebLogic IaaS offer will configure a Coherence cluster automatically. + +* Configure Coherence cluster via Coherence sub template + + Refer to [Configure Coherence cluster](coherenceTemplate.html). + +## Prepare the Parameters JSON file + +You must construct a parameters JSON file containing the parameters to `addnode-coherence.json` template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. You must specify the information of the existing {{ site.data.var.wlsFullBrandName }} and nodes that to be added. This section shows how to obtain the values for the following required properties. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Parameter NameExplanation
_artifactsLocationSee below for details.
elkSettingsOptional. JSON object type. You can specify this parameters for Elasticsearch and Kibana(ELK) connection. If enable is true, must specify other properties. See the page WebLogic with Elastic on Azure for further information.
enableIf enable is true, must specify all properties of the elkSettings.
elasticsearchEndpointEndpoint of the Elasticsearch instance.
elasticsearchPasswordPassword for Elasticsearch account.
elasticsearchUserNameUser name for Elasticsearch account.
logIndexMust be the same value output at ELK deployment time.
logsToIntegrateArray with string value. Specify the expeted logs to integrate, you must input at least one log.
adminPasswordOrKeyPassword of administration account for the new Virtual Machine that host new nodes.
adminVMNameVirtual machine name of which hosts the {{ site.data.var.wlsFullBrandName }} admin server, for example: adminVM.
enableCoherenceWebLocalStorageSpecifies whether Local Storage is enabled for the Coherence*Web cluster tier.
locationMust be the same region into which the server was initially deployed.
managedServerPrefixMust be the same prefix with which the cluster was initially deployed.
numberOfExistingCacheNodesNumber of existing Coherence cache servers, used to name new virtual machines and new managed server.
numberOfNewCacheNodesNumber of new Coherence cahce servers, used to create Virtual Machines and Managed Server.
skuUrnVersionMust be the same urn with which the cluster was initially deployed.
storageAccountNameThe name of an existing storage account.
vmSizeSelect appropriate VM Size for Coherence cache servers.
wlsDomainNameMust be the same value provided at deployment time.
wlsPasswordMust be the same value provided at deployment time.
wlsUserNameMust be the same value provided at deployment time.
+ +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateAddCacheNodeBasePath }} +``` + +### Existing cache nodes +To differentiate functionality of managed cache servers, we use **managed application server** to represent managed servers that host Java EE application, and use **managed cache server** to represent managed servers that used for cache. + +You can get the existing managed cache servers with the following command: + +```shell +$ resourceGroup= +$ managedServerPrefix= +$ numberOfExistingCacheNodes=$(az resource list -g ${resourceGroup} --resource-type Microsoft.Compute/virtualMachines --query [*].name | grep "${managedServerPrefix}StorageVM[0-9]" | sed -e 's/[^0-9]/ /g' -e 's/^ *//g' -e 's/ *$//g' | tr -s ' ' | sed 's/ /\n/g' | sort -nr | head -n1) +$ echo ${numberOfExistingCacheNodes} +``` + +### Log index + +If you configured ELK in your cluster to export WebLogic Server logs to ELK, please input the value of Kibana log index, this template will set up ELK connection and export logs to specified index. + +You can get the value from Azure portal with the following steps: + +* Go to Azure portal. +* Open you resource group and click **Deployments**. +* Open the ELK deployment, and click **Output**. +* Copy the value of `logIndex`. + +Alternatively, use Azure CLI command to list log index inside the resource group deployments: + +```shell +$ az deployment group list -g 'yourResourceGroup' --query [*].properties.outputs.logIndex.value +[ + "azure-weblogic-cluster-f984df74-ab4d-4c17-a532-7f248659fb28" +] +``` + +### Storage account + +Each Storage Account handles up to 20,000 IOPS, and 500TB of data. If you use a storage account for Standard Virtual Machines, you can store until 40 virtual disks. + +We have two disks for one Virtual Machine, it's suggested no more than 20 Virtual Machines share the same storage account. Number of virtual machines that hosting managed servers should be less than or equal to 20. + +You can get the name of storage account from Azure portal with steps: + + * Go to Azure portal + * Go to the your resource group + * Find storage account resource and copy its name + +Alternatively, use Azure CLI command to list storage account inside a resource group: + +```shell +$ az resource list -g 'yourResourceGroup' --resource-type Microsoft.Storage/storageAccounts --query [*].name +[ + "219846olvm" +] +``` + +#### Example Parameters JSON + +Here is a fully filled out parameters file. We will leave values of `adminUsername`, `authenticationType`, `dnsLabelPrefix`, `usePreviewImage` and `vmSize` as default value. + +{{ site.data.var.passwordInFileNote }} + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "_artifactsLocation": { + "value": "{{ armTemplateAddCacheNodeBasePath }}" + }, + "adminPasswordOrKey": { + "value": "jyfRat@nht2019" + }, + "adminVMName": { + "value": "adminVM" + }, + "elkSettings": { + "value": { + "enable": true, + "elasticsearchEndpoint":"https://example.eastus2.azure.elastic-cloud.com:9243", + "elasticsearchPassword": "Secret123!", + "elasticsearchUserName":"elastic", + "logIndex": "azure-weblogic-dynamic-cluster-11122020", + "logsToIntegrate": ["HTTPAccessLog", "ServerLog", "DomainLog", "DataSourceLog", "StandardErrorAndOutput", "NodeManagerLog"] + } + }, + "enableCoherenceWebLocalStorage": { + "value": true + }, + "location": { + "value": "eastus" + }, + "managedServerPrefix": { + "value": "msp" + }, + "numberOfExistingCacheNodes": { + "value": 1 + }, + "numberOfNewCacheNodes": { + "value": 1 + }, + "skuUrnVersion": { + "value": "owls-122140-8u251-ol76;Oracle:weblogic-122140-jdk8u251-ol76:owls-122140-8u251-ol7;latest" + }, + "storageAccountName": { + "value": "d40140olvm" + }, + "wlsDomainName": { + "value": "wlsd" + }, + "wlsPassword": { + "value": "welcome1" + }, + "wlsUserName": { + "value": "weblogic" + } + } +} +``` + +## Invoke the ARM template + +Assume your parameters file is available in the current directory and is named `parameters.json`. This section shows the commands to configure your {{ site.data.var.wlsFullBrandName }} deployment to add new nodes. Replace `yourResourceGroup` with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +### First, validate your parameters file + +The `az deployment group validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az deployment group validate --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateAddCacheNodeBasePath }}arm/mainTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Next, execute the template + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az deployment group create --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateAddCacheNodeBasePath }}arm/mainTemplate.json +``` + +As with the validate command, if the command returns with an exit status other than `0`, inspect the output and resolve the problem. + +This is an example output of successful deployment. Look for `"provisioningState": "Succeeded"` in your output. + +```bash +{ + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Resources/deployments/mainTemplate", + "location": null, + "name": "mainTemplate", + "properties": { + "correlationId": "19040fc8-2b74-4e64-9dd9-59a5a3ce401a", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM2/extensions/newuserscript", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM2/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Resources/deployments/pid-157ea8ac-12ae-11eb-adc1-0242ac120002", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "pid-157ea8ac-12ae-11eb-adc1-0242ac120002", + "resourceType": "Microsoft.Resources/deployments" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Network/publicIPAddresses/mspStorageVM2_PublicIP", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM2_PublicIP", + "resourceType": "Microsoft.Network/publicIPAddresses" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Network/networkInterfaces/mspStorageVM2_NIC", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM2_NIC", + "resourceType": "Microsoft.Network/networkInterfaces" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Network/networkInterfaces/mspStorageVM2_NIC", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM2_NIC", + "resourceType": "Microsoft.Network/networkInterfaces" + }, + { + "apiVersion": "2019-06-01", + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Storage/storageAccounts/33f2e3olvm", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "33f2e3olvm", + "resourceType": "Microsoft.Storage/storageAccounts" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM2", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM2", + "resourceType": "Microsoft.Compute/virtualMachines" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM2", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM2", + "resourceType": "Microsoft.Compute/virtualMachines" + }, + { + "actionName": "listKeys", + "apiVersion": "2019-04-01", + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Storage/storageAccounts/33f2e3olvm", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "33f2e3olvm", + "resourceType": "Microsoft.Storage/storageAccounts" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM2/extensions/newuserscript", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM2/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "duration": "PT10M24.4018847S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputResources": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM2", + "resourceGroup": "haiche-cluster-1106" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM2/extensions/newuserscript", + "resourceGroup": "haiche-cluster-1106" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Network/networkInterfaces/mspStorageVM2_NIC", + "resourceGroup": "haiche-cluster-1106" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Network/publicIPAddresses/mspStorageVM2_PublicIP", + "resourceGroup": "haiche-cluster-1106" + } + ], + "outputs": { + "artifactsLocationPassedIn": { + "type": "String", + "value": "{{ armTemplateAddCacheNodeBasePath }}" + } + }, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "{{ armTemplateAddCacheNodeBasePath }}" + }, + "_artifactsLocationSasToken": { + "type": "SecureString" + }, + "adminPasswordOrKey": { + "type": "SecureString" + }, + "adminUsername": { + "type": "String", + "value": "weblogic" + }, + "adminVMName": { + "type": "String", + "value": "adminVM" + }, + "authenticationType": { + "type": "String", + "value": "password" + }, + "dnsLabelPrefix": { + "type": "String", + "value": "wls" + }, + "enableCoherenceWebLocalStorage": { + "type": "Bool", + "value": true + }, + "guidValue": { + "type": "String", + "value": "d5dde421-44b0-48df-9d12-db02374654d3" + }, + "location": { + "type": "String", + "value": "eastus" + }, + "managedServerPrefix": { + "type": "String", + "value": "msp" + }, + "numberOfExistingCacheNodes": { + "type": "Int", + "value": 1 + }, + "numberOfNewCacheNodes": { + "type": "Int", + "value": 1 + }, + "skuUrnVersion": { + "type": "String", + "value": "owls-122130-8u131-ol74;Oracle:weblogic-122130-jdk8u131-ol74:owls-122130-8u131-ol7;latest" + }, + "storageAccountName": { + "type": "String", + "value": "33f2e3olvm" + }, + "usePreviewImage": { + "type": "Bool", + "value": false + }, + "vmSize": { + "type": "String", + "value": "Standard_A1" + }, + "wlsDomainName": { + "type": "String", + "value": "wlsd" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Network", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "publicIPAddresses" + }, + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "networkInterfaces" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines" + }, + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "16596437850900945013", + "templateLink": null, + "timestamp": "2020-11-09T06:28:40.936524+00:00" + }, + "resourceGroup": "haiche-cluster-1106", + "type": "Microsoft.Resources/deployments" +} +``` + +## Verify + +### Verify if new cache nodes are added to the WebLogic Server instance. + +* Go to the {{ site.data.var.wlsFullBrandName }} Administration Console. +* Go to **Environment** -> **Machines**. + + You should see logical machines with name parttern `^{managedServerPrefix}StorageVM[0-9]+$`, machine names with number suffix from `numberOfExistingCacheNodes` to `numberOfExistingCacheNodes + numberOfNewCacheNodes` are added. +* Go to **Environment** -> **Servers** + + You should see servers with name parttern `^{managedServerPrefix}Storage[0-9]+$`, server names with number suffix from `numberOfExistingCacheNodes` to `numberOfExistingCacheNodes + numberOfNewNodes` are added to `storage1`. + +### Verify if Azure resources are added + +* Go to [Azure Portal](https://ms.portal.azure.com/). +* Go to resource group that the {{ site.data.var.wlsFullBrandName }} is deployed. + + You should see corresponding Vitual Machines, Disks, Network Interfaces, Public IPs have been added. diff --git a/subtemplate-src/admin-aadNestedTemplate.md b/subtemplate-src/admin-aadNestedTemplate.md new file mode 100644 index 000000000..99653c202 --- /dev/null +++ b/subtemplate-src/admin-aadNestedTemplate.md @@ -0,0 +1,309 @@ + + +{% include variables.md %} + +# Apply Azure Active Directory ARM Template to {{ site.data.var.wlsFullBrandName }} + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} with an existing Azure Active Directory Domain Service (AAD DS) using Azure CLI. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The AAD ARM template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Azure Active Directory LDAP Instance + +To apply AAD to {{ site.data.var.wlsFullBrandName }}, you must have an existing Azure Active Directory LDAP instance to use. If you don't have AAD LADP instance, please follow the steps in the tutorial [Configure secure LDAP for an Azure Active Directory Domain Services managed domain](https://docs.microsoft.com/en-us/azure/active-directory-domain-services/tutorial-configure-ldaps). + +## Prepare the Parameters JSON file + +You must construct a parameters JSON file containing the parameters to the AAD ARM template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. We must specify the information of the existing {{ site.data.var.wlsFullBrandName }} and AAD instance. This section shows how to obtain the values for the following required properties. + +| Parameter Name | Explanation | +|----------------|-------------| +| `_artifactsLocation`| See below for details. | +| `aadsPortNumber` | (optional) The LDAP port number, defaults to 636. | +| `aadsPublicIP` | The IP address of the LDAP server | +| `aadsServerHost` | The hostname of the Active Directory Domain Services server. | +| `adminVMName`| At deployment time, if this value was changed from its default value, the value used at deployment time must be used. Otherwise, this parameter should be omitted. | +| `location` | Must be the same region into which the server was initially deployed. | +| `wlsDomainName` | The name of the {{ site.data.var.wlsFullBrandName }} domain. | +| `wlsLDAPGroupBaseDN` | The base distinguished name (DN) of the tree in the LDAP directory that contains groups. | +| `wlsLDAPPrincipalPassword` | The credential (usually a password) used to connect to the LDAP server. | +| `wlsLDAPPrincipal` | The Distinguished Name (DN) of the LDAP user that {{ site.data.var.wlsFullBrandName }} should use to connect to the LDAP server. | +| `wlsLDAPProviderName` | (optional) The value used for creating authentication provider name of WebLogic Server. | +| `wlsLDAPSSLCertificate` | Client certificate that will be imported to trust store of SSL. | +| `wlsLDAPSSLCertificate` | See below for details. | +| `wlsLDAPUserBaseDN` | The base distinguished name (DN) of the tree in the LDAP directory that contains users. | +| `wlsPassword` | Must be the same value provided at deployment time. | +| `wlsUserName` | Must be the same value provided at deployment time. | + +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateBasePath }} +``` + +### `wlsLDAPSSLCertificate` + +Use base64 to encode your existing SSL certificate. + +```bash +base64 your-certificate.cer -w 0 >temp.txt +``` + +Use the content as this file as the value of the `wlsLDAPSSLCertificate` parameter. + +#### Example Parameters JSON + +Here is a fully filled out parameters file. Note that we did not include values for parameters that have a default value. + +{{ site.data.var.passwordInFileNote }} + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "_artifactsLocation": { + "value": "{{ armTemplateBasePath }}" + }, + "aadsPublicIP": { + "value": "1.2.3.4" + }, + "aadsServerHost": { + "value": "ladps.fabrikam.com" + }, + "location": { + "value": "eastus" + }, + "wlsDomainName": { + "value": "adminDomain" + }, + "wlsLDAPGroupBaseDN": { + "value": "OU=AADDC Users,DC=fabrikam,DC=com" + }, + "wlsLDAPPrincipal": { + "value": "CN=WLSTest,OU=AADDC Users,DC=fabrikam,DC=com" + }, + "wlsLDAPPrincipalPassword": { + "value": "Secret123!" + }, + "wlsLDAPSSLCertificate": { + "value": "MIIKQQIBAz....EkAgIIAA==" + }, + "wlsLDAPUserBaseDN": { + "value": "OU=AADDC Users,DC=fabrikam,DC=com" + }, + "wlsPassword": { + "value": "welcome1" + }, + "wlsUserName": { + "value": "weblogic" + } + } +} +``` + +## Invoke the ARM template + +Assume your parameters file is available in the current directory and is named `parameters.json`. This section shows the commands to configure your {{ site.data.var.wlsFullBrandName }} deployment with the specified AAD. Replace `yourResourceGroup` with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +### First, validate your parameters file + +The `az group deployment validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az group deployment validate --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/aadNestedTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Next, execute the template + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az group deployment create --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/aadNestedTemplate.json +``` + +As with the validate command, if the command returns with an exit status other than `0`, inspect the output and resolve the problem. + +This is an example output of successful deployment. Look for `"provisioningState": "Succeeded"` in your output. + +```json +{ + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-06082/providers/Microsoft.Resources/deployments/cli", + "location": null, + "name": "cli", + "properties": { + "correlationId": "6d98e1c8-0778-4fa5-a30a-8f10bbbb6818", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-06082/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-admin-06082", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-06082/providers/Microsoft.Resources/deployments/pid-8295df19-fe6b-5745-ad24-51ef66522b24", + "resourceGroup": "oraclevm-admin-06082", + "resourceName": "pid-8295df19-fe6b-5745-ad24-51ef66522b24", + "resourceType": "Microsoft.Resources/deployments" + } + ], + "duration": "PT2M59.6052694S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputResources": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-06082/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-admin-06082" + } + ], + "outputs": { + "artifactsLocationPassedIn": { + "type": "String", + "value": "https://raw.githubusercontent.com/galiacheng/arm-oraclelinux-wls-admin/deploy/src/main/arm/" + } + }, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "https://raw.githubusercontent.com/galiacheng/arm-oraclelinux-wls-admin/deploy/src/main/arm/" + }, + "_artifactsLocationAADTemplate": { + "type": "String", + "value": "https://raw.githubusercontent.com/galiacheng/arm-oraclelinux-wls-admin/deploy/src/main/arm/" + }, + "_artifactsLocationSasToken": { + "type": "SecureString" + }, + "aadsPortNumber": { + "type": "String", + "value": "636" + }, + "aadsPublicIP": { + "type": "String", + "value": "40.76.11.111" + }, + "aadsServerHost": { + "type": "String", + "value": "ladps.wls-security.com" + }, + "adminVMName": { + "type": "String", + "value": "adminVM" + }, + "location": { + "type": "String", + "value": "eastus" + }, + "wlsDomainName": { + "type": "String", + "value": "adminDomain" + }, + "wlsLDAPGroupBaseDN": { + "type": "String", + "value": "OU=AADDC Users,DC=wls-security,DC=com" + }, + "wlsLDAPPrincipal": { + "type": "String", + "value": "CN=WLSTest,OU=AADDC Users,DC=wls-security,DC=com" + }, + "wlsLDAPPrincipalPassword": { + "type": "SecureString" + }, + "wlsLDAPProviderName": { + "type": "String", + "value": "AzureActiveDirectoryProvider" + }, + "wlsLDAPSSLCertificate": { + "type": "String", + "value": "LS0tLS1...LQ0K" + }, + "wlsLDAPUserBaseDN": { + "type": "String", + "value": "OU=AADDC Users,DC=wls-security,DC=com" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "2818584196763146470", + "templateLink": null, + "timestamp": "2020-06-09T07:07:03.444046+00:00" + }, + "resourceGroup": "oraclevm-admin-06082", + "type": "Microsoft.Resources/deployments" +} + +``` + +## Verify AAD Integration + +Follow the steps to check if AAD is enabled. + +* Visit the {{ site.data.var.wlsFullBrandName }} Admin console. +* In the left navigator, expand the tree to select **Security Realms** -> **myrealm** -> **Providers**. +* If the integration was successful, you will find the AAD provider for example `AzureActiveDirectoryProvider`. +* In the left navigator, expand the tree to select **Security Realms** -> **myrealm** -> **Users and Groups**. +* If the integration was successful, you will find users from the AAD provider. diff --git a/subtemplate-src/admin-customDNSTemplate.md b/subtemplate-src/admin-customDNSTemplate.md new file mode 100644 index 000000000..e5f8ac1cf --- /dev/null +++ b/subtemplate-src/admin-customDNSTemplate.md @@ -0,0 +1,158 @@ + + +{% include variables.md %} + +# Configure DNS alias to {{ site.data.var.wlsFullBrandName }} + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} with a custom DNS alias. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The DNS Configuration ARM template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Registered Domain Name + +You need to buy a domain name to create a custom DNS alias. + +### Azure DNS Zone + +If you create the DNS alias on an existing [Azure DNS Zone](https://docs.microsoft.com/en-us/azure/dns/dns-overview), make sure you have performed the [Azure DNS Delegation](https://docs.microsoft.com/en-us/azure/dns/dns-domain-delegation). After you have completed the delegation, you can verify it with `nslookup`. For example, assuming your domain name is **contoso.com**, this output shows a correct delegation. + +```bash +$ nslookup -type=SOA contoso.com +Server: 172.29.80.1 +Address: 172.29.80.1#53 + +Non-authoritative answer: +contoso.com + origin = ns1-01.azure-dns.com + mail addr = azuredns-hostmaster.microsoft.com + serial = 1 + refresh = 3600 + retry = 300 + expire = 2419200 + minimum = 300 +Name: ns1-01.azure-dns.com +Address: 40.90.4.1 +Name: ns1-01.azure-dns.com +Address: 2603:1061::1 +``` + +We strongly recommand you create an Azure DNS Zone for domain management and reuse it for other perpose. Follow the [guide](https://docs.microsoft.com/en-us/azure/dns/dns-getstarted-portal) to create an Azure DNS Zone. + +## Prepare the Parameters + +We provide an automation shell script for DNS configuration. You must specify the information of the existing Oracle WebLogic Server. This section shows how to obtain the values for the following required properties. + +| Parameter Name             | Explanation | +|----------------|-------------| +| `--admin-vm-name`| Required. Name of vitual machine that hosts {{ site.data.var.wlsFullBrandName }} admin server. Must be the same value provided at initial deployment time.| +| `--admin-console-label` | Required. Label for {{ site.data.var.wlsFullBrandName }} admin console. Used to generate subdomain of admin console. | +| `--artifact-location`| Required. See below for details. | +| `--resource-group` | Required. Name of resource group that has an {{ site.data.var.wlsFullBrandName }} cluster deployed. | +| `--location ` | Required. Must be the same region into which the server was initially deployed. | +| `--zone-name ` | Required. Azure DNS Zone name. | +| `--zone-resource-group` | Optional. Name of resource group that has Azure DNS Zone deployed. The parameter is only required if you are creating DNS alias on an existing DNS Zone. | +| `--help` | Help. | + +### Artifacts location + +This value must be the following. + +```bash +{{ armTemplateBasePath }} +``` + +## Invoke the Automation Script + +We provide an automation script to configure a custom DNS alias. The script lets you do the following: + + * If you have an Azure DNS Zone, it will create a DNS alias for the admin console on the existing DNS Zone. + * If you don't have an Azure DNS Zone, it will create the DNS Zone in the same resource group as the {{ site.data.var.wlsFullBrandName }} cluster, then create the DNS alias for the admin console. + +### Configure DNS Alias on an Existing Azure DNS Zone + +To configure a DNS alias on an existing Azure DNS Zone, in addition to the required parameters, you must also specify an Azure user-assigned managed identity ID and the resource group name in which your DNS Zone is deployed. + +This is an example to create a DNS alias `admin.contoso.com` for the admin console in an existing Azure DNS Zone. + +```bash +$ curl -fsSL {{ site.data.var.artifactsLocationBase }}/{{ site.data.var.artifactsLocationTag }}/{{site.data.var.artifactsLocationSubPathForVM}}{{ pageDir }}/cli-scripts/custom-dns-alias-cli.sh \ + | /bin/bash -s -- \ + --resource-group `yourResourceGroup` \ + --admin-vm-name adminVM \ + --admin-console-label admin \ + --artifact-location {{ armTemplateBasePath }} \ + --location eastus \ + --zone-name contoso.com \ + --zone-resource-group `yourDNSZoneResourceGroup` +``` + +An example output: + +```text +Done! + +Custom DNS alias: + Resource group: haiche-dns-doc + WebLogic Server Administration Console URL: http://admin.contoso.com:7001/console + WebLogic Server Administration Console secured URL: https://admin.contoso.com:7002/console + +``` + + +### Configure DNS Alias on a New Azure DNS Zone + +To configure a DNS alias on a new Azure DNS Zone, you must specify the required parameters. + +This is an example of creating an Azure DNS Zone, then creating a DNS alias `admin.contoso.com` for the admin console. + +```bash +$ curl -fsSL {{ site.data.var.artifactsLocationBase }}/{{ site.data.var.artifactsLocationTag }}/{{site.data.var.artifactsLocationSubPathForVM}}{{ pageDir }}/cli-scripts/custom-dns-alias-cli.sh \ + | /bin/bash -s -- \ + --resource-group `yourResourceGroup` \ + --admin-vm-name adminVM \ + --admin-console-label admin \ + --artifact-location {{ armTemplateBasePath }} \ + --location eastus \ + --zone-name contoso.com +``` + +An example output: + +```text +DONE! + + +Action required: + Complete Azure DNS delegation to make the alias accessible. + Reference: https://aka.ms/dns-domain-delegation + Name servers: + [ + "ns1-02.azure-dns.com.", + "ns2-02.azure-dns.net.", + "ns3-02.azure-dns.org.", + "ns4-02.azure-dns.info." + ] + +Custom DNS alias: + Resource group: haiche-dns-doc + WebLogic Server Administration Console URL: http://admin.contoso.com:7001/console + WebLogic Server Administration Console secured URL: https://admin.contoso.com:7002/console +``` + +**Note:** The DNS aliases are not accessible now, you must perform Azure DNS delegation after the deployment. Follow [Delegation of DNS zones with Azure DNS](https://aka.ms/dns-domain-delegation) to complete the Azure DNS delegation. + + +## Verify the Custom Alias + +Access the URL from output to verify if the custom alias works. diff --git a/subtemplate-src/admin-dbTemplate.md b/subtemplate-src/admin-dbTemplate.md new file mode 100644 index 000000000..54041387a --- /dev/null +++ b/subtemplate-src/admin-dbTemplate.md @@ -0,0 +1,294 @@ + + +{% include variables.md %} + +# Apply Database ARM Template to {{ site.data.var.wlsFullBrandName }} + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} with an existing Azure database using Azure CLI. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The database ARM template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Database Instance + +To apply configure a database with {{ site.data.var.wlsFullBrandName }}, +you must have an existing database instance to use. This template +supports three popular Azure databases: [Oracle](https://ms.portal.azure.com/#blade/Microsoft_Azure_Marketplace/MarketplaceOffersBlade/selectedMenuItemId/home/searchQuery/oracle%20database), [Azure SQL Server](https://docs.microsoft.com/en-us/azure/azure-sql/), [Azure Database for PostgreSQL](https://docs.microsoft.com/en-us/azure/azure-sql/database/single-database-create-quickstart?WT.mc_id=gallery&tabs=azure-portal) and [MySQL](https://learn.microsoft.com/en-us/azure/mysql/single-server/quickstart-create-mysql-server-database-using-azure-portal). If you do not have an instance, please +create one from the Azure portal. + +{% include sub-template-connect-db-with-msi.md %} + +### Apply multiple databases + +You can deploy different databases using the database ARM template, by changing the ARM parameters file and invoking the template again with Azure CLI. + +To apply multiple databases, you have to remove the previous virtual machine extension. Last ARM parameters file is cached, it will block you from configuring the new database. + +Use the following command to remove virtual machine extension: + +```bash +# remove existing vm extension +az vm extension delete -g ${yourResourceGroup} --vm-name ${adminVMName} --name newuserscript +``` + +## Prepare the Parameters JSON file + +You must construct a parameters JSON file containing the parameters to the database ARM template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. We must specify the information of the existing {{ site.data.var.wlsFullBrandName }} and database instance. This section shows how to obtain the values for the following required properties. + +| Parameter Name | Explanation | +|----------------|-------------| +| `_artifactsLocation`| See below for details. | +| `adminVMName`| At deployment time, if this value was changed from its default value, the value used at deployment time must be used. Otherwise, this parameter should be omitted. | +| `databaseType`| Must be one of `postgresql`, `oracle`, `sqlserver` and `mysql` | +| `dbIdentity` | See below for details. You must provide this value if `enablePswlessConnection` is `true`.| +| `dbGlobalTranPro` | Determines the transaction protocol (global transaction processing behavior) for the data source. Must be one of `TwoPhaseCommit`, `LoggingLastResource`, `EmulateTwoPhaseCommit`, `OnePhaseCommit` or `None`. | +| `dbIdentity` | See below for details. You must provide this value if `enablePswlessConnection` is `true`.| +| `dbPassword`| See below for details. You don't need to input this value if `enablePswlessConnection` is `false`.| +| `dbUser` | See below for details. | +| `dsConnectionURL`| See below for details. | +| `enablePswlessConnection` | True to enable passwordless datasource connection. Default value is `false`.| +| `jdbcDataSourceName`| Must be the JNDI name for the JDBC data source. | +| `location` | Must be the same region into which the server was initially deployed. | +| `wlsDomainName` | Must be the same value provided at deployment time. | +| `wlsPassword` | Must be the same value provided at deployment time. | +| `wlsUserName` | Must be the same value provided at deployment time. | + +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateBasePath }} +``` + +### Obtain the JDBC Connection String, Database User, and Database Password + +The parameter `dsConnectionURL` stands for JDBC connection string. The connection string is database specific. + +{% include sub-template-datasource-connection-url.md %} + +{% include sub-template-obtain-msi.md%} + +#### Example Parameters JSON + +Here is a fully filled out parameters file. Note that we keep default value for `adminVMName` and `wlsDomainName`. + +{{ site.data.var.passwordInFileNote }} + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "_artifactsLocation":{ + "value": "{{ armTemplateBasePath }}" + }, + "location": { + "value": "eastus" + }, + "databaseType": { + "value": "postgresql" + }, + "dsConnectionURL": { + "value": "jdbc:postgresql://ejb060801p.postgres.database.azure.com:5432/postgres?sslmode=require" + }, + "dbPassword": { + "value": "Secret123!" + }, + "dbUser": { + "value": "postgres@ejb060801p" + }, + "jdbcDataSourceName": { + "value": "jdbc/ejb060801p" + }, + "wlsPassword": { + "value": "welcome1" + }, + "wlsUserName": { + "value": "weblogic" + } + } +} +``` + + + +## Invoke the ARM template + +Assume your parameters file is available in the current directory and is named `parameters.json`. This section shows the commands to configure your {{ site.data.var.wlsFullBrandName }} deployment with the specified database. Replace `yourResourceGroup` with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +### First, validate your parameters file + +The `az group deployment validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az group deployment validate --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/dbTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Next, execute the template + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az group deployment create --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/dbTemplate.json +``` + +As with the validate command, if the command returns with an exit status other than `0`, inspect the output and resolve the problem. + +This is an example output of successful deployment. Look for `"provisioningState": "Succeeded"` in your output. + +```json +{ + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-0602/providers/Microsoft.Resources/deployments/db", + "location": null, + "name": "db", + "properties": { + "correlationId": "6fc805b9-1c47-4b32-b9b0-59745a21e559", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-0602/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-admin-0602", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-0602/providers/Microsoft.Resources/deployments/3b35b279-0e94-5264-85f5-0d9d662f8a38", + "resourceGroup": "oraclevm-admin-0602", + "resourceName": "3b35b279-0e94-5264-85f5-0d9d662f8a38", + "resourceType": "Microsoft.Resources/deployments" + } + ], + "duration": "PT17.4377546S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputResources": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-0602/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-admin-0602" + } + ], + "outputs": { + "artifactsLocationPassedIn": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + } + }, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + }, + "_artifactsLocationDbTemplate": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + } + "adminVMName": { + "type": "String", + "value": "adminVM" + }, + "databaseType": { + "type": "String", + "value": "postgresql" + }, + "dbPassword": { + "type": "SecureString" + }, + "dbUser": { + "type": "String", + "value": "weblogic@oraclevm" + }, + "dsConnectionURL": { + "type": "String", + "value": "jdbc:postgresql://oraclevm.postgres.database.azure.com:5432/postgres" + }, + "jdbcDataSourceName": { + "type": "String", + "value": "jdbc/WebLogicCafeDB" + }, + "location": { + "type": "String", + "value": "eastus" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "6381424766408193665", + "templateLink": null, + "timestamp": "2020-06-02T06:05:03.141828+00:00" + }, + "resourceGroup": "oraclevm-admin-0602", + "type": "Microsoft.Resources/deployments" +} +``` + +## Verify Database Connection + +Follow the steps to check if the database has successfully been connected. + +* Visit the {{ site.data.var.wlsFullBrandName }} Admin console. +* In the left navigation pane, expand the **Services** tree node and the **DataSources** child node. +* Select the row for the JDBC database name, for example `jdbc/WebLogicDB`. +* Select the **Monitoring** tab and the **Testing** sub-tab. +* Select `admin` and select **Test Data Source** +* If the database is enabled, you will see a message similar to "Test of jdbc/WebLogicDB on server admin was successful." diff --git a/subtemplate-src/admin-elkNestedTemplate.md b/subtemplate-src/admin-elkNestedTemplate.md new file mode 100644 index 000000000..42bb37e86 --- /dev/null +++ b/subtemplate-src/admin-elkNestedTemplate.md @@ -0,0 +1,292 @@ + + +{% include variables.md %} + +# Land {{ site.data.var.wlsFullBrandName }} logs to Elasticsearch and Kibana + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} to land logs to Elasticsearch and Kibana using Azure CLI. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The ELK ARM template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Virtual machine size requirement +Ensure the virtual machines that have been deployed have at least **2.5GB** of memory. The default virtual machine size for WLS does not have enough memory. Use at least `Standard_A2_v2`. + +### Elasticsearch instance + +Refer to [Create an an Elastic on Azure instance](https://aka.ms/arm-oraclelinux-wls-elk#create-an-an-elastic-on-azure-instance) + +## Prepare the Parameters JSON file + +You must construct a parameters JSON file containing the parameters to the ELK ARM template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. + +We must specify the information of the existing {{ site.data.var.wlsFullBrandName }} and Elasticsearch instance. This section shows how to obtain the values for the following required properties. + +| Parameter Name | Explanation | +|----------------|-------------| +| `_artifactsLocation`| See below for details. | +| `adminVMName`| Virtual machine name of which hosts the {{ site.data.var.wlsFullBrandName }} admin server. | +| `elasticsearchEndpoint` | The Elasticsearch endpoint. | +| `elasticsearchPassword` | Password of the Elasticsearch account. Used to distibute message with REST API to Elasticsearch instance. | +| `elasticsearchUserName` | User name of the Elasticsearch account. | +| `location` | Must be the same region into which the server was initially deployed. | +| `logsToIntegrate` | Specify the WebLogic logs to export to Elasticsearch, you must select at least one log. | +| `wlsDomainName` | Must be the same value provided at initial deployment time. | +| `wlsPassword` | Must be the same value provided at initial deployment time. | +| `wlsUserName` | Must be the same value provided at initial deployment time. | + +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateBasePath }} +``` + +#### Example Parameters JSON + +Here is a fully filled out parameters file. We will leave values of `adminUsername`, `authenticationType`, `dnsLabelPrefix`, and `usePreviewImage` as default value. + +{{ site.data.var.passwordInFileNote }} + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "_artifactsLocation": { + "value": "{{ armTemplateBasePath }}" + }, + "adminVMName": { + "value": "adminVM" + }, + "elasticsearchEndpoint": { + "value": "https://example.eastus2.azure.elastic-cloud.com:9243" + }, + "elasticsearchPassword": { + "value": "wlkpsw" + }, + "elasticsearchUserName": { + "value": "elastic" + }, + "location": { + "value": "eastus" + }, + "wlsDomainName": { + "value": "adminDomain" + }, + "wlsPassword": { + "value": "welcome1" + }, + "wlsUserName": { + "value": "weblogic" + } + } +} +``` + +## Invoke the ARM template + +Assume your parameters file is available in the current directory and is named `parameters.json`. This section shows the commands to configure your {{ site.data.var.wlsFullBrandName }} deployment to connect to Elasticsearch and Kinaba intance. Replace `yourResourceGroup` with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +### First, validate your parameters file + +The `az group deployment validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az deployment group validate --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/elkNestedTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Next, execute the template + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az deployment group create --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/elkNestedTemplate.json +``` + +As with the validate command, if the command returns with an exit status other than `0`, inspect the output and resolve the problem. + +This is an example output of successful deployment. Look for `"provisioningState": "Succeeded"` in your output. + +```json +{ + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-admin-elk/providers/Microsoft.Resources/deployments/elkNestedTemplate", + "location": null, + "name": "elkNestedTemplate", + "properties": { + "correlationId": "61a46b43-27d0-4478-baba-c288059892d5", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-admin-elk/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "haiche-admin-elk", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-admin-elk/providers/Microsoft.Resources/deployments/pid-e4165284-b017-5df9-9b91-3f11dd8a72e5", + "resourceGroup": "haiche-admin-elk", + "resourceName": "pid-e4165284-b017-5df9-9b91-3f11dd8a72e5", + "resourceType": "Microsoft.Resources/deployments" + }, + ], + "duration": "PT8M54.4785762S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputResources": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-admin-elk/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "haiche-admin-elk" + } + ], + "outputs": { + "artifactsLocationPassedIn": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + }, + "logIndex": { + "type": "String", + "value": "azure-weblogic-admin-b4e465d5-6ffc-49cf-b1d9-b4dbf6455d0a" + } + }, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + }, + "_artifactsLocationELKTemplate": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + }, + "_artifactsLocationSasToken": { + "type": "SecureString" + }, + "adminVMName": { + "type": "String", + "value": "adminVM" + }, + "elasticsearchEndpoint": { + "type": "String", + "value": "https://example.eastus2.azure.elastic-cloud.com:9243" + }, + "elasticsearchPassword": { + "type": "SecureString" + }, + "elasticsearchUserName": { + "type": "String", + "value": "elastic" + }, + "guidValue": { + "type": "String", + "value": "b4e465d5-6ffc-49cf-b1d9-b4dbf6455d0a" + }, + "location": { + "type": "String", + "value": "eastus" + }, + "logsToIntegrate": { + "type": "Array", + "value": [ + "HTTPAccessLog", + "ServerLog", + "DomainLog", + "DataSourceLog", + "StandardErrorAndOutput", + "NodeManagerLog" + ] + }, + "wlsDomainName": { + "type": "String", + "value": "wlsd" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "10060935779116645392", + "templateLink": null, + "timestamp": "2020-11-11T07:29:42.336797+00:00" + }, + "resourceGroup": "haiche-admin-elk", + "type": "Microsoft.Resources/deployments" +} +``` + +## Verify ELK connection + +Follow the steps to check if WebLogic Server logs are exported to Elasticsearch. + +* Go to Azure portal +* Copy log index from your resource group -> deployments -> elkNestedTemplate -> output -> logIndex . +* Go to Elasticsearch cloud and launch Kibana. +* Create index + * Go to Kibana -> Management -> Kibana -> Index Patterns + * Click `Create index Patterns` + * Input the log index you copy from output in Index pattern + * There should be an index you can select, otherwise, the ELK deployment failed + * Next step + * Select `@timestamp` in Time Filter and hit `Create index pattern` +* View logs + * Go to Kibana -> Discover + * Select the index you just created + * You will find the WebLogic Server logs listed diff --git a/subtemplate-src/appGatewayNestedTemplate.md b/subtemplate-src/appGatewayNestedTemplate.md new file mode 100644 index 000000000..428391d9f --- /dev/null +++ b/subtemplate-src/appGatewayNestedTemplate.md @@ -0,0 +1,371 @@ + + +{% include variables.md %} + +# Apply Azure App Gateway ARM Template to {{ site.data.var.wlsFullBrandName }} + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} with Azure Application Gateway using the Azure CLI. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The Application Gateway ARM tempate will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Certificate for SSL Termination + +Because the Application Gateway serves as the front end load balancer for the {{ site.data.var.wlsFullBrandName }} cluster, it must be provided with a certificate to allow browsers to connect via SSL. + +When deploying the {{ site.data.var.wlsFullBrandName }} offer from the Azure Portal, you can configure the deployment to fetch the SSL certificate and its password from a pre-existing Azure Key Vault. For a high-level introduction to SSL Certificates with Azure Key Vault see [Get started with Key Vault certificates](https://docs.microsoft.com/en-us/azure/key-vault/certificates/certificate-scenarios). For an overview of TLS termination with Application Gateway see [Overview of TLS termination and end to end TLS with Application Gateway](https://docs.microsoft.com/en-us/azure/application-gateway/ssl-overview). When configuring the Application Gateway after deployment, you must base64 encode the certificate and also know the password for the certificate. + +## Prepare the Parameters JSON file + +You must construct a parameters JSON file containing the parameters to the database ARM template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. We must specify the information of the existing SSL certificate. This section shows how to obtain the values for the following required properties. + +| Parameter Name | Explanation | +|----------------|-------------| +| `_artifactsLocation`| See below for details. | +| `adminVMName`| At deployment time, if this value was changed from its default value, the value used at deployment time must be used. Otherwise, this parameter should be omitted. | +| `customDomainName`| Specify a custome domain name if want to override application gateway hostname. You are required to input the value if you use a pre-assigned SSL for application gateway. | +| `appGatewaySSLCertificateData`| See below for details. | +| `appGatewaySSLCertificatePassword`| See below for details. | +| `dnsNameforApplicationGateway`| (optional) A prefix value for the dns name of the Application Gateway. | +| `gatewayPublicIPAddressName` | (optional) A prefix value for the public IP address of the Application Gateway. | +| `location` | Must be the same region into which the server was initially deployed. | +| `managedServerPrefix` | At deployment time, if this value was changed from its default value, the value used at deployment time must be used. Otherwise, this parameter should be omitted. | +| `numberOfInstances` | The number of instances in the cluster. Must be the same as the value used at deployment time. | +| `overrideHostName` | If `true` the template will override the application gateway hostname with value of `customDomainName`. The vaule should be `true` if you use a pre-assigned SSL for application gateway. | +| `wlsDomainName` | At deployment time, if this value was changed from its default value, the value used at deployment time must be used. Otherwise, this parameter should be omitted. | +| `wlsPassword` | Must be the same value provided at deployment time. | +| `wlsUserName` | Must be the same value provided at deployment time. | + +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateBasePath }} +``` + +### SSL Certificate Data and Password + +Use base64 to encode your existing PFX format certificate. + +```bash +base64 your-certificate.pfx -w 0 >temp.txt +``` + +Use the content as this file as the value of the `appGatewaySSLCertificateData` parameter. + +It is assumed that you have the password for the certificate. Use this as the value of the `appGatewaySSLCertificatePassword` parameter. + +#### Example Parameters JSON + +Here is a fully filled out parameters file. Note that we did not include any optional parameters, assuming the {{ site.data.var.wlsFullBrandName }} was deployed accepting the default values. + +{{ site.data.var.passwordInFileNote }} + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "_artifactsLocation":{ + "value": "{{ armTemplateBasePath }}" + }, + "appGatewaySSLCertificateData": { + "value": "MIIKCQIB...sOr3QICCAA=" + }, + "appGatewaySSLCertificatePassword": { + "value": "myPasswordInClearText" + }, + "numberOfInstances": { + "value": 3 + }, + "location": { + "value": "eastus" + }, + "wlsPassword": { + "value": "welcome1" + }, + "wlsUserName": { + "value": "weblogic" + } + } +} +``` + +## Invoke the ARM template + +Assume your parameters file is available in the current directory and is named `parameters.json`. This section shows the commands to configure your {{ site.data.var.wlsFullBrandName }} deployment with the specified database. Replace `yourResourceGroup` with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +### First, validate your parameters file + +The `az group deployment validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az group deployment validate --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/appGatewayNestedTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Next, execute the template + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az group deployment create --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/appGatewayNestedTemplate.json +``` + +As with the validate command, if the command returns with an exit status other than `0`, inspect the output and resolve the problem. + +This is an example output of successful deployment. Look for `"provisioningState": "Succeeded"` in your output. + +```json +{ + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-0604/providers/Microsoft.Resources/deployments/cli", + "location": null, + "name": "cli", + "properties": { + "correlationId": "4cc63f27-0f43-4244-9d89-a09bf417e943", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-0604/providers/Microsoft.Network/publicIPAddresses/gwip", + "resourceGroup": "oraclevm-cluster-0604", + "resourceName": "gwip", + "resourceType": "Microsoft.Network/publicIPAddresses" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-0604/providers/Microsoft.Network/applicationGateways/myAppGateway", + "resourceGroup": "oraclevm-cluster-0604", + "resourceName": "myAppGateway", + "resourceType": "Microsoft.Network/applicationGateways" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-0604/providers/Microsoft.Network/applicationGateways/myAppGateway", + "resourceGroup": "oraclevm-cluster-0604", + "resourceName": "myAppGateway", + "resourceType": "Microsoft.Network/applicationGateways" + }, + { + "apiVersion": "2019-11-01", + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-0604/providers/Microsoft.Network/publicIPAddresses/gwip", + "resourceGroup": "oraclevm-cluster-0604", + "resourceName": "gwip", + "resourceType": "Microsoft.Network/publicIPAddresses" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-0604/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-cluster-0604", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-0604/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-cluster-0604", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-0604/providers/Microsoft.Resources/deployments/pid-36deb858-08fe-5c07-bc77-ba957a59a080", + "resourceGroup": "oraclevm-cluster-0604", + "resourceName": "pid-36deb858-08fe-5c07-bc77-ba957a59a080", + "resourceType": "Microsoft.Resources/deployments" + } + ], + "duration": "PT8M41.2104793S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputResources": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-0604/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-cluster-0604" + }, + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-0604/providers/Microsoft.Network/applicationGateways/myAppGateway", + "resourceGroup": "oraclevm-cluster-0604" + }, + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-0604/providers/Microsoft.Network/publicIPAddresses/gwip", + "resourceGroup": "oraclevm-cluster-0604" + } + ], + "outputs": { + "appGatewayURL": { + "type": "String", + "value": "http://wlsgw9e6ed1-oraclevm-cluster-0604-wlsd.eastus.cloudapp.azure.com" + } + }, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + }, + "_artifactsLocationAGWTemplate": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + }, + "_artifactsLocationSasToken": { + "type": "SecureString" + }, + "adminVMName": { + "type": "String", + "value": "adminVM" + }, + "appGatewaySSLCertificateData": { + "type": "String", + "value": "MIIKQQIBAz....EkAgIIAA==" + }, + "appGatewaySSLCertificatePassword": { + "type": "String", + "value": "myRedactedPassword" + }, + "dnsNameforApplicationGateway": { + "type": "String", + "value": "wlsgw" + }, + "gatewayPublicIPAddressName": { + "type": "String", + "value": "gwip" + }, + "guidValue": { + "type": "String", + "value": "9e6ed15b-d386-4cb9-a617-3cb6f785f6a0" + }, + "location": { + "type": "String", + "value": "eastus" + }, + "managedServerPrefix": { + "type": "String", + "value": "msp" + }, + "numberOfInstances": { + "type": "Int", + "value": 4 + }, + "wlsDomainName": { + "type": "String", + "value": "wlsd" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Network", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "publicIPAddresses" + }, + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "applicationGateways" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "12239709219097081949", + "templateLink": null, + "timestamp": "2020-06-04T03:17:01.168329+00:00" + }, + "resourceGroup": "oraclevm-cluster-0604", + "type": "Microsoft.Resources/deployments" +} +``` + +## Verify Application Gateway + +We will deploy a testing application to verify if the appliaction gateway is enabled. + +Go to Admin Server Console and deploy [webtestapp.war](../resources/webtestapp.war). + +* Visit the {{ site.data.var.wlsFullBrandName }} Admin console. +* Select **Deployments**. +* Select **Install**. +* Select file `webtestapp.war`. +* Select **Next**. Choose "Install this deployment as an application". +* Select **Next**. Select "cluster-1" and "All servers in the cluster". +* Keep configuration as default and select **Finish**. +* Select **Activate Changes** +* In the left navigation pane, select **Deployments**. +* Select **Control** +* Select `webtestapp` +* Select **Start** +* Select **Servicing all requests** + +Then access the application with `/webtestapp`, you will get a page with server host information if application gateway was successfully enabled. diff --git a/subtemplate-src/cluster-aadNestedTemplate.md b/subtemplate-src/cluster-aadNestedTemplate.md new file mode 100644 index 000000000..8796d07c3 --- /dev/null +++ b/subtemplate-src/cluster-aadNestedTemplate.md @@ -0,0 +1,315 @@ + + +{% include variables.md %} + +# Apply Azure Active Directory ARM Template to {{ site.data.var.wlsFullBrandName }} + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} with an existing Azure Active Directory Domain Service (AAD DS) using Azure CLI. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The AAD ARM template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Azure Active Directory LDAP Instance + +To apply AAD to {{ site.data.var.wlsFullBrandName }}, you must have an existing Azure Active Directory LDAP instance to use. If you don't have AAD LADP instance, please follow the steps in the tutorial [Configure secure LDAP for an Azure Active Directory Domain Services managed domain](https://docs.microsoft.com/en-us/azure/active-directory-domain-services/tutorial-configure-ldaps). + +## Prepare the Parameters JSON file + +You must construct a parameters JSON file containing the parameters to the AAD ARM template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. We must specify the information of the existing {{ site.data.var.wlsFullBrandName }} and AAD instance. This section shows how to obtain the values for the following required properties. + +| Parameter Name | Explanation | +|----------------|-------------| +| `_artifactsLocation`| See below for details. | +| `aadsPortNumber` | (optional) The LDAP port number, defaults to 636. | +| `aadsPublicIP` | The IP address of the LDAP server | +| `aadsServerHost` | The hostname of the Active Directory Domain Services server. | +| `adminVMName`| At deployment time, if this value was changed from its default value, the value used at deployment time must be used. Otherwise, this parameter should be omitted. | +| `location` | Must be the same region into which the server was initially deployed. | +| `managedServerPrefix` | Must be the same managed server prefix with that in initial deployed. | +| `numberOfInstances` | Numbers of Virtual Machines that have been deployed, including Virtual Machine that hosts Administration Server. | +| `wlsDomainName` | The name of the {{ site.data.var.wlsFullBrandName }} domain. | +| `wlsLDAPGroupBaseDN` | The base distinguished name (DN) of the tree in the LDAP directory that contains groups. | +| `wlsLDAPPrincipalPassword` | The credential (usually a password) used to connect to the LDAP server. | +| `wlsLDAPPrincipal` | The Distinguished Name (DN) of the LDAP user that {{ site.data.var.wlsFullBrandName }} should use to connect to the LDAP server. | +| `wlsLDAPProviderName` | (optional) The value used for creating authentication provider name of WebLogic Server. | +| `wlsLDAPSSLCertificate` | Client certificate that will be imported to trust store of SSL. | +| `wlsLDAPSSLCertificate` | See below for details. | +| `wlsLDAPUserBaseDN` | The base distinguished name (DN) of the tree in the LDAP directory that contains users. | +| `wlsPassword` | Must be the same value provided at deployment time. | +| `wlsUserName` | Must be the same value provided at deployment time. | + +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateBasePath }} +``` + +### `wlsLDAPSSLCertificate` + +Use base64 to encode your existing SSL certificate. + +```bash +base64 your-certificate.cer -w 0 >temp.txt +``` + +Use the content as this file as the value of the `wlsLDAPSSLCertificate` parameter. + +### `numberOfInstances` + +The number of existing nodes, includeing Administration Server node. It should equal to existing Virtual Machine number. + +#### Example Parameters JSON + +Here is a fully filled out parameters file. Note that we did not include values for parameters that have a default value. Pay attention to the value of `numberOfInstances`. + +{{ site.data.var.passwordInFileNote }} + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "_artifactsLocation": { + "value": "{{ armTemplateBasePath }}" + }, + "aadsPublicIP": { + "value": "1.2.3.4" + }, + "aadsServerHost": { + "value": "ladps.fabrikam.com" + }, + "location": { + "value": "eastus" + }, + "wlsDomainName": { + "value": "wlsd" + }, + "wlsLDAPGroupBaseDN": { + "value": "OU=AADDC Users,DC=fabrikam,DC=com" + }, + "wlsLDAPPrincipal": { + "value": "CN=WLSTest,OU=AADDC Users,DC=fabrikam,DC=com" + }, + "wlsLDAPPrincipalPassword": { + "value": "Secret123!" + }, + "wlsLDAPSSLCertificate": { + "value": "MIIKQQIBAz....EkAgIIAA==" + }, + "wlsLDAPUserBaseDN": { + "value": "OU=AADDC Users,DC=fabrikam,DC=com" + }, + "wlsPassword": { + "value": "welcome1" + }, + "wlsUserName": { + "value": "weblogic" + } + } +} +``` + +## Invoke the ARM template + +Assume your parameters file is available in the current directory and is named `parameters.json`. This section shows the commands to configure your {{ site.data.var.wlsFullBrandName }} deployment with the specified AAD. Replace `yourResourceGroup` with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +### First, validate your parameters file + +The `az group deployment validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az group deployment validate --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/aadNestedTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Next, execute the template + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az group deployment create --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/aadNestedTemplate.json +``` + +As with the validate command, if the command returns with an exit status other than `0`, inspect the output and resolve the problem. + +This is an example output of successful deployment. Look for `"provisioningState": "Succeeded"` in your output. + +```json +{ + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-06082/providers/Microsoft.Resources/deployments/cli", + "location": null, + "name": "cli", + "properties": { + "correlationId": "6d98e1c8-0778-4fa5-a30a-8f10bbbb6818", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-06082/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-admin-06082", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-06082/providers/Microsoft.Resources/deployments/pid-8295df19-fe6b-5745-ad24-51ef66522b24", + "resourceGroup": "oraclevm-admin-06082", + "resourceName": "pid-8295df19-fe6b-5745-ad24-51ef66522b24", + "resourceType": "Microsoft.Resources/deployments" + } + ], + "duration": "PT2M59.6052694S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputResources": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-06082/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-admin-06082" + } + ], + "outputs": { + "artifactsLocationPassedIn": { + "type": "String", + "value": "https://raw.githubusercontent.com/galiacheng/arm-oraclelinux-wls-admin/deploy/src/main/arm/" + } + }, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "https://raw.githubusercontent.com/galiacheng/arm-oraclelinux-wls-admin/deploy/src/main/arm/" + }, + "_artifactsLocationAADTemplate": { + "type": "String", + "value": "https://raw.githubusercontent.com/galiacheng/arm-oraclelinux-wls-admin/deploy/src/main/arm/" + }, + "_artifactsLocationSasToken": { + "type": "SecureString" + }, + "aadsPortNumber": { + "type": "String", + "value": "636" + }, + "aadsPublicIP": { + "type": "String", + "value": "40.76.11.111" + }, + "aadsServerHost": { + "type": "String", + "value": "ladps.wls-security.com" + }, + "adminVMName": { + "type": "String", + "value": "adminVM" + }, + "location": { + "type": "String", + "value": "eastus" + }, + "wlsDomainName": { + "type": "String", + "value": "adminDomain" + }, + "wlsLDAPGroupBaseDN": { + "type": "String", + "value": "OU=AADDC Users,DC=wls-security,DC=com" + }, + "wlsLDAPPrincipal": { + "type": "String", + "value": "CN=WLSTest,OU=AADDC Users,DC=wls-security,DC=com" + }, + "wlsLDAPPrincipalPassword": { + "type": "SecureString" + }, + "wlsLDAPProviderName": { + "type": "String", + "value": "AzureActiveDirectoryProvider" + }, + "wlsLDAPSSLCertificate": { + "type": "String", + "value": "LS0tLS1...LQ0K" + }, + "wlsLDAPUserBaseDN": { + "type": "String", + "value": "OU=AADDC Users,DC=wls-security,DC=com" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "2818584196763146470", + "templateLink": null, + "timestamp": "2020-06-09T07:07:03.444046+00:00" + }, + "resourceGroup": "oraclevm-admin-06082", + "type": "Microsoft.Resources/deployments" +} + +``` + +## Verify AAD Integration + +Follow the steps to check if AAD is enabled. + +* Visit the {{ site.data.var.wlsFullBrandName }} Admin console. +* In the left navigator, expand the tree to select **Security Realms** -> **myrealm** -> **Providers**. +* If the integration was successful, you will find the AAD provider for example `AzureActiveDirectoryProvider`. +* In the left navigator, expand the tree to select **Security Realms** -> **myrealm** -> **Users and Groups**. +* If the integration was successful, you will find users from the AAD provider. diff --git a/subtemplate-src/cluster-addnode.md b/subtemplate-src/cluster-addnode.md new file mode 100644 index 000000000..b4bc4baf5 --- /dev/null +++ b/subtemplate-src/cluster-addnode.md @@ -0,0 +1,741 @@ + + +{% include variables.md %} + +# Add nodes to {{ site.data.var.wlsFullBrandName }} + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} to add new managed application server using Azure CLI. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Azure Active Directory LDAP Instance + +Refer to [Azure Active Directory(AAD) LDAP Instance](aadNestedTemplate.html#azure-active-directory-ldap-instance). + +### Certificate for SSL Termination +Refer to [Configure Azure Application Gateway#Certificate for SSL Termination](appGatewayNestedTemplate.html#certificate-for-ssl-termination). + +### Administering Security for Oracle WebLogic Server & Configuring KeyStores +Refer to [Configuring Keystores](https://docs.oracle.com/en/middleware/fusion-middleware/weblogic-server/12.2.1.4/secmg/identity_trust.html). + +### Generate Base64 string for a given ssl certificate/keystore file + +Use the following command to generate a Base64 string for a given ssl certificate/keystore file, to be used as input in the parameters JSON file + +
base64 /my/path/your-certificate.cer -w 0 >temp.txt
+ + +## Prepare the Parameters JSON file + +You must construct a parameters JSON file containing the parameters to the add-node ARM template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. You must specify the information of the existing {{ site.data.var.wlsFullBrandName }} and nodes that to be added. This section shows how to obtain the values for the following required properties. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Parameter NameExplanation
_artifactsLocationSee below for details.
aadsSettingsOptional. JSON object type. You can specify this parameters for Azure Active Directory integration. If enable is true, must specify other properties.
enableIf enable is true, must specify all properties of the aadSettings.
publicIPThe public IP address of Azure Active Directory LDAP server.
serverHostThe server host of Azure Active Directory LDAP server.
certificateBase64StringThe based64 string of LADP client certificate that will be imported to trust store of WebLogic Server to enable SSL connection of AD provider.
adminPasswordOrKeyPassword of administration account for the new Virtual Machine that host new nodes.
adminURLThe URL of WebLogic Administration Server, usually made up with Virtual Machine name and port, for example: adminVM:7001.
appGatewaySettingsOptional. JSON object type. You can specify these parameters for application gateway configuration. If enable is true, you must specify other properties. If enable is false, the other properties are ignored. See the page Migrate a WebLogic Server cluster to Azure with Azure Application Gateway as a load balancer for further information.
enableIf enable is true, must specify all properties of the appGatewaySettings.
publicIPNameAzure resource name of application gateway public IP, default value is gwip
certificateBase64StringBase64 string of server certificate for application gateway.
certificatePasswordPassword of server certificate.
elkSettingsOptional. JSON object type. You can specify this parameters for Elasticsearch and Kibana(ELK) connection. If enable is true, must specify other properties. See the page WebLogic with Elastic on Azure for further information.
enableIf enable is true, must specify all properties of the elkSettings.
elasticsearchEndpointEndpoint of the Elasticsearch instance.
elasticsearchPasswordPassword for Elasticsearch account.
elasticsearchUserNameUser name for Elasticsearch account.
logIndexMust be the same value output at ELK deployment time.
logsToIntegrateArray with string value. Specify the expeted logs to integrate, you must input at least one log.
enableCoherenceIf true, create application managed server and add to the Coherence cluster application tier.
numberOfExistingNodesThe number of existing managed application servers, used to generate new virtual machine name.
numberOfNewNodesThe number of application managed server to add.
storageAccountNameThe name of an existing storage account.
wlsDomainNameMust be the same value provided at deployment time.
wlsUserNameMust be the same value provided at deployment time.
wlsPasswordMust be the same value provided at deployment time.
customSSLSettingsOptional. JSON object type. You can specify this parameters for configuring Custom SSL Settings for WebLogic Administration Server. If enable is true, must specify other properties. See the page Administering Security for Oracle WebLogic Server and Configuring Keystores for further information.
enableIf enable is true, must specify all properties of the customSSLSettings. +   Set to false by default.
customIdentityKeyStoreBase64StringThe based64 string of the custom identity keystore file that will be configured in the WebLogic Administration Server to enable SSL connection.
customIdentityKeyStorePassPhraseThe identity keystore pass phrase
customIdentityKeyStoreTypeIdentity Key Store Type. This can be either JKS or PKCS12
customTrustKeyStoreBase64StringThe based64 string of the custom trust keystore file that will be configured in the WebLogic Administration Server to enable SSL connection.
customTrustKeyStorePassPhraseThe trust keystore pass phrase
customTrustKeyStoreTypeTrust Key Store Type. This can be either JKS or PKCS12
privateKeyAliasThe private key alias
privateKeyPassPhraseThe private Key Pass phrase.
+ +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateAddNodeBasePath }} +``` + +### Enable SSH Authentication to VMs +If the cluster was deployed with SSH Authentication to VMs enabled, add this variable to your parameter file and fill in the base64 decoded public SSH key string to the `adminPasswordOrKey` field: +``` + "authenticationType": { + "value": "sshPublicKey" + }, + "adminPasswordOrKey": { + "value": "ssh-rsa ...." + }, +``` + +### Enable coherence +If `enableCoherence` is `true`, the template will create Azure resources to host new managed servers, and configure new application nodes to Coherence cluster. If your cluster is not Coherence cluster, please do not set this parameter `true`. + +### Existing managed application servers +To differentiate functionality of managed servers, we use **managed application server** to represent managed servers that host Java EE application, and use **managed cache server** to represent managed servers that used for cache. + +You can get the existing managed application servers with the following command: + +```shell +$ resourceGroup= +$ managedServerPrefix= +$ numberOfExistingNodes=$(az resource list -g ${resourceGroup} --resource-type Microsoft.Compute/virtualMachines --query [*].name | grep "${managedServerPrefix}VM[0-9]" | sed -e 's/[^0-9]/ /g' -e 's/^ *//g' -e 's/ *$//g' | tr -s ' ' | sed 's/ /\n/g' | sort -nr | head -n1) +$ echo ${numberOfExistingNodes} +``` + +### Log index + +If you configured ELK in your cluster to export WebLogic Server logs to ELK, please input the value of Kibana log index, this template will set up ELK connection and export logs to specified index. + +You can get the value from Azure portal with the following steps: + +* Go to Azure portal. +* Open you resource group and click **Deployments**. +* Open the ELK deployment, and click **Output**. +* Copy the value of `logIndex`. + +Alternatively, use Azure CLI command to list log index inside the resource group deployments: + +```shell +$ az deployment group list -g 'yourResourceGroup' --query [*].properties.outputs.logIndex.value +[ + "azure-weblogic-cluster-f984df74-ab4d-4c17-a532-7f248659fb28" +] +``` + +### Storage account + +Each Storage Account handles up to 20,000 IOPS, and 500TB of data. If you use a storage account for Standard Virtual Machines, you can store until 40 virtual disks. + +We have two disks for one Virtual Machine, it's suggested no more than 20 Virtual Machines share the same storage account. Number of virtual machines that hosting managed servers should be less than or equal to 20. + +You can get the name of storage account from Azure portal with steps: + + * Go to Azure portal + * Go to the your resource group + * Find storage account resource and copy its name + +Alternatively, use Azure CLI command to list storage account inside a resource group: + +```shell +$ az resource list -g 'yourResourceGroup' --resource-type Microsoft.Storage/storageAccounts --query [*].name +[ + "219846olvm" +] +``` + +#### Example Parameters JSON + +Here is a fully filled out parameters file, with Azure Active Directory enabled. We will leave values of `adminUsername`, `authenticationType`, `dnsLabelPrefix`, `managedServerPrefix`, `skuUrnVersion`, `usePreviewImage` and `vmSize` as default value. + +{{ site.data.var.passwordInFileNote }} + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "_artifactsLocation": { + "value": "{{ armTemplateAddNodeBasePath }}" + }, + "aadsSettings": { + "value": { + "enable": true, + "publicIP":"13.68.244.90", + "serverHost": "ladps.wls-security.com", + "certificateBase64String":"LS0tLS1C...tLS0tLQ0K" + } + }, + "adminPasswordOrKey": { + "value": "Secret123!" + }, + "adminURL":{ + "value": "adminVM:7001" + }, + "appGatewaySettings": { + "value": { + "enable": true, + "publicIPName": "gwip", + "certificateBase64String": "MIIKQQI...gIIAA==", + "certificatePassword": "Secret123!" + } + }, + "elkSettings": { + "value": { + "enable": true, + "elasticsearchEndpoint":"https://example.eastus2.azure.elastic-cloud.com:9243", + "elasticsearchPassword": "Secret123!", + "elasticsearchUserName":"elastic", + "logIndex": "azure-weblogic-dynamic-cluster-11122020", + "logsToIntegrate": ["HTTPAccessLog", "ServerLog", "DomainLog", "DataSourceLog", "StandardErrorAndOutput", "NodeManagerLog"] + } + }, + "location": { + "value": "eastus" + }, + "numberOfExistingNodes": { + "value": 4 + }, + "numberOfNewNodes": { + "value": 3 + }, + "storageAccountName": { + "value": "496dfdolvm" + }, + "wlsDomainName": { + "value": "wlsd" + }, + "wlsUserName": { + "value": "weblogic" + }, + "wlsPassword": { + "value": "welcome1" + }, + "customSSLSettings": { + "value": { + "enable": true, + "customIdentityKeyStoreBase64String": "/u3+7QAAAAIAAAABAAAAAQAKc2VydmV....QZL24ljJLq", + "customIdentityKeyStorePassPhrase": "mypassword", + "customIdentityKeyStoreType": "JKS", + "customTrustKeyStoreBase64String": "/u3+7QAAAAIAAAABAAAAAgAJdHJ1c3R....Td4bYVnONyS0PC7k=", + "customTrustKeyStorePassPhrase": "mypassword", + "customTrustKeyStoreType": "JKS", + "privateKeyAlias": "servercert", + "privateKeyPassPhrase": "mypassword" + } + } + } +} +``` + +## Invoke the ARM template + +Assume your parameters file is available in the current directory and is named `parameters.json`. This section shows the commands to configure your {{ site.data.var.wlsFullBrandName }} deployment to add new nodes. Replace `yourResourceGroup` with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +### First, validate your parameters file + +The `az group deployment validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az group deployment validate --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateAddNodeBasePath }}arm/mainTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Next, execute the template + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az group deployment create --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateAddNodeBasePath }}arm/mainTemplate.json +``` + +As with the validate command, if the command returns with an exit status other than `0`, inspect the output and resolve the problem. + +This is an example output of successful deployment. Look for `"provisioningState": "Succeeded"` in your output. + +```bash +{ + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Resources/deployments/mainTemplate", + "location": null, + "name": "mainTemplate", + "properties": { + "correlationId": "54517529-a1c4-422f-a539-23b9a5129e80", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Compute/virtualMachines/mspVM7/extensions/newuserscript", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "mspVM7/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Resources/deployments/pid-c7671c10-ae59-5ec5-bff3-c60db22d7ea4", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "pid-c7671c10-ae59-5ec5-bff3-c60db22d7ea4", + "resourceType": "Microsoft.Resources/deployments" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Network/publicIPAddresses/mspVM7_PublicIP", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "mspVM7_PublicIP", + "resourceType": "Microsoft.Network/publicIPAddresses" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Network/networkInterfaces/mspVM7_NIC", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "mspVM7_NIC", + "resourceType": "Microsoft.Network/networkInterfaces" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Network/networkInterfaces/mspVM7_NIC", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "mspVM7_NIC", + "resourceType": "Microsoft.Network/networkInterfaces" + }, + { + "apiVersion": "2019-06-01", + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Storage/storageAccounts/09b943olvm", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "09b943olvm", + "resourceType": "Microsoft.Storage/storageAccounts" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Compute/virtualMachines/mspVM7", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "mspVM7", + "resourceType": "Microsoft.Compute/virtualMachines" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Compute/virtualMachines/mspVM7", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "mspVM7", + "resourceType": "Microsoft.Compute/virtualMachines" + }, + { + "actionName": "listKeys", + "apiVersion": "2019-04-01", + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Storage/storageAccounts/09b943olvm", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "09b943olvm", + "resourceType": "Microsoft.Storage/storageAccounts" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Compute/virtualMachines/mspVM7/extensions/newuserscript", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "mspVM7/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "duration": "PT9M6.8098765S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputResources": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Compute/virtualMachines/mspVM7", + "resourceGroup": "oraclevm-dcluster-0727" + }, + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Compute/virtualMachines/mspVM7/extensions/newuserscript", + "resourceGroup": "oraclevm-dcluster-0727" + }, + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Network/networkInterfaces/mspVM7_NIC", + "resourceGroup": "oraclevm-dcluster-0727" + }, + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Network/publicIPAddresses/mspVM7_PublicIP", + "resourceGroup": "oraclevm-dcluster-0727" + } + ], + "outputs": { + "wlsDomainLocation": { + "type": "String", + "value": "/u01/domains/wlsd" + } + }, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "{{ armTemplateAddNodeBasePath }}" + }, + "_artifactsLocationSasToken": { + "type": "SecureString" + }, + "aadsSettings": { + "type": "Object", + "value": { + "certificateBase64String": "LS0tLS1C...S0tLQ0K", + "enable": true, + "publicIP": "40.76.11.111", + "serverHost": "ladps.wls-security.com" + } + }, + "adminPasswordOrKey": { + "type": "SecureString" + }, + "adminURL": { + "type": "String", + "value": "adminVM:7001" + }, + "adminUsername": { + "type": "String", + "value": "weblogic" + }, + "authenticationType": { + "type": "String", + "value": "password" + }, + "dnsLabelPrefix": { + "type": "String", + "value": "wls" + }, + "guidValue": { + "type": "String", + "value": "67657ba3-6248-46e5-bedc-53e16ac82571" + }, + "location": { + "type": "String", + "value": "eastus" + }, + "managedServerPrefix": { + "type": "String", + "value": "msp" + }, + "numberOfExistingNodes": { + "type": "Int", + "value": 7 + }, + "numberOfNewNodes": { + "type": "Int", + "value": 1 + }, + "skuUrnVersion": { + "type": "String", + "value": "owls-122130-8u131-ol74;Oracle:weblogic-122130-jdk8u131-ol74:owls-122130-8u131-ol7;1.1.1" + }, + "storageAccountName": { + "type": "String", + "value": "09b943olvm" + }, + "usePreviewImage": { + "type": "Bool", + "value": false + }, + "vmSize": { + "type": "String", + "value": "Standard_A3" + }, + "wlsDomainName": { + "type": "String", + "value": "wlsd" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + }, + "customSSLSettings": { + "type": "Object", + "value": { + "enable": true, + "customIdentityKeyStoreBase64String": "/u3+7QAAAAIAAAABAAAAAQAKc2VydmV....QZL24ljJLq", + "customIdentityKeyStorePassPhrase": "mypassword", + "customIdentityKeyStoreType": "JKS", + "customTrustKeyStoreBase64String": "/u3+7QAAAAIAAAABAAAAAgAJdHJ1c3R....Td4bYVnONyS0PC7k=", + "customTrustKeyStorePassPhrase": "mypassword", + "customTrustKeyStoreType": "JKS", + "privateKeyAliasSecret": "servercert", + "privateKeyPassPhraseSecret": "mypassword" + } + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Network", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "publicIPAddresses" + }, + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "networkInterfaces" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines" + }, + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "15879952829017360289", + "templateLink": { + "contentVersion": "1.0.0.0", + "uri": "{{ armTemplateAddNodeBasePath }}arm/mainTemplate.json" + }, + "timestamp": "2020-07-27T12:37:03.733682+00:00" + }, + "resourceGroup": "oraclevm-dcluster-0727", + "type": "Microsoft.Resources/deployments" +} +``` + +## Verify + +### Verify if new nodes are added to the WebLogic Server instance. + +* Go to the {{ site.data.var.wlsFullBrandName }} Administration Console. +* Go to **Environment** -> **Machines**. + + You should see logical machines with name parttern `^{managedServerPrefix}VM[0-9]+`, machine names with number suffix from `numberOfExistingNodes` to `numberOfExistingNodes + numberOfNewNodes` are added. +* Go to **Environment** -> **Servers** + + You should see servers with name parttern `^{managedServerPrefix}[0-9]+$`, server names with number suffix from `numberOfExistingNodes` to `numberOfExistingNodes + numberOfNewNodes` are added to `cluster1`. + + +### Verify if the newly added server has SSL configured successfully +* If the input parameter customSSLSettings.enable is set to true and the required custom SSL configuration values have been provided, then you should see the SSL configuration for the newly added server under **Environment** -> **Servers** -> **New Server** -> **Keystores** + +### Verify if Azure resources are added + +* Go to [Azure Portal](https://ms.portal.azure.com/). +* Go to resource group that the {{ site.data.var.wlsFullBrandName }} is deployed. + + You should see corresponding Vitual Machines, Disks, Network Interfaces, Public IPs have been added. + +### Verify AAD Integration + +Verify AAD integration by delpoying a simple Java EE applciation with basic authentication. + +* Go to Administration Server Console and deploy [testing application](../resources/basicauth.war). + * Select **Deployments**. + * Select **Install**. + * Select file `basicauth.war`. + * Select **Next**. Choose "Install this deployment as an application". + * Select **Next**. Select "cluster-1" and "All servers in the cluster". + * Keep configuration as default and select **Finish**. + * Select **Activate Changes** + * In the left navigation pane, select **Deployments**. + * Select **Control** + * Select `basicauth` + * Select **Start** + * Select **Servicing all requests** + +* Access the sample application + * Go to Administration Server Console + * Go to **Environment -> Machines**. Click one of the new machines, make sure there are servers running on that machine. Click **Node Manager** and make note of the machine host in **Listen Address**, here named it as `machineName`. Click **Servers** and make note of **Listen Port**, here named it as `port`. + * Go to [Azure Portal](https://ms.portal.azure.com/), and get DNS name from Virtual Machine has the same name of `machineName`, named it `machineDNS` + * Go to `http://${machineDNS}:${port}/basicauth`, the browser will prompt up to ask for credentials, input one of AAD users from group **AAD DC Administrators**, note that use name should be **sAMAccountName**, for example `wlstest` for user `wlstest@javaeehotmailcom.onmicrosoft.com`. + * Expected result, you can access the sample application without error. diff --git a/subtemplate-src/cluster-customDNSTemplate.md b/subtemplate-src/cluster-customDNSTemplate.md new file mode 100644 index 000000000..5e6f6a84a --- /dev/null +++ b/subtemplate-src/cluster-customDNSTemplate.md @@ -0,0 +1,168 @@ + + +{% include variables.md %} + +# Configure DNS alias to {{ site.data.var.wlsFullBrandName }} + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} with a custom DNS alias. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The DNS Configuration ARM template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Registered Domain Name + +You need to buy a domain name to create a custom DNS alias. + +### Azure DNS Zone + +If you create the DNS alias on an existing [Azure DNS Zone](https://docs.microsoft.com/en-us/azure/dns/dns-overview), make sure you have performed the [Azure DNS Delegation](https://docs.microsoft.com/en-us/azure/dns/dns-domain-delegation). After you have completed the delegation, you can verify it with `nslookup`. For example, assuming your domain name is **contoso.com**, this output shows a correct delegation. + +```bash +$ nslookup -type=SOA contoso.com +Server: 172.29.80.1 +Address: 172.29.80.1#53 + +Non-authoritative answer: +contoso.com + origin = ns1-01.azure-dns.com + mail addr = azuredns-hostmaster.microsoft.com + serial = 1 + refresh = 3600 + retry = 300 + expire = 2419200 + minimum = 300 +Name: ns1-01.azure-dns.com +Address: 40.90.4.1 +Name: ns1-01.azure-dns.com +Address: 2603:1061::1 +``` + +We strongly recommand you create an Azure DNS Zone for domain management and reuse it for other perpose. Follow the [guide](https://docs.microsoft.com/en-us/azure/dns/dns-getstarted-portal) to create an Azure DNS Zone. + +## Prepare the Parameters + +We provide an automation shell script for DNS configuration. You must specify the information of the existing Oracle WebLogic Server. This section shows how to obtain the values for the following required properties. + +| Parameter Name             | Explanation | +|----------------|-------------| +| `--admin-vm-name`| Required. Name of vitual machine that hosts {{ site.data.var.wlsFullBrandName }} admin server. Must be the same value provided at initial deployment time.| +| `--admin-console-label` | Required. Label for {{ site.data.var.wlsFullBrandName }} admin console. Used to generate subdomain of admin console. | +| `--artifact-location`| Required. See below for details. | +| `--resource-group` | Required. Name of resource group that has an {{ site.data.var.wlsFullBrandName }} cluster deployed. | +| `--location ` | Required. Must be the same region into which the server was initially deployed. | +| `--zone-name ` | Required. Azure DNS Zone name. | +| `--gateway-label` | Optional. Label for applciation gateway. Used to generate subdomain of application gateway. The parameter is only required if you want to create DNS alias for application gateway.| +| `--zone-resource-group` | Optional. Name of resource group that has Azure DNS Zone deployed. The parameter is only required if you are creating DNS alias on an existing DNS Zone. | +| `--help` | Help. | + +### Artifacts location + +This value must be the following. + +```bash +{{ armTemplateBasePath }} +``` + +## Invoke the Automation Script + +We provide an automation script to configure a custom DNS alias. The script lets you do the following: + + * If you have an Azure DNS Zone, it will create a DNS alias for the admin console and application gateway on the existing DNS Zone. + * If you don't have an Azure DNS Zone, it will create the DNS Zone in the same resource group as the {{ site.data.var.wlsFullBrandName }} cluster, then create the DNS alias for the admin console and application gateway. + +### Configure DNS Alias on an Existing Azure DNS Zone + +To configure a DNS alias on an existing Azure DNS Zone, in addition to the required parameters, you must also specify an Azure user-assigned managed identity ID and the resource group name in which your DNS Zone is deployed. + +This is an example to create a DNS alias `admin.contoso.com` for the admin console and `applciations.contoso.com` for the application gateway on an existing Azure DNS Zone. + +```bash +$ curl -fsSL {{ site.data.var.artifactsLocationBase }}/{{ site.data.var.artifactsLocationTag }}/{{site.data.var.artifactsLocationSubPathForVM}}{{ pageDir }}/cli-scripts/custom-dns-alias-cli.sh \ + | /bin/bash -s -- \ + --resource-group `yourResourceGroup` \ + --admin-vm-name adminVM \ + --admin-console-label admin \ + --artifact-location {{ armTemplateBasePath }} \ + --location eastus \ + --zone-name contoso.com \ + --gateway-label applications \ + --zone-resource-group `yourDNSZoneResourceGroup` +``` + +An example output: + +```text +Done! + +Custom DNS alias: + Resource group: haiche-dns-doc + WebLogic Server Administration Console URL: http://admin.contoso.com:7001/console + WebLogic Server Administration Console secured URL: https://admin.contoso.com:7002/console + + + Application Gateway URL: http://applications.contoso.com + Application Gateway secured URL: https://applications.contoso.com +``` + + +### Configure DNS Alias on a New Azure DNS Zone + +To configure a DNS alias on a new Azure DNS Zone, you must specify the required parameters. + +This is an example of creating an Azure DNS Zone, then creating a DNS alias `admin.contoso.com` for the admin console and `applications.contoso.com` for application gateway. + +```bash +$ curl -fsSL {{ site.data.var.artifactsLocationBase }}/{{ site.data.var.artifactsLocationTag }}/{{site.data.var.artifactsLocationSubPathForVM}}{{ pageDir }}/cli-scripts/custom-dns-alias-cli.sh \ + | /bin/bash -s -- \ + --resource-group `yourResourceGroup` \ + --admin-vm-name adminVM \ + --admin-console-label admin \ + --artifact-location {{ armTemplateBasePath }} \ + --location eastus \ + --zone-name contoso.com \ + --gateway-label applications +``` + +An example output: + +```text +DONE! + + +Action required: + Complete Azure DNS delegation to make the alias accessible. + Reference: https://aka.ms/dns-domain-delegation + Name servers: + [ + "ns1-02.azure-dns.com.", + "ns2-02.azure-dns.net.", + "ns3-02.azure-dns.org.", + "ns4-02.azure-dns.info." + ] + +Custom DNS alias: + Resource group: haiche-dns-doc + WebLogic Server Administration Console URL: http://admin.contoso.com:7001/console + WebLogic Server Administration Console secured URL: https://admin.contoso.com:7002/console + + + Application Gateway URL: http://applications.contoso.com + Application Gateway secured URL: https://applications.contoso.com +``` + +**Note:** The DNS aliases are not accessible now, you must perform Azure DNS delegation after the deployment. Follow [Delegation of DNS zones with Azure DNS](https://aka.ms/dns-domain-delegation) to complete the Azure DNS delegation. + + +## Verify the Custom Alias + +Access the URL from output to verify if the custom alias works. diff --git a/subtemplate-src/cluster-deletenode.md b/subtemplate-src/cluster-deletenode.md new file mode 100644 index 000000000..f02442b19 --- /dev/null +++ b/subtemplate-src/cluster-deletenode.md @@ -0,0 +1,542 @@ + + +{% include variables.md %} + +# Delete nodes from {{ site.data.var.wlsFullBrandName }} + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} to delete nodes using Azure CLI. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +## Prepare the Parameters JSON file + +You must construct a parameters JSON file containing the parameters to the delete-node ARM template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. You must specify the information of the existing {{ site.data.var.wlsFullBrandName }} and nodes to be deleted. This section shows how to obtain the values for the following required properties. + +| Parameter Name | Explanation | +|----------------|-------------| +| `_artifactsLocation`| See below for details. | +| `adminVMName`| At deployment time, if this value was changed from its default value, the value used at deployment time must be used. Otherwise, this parameter should be omitted. | +| `deletingManagedServerNames` | The names of managed server that you want to delete. | +| `deletingManagedServerMachineNames`| The resource names of Azure Virtual Machine hosting managed servers that you want to delete. | +| `wlsPassword` | Must be the same value provided at deployment time. | +| `wlsUserName` | Must be the same value provided at deployment time. | + +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateDeleteNodeBasePath }} +``` + +### `deletingManagedServerNames` + +This value must be an array of strings, for example: `["msp1", "msp2"]`. + +You can get the server names from WebLogic Server Administration Console, following the steps: + +* Go to WebLogic Server Administration Console, http://admin-host:7001/console. + +* Go to **Environment** -> **Servers**. + + You will find all available servers. Server names are listed in **Name** column. + + Make note of the machine for the deleting servers, you need to find out corresponding Azure Virtual Machine names of those machines. + +### `deletingManagedServerMachineNames` + +This value must be an array of strings, for example: `["mspVM1", "mspVM2"]`. + +You can get the server names from WebLogic Server Administration Console, following the steps: + +* Go to WebLogic Server Administration Console, http://admin-host:7001/console. + +* Go to **Environment** -> **Machines**. + + Open the machine you noted down in step `deletingManagedServerNames`. + + Click **Configuration** -> **Node Manager**, you will get compute name from **Listen Address**. + + The Azure Virtual Machine name was set with the same value of compute name during {{ site.data.var.wlsFullBrandName }} deployment. + +#### Example Parameters JSON + +Here is a fully filled out parameters file. Note that here we do not include `adminVMName`. + +{{ site.data.var.passwordInFileNote }} + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "_artifactsLocation": { + "value": "{{ armTemplateDeleteNodeBasePath }}" + }, + "deletingManagedServerNames": { + "value": [ + "msp4", + "mspStorage2" + ] + }, + "deletingManagedServerMachineNames": { + "value": [ + "mspVM4", + "mspStorageVM2" + ] + }, + "wlsPassword": { + "value": "welcome1" + }, + "wlsUserName": { + "value": "weblogic" + } + } +} +``` + +## Invoke the delete-node script + +To delete managed nodes completely, you have to delete managed servers logically from the WebLogic Server instance, and physically release Azure resources that host the managed servers. We realize the two purposes in different ways: + * Delete managed servers and machines logically from WebLogic Server instance by deploying delete-node ARM template with Azure CLI. You have to specify the parameters file. + * Release corresponding Azure resources by running Azure CLI commands. The following resources will be removed: + * Virtual Machines that host managed servers that will be deleted. + * Data disks attached to the Virtual Machines + * OS disks attached to the Virtual Machines + * Network Interfaces added to the Virtual Machines + * Public IPs attached to the Virtual Machines + * If the Application Gateway is deployed, will remove the manged server hosts from gateway. + +We have provided an automation script for above two purposes, you can delete managed nodes easily with the following instructions. + +### Invoke the script + +Assume your parameters file is available in the current directory and is named `parameters.json`. Replace `yourResourceGroup` with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +The following command runs the script in silent mode with option `-s`, this mode will delete managed nodes logically and physically. + +If you want to keep Azure resources, refer to [advanced usage](#advanced-usage) for further information. + +```bash +$ curl -fsSL {{ armTemplateDeleteNodeBasePath }}scripts/deletenode-cli.sh | /bin/bash -s -- -s -g `yourResourceGroup` -u {{ armTemplateDeleteNodeBasePath }}arm/mainTemplate.json -p parameters.json +``` + +The script will validate the template with your parameters file; deploy the template to delete managed servers from WebLogic Server cluster; run Azure CLI commands to delete corresponding Azure resources. + +This is an example output of successful deployment, the {{ site.data.var.wlsFullBrandName }} is deployed with Application Gateway. Look for `Completed!` in your output. + +```bash +{ + "error": null, + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Resources/deployments/mainTemplate", + "name": "mainTemplate", + "properties": { + "correlationId": "cbfaa443-3a72-4217-83e1-cc91485597fa", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-cluster-07232", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Resources/deployments/pid-4b263220-3cc6-53b9-aef3-23ad10c45d52", + "resourceGroup": "oraclevm-cluster-07232", + "resourceName": "pid-4b263220-3cc6-53b9-aef3-23ad10c45d52", + "resourceType": "Microsoft.Resources/deployments" + } + ], + "duration": "PT0S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputs": null, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "{{ armTemplateDeleteNodeBasePath }}" + }, + "_artifactsLocationSasToken": { + "type": "SecureString" + }, + "adminVMName": { + "type": "String", + "value": "adminVM" + }, + "deletingManagedServerMachineNames": { + "type": "Array", + "value": [ + "mspVM2" + ] + }, + "deletingManagedServerNames": { + "type": "Array", + "value": [ + "msp2" + ] + }, + "location": { + "type": "String", + "value": "eastus" + }, + "wlsForceShutDown": { + "type": "String", + "value": "true" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "3171958496378517565", + "templateLink": { + "contentVersion": "1.0.0.0", + "uri": "{{ armTemplateDeleteNodeBasePath }}arm/mainTemplate.json" + }, + "timestamp": "2020-07-23T07:44:38.977624+00:00", + "validatedResources": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Resources/deployments/pid-7d4ae6d6-17c5-5168-b7d2-e0bf33a1e878", + "resourceGroup": "oraclevm-cluster-07232" + }, + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-cluster-07232" + }, + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Resources/deployments/pid-4b263220-3cc6-53b9-aef3-23ad10c45d52", + "resourceGroup": "oraclevm-cluster-07232" + } + ] + }, + "resourceGroup": "oraclevm-cluster-07232", + "type": "Microsoft.Resources/deployments" +} +Accepted: newuserscript (Microsoft.Compute/virtualMachines/extensions) +Accepted: deletenode-1595490274 (Microsoft.Resources/deployments) +Command ran in 102.719 seconds (init: 0.061, invoke: 102.658) +Extension 'resource-graph' is already installed. +List resource Ids to be deleted: +/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Compute/virtualMachines/mspVM2 +/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Network/networkInterfaces/mspVM2_NIC +/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Network/publicIPAddresses/mspVM2_PublicIP +/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/ORACLEVM-CLUSTER-07232/providers/Microsoft.Compute/disks/mspVM2_OsDisk_1_e6d8ffb0e73649a4a713acf5e6ca7099 +/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/ORACLEVM-CLUSTER-07232/providers/Microsoft.Compute/disks/mspVM2_lun_0_2_942609646fdc4e1dab06b23ffeee650f +Are you sure to delete these resources (y/n)?Deleting managed resources...Please do not stop. +[ + null, + null, + null, + null, + null +] +Command ran in 112.375 seconds (init: 0.062, invoke: 112.313) +Check if application gateway has deployed... +Removing mspVM2 from application gateway, please do not stop. +{ + "backendAddresses": [ + { + "fqdn": "mspVM1", + "ipAddress": null + }, + { + "fqdn": "mspVM3", + "ipAddress": null + } + ], + "backendIpConfigurations": null, + "etag": "W/\"23399346-e17b-4f56-bda4-5e77c1d82195\"", + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Network/applicationGateways/myAppGateway/backendAddressPools/myGatewayBackendPool", + "name": "myGatewayBackendPool", + "provisioningState": "Succeeded", + "resourceGroup": "oraclevm-cluster-07232", + "type": "Microsoft.Network/applicationGateways/backendAddressPools" +} + +Complete! +``` + +### Advanced usage + +If you want to learn more about the script and run it manually, follow the advanced instructions to interact with the ternimal. + + * Download the script + + ```bash + $ curl -fsSL {{ armTemplateDeleteNodeBasePath }}scripts/deletenode-cli.sh + ``` + + You will get a shell script named `deletenode-cli.sh` in your current directory. Usage of the script: + + ```bash + ./deletenode-cli.sh -h + usage: deletenode-cli.sh -g resource-group [-f template-file] [-u template-url] -p paramter-file [-h] + -g Azure Resource Group of the Vitural Machines that host deleting manages servers, must be specified. + -f Path of ARM template to delete nodes, must be specified -f option or -u option. + -u URL of ARM template, must be specified -f option or -u option. + -p Path of ARM parameter, must be specified. + -s Execute the script in silent mode. The script will input y automatically for the prompt. + -h Help + ``` + + You can not only run the script with a local template file by specifying `-f` option, but also with a templatle URL using `-u` option. + + * Run the script + + Run the script with your parameters file in your current directory. The following command runs with a template URL: + + ```bash + ./deletenode-cli.sh -g yourResourceGroup -u {{ armTemplateDeleteNodeBasePath }}arm/mainTemplate.json -p parameters.json + ``` + + Before deleting any Azure resource, the script will prompt up message **Are you sure to delete these resources (y/n)?** to comfirm if you want to delete Azure resources. If you input `Y/y`, the Azure resources will be deleted. Otherwise, keep the resource and exit. + + This is an example output of deployment that will not delete Azure resources from your resource group, the {{ site.data.var.wlsFullBrandName }} is deployed with Application Gateway. Look for `Completed!` in your output. + + ```bash + { + "error": null, + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Resources/deployments/mainTemplate", + "name": "mainTemplate", + "properties": { + "correlationId": "4b15b45b-fb1f-4def-ad32-d96201000ac1", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-cluster-07232", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Resources/deployments/pid-4b263220-3cc6-53b9-aef3-23ad10c45d52", + "resourceGroup": "oraclevm-cluster-07232", + "resourceName": "pid-4b263220-3cc6-53b9-aef3-23ad10c45d52", + "resourceType": "Microsoft.Resources/deployments" + } + ], + "duration": "PT0S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputs": null, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "{{ armTemplateDeleteNodeBasePath }}" + }, + "_artifactsLocationSasToken": { + "type": "SecureString" + }, + "adminVMName": { + "type": "String", + "value": "adminVM" + }, + "deletingManagedServerMachineNames": { + "type": "Array", + "value": [ + "mspVM3" + ] + }, + "deletingManagedServerNames": { + "type": "Array", + "value": [ + "msp3" + ] + }, + "location": { + "type": "String", + "value": "eastus" + }, + "wlsForceShutDown": { + "type": "String", + "value": "true" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "3171958496378517565", + "templateLink": { + "contentVersion": "1.0.0.0", + "uri": "{{ armTemplateDeleteNodeBasePath }}arm/mainTemplate.json" + }, + "timestamp": "2020-07-24T04:17:38.500948+00:00", + "validatedResources": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Resources/deployments/pid-7d4ae6d6-17c5-5168-b7d2-e0bf33a1e878", + "resourceGroup": "oraclevm-cluster-07232" + }, + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-cluster-07232" + }, + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Resources/deployments/pid-4b263220-3cc6-53b9-aef3-23ad10c45d52", + "resourceGroup": "oraclevm-cluster-07232" + } + ] + }, + "resourceGroup": "oraclevm-cluster-07232", + "type": "Microsoft.Resources/deployments" +} +Succeeded: pid-7d4ae6d6-17c5-5168-b7d2-e0bf33a1e878 (Microsoft.Resources/deployments) +Accepted: deletenode-1595564252 (Microsoft.Resources/deployments) +Accepted: newuserscript (Microsoft.Compute/virtualMachines/extensions) +Command ran in 102.182 seconds (init: 0.089, invoke: 102.092) +Extension 'resource-graph' is already installed. +List resource Ids to be deleted: +/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Compute/virtualMachines/mspVM3 +/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Network/networkInterfaces/mspVM3_NIC +/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Network/publicIPAddresses/mspVM3_PublicIP +/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/ORACLEVM-CLUSTER-07232/providers/Microsoft.Compute/disks/mspVM3_OsDisk_1_d5e69682dbff491e97b7a04eea3896eb +/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/ORACLEVM-CLUSTER-07232/providers/Microsoft.Compute/disks/mspVM3_lun_0_2_f5bfbf93870f4ed3b1d90a8b953818e7 +Are you sure to delete these resources (y/n)?n +Check if application gateway has deployed... +Removing mspVM3 from application gateway, please do not stop. +{ + "backendAddresses": [ + { + "fqdn": "mspVM1", + "ipAddress": null + } + ], + "backendIpConfigurations": null, + "etag": "W/\"b6f76f57-be98-406d-ac9c-d11035fd3b5b\"", + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-cluster-07232/providers/Microsoft.Network/applicationGateways/myAppGateway/backendAddressPools/myGatewayBackendPool", + "name": "myGatewayBackendPool", + "provisioningState": "Succeeded", + "resourceGroup": "oraclevm-cluster-07232", + "type": "Microsoft.Network/applicationGateways/backendAddressPools" +} + +Complete! + ``` + +## Verify + +### Verify if the managed servers are deleted from WebLogic Server instance. + +* Go to the {{ site.data.var.wlsFullBrandName }} Administration Console. +* Go to **Environment** -> **Servers**. + You should see no server names that have been deleted listed in **Name** column. +* Go to **Environment -> Machines**. + You should see logical machines that host the servers that have been deleted are removed. + +### Verify if the Azure resources are deleted + +* Go to [Azure Portal](https://ms.portal.azure.com/). +* Go to resource group that the {{ site.data.var.wlsFullBrandName }} is deployed. + You should see corresponding Vitual Machines, Disks, Network Interfaces, Public IPs have been removed. + + For example, I want to delete managed server `msp1`, corresponding Virtual Machine name is `mspVM1`, Azure resource names are: + * Virtual Machine: `mspVM1` + * Data Disk: `mspVM1_lun_0_2_9d41e2c965744665adb6965625c20d9a` + * OS Disk: `mspVM1_OsDisk_1_05a8d81f5d01419a97ee17a45f974dca` + * Network Interface: `mspVM1_NIC` + * Public IP: `mspVM1_PublicIP` + + All of these resource should be deleted after the script finishes, unless you don't expect to delete them without specifying "Y/y" to the prompt. diff --git a/subtemplate-src/cluster-elkNestedTemplate.md b/subtemplate-src/cluster-elkNestedTemplate.md new file mode 100644 index 000000000..c675fbfa8 --- /dev/null +++ b/subtemplate-src/cluster-elkNestedTemplate.md @@ -0,0 +1,406 @@ + + +{% include variables.md %} + +# Land {{ site.data.var.wlsFullBrandName }} logs to Elasticsearch and Kibana + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} to land logs to Elasticsearch and Kibana using Azure CLI. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The ELK ARM template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Virtual machine size requirement +Ensure the virtual machines that have been deployed have at least **2.5GB** of memory. The default virtual machine size for WLS does not have enough memory. Use at least `Standard_A2_v2`. + +### Elasticsearch instance + +Refer to [Create an an Elastic on Azure instance](https://aka.ms/arm-oraclelinux-wls-elk#create-an-an-elastic-on-azure-instance) + +## Prepare the Parameters JSON file + +You must construct a parameters JSON file containing the parameters to the ELK ARM template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. + +We must specify the information of the existing {{ site.data.var.wlsFullBrandName }} and Elasticsearch instance. This section shows how to obtain the values for the following required properties. + +| Parameter Name | Explanation | +|----------------|-------------| +| `_artifactsLocation`| See below for details. | +| `adminVMName`| Virtual machine name of which hosts the {{ site.data.var.wlsFullBrandName }} admin server. | +| `elasticsearchEndpoint` | The Elasticsearch endpoint. | +| `elasticsearchPassword` | Password of the Elasticsearch account. Used to distibute message with REST API to Elasticsearch instance. | +| `elasticsearchUserName` | User name of the Elasticsearch account. | +| `location` | Must be the same region into which the server was initially deployed. | +| `logsToIntegrate` | Specify the WebLogic logs to export to Elasticsearch, you must select at least one log. | +| `managedServerPrefix` | Must be the same prefix with which the cluster was initially deployed. | +| `numberOfManagedApplicationInstances` | Number of VMs that have been deployed to host managed application server. | +| `numberOfManagedCacheInstances` | Number of VMs that have been deployed to host managed cache server, please set the value if your cluster is Coherence cluster. | +| `wlsDomainName` | Must be the same value provided at initial deployment time. | +| `wlsPassword` | Must be the same value provided at initial deployment time. | +| `wlsUserName` | Must be the same value provided at initial deployment time. | + +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateBasePath }} +``` + +### Number of Managed application instances + +You can get the existing Managed application instances number with the following command using Azure CLI. + +```shell +$ resourceGroup= +$ managedServerPrefix= +$ numberOfManagedApplicationInstances=$(az resource list -g ${resourceGroup} --resource-type Microsoft.Compute/virtualMachines --query [*].name | grep "${managedServerPrefix}VM[0-9]" | sed -e 's/[^0-9]/ /g' -e 's/^ *//g' -e 's/ *$//g' | tr -s ' ' | sed 's/ /\n/g' | sort -nr | head -n1) +$ echo ${numberOfManagedApplicationInstances} +``` + +### Number of Managed cache instances + +This parameter works for Coherence cluster. If your cluster is not Coherence cluter, keep it with default value `0`. + +You can get the existing Managed cache instances number with the following command using Azure CLI. It should be `0` if no value returned. + +```shell +$ resourceGroup= +$ managedServerPrefix= +$ numberOfManagedCacheInstances=$(az resource list -g ${resourceGroup} --resource-type Microsoft.Compute/virtualMachines --query [*].name | grep "${managedServerPrefix}StorageVM[0-9]" | sed -e 's/[^0-9]/ /g' -e 's/^ *//g' -e 's/ *$//g' | tr -s ' ' | sed 's/ /\n/g' | sort -nr | head -n1) +$ echo ${numberOfManagedCacheInstances} +``` + +#### Example Parameters JSON + +Here is a fully filled out parameters file. We will leave values of `adminUsername`, `authenticationType`, `dnsLabelPrefix`, and `usePreviewImage` as default value. + +{{ site.data.var.passwordInFileNote }} + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "_artifactsLocation": { + "value": "{{ armTemplateBasePath }}" + }, + "adminVMName": { + "value": "adminVM" + }, + "elasticsearchEndpoint": { + "value": "https://example.eastus2.azure.elastic-cloud.com:9243" + }, + "elasticsearchPassword": { + "value": "wlkpsw" + }, + "elasticsearchUserName": { + "value": "elastic" + }, + "location": { + "value": "eastus" + }, + "managedServerPrefix": { + "value": "msp" + }, + "numberOfManagedApplicationInstances": { + "value": 2 + }, + "numberOfManagedCacheInstances": { + "value": 0 + }, + "wlsDomainName": { + "value": "wlsd" + }, + "wlsPassword": { + "value": "welcome1" + }, + "wlsUserName": { + "value": "weblogic" + } + } +} +``` + +## Invoke the ARM template + +Assume your parameters file is available in the current directory and is named `parameters.json`. This section shows the commands to configure your {{ site.data.var.wlsFullBrandName }} deployment to connect to Elasticsearch and Kinaba intance. Replace `yourResourceGroup` with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +### First, validate your parameters file + +The `az group deployment validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az deployment group validate --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/elkNestedTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Next, execute the template + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az deployment group create --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/elkNestedTemplate.json +``` + +As with the validate command, if the command returns with an exit status other than `0`, inspect the output and resolve the problem. + +This is an example output of successful deployment. Look for `"provisioningState": "Succeeded"` in your output. + +```json +{ + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Resources/deployments/elkNestedTemplate", + "location": null, + "name": "elkNestedTemplate", + "properties": { + "correlationId": "61a46b43-27d0-4478-baba-c288059892d5", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/mspVM1/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "mspVM1/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/mspVM2/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "mspVM2/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/mspStorageVM1/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "mspStorageVM1/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Resources/deployments/pid-e4165284-b017-5df9-9b91-3f11dd8a72e5", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "pid-e4165284-b017-5df9-9b91-3f11dd8a72e5", + "resourceType": "Microsoft.Resources/deployments" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/mspVM1/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "mspVM1/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/mspVM2/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "mspVM2/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/mspStorageVM1/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "mspStorageVM1/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "duration": "PT8M54.4785762S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputResources": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/mspStorageVM1/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/mspVM1/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/mspVM2/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk" + } + ], + "outputs": { + "artifactsLocationPassedIn": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + }, + "logIndex": { + "type": "String", + "value": "azure-weblogic-cluster-b4e465d5-6ffc-49cf-b1d9-b4dbf6455d0a" + } + }, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + }, + "_artifactsLocationELKTemplate": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + }, + "_artifactsLocationSasToken": { + "type": "SecureString" + }, + "adminVMName": { + "type": "String", + "value": "adminVM" + }, + "elasticsearchEndpoint": { + "type": "String", + "value": "https://example.eastus2.azure.elastic-cloud.com:9243" + }, + "elasticsearchPassword": { + "type": "SecureString" + }, + "elasticsearchUserName": { + "type": "String", + "value": "elastic" + }, + "guidValue": { + "type": "String", + "value": "b4e465d5-6ffc-49cf-b1d9-b4dbf6455d0a" + }, + "location": { + "type": "String", + "value": "eastus" + }, + "logsToIntegrate": { + "type": "Array", + "value": [ + "HTTPAccessLog", + "ServerLog", + "DomainLog", + "DataSourceLog", + "StandardErrorAndOutput", + "NodeManagerLog" + ] + }, + "managedServerPrefix": { + "type": "String", + "value": "msp" + }, + "numberOfManagedApplicationInstances": { + "type": "Int", + "value": 2 + }, + "numberOfManagedCacheInstances": { + "type": "Int", + "value": 1 + }, + "wlsDomainName": { + "type": "String", + "value": "wlsd" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "10060935779116645392", + "templateLink": null, + "timestamp": "2020-11-11T07:29:42.336797+00:00" + }, + "resourceGroup": "haiche-cluster-elk", + "type": "Microsoft.Resources/deployments" +} +``` + +## Verify ELK connection + +Follow the steps to check if WebLogic Server logs are exported to Elasticsearch. + +* Go to Azure portal +* Copy log index from your resource group -> deployments -> elkNestedTemplate -> output -> logIndex . +* Go to Elasticsearch cloud and launch Kibana. +* Create index + * Go to Kibana -> Management -> Kibana -> Index Patterns + * Click `Create index Patterns` + * Input the log index you copy from output in Index pattern + * There should be an index you can select, otherwise, the ELK deployment failed + * Next step + * Select `@timestamp` in Time Filter and hit `Create index pattern` +* View logs + * Go to Kibana -> Discover + * Select the index you just created + * You will find the WebLogic Server logs listed diff --git a/subtemplate-src/cluster-nsgRulesTemplate.md b/subtemplate-src/cluster-nsgRulesTemplate.md new file mode 100644 index 000000000..71c76350d --- /dev/null +++ b/subtemplate-src/cluster-nsgRulesTemplate.md @@ -0,0 +1,86 @@ + + +{% include variables.md %} + +# Apply Azure Network Security Rule ARM Template to {{ site.data.var.wlsFullBrandName }} + +This page documents how to append addtional security rules to an existing Azure Network Security Group deployed with {{ site.data.var.wlsFullBrandName }} using the Azure CLI. + +## Prerequisies + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### Azure Network Security Group + +The Azure Network Security Rule ARM template will be applied to an existing Azure Network Security Group (NSG) instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Prepare the Parameters JSON file + +You must construct a parameter JSON file containing the parameters to the NSG template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. The options to this template declare the desired configuration of the NSG. + +| Parameter Name | Description | +| `denyPublicTrafficForAdminServer` | Deny public tranffic for the admin server on port 7001, 7002. | +| `denyPublicTrafficForManagedServer` | Deny public tranffic for the managed servers on port 8001. | +| `enableAppGateway` | We deal with the configuration for managed servers when the Application Gateway is enabled. | +| `networkSecurityGroupName` | The name of the NSG. | + +#### Example Parameters JSON file + +Here is a fully filled out parameters file, assuming the {{ site.data.var.wlsFullBrandName }} was deployed accepting the default values. + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "denyPublicTrafficForManagedServer": { + "value": true + }, + "denyPublicTrafficForAdminServer": { + "value": false + }, + "enableAppGateway": { + "value": true + }, + "networkSecurityGroupName": { + "value": "wls-nsg" + } + } +} +``` + +## Invoke the ARM template + +This section shows how to kick off the deployment step-by-step. After the deployment, your existing NSG will append two additional Inbound Rules for admin and managed servers. Here we assume you have the parameter file in the current directory, the file is named `parameters.json`, and your NSG is named `wls-nsg`. Don't forget to replace `yourResourceGroup` with the Azure resource group in which the NSG is created. + +### First, validate your parameters file + +The `az group deployment validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az group deployment validate --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/nsgNestedTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Next, execute the template with it + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az group deployment create --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/nsgNestedTemplate.json +``` + +## Verify the rules have been appended to the Azure Network Security Group successfully + +When the deployment is completed, you can verify the appended rules via Azure Portal +* Visit the Azure Network Security Group under your resource group used above. +* Go to `Settings -> Inbound security rules`. +* Verify there is a rule named `WebLogicAdminPortsAllowed` with **Priority = '210'; Port = '7001, 7002'; Protocol = 'TCP'; Source = '10.0.0.0/24'; Aciton = 'Allow'**. +* Verify there is a rule named `WebLogicManagedPortsDenied` with **Priority = '221'; Port = '8001'; Protocol = '*'; Aciton = 'Deny'**. + diff --git a/subtemplate-src/coherenceTemplate.md b/subtemplate-src/coherenceTemplate.md new file mode 100644 index 000000000..401c1ec9a --- /dev/null +++ b/subtemplate-src/coherenceTemplate.md @@ -0,0 +1,533 @@ + + +{% include variables.md %} + +# Configure Coherence cluster to {{ site.data.var.wlsFullBrandName }} + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} with a Coherence cluster using Azure CLI. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The Coherence ARM template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +**Note:** if you have enabled Coherence in the initial offer deployment from Azure portal, the Coherence cluster has been set up, you don't need to run Coherence tempalte. + +### Elasticsearch instance + +Optional. + +Refer to [Create an an Elastic on Azure instance](https://aka.ms/arm-oraclelinux-wls-elk#create-an-an-elastic-on-azure-instance) + +## Prepare the Parameters JSON file + +You must construct a parameters JSON file containing the parameters to the Coherence ARM template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. + +The deployment of coherenceTemplate.json will: + * Provision Azure resources, including virtual machine, network interface, disk, public IP to host new Coherence cache servers. + * Configure WebLogic Coherence cluster, including: + * Create Coherence cluster `myCoherence` + * Create data tier `storage1` cluster. + * Associate `cluster1` and `storage1` to `myCoherence` cluster. + * Create cache servers and assign them to `storage1` cluster. + +We must specify the information of the existing {{ site.data.var.wlsFullBrandName }}. This section shows how to obtain the values for the following required properties. + +| Parameter Name | Explanation | +|----------------|-------------| +| `_artifactsLocation`| See below for details. | +| `adminPasswordOrKey` | SSH Key or password for the Virtual Machine. SSH key is recommended. | +| `adminVMName`| Virtual machine name of which hosts the {{ site.data.var.wlsFullBrandName }} admin server. | +| `elasticsearchEndpoint` | The Elasticsearch endpoint. | +| `elasticsearchPassword` | Password for the Elasticsearch account. | +| `elasticsearchUserName` | User name for the Elasticsearch account. | +| `enableCoherenceWebLocalStorage` | Specifies whether Local Storage is enabled for the Coherence*Web cluster tier. | +| `enableELK` | If true, use the supplied parameters to distribute WebLogic Server logs to the Elasticsearch instance. | +| `location` | Must be the same region into which the server was initially deployed. | +| `logIndex` | Elasticsearch index you expect to export the logs to. Must be the same value with output from initial ELK deployment. | +| `logsToIntegrate` | Specify the WebLogic logs to export to Elasticsearch, you must select at least one log. | +| `managedServerPrefix` | Must be the same prefix with which the cluster was initially deployed. | +| `numberOfCoherenceCacheInstances` | Number of Coherence cache servers, used to create Virtual Machines and Managed Server. | +| `skuUrnVersion` | Must be the same urn with which the cluster was initially deployed. | +| `storageAccountName` | The name of an existing storage account. | +| `vmSizeSelectForCoherence` | Select appropriate VM Size for Coherence cache servers. | +| `wlsDomainName` | Must be the same value provided at initial deployment time. | +| `wlsPassword` | Must be the same value provided at initial deployment time. | +| `wlsUserName` | Must be the same value provided at initial deployment time. | + +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateBasePath }} +``` + +### Log index + +If you configured ELK in your cluster to export WebLogic Server logs to ELK, please input the value of Kibana log index, this template will set up ELK connection and export logs to specified index. + +You can get the value from Azure portal with the following steps: + +* Go to Azure portal. +* Open you resource group and click **Deployments**. +* Open the ELK deployment, and click **Output**. +* Copy the value of `logIndex`. + +Alternatively, use Azure CLI command to list log index inside the resource group deployments: + +```shell +$ az deployment group list -g 'yourResourceGroup' --query [*].properties.outputs.logIndex.value +[ + "azure-weblogic-cluster-f984df74-ab4d-4c17-a532-7f248659fb28" +] +``` + +### Storage account + +Each Storage Account handles up to 20,000 IOPS, and 500TB of data. If you use a storage account for Standard Virtual Machines, you can store until 40 virtual disks. + +We have two disks for one Virtual Machine, it's suggested no more than 20 Virtual Machines share the same storage account. Number of virtual machines that hosting managed servers should be less than or equal to 20. + +You can get the name of storage account from Azure portal with steps: + + * Go to Azure portal + * Go to the your resource group + * Find storage account resource and copy its name + +Alternatively, use Azure CLI command to list storage account inside a resource group: + +```shell +$ az resource list -g 'yourResourceGroup' --resource-type Microsoft.Storage/storageAccounts --query [*].name +[ + "219846olvm" +] +``` + +#### Example Parameters JSON + +Here is a fully filled out parameters file. This is an example to set up Coherence*Web. We will leave values of `adminUsername`, `authenticationType`, `dnsLabelPrefix`, and `usePreviewImage` as default value. + +{{ site.data.var.passwordInFileNote }} + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "_artifactsLocation": { + "value": "{{ armTemplateBasePath }}" + }, + "adminPasswordOrKey": { + "value": "jyfRat@nht2019" + }, + "adminVMName": { + "value": "adminVM" + }, + "elasticsearchEndpoint": { + "value": "https://example.eastus2.azure.elastic-cloud.com:9243" + }, + "elasticsearchPassword": { + "value": "Secret123!" + }, + "elasticsearchUserName": { + "value": "elastic" + }, + "enableCoherenceWebLocalStorage": { + "value": true + }, + "enableELK": { + "value": true + }, + "managedServerPrefix": { + "value": "msp" + }, + "location": { + "value": "eastus" + }, + "logIndex": { + "value": "azure-weblogic-cluster-11122020" + }, + "logsToIntegrate": { + "value": ["HTTPAccessLog", "ServerLog", "DomainLog", "DataSourceLog", "StandardErrorAndOutput","NodeManagerLog"] + }, + "numberOfCoherenceCacheInstances": { + "value": 1 + }, + "skuUrnVersion": { + "value": "owls-122140-8u251-ol76;Oracle:weblogic-122140-jdk8u251-ol76:owls-122140-8u251-ol7;latest" + }, + "storageAccountName": { + "value": "d40140olvm" + }, + "vmSizeSelectForCoherence": { + "value": "Standard_A1" + }, + "wlsDomainName": { + "value": "wlsd" + }, + "wlsPassword": { + "value": "welcome1" + }, + "wlsUserName": { + "value": "weblogic" + } + } +} +``` + +## Invoke the ARM template + +Assume your parameters file is available in the current directory and is named `parameters.json`. This section shows the commands to configure your {{ site.data.var.wlsFullBrandName }} deployment with a Coherence cluster. Replace `yourResourceGroup` with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +### First, validate your parameters file + +The `az deployment group validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az deployment group validate --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/coherenceTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Next, execute the template + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az deployment group create --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/coherenceTemplate.json +``` + +As with the validate command, if the command returns with an exit status other than `0`, inspect the output and resolve the problem. + +This is an example output of successful deployment. Look for `"provisioningState": "Succeeded"` in your output. + +```json +{ + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Resources/deployments/coherenceTemplate", + "location": null, + "name": "coherenceTemplate", + "properties": { + "correlationId": "07555c54-2384-4ca3-b427-6cf7d8b53052", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM1/extensions/newuserscript", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM1/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Resources/deployments/pid-157eaa6e-12ae-11eb-adc1-0242ac120002", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "pid-157eaa6e-12ae-11eb-adc1-0242ac120002", + "resourceType": "Microsoft.Resources/deployments" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Network/publicIPAddresses/mspStorageVM1_PublicIP", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM1_PublicIP", + "resourceType": "Microsoft.Network/publicIPAddresses" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Network/networkInterfaces/mspStorageVM1_NIC", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM1_NIC", + "resourceType": "Microsoft.Network/networkInterfaces" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Network/networkInterfaces/mspStorageVM1_NIC", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM1_NIC", + "resourceType": "Microsoft.Network/networkInterfaces" + }, + { + "apiVersion": "2019-06-01", + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Storage/storageAccounts/33f2e3olvm", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "33f2e3olvm", + "resourceType": "Microsoft.Storage/storageAccounts" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM1", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM1", + "resourceType": "Microsoft.Compute/virtualMachines" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM1", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM1", + "resourceType": "Microsoft.Compute/virtualMachines" + }, + { + "actionName": "listKeys", + "apiVersion": "2019-06-01", + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Storage/storageAccounts/33f2e3olvm", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "33f2e3olvm", + "resourceType": "Microsoft.Storage/storageAccounts" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM1", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM1", + "resourceType": "Microsoft.Compute/virtualMachines" + }, + { + "actionName": "listKeys", + "apiVersion": "2019-06-01", + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Storage/storageAccounts/33f2e3olvm", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "33f2e3olvm", + "resourceType": "Microsoft.Storage/storageAccounts" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM1/extensions/newuserscript", + "resourceGroup": "haiche-cluster-1106", + "resourceName": "mspStorageVM1/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "duration": "PT9M26.6278882S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputResources": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "haiche-cluster-1106" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM1", + "resourceGroup": "haiche-cluster-1106" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM1/extensions/newuserscript", + "resourceGroup": "haiche-cluster-1106" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Network/networkInterfaces/mspStorageVM1_NIC", + "resourceGroup": "haiche-cluster-1106" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Network/publicIPAddresses/mspStorageVM1_PublicIP", + "resourceGroup": "haiche-cluster-1106" + } + ], + "outputs": { + "artifactsLocationPassedIn": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + } + }, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + }, + "_artifactsLocationCoherenceTemplate": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + }, + "_artifactsLocationSasToken": { + "type": "SecureString" + }, + "adminPasswordOrKey": { + "type": "SecureString" + }, + "adminUsername": { + "type": "String", + "value": "weblogic" + }, + "adminVMName": { + "type": "String", + "value": "adminVM" + }, + "authenticationType": { + "type": "String", + "value": "password" + }, + "dnsLabelPrefix": { + "type": "String", + "value": "wls" + }, + "enableCoherenceWebLocalStorage": { + "type": "Bool", + "value": true + }, + "guidValue": { + "type": "String", + "value": "b4c17707-b932-43f0-a4cc-6d6990bb850f" + }, + "location": { + "type": "String", + "value": "eastus" + }, + "managedServerPrefix": { + "type": "String", + "value": "msp" + }, + "numberOfCoherenceCacheInstances": { + "type": "Int", + "value": 1 + }, + "skuUrnVersion": { + "type": "String", + "value": "owls-122130-8u131-ol74;Oracle:weblogic-122130-jdk8u131-ol74:owls-122130-8u131-ol7;latest" + }, + "storageAccountName": { + "type": "String", + "value": "33f2e3olvm" + }, + "usePreviewImage": { + "type": "Bool", + "value": false + }, + "vmSizeSelectForCoherence": { + "type": "String", + "value": "Standard_A1" + }, + "wlsDomainName": { + "type": "String", + "value": "wlsd" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Network", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "publicIPAddresses" + }, + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "networkInterfaces" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines" + }, + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "7840329080326569798", + "templateLink": null, + "timestamp": "2020-11-06T08:48:57.229200+00:00" + }, + "resourceGroup": "haiche-cluster-1106", + "type": "Microsoft.Resources/deployments" +} +``` + +## Verify Coherence cluster + +Follow the steps to check if Coherence*Web is enabled. + +* Follow the example parameters to set up Coherence*Web. +* Go to admin console portal. +* Deploy [coherence-sample.war](../resources/coherence-sample.war) to `cluster1`. + Please select `cluster1` in the Targets page. +* Start `coherence-sample`. +* Open the sample with browser, click "add session" to add session infomation. Click "test session" to verify. + +If the Coherence cluster does not set up successfully, the application deployment will fail. + +If the cache server does not work correctly, session can not be saved, as we disabled local storage in application servers. diff --git a/subtemplate-src/dbTemplate.md b/subtemplate-src/dbTemplate.md new file mode 100644 index 000000000..ea0775c1a --- /dev/null +++ b/subtemplate-src/dbTemplate.md @@ -0,0 +1,295 @@ + + +{% include variables.md %} + +# Apply Database ARM Template to {{ site.data.var.wlsFullBrandName }} + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} with an existing Azure database using Azure CLI. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The database ARM template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Database Instance + +To apply configure a database with {{ site.data.var.wlsFullBrandName }}, +you must have an existing database instance to use. This template +supports three popular Azure databases: [Oracle](https://ms.portal.azure.com/#blade/Microsoft_Azure_Marketplace/MarketplaceOffersBlade/selectedMenuItemId/home/searchQuery/oracle%20database), [Azure SQL Server](https://docs.microsoft.com/en-us/azure/azure-sql/), [Azure Database for PostgreSQL](https://docs.microsoft.com/en-us/azure/azure-sql/database/single-database-create-quickstart?WT.mc_id=gallery&tabs=azure-portal) and [MySQL](https://learn.microsoft.com/en-us/azure/mysql/single-server/quickstart-create-mysql-server-database-using-azure-portal). If you do not have an instance, please +create one from the Azure portal. + +{% include sub-template-connect-db-with-msi.md %} + +### Apply multiple databases + +You can deploy different databases using the database ARM template, by changing the ARM parameters file and invoking the template again with Azure CLI. + +To apply multiple databases, you have to remove the previous virtual machine extension. Last ARM parameters file is cached, it will block you from configuring the new database. + +Use the following command to remove virtual machine extension: + +```bash +# remove existing vm extension +az vm extension delete -g ${yourResourceGroup} --vm-name ${adminVMName} --name newuserscript +``` + +## Prepare the Parameters JSON file + +You must construct a parameters JSON file containing the parameters to the database ARM template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. We must specify the information of the existing {{ site.data.var.wlsFullBrandName }} and database instance. This section shows how to obtain the values for the following required properties. + +| Parameter Name | Explanation | +|----------------|-------------| +| `_artifactsLocation`| See below for details. | +| `adminVMName`| At deployment time, if this value was changed from its default value, the value used at deployment time must be used. Otherwise, this parameter should be omitted. | +| `databaseType`| Must be one of `postgresql`, `oracle`, `sqlserver` and `mysql` | +| `dbGlobalTranPro` | Determines the transaction protocol (global transaction processing behavior) for the data source. Must be one of `TwoPhaseCommit`, `LoggingLastResource`, `EmulateTwoPhaseCommit`, `OnePhaseCommit` or `None`. | +| `dbIdentity` | See below for details. You must provide this value if `enablePswlessConnection` is `true`.| +| `dbPassword`| See below for details. You don't need to input this value if `enablePswlessConnection` is `false`.| +| `dbUser` | See below for details. | +| `dsConnectionURL`| See below for details. | +| `enablePswlessConnection` | True to enable passwordless datasource connection. Default value is `false`.| +| `jdbcDataSourceName`| Must be the JNDI name for the JDBC data source. | +| `location` | Must be the same region into which the server was initially deployed. | +| `managedServerPrefix` | Must be the same value provided at deployment time. | +| `numberOfManagedApplicationInstances` | Numbers of managed servers. Must be the same value provided at deployment time. | +| `wlsDomainName` | Must be the same value provided at deployment time. | +| `wlsPassword` | Must be the same value provided at deployment time. | +| `wlsUserName` | Must be the same value provided at deployment time. | + +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateBasePath }} +``` + +### Obtain the JDBC Connection String, Database User, and Database Password + +The parameter `dsConnectionURL` stands for JDBC connection string. The connection string is database specific. + +{% include sub-template-datasource-connection-url.md %} + +{% include sub-template-obtain-msi.md%} + +#### Example Parameters JSON + +Here is a fully filled out parameters file. Note that we keep default value for `adminVMName`, `managedServerPrefix`, `numberOfManagedApplicationInstances` and `wlsDomainName`. + +{{ site.data.var.passwordInFileNote }} + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "_artifactsLocation":{ + "value": "{{ armTemplateBasePath }}" + }, + "location": { + "value": "eastus" + }, + "databaseType": { + "value": "postgresql" + }, + "dsConnectionURL": { + "value": "jdbc:postgresql://ejb060801p.postgres.database.azure.com:5432/postgres?sslmode=require" + }, + "dbPassword": { + "value": "Secret123!" + }, + "dbUser": { + "value": "postgres@ejb060801p" + }, + "jdbcDataSourceName": { + "value": "jdbc/ejb060801p" + }, + "wlsPassword": { + "value": "welcome1" + }, + "wlsUserName": { + "value": "weblogic" + } + } +} +``` + + + +## Invoke the ARM template + +Assume your parameters file is available in the current directory and is named `parameters.json`. This section shows the commands to configure your {{ site.data.var.wlsFullBrandName }} deployment with the specified database. Replace `yourResourceGroup` with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +### First, validate your parameters file + +The `az group deployment validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az group deployment validate --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/dbTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Next, execute the template + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az group deployment create --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/dbTemplate.json +``` + +As with the validate command, if the command returns with an exit status other than `0`, inspect the output and resolve the problem. + +This is an example output of successful deployment. Look for `"provisioningState": "Succeeded"` in your output. + +```json +{ + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-0602/providers/Microsoft.Resources/deployments/db", + "location": null, + "name": "db", + "properties": { + "correlationId": "6fc805b9-1c47-4b32-b9b0-59745a21e559", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-0602/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-admin-0602", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-0602/providers/Microsoft.Resources/deployments/3b35b279-0e94-5264-85f5-0d9d662f8a38", + "resourceGroup": "oraclevm-admin-0602", + "resourceName": "3b35b279-0e94-5264-85f5-0d9d662f8a38", + "resourceType": "Microsoft.Resources/deployments" + } + ], + "duration": "PT17.4377546S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputResources": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-0602/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-admin-0602" + } + ], + "outputs": { + "artifactsLocationPassedIn": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + } + }, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + }, + "_artifactsLocationDbTemplate": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + } + "adminVMName": { + "type": "String", + "value": "adminVM" + }, + "databaseType": { + "type": "String", + "value": "postgresql" + }, + "dbPassword": { + "type": "SecureString" + }, + "dbUser": { + "type": "String", + "value": "weblogic@oraclevm" + }, + "dsConnectionURL": { + "type": "String", + "value": "jdbc:postgresql://oraclevm.postgres.database.azure.com:5432/postgres" + }, + "jdbcDataSourceName": { + "type": "String", + "value": "jdbc/WebLogicCafeDB" + }, + "location": { + "type": "String", + "value": "eastus" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "6381424766408193665", + "templateLink": null, + "timestamp": "2020-06-02T06:05:03.141828+00:00" + }, + "resourceGroup": "oraclevm-admin-0602", + "type": "Microsoft.Resources/deployments" +} +``` + +## Verify Database Connection + +Follow the steps to check if the database has successfully been connected. + +* Visit the {{ site.data.var.wlsFullBrandName }} Admin console. +* In the left navigation pane, expand the **Services** tree node and the **DataSources** child node. +* Select the row for the JDBC database name, for example `jdbc/WebLogicDB`. +* Select the **Monitoring** tab and the **Testing** sub-tab. +* Select `admin` and select **Test Data Source** +* If the database is enabled, you will see a message similar to "Test of jdbc/WebLogicDB on server admin was successful." diff --git a/subtemplate-src/dynamic-cluster-aadNestedTemplate.md b/subtemplate-src/dynamic-cluster-aadNestedTemplate.md new file mode 100644 index 000000000..9dacb7df1 --- /dev/null +++ b/subtemplate-src/dynamic-cluster-aadNestedTemplate.md @@ -0,0 +1,315 @@ + + +{% include variables.md %} + +# Apply Azure Active Directory ARM Template to {{ site.data.var.wlsFullBrandName }} + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} with an existing Azure Active Directory Domain Service (AAD DS) using Azure CLI. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The AAD ARM template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Azure Active Directory LDAP Instance + +To apply AAD to {{ site.data.var.wlsFullBrandName }}, you must have an existing Azure Active Directory LDAP instance to use. If you don't have AAD LADP instance, please follow the steps in the tutorial [Configure secure LDAP for an Azure Active Directory Domain Services managed domain](https://docs.microsoft.com/en-us/azure/active-directory-domain-services/tutorial-configure-ldaps). + +## Prepare the Parameters JSON file + +You must construct a parameters JSON file containing the parameters to the AAD ARM template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. We must specify the information of the existing {{ site.data.var.wlsFullBrandName }} and AAD instance. This section shows how to obtain the values for the following required properties. + +| Parameter Name | Explanation | +|----------------|-------------| +| `_artifactsLocation`| See below for details. | +| `aadsPortNumber` | (optional) The LDAP port number, defaults to 636. | +| `aadsPublicIP` | The IP address of the LDAP server | +| `aadsServerHost` | The hostname of the Active Directory Domain Services server. | +| `adminVMName`| At deployment time, if this value was changed from its default value, the value used at deployment time must be used. Otherwise, this parameter should be omitted. | +| `dynamicClusterSize` | Size of the dynamic cluster. | +| `location` | Must be the same region into which the server was initially deployed. | +| `managedServerPrefix` | Must be the same managed server prefix with that in initial deployed. | +| `wlsDomainName` | The name of the {{ site.data.var.wlsFullBrandName }} domain. | +| `wlsLDAPGroupBaseDN` | The base distinguished name (DN) of the tree in the LDAP directory that contains groups. | +| `wlsLDAPPrincipalPassword` | The credential (usually a password) used to connect to the LDAP server. | +| `wlsLDAPPrincipal` | The Distinguished Name (DN) of the LDAP user that {{ site.data.var.wlsFullBrandName }} should use to connect to the LDAP server. | +| `wlsLDAPProviderName` | (optional) The value used for creating authentication provider name of WebLogic Server. | +| `wlsLDAPSSLCertificate` | Client certificate that will be imported to trust store of SSL. | +| `wlsLDAPSSLCertificate` | See below for details. | +| `wlsLDAPUserBaseDN` | The base distinguished name (DN) of the tree in the LDAP directory that contains users. | +| `wlsPassword` | Must be the same value provided at deployment time. | +| `wlsUserName` | Must be the same value provided at deployment time. | + +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateBasePath }} +``` + +### `wlsLDAPSSLCertificate` + +Use base64 to encode your existing SSL certificate. + +```bash +base64 your-certificate.cer -w 0 >temp.txt +``` + +Use the content as this file as the value of the `wlsLDAPSSLCertificate` parameter. + +### `dynamicClusterSize` + +Size of the dynamic cluster, it should equal to numbers of Virtual Machines that have names starting with `msp`. + +#### Example Parameters JSON + +Here is a fully filled out parameters file. Note that we did not include values for parameters that have a default value. Pay attention to the value of `dynamicClusterSize`. + +{{ site.data.var.passwordInFileNote }} + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "_artifactsLocation": { + "value": "{{ armTemplateBasePath }}" + }, + "aadsPublicIP": { + "value": "1.2.3.4" + }, + "aadsServerHost": { + "value": "ladps.fabrikam.com" + }, + "location": { + "value": "eastus" + }, + "wlsDomainName": { + "value": "wlsd" + }, + "wlsLDAPGroupBaseDN": { + "value": "OU=AADDC Users,DC=fabrikam,DC=com" + }, + "wlsLDAPPrincipal": { + "value": "CN=WLSTest,OU=AADDC Users,DC=fabrikam,DC=com" + }, + "wlsLDAPPrincipalPassword": { + "value": "Secret123!" + }, + "wlsLDAPSSLCertificate": { + "value": "MIIKQQIBAz....EkAgIIAA==" + }, + "wlsLDAPUserBaseDN": { + "value": "OU=AADDC Users,DC=fabrikam,DC=com" + }, + "wlsPassword": { + "value": "welcome1" + }, + "wlsUserName": { + "value": "weblogic" + } + } +} +``` + +## Invoke the ARM template + +Assume your parameters file is available in the current directory and is named `parameters.json`. This section shows the commands to configure your {{ site.data.var.wlsFullBrandName }} deployment with the specified AAD. Replace `yourResourceGroup` with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +### First, validate your parameters file + +The `az group deployment validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az group deployment validate --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/aadNestedTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Next, execute the template + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az group deployment create --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/aadNestedTemplate.json +``` + +As with the validate command, if the command returns with an exit status other than `0`, inspect the output and resolve the problem. + +This is an example output of successful deployment. Look for `"provisioningState": "Succeeded"` in your output. + +```json +{ + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-06082/providers/Microsoft.Resources/deployments/cli", + "location": null, + "name": "cli", + "properties": { + "correlationId": "6d98e1c8-0778-4fa5-a30a-8f10bbbb6818", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-06082/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-admin-06082", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-06082/providers/Microsoft.Resources/deployments/pid-8295df19-fe6b-5745-ad24-51ef66522b24", + "resourceGroup": "oraclevm-admin-06082", + "resourceName": "pid-8295df19-fe6b-5745-ad24-51ef66522b24", + "resourceType": "Microsoft.Resources/deployments" + } + ], + "duration": "PT2M59.6052694S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputResources": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-admin-06082/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-admin-06082" + } + ], + "outputs": { + "artifactsLocationPassedIn": { + "type": "String", + "value": "https://raw.githubusercontent.com/galiacheng/arm-oraclelinux-wls-admin/deploy/src/main/arm/" + } + }, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "https://raw.githubusercontent.com/galiacheng/arm-oraclelinux-wls-admin/deploy/src/main/arm/" + }, + "_artifactsLocationAADTemplate": { + "type": "String", + "value": "https://raw.githubusercontent.com/galiacheng/arm-oraclelinux-wls-admin/deploy/src/main/arm/" + }, + "_artifactsLocationSasToken": { + "type": "SecureString" + }, + "aadsPortNumber": { + "type": "String", + "value": "636" + }, + "aadsPublicIP": { + "type": "String", + "value": "40.76.11.111" + }, + "aadsServerHost": { + "type": "String", + "value": "ladps.wls-security.com" + }, + "adminVMName": { + "type": "String", + "value": "adminVM" + }, + "location": { + "type": "String", + "value": "eastus" + }, + "wlsDomainName": { + "type": "String", + "value": "adminDomain" + }, + "wlsLDAPGroupBaseDN": { + "type": "String", + "value": "OU=AADDC Users,DC=wls-security,DC=com" + }, + "wlsLDAPPrincipal": { + "type": "String", + "value": "CN=WLSTest,OU=AADDC Users,DC=wls-security,DC=com" + }, + "wlsLDAPPrincipalPassword": { + "type": "SecureString" + }, + "wlsLDAPProviderName": { + "type": "String", + "value": "AzureActiveDirectoryProvider" + }, + "wlsLDAPSSLCertificate": { + "type": "String", + "value": "LS0tLS1...LQ0K" + }, + "wlsLDAPUserBaseDN": { + "type": "String", + "value": "OU=AADDC Users,DC=wls-security,DC=com" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "2818584196763146470", + "templateLink": null, + "timestamp": "2020-06-09T07:07:03.444046+00:00" + }, + "resourceGroup": "oraclevm-admin-06082", + "type": "Microsoft.Resources/deployments" +} + +``` + +## Verify AAD Integration + +Follow the steps to check if AAD is enabled. + +* Visit the {{ site.data.var.wlsFullBrandName }} Admin console. +* In the left navigator, expand the tree to select **Security Realms** -> **myrealm** -> **Providers**. +* If the integration was successful, you will find the AAD provider for example `AzureActiveDirectoryProvider`. +* In the left navigator, expand the tree to select **Security Realms** -> **myrealm** -> **Users and Groups**. +* If the integration was successful, you will find users from the AAD provider. diff --git a/subtemplate-src/dynamic-cluster-addnode.md b/subtemplate-src/dynamic-cluster-addnode.md new file mode 100644 index 000000000..c4356ae71 --- /dev/null +++ b/subtemplate-src/dynamic-cluster-addnode.md @@ -0,0 +1,691 @@ + + +{% include variables.md %} + +# Add nodes to {{ site.data.var.wlsFullBrandName }} + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} to add add new managed application nodes using Azure CLI. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Azure Active Directory LDAP Instance + +Refer to [Azure Active Directory(AAD) LDAP Instance](aadNestedTemplate.html#azure-active-directory-ldap-instance). + +### Administering Security for Oracle WebLogic Server & Configuring KeyStores + +Refer to [Configuring Keystores](https://docs.oracle.com/en/middleware/fusion-middleware/weblogic-server/12.2.1.4/secmg/identity_trust.html). + +### Generate Base64 string for a given ssl certificate/keystore file + +Use the following command to generate a Base64 string for a given ssl certificate/keystore file, to be used as input in the parameters JSON file + +
base64 /my/path/your-certificate.cer -w 0 >temp.txt
+ + +## Prepare the Parameters JSON file + +You must construct a parameters JSON file containing the parameters to the add-node ARM template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. You must specify the information of the existing {{ site.data.var.wlsFullBrandName }} and nodes that to be added. This section shows how to obtain the values for the following required properties. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Parameter NameExplanation
_artifactsLocationSee below for details.
aadsSettingsOptional. JSON object type. You can specify this parameters for Azure Active Directory integration. If enable is true, must specify other properties.
enableIf enable is true, must specify all properties of the aadSettings.
publicIPThe public IP address of Azure Active Directory LDAP server.
serverHostThe server host of Azure Active Directory LDAP server.
certificateBase64StringThe based64 string of LADP client certificate that will be imported to trust store of WebLogic Server to enable SSL connection of AD provider.
adminPasswordOrKeyPassword of administration account for the new Virtual Machine that host new nodes.
adminURLThe URL of WebLogic Administration Server, usually made up with Virtual Machine name and port, for example: adminVM:7001.
elkSettingsOptional. JSON object type. You can specify this parameters for Elasticsearch and Kibana(ELK) connection. If enable is true, must specify other properties. See the page WebLogic with Elastic on Azure for further information.
enableIf enable is true, must specify all properties of the elkSettings.
elasticsearchEndpointEndpoint of the Elasticsearch instance.
elasticsearchPasswordPassword for Elasticsearch account.
elasticsearchUserNameUser name for Elasticsearch account.
logIndexMust be the same value output at ELK deployment time.
logsToIntegrateArray with string value. Specify the expeted logs to integrate, you must input at least one log.
numberOfExistingNodesThe number of existing managed application nodes, used to generate new virtual machine name,.
numberOfNewNodesThe number of nodes to add.
storageAccountNameThe name of an existing storage account.
wlsDomainNameMust be the same value provided at deployment time.
wlsUserNameMust be the same value provided at deployment time.
wlsPasswordMust be the same value provided at deployment time.
customSSLSettingsOptional. JSON object type. You can specify this parameters for configuring Custom SSL Settings for WebLogic Administration Server. If enable is true, must specify other properties. See the page Administering Security for Oracle WebLogic Server and Configuring Keystores for further information.
enableIf enable is true, must specify all properties of the customSSLSettings. +  Set to false by default.
customIdentityKeyStoreBase64StringThe based64 string of the custom identity keystore file that will be configured in the WebLogic Administration Server to enable SSL connection.
customIdentityKeyStorePassPhraseThe identity keystore pass phrase
customIdentityKeyStoreTypeIdentity Key Store Type. This can be either JKS or PKCS12
customTrustKeyStoreBase64StringThe based64 string of the custom trust keystore file that will be configured in the WebLogic Administration Server to enable SSL connection.
customTrustKeyStorePassPhraseThe trust keystore pass phrase
customTrustKeyStoreTypeTrust Key Store Type. This can be either JKS or PKCS12
privateKeyAliasThe private key alias
privateKeyPassPhraseThe private Key Pass phrase.
+ +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateAddNodeBasePath }} +``` + +### Existing managed application servers +To differentiate functionality of managed servers, we use **managed application server** to represent managed servers that host Java EE application, and use **managed cache server** to represent managed servers that used for cache. + +You can get the existing managed application nodes with the following command: + +```shell +$ resourceGroup= +$ managedServerPrefix= +$ numberOfExistingNodes=$(az resource list -g ${resourceGroup} --resource-type Microsoft.Compute/virtualMachines --query [*].name | grep "${managedServerPrefix}VM[0-9]" | sed -e 's/[^0-9]/ /g' -e 's/^ *//g' -e 's/ *$//g' | tr -s ' ' | sed 's/ /\n/g' | sort -nr | head -n1) +$ echo ${numberOfExistingNodes} +``` + +### Log index + +If you configured ELK in your cluster to export WebLogic Server logs to ELK, please input the value of Kibana log index, this template will set up ELK connection and export logs to specified index. + +You can get the value from Azure portal with the following steps: + +* Go to Azure portal. +* Open you resource group and click **Deployments**. +* Open the ELK deployment, and click **Output**. +* Copy the value of `logIndex`. + +Alternatively, use Azure CLI command to list log index inside the resource group deployments: + +```shell +$ az deployment group list -g 'yourResourceGroup' --query [*].properties.outputs.logIndex.value +[ + "azure-weblogic-cluster-f984df74-ab4d-4c17-a532-7f248659fb28" +] +``` + +### Storage account + +Each Storage Account handles up to 20,000 IOPS, and 500TB of data. If you use a storage account for Standard Virtual Machines, you can store until 40 virtual disks. + +We have two disks for one Virtual Machine, it's suggested no more than 20 Virtual Machines share the same storage account. Number of virtual machines that hosting managed servers should be less than or equal to 20. + +You can get the name of storage account from Azure portal with steps: + + * Go to Azure portal + * Go to the your resource group + * Find storage account resource and copy its name + +Alternatively, use Azure CLI command to list storage account inside a resource group: + +```shell +$ az resource list -g 'yourResourceGroup' --resource-type Microsoft.Storage/storageAccounts --query [*].name +[ + "219846olvm" +] +``` + +#### Example Parameters JSON + +Here is a fully filled out parameters file, with Azure Active Directory enabled. We will leave values of `adminUsername`, `authenticationType`, `dnsLabelPrefix`, `managedServerPrefix`, `skuUrnVersion`, `usePreviewImage` and `vmSize` as default value. + +{{ site.data.var.passwordInFileNote }} + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "_artifactsLocation": { + "value": "{{ armTemplateAddNodeBasePath }}" + }, + "aadsSettings": { + "value": { + "enable": true, + "publicIP":"13.68.244.90", + "serverHost": "ladps.wls-security.com", + "certificateBase64String":"LS0tLS1C...tLS0tLQ0K" + } + }, + "adminPasswordOrKey": { + "value": "Secret123!" + }, + "adminURL":{ + "value": "adminVM:7001" + }, + "elkSettings": { + "value": { + "enable": true, + "elasticsearchEndpoint":"https://example.eastus2.azure.elastic-cloud.com:9243", + "elasticsearchPassword": "Secret123!", + "elasticsearchUserName":"elastic", + "logIndex": "azure-weblogic-dynamic-cluster-11122020", + "logsToIntegrate": ["HTTPAccessLog", "ServerLog", "DomainLog", "DataSourceLog", "StandardErrorAndOutput", "NodeManagerLog"] + } + }, + "location": { + "value": "eastus" + }, + "numberOfExistingNodes": { + "value": 4 + }, + "numberOfNewNodes": { + "value": 3 + }, + "storageAccountName": { + "value": "496dfdolvm" + }, + "wlsDomainName": { + "value": "wlsd" + }, + "wlsUserName": { + "value": "weblogic" + }, + "wlsPassword": { + "value": "welcome1" + }, + "customSSLSettings": { + "value": { + "enable": true, + "customIdentityKeyStoreBase64String": "/u3+7QAAAAIAAAABAAAAAQAKc2VydmV....QZL24ljJLq", + "customIdentityKeyStorePassPhrase": "mypassword", + "customIdentityKeyStoreType": "JKS", + "customTrustKeyStoreBase64String": "/u3+7QAAAAIAAAABAAAAAgAJdHJ1c3R....Td4bYVnONyS0PC7k=", + "customTrustKeyStorePassPhrase": "mypassword", + "customTrustKeyStoreType": "JKS", + "privateKeyAliasSecret": "servercert", + "privateKeyPassPhraseSecret": "mypassword" + } + } + } +} +``` + +## Invoke the ARM template + +Assume your parameters file is available in the current directory and is named `parameters.json`. This section shows the commands to configure your {{ site.data.var.wlsFullBrandName }} deployment to add new nodes. Replace `yourResourceGroup` with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +### First, validate your parameters file + +The `az group deployment validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az group deployment validate --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateAddNodeBasePath }}arm/mainTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Next, execute the template + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az group deployment create --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateAddNodeBasePath }}arm/mainTemplate.json +``` + +As with the validate command, if the command returns with an exit status other than `0`, inspect the output and resolve the problem. + +This is an example output of successful deployment. Look for `"provisioningState": "Succeeded"` in your output. + +```bash +{ + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Resources/deployments/mainTemplate", + "location": null, + "name": "mainTemplate", + "properties": { + "correlationId": "54517529-a1c4-422f-a539-23b9a5129e80", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Compute/virtualMachines/mspVM7/extensions/newuserscript", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "mspVM7/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Resources/deployments/pid-c7671c10-ae59-5ec5-bff3-c60db22d7ea4", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "pid-c7671c10-ae59-5ec5-bff3-c60db22d7ea4", + "resourceType": "Microsoft.Resources/deployments" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Network/publicIPAddresses/mspVM7_PublicIP", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "mspVM7_PublicIP", + "resourceType": "Microsoft.Network/publicIPAddresses" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Network/networkInterfaces/mspVM7_NIC", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "mspVM7_NIC", + "resourceType": "Microsoft.Network/networkInterfaces" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Network/networkInterfaces/mspVM7_NIC", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "mspVM7_NIC", + "resourceType": "Microsoft.Network/networkInterfaces" + }, + { + "apiVersion": "2019-06-01", + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Storage/storageAccounts/09b943olvm", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "09b943olvm", + "resourceType": "Microsoft.Storage/storageAccounts" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Compute/virtualMachines/mspVM7", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "mspVM7", + "resourceType": "Microsoft.Compute/virtualMachines" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Compute/virtualMachines/mspVM7", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "mspVM7", + "resourceType": "Microsoft.Compute/virtualMachines" + }, + { + "actionName": "listKeys", + "apiVersion": "2019-04-01", + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Storage/storageAccounts/09b943olvm", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "09b943olvm", + "resourceType": "Microsoft.Storage/storageAccounts" + } + ], + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Compute/virtualMachines/mspVM7/extensions/newuserscript", + "resourceGroup": "oraclevm-dcluster-0727", + "resourceName": "mspVM7/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "duration": "PT9M6.8098765S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputResources": [ + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Compute/virtualMachines/mspVM7", + "resourceGroup": "oraclevm-dcluster-0727" + }, + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Compute/virtualMachines/mspVM7/extensions/newuserscript", + "resourceGroup": "oraclevm-dcluster-0727" + }, + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Network/networkInterfaces/mspVM7_NIC", + "resourceGroup": "oraclevm-dcluster-0727" + }, + { + "id": "/subscriptions/05887623-95c5-4e50-a71c-6e1c738794e2/resourceGroups/oraclevm-dcluster-0727/providers/Microsoft.Network/publicIPAddresses/mspVM7_PublicIP", + "resourceGroup": "oraclevm-dcluster-0727" + } + ], + "outputs": { + "wlsDomainLocation": { + "type": "String", + "value": "/u01/domains/wlsd" + } + }, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "{{ armTemplateAddNodeBasePath }}" + }, + "_artifactsLocationSasToken": { + "type": "SecureString" + }, + "aadsSettings": { + "type": "Object", + "value": { + "certificateBase64String": "LS0tLS1C...S0tLQ0K", + "enable": true, + "publicIP": "40.76.11.111", + "serverHost": "ladps.wls-security.com" + } + }, + "adminPasswordOrKey": { + "type": "SecureString" + }, + "adminURL": { + "type": "String", + "value": "adminVM:7001" + }, + "adminUsername": { + "type": "String", + "value": "weblogic" + }, + "authenticationType": { + "type": "String", + "value": "password" + }, + "dnsLabelPrefix": { + "type": "String", + "value": "wls" + }, + "guidValue": { + "type": "String", + "value": "67657ba3-6248-46e5-bedc-53e16ac82571" + }, + "location": { + "type": "String", + "value": "eastus" + }, + "managedServerPrefix": { + "type": "String", + "value": "msp" + }, + "numberOfExistingNodes": { + "type": "Int", + "value": 7 + }, + "numberOfNewNodes": { + "type": "Int", + "value": 1 + }, + "skuUrnVersion": { + "type": "String", + "value": "owls-122130-8u131-ol74;Oracle:weblogic-122130-jdk8u131-ol74:owls-122130-8u131-ol7;1.1.1" + }, + "storageAccountName": { + "type": "String", + "value": "09b943olvm" + }, + "usePreviewImage": { + "type": "Bool", + "value": false + }, + "vmSize": { + "type": "String", + "value": "Standard_A3" + }, + "wlsDomainName": { + "type": "String", + "value": "wlsd" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + }, + "customSSLSettings": { + "type": "Object", + "value": { + "enable": true, + "customIdentityKeyStoreBase64String": "/u3+7QAAAAIAAAABAAAAAQAKc2VydmV....QZL24ljJLq", + "customIdentityKeyStorePassPhrase": "mypassword", + "customIdentityKeyStoreType": "JKS", + "customTrustKeyStoreBase64String": "/u3+7QAAAAIAAAABAAAAAgAJdHJ1c3R....Td4bYVnONyS0PC7k=", + "customTrustKeyStorePassPhrase": "mypassword", + "customTrustKeyStoreType": "JKS", + "privateKeyAliasSecret": "servercert", + "privateKeyPassPhraseSecret": "mypassword" + } + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Network", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "publicIPAddresses" + }, + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "networkInterfaces" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines" + }, + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "15879952829017360289", + "templateLink": { + "contentVersion": "1.0.0.0", + "uri": "{{ armTemplateAddNodeBasePath }}arm/mainTemplate.json" + }, + "timestamp": "2020-07-27T12:37:03.733682+00:00" + }, + "resourceGroup": "oraclevm-dcluster-0727", + "type": "Microsoft.Resources/deployments" +} +``` + +## Verify + +### Verify if new nodes are added to the WebLogic Server instance. + +* Go to the {{ site.data.var.wlsFullBrandName }} Administration Console. +* Go to **Environment -> Machines**. + You should see logical machines with suffix from `numberOfExistingNodes` to `numberOfExistingNodes + numberOfNewNodes` are added. + Make note of the total number of machines. + +* Scale up to check if the machines work + * Go to **Environment** -> **Cluster** -> `cluster1` -> **Control** -> **Scaling**. + + Input value to **Desired Number of Running Servers** with the total number of machines, saved in last step. + * Save and activate. + * Go to **Environment** -> **Servers**. + + Expected result: the running managed server number is the same as machine total number. And there are servers running on the new managed nodes. + +### Verify if Azure resources are added + +* Go to [Azure Portal](https://ms.portal.azure.com/). +* Go to resource group that the {{ site.data.var.wlsFullBrandName }} is deployed. + + You should see corresponding Vitual Machines, Disks, Network Interfaces, Public IPs have been added. + +### Verify AAD Integration + +Verify AAD integration by delpoying a simple Java EE applciation with basic authentication. + +* Go to Administration Server Console and deploy [testing application](../resources/basicauth.war). + * Select **Deployments**. + * Select **Install**. + * Select file `basicauth.war`. + * Select **Next**. Choose "Install this deployment as an application". + * Select **Next**. Select "cluster-1" and "All servers in the cluster". + * Keep configuration as default and select **Finish**. + * Select **Activate Changes** + * In the left navigation pane, select **Deployments**. + * Select **Control** + * Select `basicauth` + * Select **Start** + * Select **Servicing all requests** + +* Access the sample application + * Go to Administration Server Console + * Go to **Environment -> Machines**. Click one of the new machines, make sure there are servers running on that machine. Click **Node Manager** and make note of the machine host in **Listen Address**, here named it as `machineName`. Click **Servers** and make note of **Listen Port**, here named it as `port`. + * Go to [Azure Portal](https://ms.portal.azure.com/), and get DNS name from Virtual Machine has the same name of `machineName`, named it `machineDNS` + * Go to `http://${machineDNS}:${port}/basicauth`, the browser will prompt up to ask for credentials, input one of AAD users from group **AAD DC Administrators**, note that use name should be **sAMAccountName**, for example `wlstest` for user `wlstest@javaeehotmailcom.onmicrosoft.com`. + * Expected result, you can access the sample application without error. diff --git a/subtemplate-src/dynamic-cluster-customDNSTemplate.md b/subtemplate-src/dynamic-cluster-customDNSTemplate.md new file mode 100644 index 000000000..a4ee6364d --- /dev/null +++ b/subtemplate-src/dynamic-cluster-customDNSTemplate.md @@ -0,0 +1,172 @@ + + +{% include variables.md %} + +# Configure DNS alias to {{ site.data.var.wlsFullBrandName }} + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} with a custom DNS alias. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The DNS Configuration ARM template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Registered Domain Name + +You need to buy a domain name to create a custom DNS alias. + +### Azure DNS Zone + +If you create the DNS alias on an existing [Azure DNS Zone](https://docs.microsoft.com/en-us/azure/dns/dns-overview), make sure you have performed the [Azure DNS Delegation](https://docs.microsoft.com/en-us/azure/dns/dns-domain-delegation). After you have completed the delegation, you can verify it with `nslookup`. For example, assuming your domain name is **contoso.com**, this output shows a correct delegation. + +```bash +$ nslookup -type=SOA contoso.com +Server: 172.29.80.1 +Address: 172.29.80.1#53 + +Non-authoritative answer: +contoso.com + origin = ns1-01.azure-dns.com + mail addr = azuredns-hostmaster.microsoft.com + serial = 1 + refresh = 3600 + retry = 300 + expire = 2419200 + minimum = 300 +Name: ns1-01.azure-dns.com +Address: 40.90.4.1 +Name: ns1-01.azure-dns.com +Address: 2603:1061::1 +``` + +We strongly recommand you create an Azure DNS Zone for domain management and reuse it for other perpose. Follow the [guide](https://docs.microsoft.com/en-us/azure/dns/dns-getstarted-portal) to create an Azure DNS Zone. + + +## Prepare the Parameters + +We provide an automation shell script for DNS configuration. You must specify the information of the existing Oracle WebLogic Server. This section shows how to obtain the values for the following required properties. + +| Parameter Name             | Explanation | +|----------------|-------------| +| `--admin-vm-name`| Required. Name of vitual machine that hosts {{ site.data.var.wlsFullBrandName }} admin server. Must be the same value provided at initial deployment time.| +| `--admin-console-label` | Required. Label for {{ site.data.var.wlsFullBrandName }} admin console. Used to generate subdomain of admin console. | +| `--artifact-location`| Required. See below for details. | +| `--resource-group` | Required. Name of resource group that has an {{ site.data.var.wlsFullBrandName }} cluster deployed. | +| `--location` | Required. Must be the same region into which the server was initially deployed. | +| `--zone-name` | Required. Azure DNS Zone name. | +| `--ohs-vm-name` | Optional. Specify name of the VM that hosts the Oracle HTTP Server Load Balancer. | +| `--loadbalancer-label` | Optional. Label for Load Balancer. Used to generate subdomain of application gateway. The parameter is only required if you want to create DNS alias for application gateway.| +| `--zone-resource-group` | Optional. Name of resource group that has Azure DNS Zone deployed. The parameter is only required if you are creating DNS alias on an existing DNS Zone. | +| `--help` | Help. | + +### Artifacts location + +This value must be the following. + +```bash +{{ armTemplateBasePath }} +``` + +## Invoke the Automation Script + +We provide an automation script to configure a custom DNS alias. The script lets you do the following: + + * If you have an Azure DNS Zone, it will create a DNS alias for the admin console and application gateway on the existing DNS Zone. + * If you don't have an Azure DNS Zone, it will create the DNS Zone in the same resource group as the {{ site.data.var.wlsFullBrandName }} cluster, then create the DNS alias for the admin console and application gateway. + +### Configure DNS Alias on an Existing Azure DNS Zone + +To configure a DNS alias on an existing Azure DNS Zone, in addition to the required parameters, you must also specify an Azure user-assigned managed identity ID and the resource group name in which your DNS Zone is deployed. + +This is an example to create a DNS alias `admin.contoso.com` for the admin console and `applciations.contoso.com` for the application gateway on an existing Azure DNS Zone. + +```bash +$ curl -fsSL {{ site.data.var.artifactsLocationBase }}/{{ site.data.var.artifactsLocationTag }}/{{site.data.var.artifactsLocationSubPathForVM}}{{ pageDir }}/cli-scripts/custom-dns-alias-cli.sh \ + | /bin/bash -s -- \ + --resource-group `yourResourceGroup` \ + --admin-vm-name adminVM \ + --admin-console-label admin \ + --artifact-location {{ armTemplateBasePath }} \ + --location eastus \ + --zone-name contoso.com \ + --ohs-vm-name ohsVM \ + --loadbalancer-label applications \ + --zone-resource-group `yourDNSZoneResourceGroup` +``` + +An example output: + +```text +Done! + +Custom DNS alias: + Resource group: haiche-dns-doc + WebLogic Server Administration Console URL: http://admin.contoso.com:7001/console + WebLogic Server Administration Console secured URL: https://admin.contoso.com:7002/console + + + Application Gateway URL: http://applications.contoso.com:7777 + Application Gateway secured URL: https://applications.contoso.com:4444 +``` + + +### Configure DNS Alias on a New Azure DNS Zone + +To configure a DNS alias on a new Azure DNS Zone, you must specify the required parameters. + +This is an example of creating an Azure DNS Zone, then creating a DNS alias `admin.contoso.com` for the admin console and `applications.contoso.com` for application gateway. + +```bash +$ curl -fsSL {{ site.data.var.artifactsLocationBase }}/{{ site.data.var.artifactsLocationTag }}/{{site.data.var.artifactsLocationSubPathForVM}}{{ pageDir }}/cli-scripts/custom-dns-alias-cli.sh \ + | /bin/bash -s -- \ + --resource-group `yourResourceGroup` \ + --admin-vm-name adminVM \ + --admin-console-label admin \ + --artifact-location {{ armTemplateBasePath }} \ + --location eastus \ + --zone-name contoso.com \ + --ohs-vm-name ohsVM \ + --loadbalancer-label applications +``` + +An example output: + +```text +DONE! + + +Action required: + Complete Azure DNS delegation to make the alias accessible. + Reference: https://aka.ms/dns-domain-delegation + Name servers: + [ + "ns1-02.azure-dns.com.", + "ns2-02.azure-dns.net.", + "ns3-02.azure-dns.org.", + "ns4-02.azure-dns.info." + ] + +Custom DNS alias: + Resource group: haiche-dns-doc + WebLogic Server Administration Console URL: http://admin.contoso.com:7001/console + WebLogic Server Administration Console secured URL: https://admin.contoso.com:7002/console + + + Application Gateway URL: http://applications.contoso.com:7777 + Application Gateway secured URL: https://applications.contoso.com:4444 +``` + +**Note:** The DNS aliases are not accessible now, you must perform Azure DNS delegation after the deployment. Follow [Delegation of DNS zones with Azure DNS](https://aka.ms/dns-domain-delegation) to complete the Azure DNS delegation. + + +## Verify the Custom Alias + +Access the URL from output to verify if the custom alias works. diff --git a/subtemplate-src/dynamic-cluster-deletenode.md b/subtemplate-src/dynamic-cluster-deletenode.md new file mode 100644 index 000000000..1fc614491 --- /dev/null +++ b/subtemplate-src/dynamic-cluster-deletenode.md @@ -0,0 +1,489 @@ + + +{% include variables.md %} + +# Delete nodes from {{ site.data.var.wlsFullBrandName }} + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} to delete nodes using Azure CLI. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +## Prepare the Parameters JSON file + +You must construct a parameters JSON file containing the parameters that to the delete-node ARM template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. You must specify the information of the existing {{ site.data.var.wlsFullBrandName }} and nodes that to be deleted. This section shows how to obtain the values for the following required properties. + +| Parameter Name | Explanation | +|----------------|-------------| +| `_artifactsLocation`| See below for details. | +| `adminVMName`| At deployment time, if this value was changed from its default value, the value used at deployment time must be used. Otherwise, this parameter should be omitted. | +| `deletingCacheServerNames`| (Optional) Names of cache servers to be deleted, comma delimited. Please ignore this parameter if you are not deleting cache servers. | +| `deletingManagedServerMachineNames`| The resource names of Azure Virtual Machine hosting managed nodes that you want to delete. | +| `wlsPassword` | Must be the same value provided at deployment time. | +| `wlsUserName` | Must be the same value provided at deployment time. | + +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateDeleteNodeBasePath }} +``` + +### Server names + +This value must be an array of strings, with pattern `^${managedServerPrefix}Storage[0-9]+$`, for example: `["mspStorage1", "mspStorage2"]`. + +You can get the server names from WebLogic Server Administration Console, following the steps: + +* Go to WebLogic Server Administration Console, http://admin-host:7001/console. + +* Go to **Environment** -> **Servers**. + + Server names are listed in the first column. + + If you want to remove coresponding virtual machine, please go to [Machine names](#machine-names) to obtain machine names. + +### Machine names + +This value must be an array of strings, for example: `["mspVM1", "mspVM2", "mspStorageVM2"]`. + +You can get the machine names from WebLogic Server Administration Console, following the steps: + +* Go to WebLogic Server Administration Console, http://admin-host:7001/console. + +* Go to **Environment** -> **Machines**. + + Open the machine you want to delete. + + Click **Configuration** -> **Node Manager**, you will get compute name from **Listen Address**. + + The Azure Virtual Machine name was set with the same value of compute name during {{ site.data.var.wlsFullBrandName }} deployment. + +#### Example Parameters JSON + +Here is a fully filled out parameters file. Note that we do not include `adminVMName`. + +{{ site.data.var.passwordInFileNote }} + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "_artifactsLocation": { + "value": "{{ armTemplateDeleteNodeBasePath }}" + }, + "deletingCacheServerNames": { + "value": [ + "mspStorage2" + ] + }, + "deletingManagedServerMachineNames": { + "value": [ + "mspVM4", + "mspStorageVM2" + ] + }, + "wlsPassword": { + "value": "welcome1" + }, + "wlsUserName": { + "value": "weblogic" + } + } +} +``` + +## Invoke the delete-node script + +To delete managed nodes completely, you have to delete managed nodes logically from the WebLogic Server instance, and physically release Azure resources that host the managed nodes. We realize the two purposes in different ways: + * Delete machines logically from WebLogic Server instance by deploying delete-node ARM template with Azure CLI. You have to specify the parameters file. + The cluster will restart after deleting the machines, and manages servers may be reallocated to another existing machine. + * Release corresponding Azure resources by running Azure CLI commands. The following resources will be removed: + * Virtual Machines that host managed nodes that will be deleted. + * Data disks attached to the Virtual Machines + * OS disks attached to the Virtual Machines + * Network Interfaces added to the Virtual Machines + * Public IPs attached to the Virtual Machines + +We have provided an automation script for above two purposes, you can delete managed nodes easily with the following instructions. + +### Invoke the script + +Assume your parameters file is available in the current directory and is named `parameters.json`. Replace `yourResourceGroup` with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +The following command runs the script in silent mode with option `-s`, this mode will delete managed nodes logically and physically. + +If you want to keep Azure resources, refer to [advanced usage](#advanced-usage) for further information. + +```bash +$ curl -fsSL {{ armTemplateDeleteNodeBasePath }}scripts/deletenode-cli.sh | /bin/bash -s -- -s -g `yourResourceGroup` -u {{ armTemplateDeleteNodeBasePath }}arm/mainTemplate.json -p parameters.json +``` + +The script will validate the template with your parameters file; deploy the template to delete managed servers from WebLogic Server cluster; run Azure CLI commands to delete corresponding Azure resources. + +This is an example output of successful deployment, the {{ site.data.var.wlsFullBrandName }} is deployed with Application Gateway. Look for `Completed!` in your output. + +```bash +{ + "error": null, + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/oraclevm-dcluster-07222/providers/Microsoft.Resources/deployments/mainTemplate", + "name": "mainTemplate", + "properties": { + "correlationId": "be24f5de-1fdf-4fc6-be97-ac53af3ccd3c", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/oraclevm-dcluster-07222/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-dcluster-07222", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/oraclevm-dcluster-07222/providers/Microsoft.Resources/deployments/pid-db9aa5e4-1e77-5f54-af38-9a7515cd27ab", + "resourceGroup": "oraclevm-dcluster-07222", + "resourceName": "pid-db9aa5e4-1e77-5f54-af38-9a7515cd27ab", + "resourceType": "Microsoft.Resources/deployments" + } + ], + "duration": "PT0S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputs": null, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "{{ armTemplateDeleteNodeBasePath }}" + }, + "_artifactsLocationSasToken": { + "type": "SecureString" + }, + "adminVMName": { + "type": "String", + "value": "adminVM" + }, + "deletingManagedServerMachineNames": { + "type": "Array", + "value": [ + "mspVM1" + ] + }, + "location": { + "type": "String", + "value": "eastus" + }, + "wlsForceShutDown": { + "type": "String", + "value": "true" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "17905048512558945100", + "templateLink": { + "contentVersion": "1.0.0.0", + "uri": "{{ armTemplateDeleteNodeBasePath }}arm/mainTemplate.json" + }, + "timestamp": "2020-07-23T08:36:10.953240+00:00", + "validatedResources": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/oraclevm-dcluster-07222/providers/Microsoft.Resources/deployments/pid-a816a607-eb8a-5aa1-9475-c3fba6994679", + "resourceGroup": "oraclevm-dcluster-07222" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/oraclevm-dcluster-07222/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-dcluster-07222" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/oraclevm-dcluster-07222/providers/Microsoft.Resources/deployments/pid-db9aa5e4-1e77-5f54-af38-9a7515cd27ab", + "resourceGroup": "oraclevm-dcluster-07222" + } + ] + }, + "resourceGroup": "oraclevm-dcluster-07222", + "type": "Microsoft.Resources/deployments" +} +Command ran in 46.180 seconds (init: 0.064, invoke: 46.116) +Extension 'resource-graph' is already installed. +List resource Ids to be deleted: +/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/oraclevm-dcluster-07222/providers/Microsoft.Compute/virtualMachines/mspVM1 +/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/oraclevm-dcluster-07222/providers/Microsoft.Network/networkInterfaces/mspVM1NIC +/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/oraclevm-dcluster-07222/providers/Microsoft.Network/publicIPAddresses/mspVM1PublicIP +/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/ORACLEVM-DCLUSTER-07222/providers/Microsoft.Compute/disks/mspVM1_OsDisk_1_e490d8e72ef14081aea596eab709efef +/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/ORACLEVM-DCLUSTER-07222/providers/Microsoft.Compute/disks/mspVM1_lun_0_2_bb9f86a391c34e2d8dbe3b1b408d4952 +Are you sure to delete these resources (y/n)?Deleting managed resources...Please do not stop. +Deleting managed resources...Please do not stop. +[ + null, + null, + null, + null, + null +] +Command ran in 99.764 seconds (init: 0.068, invoke: 99.696) + +Complete! +``` + +### Advanced usage + +If you want to learn more about the script and run it manually, follow the advanced instructions to interact with the ternimal. + + * Download the script + + ```bash + $ curl -fsSL {{ armTemplateDeleteNodeBasePath }}scripts/deletenode-cli.sh + ``` + + You will get a shell script named `deletenode-cli.sh` in your current directory. Usage of the script: + + ```bash + ./deletenode-cli.sh -h + usage: deletenode-cli.sh -g resource-group [-f template-file] [-u template-url] -p paramter-file [-h] + -g Azure Resource Group of the Vitural Machines that host deleting manages servers, must be specified. + -f Path of ARM template to delete nodes, must be specified -f option or -u option. + -u URL of ARM template, must be specified -f option or -u option. + -p Path of ARM parameter, must be specified. + -s Execute the script in silent mode. The script will input y automatically for the prompt. + -h Help + ``` + + You can not only run the script with a local template file by specifying `-f` option, but also with a templatle URL using `-u` option. + + * Run the script + + Run the script with your parameters file in your current directory. The following command runs with a template URL: + + ```bash + ./deletenode-cli.sh -g yourResourceGroup -u {{ armTemplateDeleteNodeBasePath }}arm/mainTemplate.json -p parameters.json + ``` + + Before deleting any Azure resource, the script will prompt up message **Are you sure to delete these resources (y/n)?** to comfirm if you want to delete Azure resources. If you input `Y/y`, the Azure resources will be deleted. Otherwise, keep the resource and exit. + + This is an example output of deployment that will not delete Azure resources from your resource group, the {{ site.data.var.wlsFullBrandName }} is deployed with Application Gateway. Look for `Completed!` in your output. + + ```bash + { + "error": null, + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/oraclevm-dcluster-07222/providers/Microsoft.Resources/deployments/mainTemplate", + "name": "mainTemplate", + "properties": { + "correlationId": "be24f5de-1fdf-4fc6-be97-ac53af3ccd3c", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/oraclevm-dcluster-07222/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-dcluster-07222", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/oraclevm-dcluster-07222/providers/Microsoft.Resources/deployments/pid-db9aa5e4-1e77-5f54-af38-9a7515cd27ab", + "resourceGroup": "oraclevm-dcluster-07222", + "resourceName": "pid-db9aa5e4-1e77-5f54-af38-9a7515cd27ab", + "resourceType": "Microsoft.Resources/deployments" + } + ], + "duration": "PT0S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputs": null, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "{{ armTemplateDeleteNodeBasePath }}" + }, + "_artifactsLocationSasToken": { + "type": "SecureString" + }, + "adminVMName": { + "type": "String", + "value": "adminVM" + }, + "deletingManagedServerMachineNames": { + "type": "Array", + "value": [ + "mspVM1" + ] + }, + "location": { + "type": "String", + "value": "eastus" + }, + "wlsForceShutDown": { + "type": "String", + "value": "true" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "17905048512558945100", + "templateLink": { + "contentVersion": "1.0.0.0", + "uri": "{{ armTemplateDeleteNodeBasePath }}arm/mainTemplate.json" + }, + "timestamp": "2020-07-23T08:36:10.953240+00:00", + "validatedResources": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/oraclevm-dcluster-07222/providers/Microsoft.Resources/deployments/pid-a816a607-eb8a-5aa1-9475-c3fba6994679", + "resourceGroup": "oraclevm-dcluster-07222" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/oraclevm-dcluster-07222/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "oraclevm-dcluster-07222" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/oraclevm-dcluster-07222/providers/Microsoft.Resources/deployments/pid-db9aa5e4-1e77-5f54-af38-9a7515cd27ab", + "resourceGroup": "oraclevm-dcluster-07222" + } + ] + }, + "resourceGroup": "oraclevm-dcluster-07222", + "type": "Microsoft.Resources/deployments" +} +Command ran in 46.180 seconds (init: 0.064, invoke: 46.116) +Extension 'resource-graph' is already installed. +List resource Ids to be deleted: +/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/oraclevm-dcluster-07222/providers/Microsoft.Compute/virtualMachines/mspVM1 +/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/oraclevm-dcluster-07222/providers/Microsoft.Network/networkInterfaces/mspVM1NIC +/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/oraclevm-dcluster-07222/providers/Microsoft.Network/publicIPAddresses/mspVM1PublicIP +/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/ORACLEVM-DCLUSTER-07222/providers/Microsoft.Compute/disks/mspVM1_OsDisk_1_e490d8e72ef14081aea596eab709efef +/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/ORACLEVM-DCLUSTER-07222/providers/Microsoft.Compute/disks/mspVM1_lun_0_2_bb9f86a391c34e2d8dbe3b1b408d4952 +Are you sure to delete these resources (y/n)?n + +Complete! + ``` + +## Verify + +### Verify if the managed servers are deleted from WebLogic Server instance. + +* Go to the {{ site.data.var.wlsFullBrandName }} Administration Console. +* Go to **Environment** -> **Machines**. + + You should see the logical machine names (e.g. `machine-mspVM1`) that have been deleted is not listed in **Name** column. + +### Verify if the Azure resources are deleted + +* Go to Azure Portal, https://ms.portal.azure.com/. +* Go to resource group that the {{ site.data.var.wlsFullBrandName }} is deployed. + + You should see corresponding Vitual Machines, Disks, Network Interfaces, Public IPs have been removed. + + For example, I want to delete managed server `msp1`, corresponding Virtual Machine name is `mspVM1`, Azure resource names are: + * Virtual Machine: `mspVM1` + * Data Disk: `mspVM1_lun_0_2_9d41e2c965744665adb6965625c20d9a` + * OS Disk: `mspVM1_OsDisk_1_05a8d81f5d01419a97ee17a45f974dca` + * Network Interface: `mspVM1_NIC` + * Public IP: `mspVM1_PublicIP` + + All of these resource should be deleted after the script finishes, unless you don't expect to delete them without specifying "Y/y" to the prompt. + + diff --git a/subtemplate-src/dynamic-cluster-elkNestedTemplate.md b/subtemplate-src/dynamic-cluster-elkNestedTemplate.md new file mode 100644 index 000000000..f3b1f2ff9 --- /dev/null +++ b/subtemplate-src/dynamic-cluster-elkNestedTemplate.md @@ -0,0 +1,413 @@ + + +{% include variables.md %} + +# Land {{ site.data.var.wlsFullBrandName }} logs to Elasticsearch and Kibana + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} to land logs to Elasticsearch and Kibana using Azure CLI. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The ELK ARM template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Virtual machine size requirement +Ensure the virtual machines that have been deployed have at least **2.5GB** of memory. The default virtual machine size for WLS does not have enough memory. Use at least `Standard_A2_v2`. + +### Elasticsearch instance + +Refer to [Create an an Elastic on Azure instance](https://aka.ms/arm-oraclelinux-wls-elk#create-an-an-elastic-on-azure-instance) + +## Prepare the Parameters JSON file + +You must construct a parameters JSON file containing the parameters to the ELK ARM template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. + +We must specify the information of the existing {{ site.data.var.wlsFullBrandName }} and Elasticsearch instance. This section shows how to obtain the values for the following required properties. + +| Parameter Name | Explanation | +|----------------|-------------| +| `_artifactsLocation`| See below for details. | +| `adminVMName`| Virtual machine name of which hosts the {{ site.data.var.wlsFullBrandName }} admin server. | +| `elasticsearchEndpoint` | The Elasticsearch endpoint. | +| `elasticsearchPassword` | Password for the Elasticsearch account. | +| `elasticsearchUserName` | User name for the Elasticsearch account. | +| `location` | Must be the same region into which the server was initially deployed. | +| `logsToIntegrate` | Specify the WebLogic logs to export to Elasticsearch, you must select at least one log. | +| `managedServerPrefix` | Must be the same prefix with which the cluster was initially deployed. | +| `maxDynamicClusterSize` | Must be the same value with which the cluster was initially deployed. | +| `numberOfManagedApplicationInstances` | Number of VMs that have been deployed to host managed application server. | +| `numberOfManagedCacheInstances` | Number of VMs that have been deployed to host managed cache server, please set the value if your cluster is Coherence cluster. | +| `wlsDomainName` | Must be the same value provided at initial deployment time. | +| `wlsPassword` | Must be the same value provided at initial deployment time. | +| `wlsUserName` | Must be the same value provided at initial deployment time. | + +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateBasePath }} +``` + +### Number of Managed application instances + +You can get the existing Managed application instances number with the following command using Azure CLI. + +```shell +$ resourceGroup= +$ managedServerPrefix= +$ numberOfManagedApplicationInstances=$(az resource list -g ${resourceGroup} --resource-type Microsoft.Compute/virtualMachines --query [*].name | grep "${managedServerPrefix}VM[0-9]" | sed -e 's/[^0-9]/ /g' -e 's/^ *//g' -e 's/ *$//g' | tr -s ' ' | sed 's/ /\n/g' | sort -nr | head -n1) +$ echo ${numberOfManagedApplicationInstances} +``` + +### Number of Managed cache instances + +This parameter works for Coherence cluster. If your cluster is not Coherence cluter, keep it with default value `0`. + +You can get the existing Managed cache instances number with the following command using Azure CLI. It should be `0` if no value returned. + +```shell +$ resourceGroup= +$ managedServerPrefix= +$ numberOfManagedCacheInstances=$(az resource list -g ${resourceGroup} --resource-type Microsoft.Compute/virtualMachines --query [*].name | grep "${managedServerPrefix}StorageVM[0-9]" | sed -e 's/[^0-9]/ /g' -e 's/^ *//g' -e 's/ *$//g' | tr -s ' ' | sed 's/ /\n/g' | sort -nr | head -n1) +$ echo ${numberOfManagedCacheInstances} +``` + +#### Example Parameters JSON + +Here is a fully filled out parameters file. We will leave values of `adminUsername`, `authenticationType`, `dnsLabelPrefix`, and `usePreviewImage` as default value. + +{{ site.data.var.passwordInFileNote }} + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "_artifactsLocation": { + "value": "{{ armTemplateBasePath }}" + }, + "adminVMName": { + "value": "adminVM" + }, + "elasticsearchEndpoint": { + "value": "https://example.eastus2.azure.elastic-cloud.com:9243" + }, + "elasticsearchPassword": { + "value": "wlkpsw" + }, + "elasticsearchUserName": { + "value": "elastic" + }, + "location": { + "value": "eastus" + }, + "managedServerPrefix": { + "value": "msp" + }, + "maxDynamicClusterSize": { + "value": 8 + }, + "numberOfManagedApplicationInstances": { + "value": 3 + }, + "numberOfManagedCacheInstances": { + "value": 0 + }, + "wlsDomainName": { + "value": "wlsd" + }, + "wlsPassword": { + "value": "welcome1" + }, + "wlsUserName": { + "value": "weblogic" + } + } +} +``` + +## Invoke the ARM template + +Assume your parameters file is available in the current directory and is named `parameters.json`. This section shows the commands to configure your {{ site.data.var.wlsFullBrandName }} deployment to connect to Elasticsearch and Kinaba intance. Replace `yourResourceGroup` with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +### First, validate your parameters file + +The `az group deployment validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az deployment group validate --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/elkNestedTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Next, execute the template + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az deployment group create --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/elkNestedTemplate.json +``` + +As with the validate command, if the command returns with an exit status other than `0`, inspect the output and resolve the problem. + +This is an example output of successful deployment. Look for `"provisioningState": "Succeeded"` in your output. + +```json +{ + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Resources/deployments/elkNestedTemplate", + "location": null, + "name": "elkNestedTemplate", + "properties": { + "correlationId": "61a46b43-27d0-4478-baba-c288059892d5", + "debugSetting": null, + "dependencies": [ + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/mspVM1/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "mspVM1/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/mspVM2/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "mspVM2/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/mspStorageVM1/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "mspStorageVM1/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Resources/deployments/pid-e4165284-b017-5df9-9b91-3f11dd8a72e5", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "pid-e4165284-b017-5df9-9b91-3f11dd8a72e5", + "resourceType": "Microsoft.Resources/deployments" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/mspVM1/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "mspVM1/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/mspVM2/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "mspVM2/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + }, + { + "dependsOn": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "adminVM/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/mspStorageVM1/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk", + "resourceName": "mspStorageVM1/newuserscript", + "resourceType": "Microsoft.Compute/virtualMachines/extensions" + } + ], + "duration": "PT8M54.4785762S", + "mode": "Incremental", + "onErrorDeployment": null, + "outputResources": [ + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/adminVM/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/mspStorageVM1/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/mspVM1/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk" + }, + { + "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-elk/providers/Microsoft.Compute/virtualMachines/mspVM2/extensions/newuserscript", + "resourceGroup": "haiche-cluster-elk" + } + ], + "outputs": { + "artifactsLocationPassedIn": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + }, + "logIndex": { + "type": "String", + "value": "azure-weblogic-cluster-b4e465d5-6ffc-49cf-b1d9-b4dbf6455d0a" + } + }, + "parameters": { + "_artifactsLocation": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + }, + "_artifactsLocationELKTemplate": { + "type": "String", + "value": "{{ armTemplateBasePath }}" + }, + "_artifactsLocationSasToken": { + "type": "SecureString" + }, + "adminVMName": { + "type": "String", + "value": "adminVM" + }, + "elasticsearchEndpoint": { + "type": "String", + "value": "https://example.eastus2.azure.elastic-cloud.com:9243" + }, + "elasticsearchPassword": { + "type": "SecureString" + }, + "elasticsearchUserName": { + "type": "String", + "value": "elastic" + }, + "guidValue": { + "type": "String", + "value": "b4e465d5-6ffc-49cf-b1d9-b4dbf6455d0a" + }, + "location": { + "type": "String", + "value": "eastus" + }, + "logsToIntegrate": { + "type": "Array", + "value": [ + "HTTPAccessLog", + "ServerLog", + "DomainLog", + "DataSourceLog", + "StandardErrorAndOutput", + "NodeManagerLog" + ] + }, + "managedServerPrefix": { + "type": "String", + "value": "msp" + }, + "maxDynamicClusterSize": { + "value": 8 + }, + "numberOfManagedApplicationInstances": { + "type": "Int", + "value": 2 + }, + "numberOfManagedCacheInstances": { + "type": "Int", + "value": 1 + }, + "wlsDomainName": { + "type": "String", + "value": "wlsd" + }, + "wlsPassword": { + "type": "SecureString" + }, + "wlsUserName": { + "type": "String", + "value": "weblogic" + } + }, + "parametersLink": null, + "providers": [ + { + "id": null, + "namespace": "Microsoft.Resources", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + null + ], + "properties": null, + "resourceType": "deployments" + } + ] + }, + { + "id": null, + "namespace": "Microsoft.Compute", + "registrationPolicy": null, + "registrationState": null, + "resourceTypes": [ + { + "aliases": null, + "apiVersions": null, + "capabilities": null, + "locations": [ + "eastus" + ], + "properties": null, + "resourceType": "virtualMachines/extensions" + } + ] + } + ], + "provisioningState": "Succeeded", + "template": null, + "templateHash": "10060935779116645392", + "templateLink": null, + "timestamp": "2020-11-11T07:29:42.336797+00:00" + }, + "resourceGroup": "haiche-cluster-elk", + "type": "Microsoft.Resources/deployments" +} +``` + +## Verify ELK connection + +Follow the steps to check if WebLogic Server logs are exported to Elasticsearch. + +* Go to Azure portal +* Copy log index from your resource group -> deployments -> elkNestedTemplate -> output -> logIndex . +* Go to Elasticsearch cloud and launch Kibana. +* Create index + * Go to Kibana -> Management -> Kibana -> Index Patterns + * Click `Create index Patterns` + * Input the log index you copy from output in Index pattern + * There should be an index you can select, otherwise, the ELK deployment failed + * Next step + * Select `@timestamp` in Time Filter and hit `Create index pattern` +* View logs + * Go to Kibana -> Discover + * Select the index you just created + * You will find the WebLogic Server logs listed diff --git a/subtemplate-src/dynamic-cluster-nsgRulesTemplate.md b/subtemplate-src/dynamic-cluster-nsgRulesTemplate.md new file mode 100644 index 000000000..e47262537 --- /dev/null +++ b/subtemplate-src/dynamic-cluster-nsgRulesTemplate.md @@ -0,0 +1,86 @@ + + +{% include variables.md %} + +# Apply Azure Network Security Rule ARM Template to {{ site.data.var.wlsFullBrandName }} + +This page documents how to append addtional security rules to an existing Azure Network Security Group deployed with {{ site.data.var.wlsFullBrandName }} using the Azure CLI. + +## Prerequisies + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### Azure Network Security Group + +The Azure Network Security Rule ARM template will be applied to an existing Azure Network Security Group (NSG) instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Prepare the Parameters JSON file + +You must construct a parameter JSON file containing the parameters to the NSG template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. The options to this template declare the desired configuration of the NSG. + +| Parameter Name | Description | +| `denyPublicTrafficForAdminServer` | Deny public tranffic for the admin server on port 7001, 7002. | +| `denyPublicTrafficForManagedServer` | Deny public tranffic for the managed servers on port 8001. | +| `enableOHS` | We deal with the configuration for managed servers when the OHS load balancer is enabled. | +| `networkSecurityGroupName` | The name of the NSG. | + +#### Example Parameters JSON file + +Here is a fully filled out parameters file, assuming the {{ site.data.var.wlsFullBrandName }} was deployed accepting the default values. + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "denyPublicTrafficForManagedServer": { + "value": true + }, + "denyPublicTrafficForAdminServer": { + "value": false + }, + "enableOHS": { + "value": true + }, + "networkSecurityGroupName": { + "value": "wls-nsg" + } + } +} +``` + +## Invoke the ARM template + +This section shows how to kick off the deployment step-by-step. After the deployment, your existing NSG will append two additional Inbound Rules for admin and managed servers. Here we assume you have the parameter file in the current directory, the file is named `parameters.json`, and your NSG is named `wls-nsg`. Don't forget to replace `yourResourceGroup` with the Azure resource group in which the NSG is created. + +### First, validate your parameters file + +The `az group deployment validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az group deployment validate --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/nsgNestedTemplate.json +``` + +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Next, execute the template with it + +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az group deployment create --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/nsgNestedTemplate.json +``` + +## Verify the rules have been appended to the Azure Network Security Group successfully + +When the deployment is completed, you can verify the appended rules via Azure Portal +* Visit the Azure Network Security Group under your resource group used above. +* Go to `Settings -> Inbound security rules`. +* Verify there is a rule named `WebLogicAdminPortsAllowed` with **Priority = '210'; Port = '7001, 7002'; Protocol = 'TCP'; Source = '10.0.0.0/24'; Aciton = 'Allow'**. +* Verify there is a rule named `WebLogicManagedPortsDenied` with **Priority = '221'; Port = '8001'; Protocol = '*'; Aciton = 'Deny'**. + diff --git a/subtemplate-src/dynamic-cluster-ohsNestedTemplate.md b/subtemplate-src/dynamic-cluster-ohsNestedTemplate.md new file mode 100644 index 000000000..89503b001 --- /dev/null +++ b/subtemplate-src/dynamic-cluster-ohsNestedTemplate.md @@ -0,0 +1,215 @@ + + +{% include variables.md %} + +# Apply OHS ARM Template to {{ site.data.var.wlsFullBrandName }} + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} with a Oracle HTTP Server using Azure CLI. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Certificate for SSL Termination + +Oracle HTTP Server serves as the front end load balancer for the {{ site.data.var.wlsFullBrandName }} dynamic cluster, hence it must be provided with a certificate to allow browsers to connect via SSL. + +#### Creating Self-signed certificate + +This section describes how to create a self-signed certificate in the format expected by Oracle HTTP server. The example provided below is one of the ways to create self-signed certificates. Note that such self-signed certificates created should only be used for testing purpose and it is not recommended for production purpose. + +* JKS format certificate + + ```bash + keytool -genkey -keyalg RSA -alias selfsigned -keystore keyStore.jks -storepass password -validity 360 -keysize 2048 + ``` + + Provide all information prompted and store in a file. + +* PKCS12 format certificate + + ```bash + openssl req -newkey rsa:2048 -x509 -keyout key.pem -out out.pem -days 3650 + ``` + + Provide all information prompted and store in a file. + +## Prepare the Parameters JSON file + +You must construct a parameters JSON file containing the parameters to the OHS ARM template. See [Create Resource Manager parameter file](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files) for background information about parameter files. We must specify the information of the existing SSL certificate. This section shows how to obtain the values for the following required properties. + +| Parameter Name | Explanation | +|----------------|-------------| +| `_artifactsLocation`| See below for details. | +|`adminPasswordOrKey`|Password of administration account for the new Virtual Machine that hosts Oracle HTTP Server.| +|`adminUsername`| Username of administration account for the new Virtual Machine that hosts Oracle HTTP Server.| +|`adminRestMgmtURL`| WebLogic Server admin REST management URL. It should be in the format `http://admincomputername:adminport/management/weblogic/latest`.Example `http://adminVM:7001/management/weblogic/latest` or `http://adminVM:7005/management/weblogic/latest` | +|`dnsLabelPrefix`| Must be the same `dnsLabelPrefix` value with which WebLogic Dynamic cluster deployment is made. This value is used for fetching existing deployment `dnsLabelPrefix-nsg` NSG value. | +|`location`| Must be the same region into which the WebLogic dynamic cluster deployment is made.| +|`ohsComponentName` | Oracle HTTP Server component name to be configured as part of domain. At deployment, if this value is changed from its default value, the value used at deployment time must be used.| +|`ohsDomainName`| Oracle HTTP Server standalone domain name. At deployment, if this value is changed from its default value, the value used at deployment time must be used. | +|`ohsNMPassword`| Oracle HTTP Server NodeManager password configured as part of the domain. | +|`ohsNMUser`| Oracle HTTP Server NodeManager user name configured as part of the domain.| +|`keyType` | Certificate format supported for configuring Oracle HTTP Server SSL configuration. Supported format is `JKS` and `PKCS12`. Default value is `PKCS12`| +|`ohsSSLKeystoreData`| base64 bit encoded value of JKS/PKCS12 certificate contents. See below for details| +|`ohsSSLKeystorePassword`|The keystore stored password | +|`ohsSkuUrnVersion`| Oracle HTTP Server base images provided by publisher Oracle. Refer [Azure Marketplace OHS Base Images](https://azuremarketplace.microsoft.com/en-us/marketplace/apps?search=oracle%20ohs%20base%20image) | +|`ohsVMName`|At deployment time, if this value is changed from its default value, the value used at deployment time must be used. Otherwise, this parameter should be omitted.| +|`ohshttpPort` | Http server port configured using which application can be accessed via Oracle HTTP Server.At deployment, if this value is changed from its default value, the value used at deployment time must be used.| +|`ohshttpsPort`| Https server port configured using which application can be accessed via Oracle HTTP Server.At deployment, if this value is changed from its default value, the value used at deployment time must be used.| +|`oracleVaultPswd` | Password for Oracle wallet/vault, to add certificates supplied for OHS.| +|`storageAccountName`| The name of an existing storage account. Must be the same storage account name avilable in existing deployed WebLogic dynamic cluster| +|`virtualNetworkName`| The name of an existing virtual network name. Must be the same virtual network name available in existing deployed WebLogic dynamic cluster| +|`wlsUserName` |Must be the same value provided at deployment time for WebLogic dynamic cluster deployment time.| +|`wlsPassword` |Must be the same value provided at deployment time WebLogic dynamic cluster deployment time.| + + +### `_artifactsLocation` + +This value must be the following. + +```bash +{{ armTemplateBasePath }} +``` + +### `ohsSSLKeystoreData` +Use base64 to encode your existing SSL certificate. + + base64 your-JKS/PKCS12-certificate-contents -w 0 > temp.txt + +Use temp.txt contents to set the value for ohsSSLKeystoreData + +#### Example Parameters JSON + +Here is a fully filled out parameters file. Note that we did not include any optional parameters, assuming the {{ site.data.var.wlsFullBrandName }} was deployed accepting the default values. + +{{ site.data.var.passwordInFileNote }} + +```json +{ + "_artifactsLocation": { + "value": "{{ armTemplateBasePath }}" + }, + "adminPasswordOrKey": { + "value": "Azure123456!" + }, + "adminRestMgmtURL": { + "value": "http://adminVM:7001/management/weblogic/latest" + }, + "adminUsername": { + "value": "azureuser" + }, + "dnsLabelPrefix": { + "value": "wls" + }, + "keyType": { + "value": "JKS" + }, + "location": { + "value": "eastus" + }, + "ohsComponentName": { + "value": "ohs_component" + }, + "ohsDomainName": { + "value": "ohsStandaloneDomain" + }, + "ohsNMPassword": { + "value": "Nmpswd1234567" + }, + "ohsNMUser": { + "value": "weblogic" + }, + "ohsSSLKeystoreData": { + "value": "/u3+7QAAAAIAAAABAAAAAQAKc2VsZnNpZ25lZAAAAX ...." + }, + "ohsSSLKeystorePassword": { + "value": "azure123!" + }, + "ohsSkuUrnVersion": { + "value": "ohs-122140-jdk8-ol76;ohs-122140-jdk8-ol76;latest" + }, + "ohsVMName": { + "value": "ohsVM" + }, + "ohshttpPort": { + "value": "7777" + }, + "ohshttpsPort": { + "value": "4444" + }, + "oracleVaultPswd": { + "value": "Welcome1234567" + }, + "storageAccountName": { + "value": "6be282olvm" + }, + "virtualNetworkName": { + "value": "wlsd_VNET" + }, + "wlsPassword": { + "value": "Welcome1234567" + }, + "wlsUserName": { + "value": "weblogic" + } +} +``` + +### Invoke the ARM template +Assume your parameters file is available in the current directory and is named parameters.json. This section shows the commands to configure your {{ site.data.var.wlsFullBrandName }} deployment with a Oracle HTTP Server. Replace yourResourceGroup with the Azure resource group in which the {{ site.data.var.wlsFullBrandName }} is deployed. + +### First, validate your parameters file +The `az deployment group validate` command is very useful to validate your parameters file is syntactically correct. + +```bash +az deployment group validate --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/ohsNestedTemplate.json +``` +If the command returns with an exit status other than `0`, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad `echo $?` immediately after the `az` command. + +### Next, execute the template +After successfully validating the template invocation, change `validate` to `create` to invoke the template. + +```bash +az deployment group create --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri {{ armTemplateBasePath }}nestedtemplates/ohsNestedTemplate.json +``` +As with the validate command, if the command returns with an exit status other than 0, inspect the output and resolve the problem. + +This is an example output of successful deployment. Look for `"provisioningState": "Succeeded"` in your output. + +```bash + "provisioningState": "Succeeded", + "template": null, + "templateHash": "13760326614657528322", +``` + +## Verify Oracle HTTP Server setup + +Successful deployment provides Oracle HTTP Server access url in your output, similar to below. + +```json + "ohsAccessURL": { + "type": "String", + "value": "http://wls-5ff4cab395-loadbalancer.eastus.cloudapp.azure.com:7777" + }, + "ohsSecureAccessURL": { + "type": "String", + "value": "https://wls-5ff4cab395-loadbalancer.eastus.cloudapp.azure.com:4444" + } +``` + +Follow the steps to verify Oracle HTTP Server. +* Visit the {{ site.data.var.wlsFullBrandName }} Admin console. +* In the left navigator, expand the tree to select **Deployments**, install some sample application targeted to the {{ site.data.var.wlsFullBrandName }} cluster and start the service. +* Access your application using ohsAccessURL/application +* Access your application using ohsSecureAccessURL/application + diff --git a/subtemplate-src/dynamic-customDNSTemplate.md b/subtemplate-src/dynamic-customDNSTemplate.md new file mode 100644 index 000000000..0a06c7d23 --- /dev/null +++ b/subtemplate-src/dynamic-customDNSTemplate.md @@ -0,0 +1,182 @@ + + +{% include variables.md %} + +# Configure DNS alias to {{ site.data.var.wlsFullBrandName }} + +This page documents how to configure an existing deployment of {{ site.data.var.wlsFullBrandName }} with a custom DNS alias. + +## Prerequisites + +### Environment for Setup + +* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure), use `az --version` to test if `az` works. + +### WebLogic Server Instance + +The DNS Configuration ARM template will be applied to an existing {{ site.data.var.wlsFullBrandName }} instance. If you don't have one, please create a new instance from the Azure portal, by following the link to the offer [in the index](index.md). + +### Registered Domain Name + +You need to buy a domain name to create a custom DNS alias. + +### Azure DNS Zone + +If you create the DNS alias on an existing [Azure DNS Zone](https://docs.microsoft.com/en-us/azure/dns/dns-overview), make sure you have performed the [Azure DNS Delegation](https://docs.microsoft.com/en-us/azure/dns/dns-domain-delegation). After you have completed the delegation, you can verify it with `nslookup`. For example, assuming your domain name is **contoso.com**, this output shows a correct delegation. + +```bash +$ nslookup -type=SOA contoso.com +Server: 172.29.80.1 +Address: 172.29.80.1#53 + +Non-authoritative answer: +contoso.com + origin = ns1-01.azure-dns.com + mail addr = azuredns-hostmaster.microsoft.com + serial = 1 + refresh = 3600 + retry = 300 + expire = 2419200 + minimum = 300 +Name: ns1-01.azure-dns.com +Address: 40.90.4.1 +Name: ns1-01.azure-dns.com +Address: 2603:1061::1 +``` + +We strongly recommand you create an Azure DNS Zone for domain management and reuse it for other perpose. Follow the [guide](https://docs.microsoft.com/en-us/azure/dns/dns-getstarted-portal) to create an Azure DNS Zone. + +### Azure Managed Indentify + +If you are going to configure DNS alias based on an existing DNS Zone, you are required to input the ID of a user-assigned managed identity. + +Follow this [guide](https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/how-to-manage-ua-identity-portal) to create a user-assigned managed identity. + +To obtain ID of the indentify: go to Azure Portal; open the identity **Overview** page; click **JSON View** and copy the **Resource ID**. + + +## Prepare the Parameters + +We provide an automation shell script for DNS configuration. You must specify the information of the existing Oracle WebLogic Server. This section shows how to obtain the values for the following required properties. + +| Parameter Name             | Explanation | +|----------------|-------------| +| `--admin-vm-name`| Required. Name of vitual machine that hosts {{ site.data.var.wlsFullBrandName }} admin server. Must be the same value provided at initial deployment time.| +| `--admin-console-label` | Required. Label for {{ site.data.var.wlsFullBrandName }} admin console. Used to generate subdomain of admin console. | +| `--artifact-location`| Required. See below for details. | +| `--resource-group` | Required. Name of resource group that has an {{ site.data.var.wlsFullBrandName }} cluster deployed. | +| `--location` | Required. Must be the same region into which the server was initially deployed. | +| `--zone-name` | Required. Azure DNS Zone name. | +| `--ohs-vm-name` | Optional. Specify name of the VM that hosts the Oracle HTTP Server Load Balancer. | +| `--loadbalancer-label` | Optional. Label for Load Balancer. Used to generate subdomain of application gateway. The parameter is only required if you want to create DNS alias for application gateway.| +| `--identity-id` | Optional. ID of Azure user-assigned managed identity. The parameter is only required if you are creating DNS alias on an existing DNS Zone.| +| `--zone-resource-group` | Optional. Name of resource group that has Azure DNS Zone deployed. The parameter is only required if you are creating DNS alias on an existing DNS Zone. | +| `--help` | Help. | + +### Artifacts location + +This value must be the following. + +```bash +{{ armTemplateBasePath }} +``` + +## Invoke the Automation Script + +We provide an automation script to configure a custom DNS alias. The script lets you do the following: + + * If you have an Azure DNS Zone, it will create a DNS alias for the admin console and application gateway on the existing DNS Zone. + * If you don't have an Azure DNS Zone, it will create the DNS Zone in the same resource group as the {{ site.data.var.wlsFullBrandName }} cluster, then create the DNS alias for the admin console and application gateway. + +### Configure DNS Alias on an Existing Azure DNS Zone + +To configure a DNS alias on an existing Azure DNS Zone, in addition to the required parameters, you must also specify an Azure user-assigned managed identity ID and the resource group name in which your DNS Zone is deployed. + +This is an example to create a DNS alias `admin.contoso.com` for the admin console and `applciations.contoso.com` for the application gateway on an existing Azure DNS Zone. + +```bash +$ curl -fsSL {{ site.data.var.artifactsLocationBase }}{{ pageDir }}/{{ site.data.var.artifactsLocationTag }}/cli-scripts/custom-dns-alias-cli.sh \ + | /bin/bash -s -- \ + --resource-group `yourResourceGroup` \ + --admin-vm-name adminVM \ + --admin-console-label admin \ + --artifact-location {{ armTemplateBasePath }} \ + --location eastus \ + --zone-name contoso.com \ + --ohs-vm-name ohsVM \ + --loadbalancer-label applications \ + --identity-id `yourIndentityID` \ + --zone-resource-group `yourDNSZoneResourceGroup` +``` + +An example output: + +```text +Done! + +Custom DNS alias: + Resource group: haiche-dns-doc + WebLogic Server Administration Console URL: http://admin.contoso.com:7001/console + WebLogic Server Administration Console secured URL: https://admin.contoso.com:7002/console + + + Application Gateway URL: http://applications.contoso.com:7777 + Application Gateway secured URL: https://applications.contoso.com:4444 +``` + + +### Configure DNS Alias on a New Azure DNS Zone + +To configure a DNS alias on a new Azure DNS Zone, you must specify the required parameters. + +This is an example of creating an Azure DNS Zone, then creating a DNS alias `admin.contoso.com` for the admin console and `applications.contoso.com` for application gateway. + +```bash +$ curl -fsSL {{ site.data.var.artifactsLocationBase }}{{ pageDir }}/{{ site.data.var.artifactsLocationTag }}/cli-scripts/custom-dns-alias-cli.sh \ + | /bin/bash -s -- \ + --resource-group `yourResourceGroup` \ + --admin-vm-name adminVM \ + --admin-console-label admin \ + --artifact-location {{ armTemplateBasePath }} \ + --location eastus \ + --zone-name contoso.com \ + --ohs-vm-name ohsVM \ + --loadbalancer-label applications +``` + +An example output: + +```text +DONE! + + +Action required: + Complete Azure DNS delegation to make the alias accessible. + Reference: https://aka.ms/dns-domain-delegation + Name servers: + [ + "ns1-02.azure-dns.com.", + "ns2-02.azure-dns.net.", + "ns3-02.azure-dns.org.", + "ns4-02.azure-dns.info." + ] + +Custom DNS alias: + Resource group: haiche-dns-doc + WebLogic Server Administration Console URL: http://admin.contoso.com:7001/console + WebLogic Server Administration Console secured URL: https://admin.contoso.com:7002/console + + + Application Gateway URL: http://applications.contoso.com:7777 + Application Gateway secured URL: https://applications.contoso.com:4444 +``` + +**Note:** The DNS aliases are not accessible now, you must perform Azure DNS delegation after the deployment. Follow [Delegation of DNS zones with Azure DNS](https://aka.ms/dns-domain-delegation) to complete the Azure DNS delegation. + + +## Verify the Custom Alias + +Access the URL from output to verify if the custom alias works. diff --git a/vms/index.md b/vms/index.md new file mode 100644 index 000000000..8e9d73fdf --- /dev/null +++ b/vms/index.md @@ -0,0 +1,16 @@ + + +# Oracle WebLogic Server on Azure virtual machines + + +This page lists the collections of templates for working with existing deployments. + +* [Oracle WebLogic Server with Admin Server](../admin/) + +* [Oracle WebLogic Server Cluster](../cluster/) + +* [Oracle WebLogic Server Dynamic Cluster](../dynamic-cluster/) + diff --git a/weblogic-azure-aks/README.md b/weblogic-azure-aks/README.md deleted file mode 100644 index 8725b2442..000000000 --- a/weblogic-azure-aks/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# About WebLogic on Microsoft Azure Kubernetes Service - -As part of a broad-ranging partnership between Oracle and Microsoft, this project offers support for running Oracle WebLogic Server in Azure Kubernetes Service (AKS). The partnership includes joint support for a range of Oracle software running on Azure, including Oracle WebLogic, Oracle Linux, and Oracle DB, as well as interoperability between Oracle Cloud Infrastructure (OCI) and Azure. - -This is the main/root git repository for the Azure Resource Management (ARM) templates and other scripts used for the implementation of WebLogic Server on Microsoft Azure AKS. - -## Installation - -The [Azure Marketplace WebLogic Server Offering](https://azuremarketplace.microsoft.com/en-us/marketplace/apps?search=WebLogic) offers a simplified UI and installation experience over the full power of the ARM template. - -## Documentation - -Please refer to the documentation sample [Oracle WebLogic Server Azure Applications](https://aka.ms/wls-aks-docs-sample) - -## Examples - -To get details of how to run Oracle WebLogic Server on Azure Kubernetes Service refer to the blog [Run Oracle WebLogic Server on the Azure Kubernetes Service](https://blogs.oracle.com/weblogicserver/run-oracle-weblogic-server-on-the-azure-kubernetes-service). - -## Issues - -Issue related to Oracle WebLogic Server on Microsoft Azure implementation are tracked ain the [Issues tab](https://github.com/oracle/weblogic-azure/issues) of the GitHub project. - -## Workflow Tracker - -This section tracks GitHub Actions configured for each offer repo, 'Build and Test' and 'New Tag' are two different workflows. -| Offer Repo | Build and Test | New Tag | -|--- |--- |--- | -| [WLS on AKS] | [Build and Test]| [New Tag]| - -## Pull Requests - -This section tracks GitHub [pull requests](https://github.com/oracle/weblogic-azure/pulls). - -## License - -Copyright (c) 2021 Oracle and/or its affiliates. - -Released under the Universal Permissive License v1.0 as shown at -. diff --git a/weblogic-azure-aks/pom.xml b/weblogic-azure-aks/pom.xml deleted file mode 100644 index 32522acc5..000000000 --- a/weblogic-azure-aks/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - 4.0.0 - - - - - - com.oracle.weblogic.azure - weblogic-azure - 1.0.0 - - - com.oracle.weblogic.azure - wls-on-aks-azure-marketplace - ${version.wls-on-aks-azure-marketplace} - - jar - wls-on-aks-azure-marketplace - - - ${project.basedir}/.. - - false - false - - - diff --git a/weblogic-azure-aks/src/main/arm/createUiDefinition.json b/weblogic-azure-aks/src/main/arm/createUiDefinition.json deleted file mode 100644 index e5f6bf90d..000000000 --- a/weblogic-azure-aks/src/main/arm/createUiDefinition.json +++ /dev/null @@ -1,2158 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/0.1.2-preview/CreateUIDefinition.MultiVm.json#", - "handler": "Microsoft.Azure.CreateUIDef", - "version": "0.1.2-preview", - "parameters": { - "config": { - "basics": { - "resourceGroup": { - "allowExisting": true - } - } - }, - "basics": [ - { - "name": "infoForBeforeDeployment", - "type": "Microsoft.Common.InfoBox", - "visible": true, - "options": { - "icon": "Info", - "text": "The Azure identity deploying this offer must have one of the following two sets of Azure role-based access control roles:
  • Contributor and User Access Administrator of the current subscription.
  • Owner of the current subscription.
  • " - } - }, - { - "name": "basicsRequired", - "type": "Microsoft.Common.Section", - "label": "Credentials for WebLogic", - "elements": [ - { - "name": "listVMSizes", - "type": "Microsoft.Solutions.ArmApiControl", - "request": { - "method": "GET", - "path": "[concat(subscription().id, '/providers/Microsoft.Compute/locations/',location(),'/vmSizes?api-version=2024-03-01')]" - } - }, - { - "name": "wlsUserName", - "type": "Microsoft.Common.TextBox", - "label": "Username for WebLogic Administrator", - "defaultValue": "weblogic", - "toolTip": "Use only letters and numbers", - "constraints": { - "required": true, - "validations": [ - { - "regex": "^[a-z0-9A-Z]{1,30}$", - "message": "The value must be 1-30 characters long and must only contain letters and numbers." - } - ] - }, - "visible": true - }, - { - "name": "wlsPassword", - "type": "Microsoft.Common.PasswordBox", - "label": { - "password": "Password for WebLogic Administrator", - "confirmPassword": "Confirm password" - }, - "toolTip": "Password for WebLogic Administrator", - "constraints": { - "required": true, - "regex": "^(?=.*[A-Z])(?=.*[a-z])(?=.*\\d)[A-Za-z\\d]{12,}$", - "validationMessage": "The password must contain at least 12 characters, with at least 1 uppercase letter, 1 lowercase letter and 1 number, and special characters are not allowed." - }, - "options": { - "hideConfirmation": false - }, - "visible": true - }, - { - "name": "wdtRuntimePassword", - "type": "Microsoft.Common.PasswordBox", - "label": { - "password": "Password for WebLogic Model encryption", - "confirmPassword": "Confirm password" - }, - "toolTip": "Model in Image requires a runtime encryption secret with a secure `password` key. This secret is used by the operator to encrypt model and domain home artifacts before it adds them to a runtime ConfigMap or log. See https://aka.ms/wls-aks-model-runtime-encryption-secret.", - "constraints": { - "required": true, - "regex": "^(?=.*[A-Z])(?=.*[a-z])(?=.*\\d)[A-Za-z\\d]{12,}$", - "validationMessage": "The password must contain at least 12 characters, with at least 1 uppercase letter, 1 lowercase letter and 1 number, and special characters are not allowed." - }, - "options": { - "hideConfirmation": false - }, - "visible": true - } - ], - "visible": true - }, - { - "name": "basicsOptional", - "type": "Microsoft.Common.Section", - "label": "Optional Basic Configuration", - "elements": [ - { - "name": "basicsOptionalAcceptDefaults", - "type": "Microsoft.Common.OptionsGroup", - "label": "Accept defaults for optional configuration?", - "defaultValue": "Yes", - "toolTip": "Select 'No' to edit optional basic configuration.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": "false" - }, - { - "label": "No", - "value": "true" - } - ], - "required": true - } - }, - { - "name": "managedServerPrefix", - "type": "Microsoft.Common.TextBox", - "label": "Name prefix for Managed Server", - "toolTip": "The string to prepend to the name of the managed server.", - "defaultValue": "managed-server", - "constraints": { - "required": true, - "regex": "^(?=.{3,20}$)[a-zA-Z](?!.*--)[a-zA-Z0-9-]*[a-zA-Z0-9]$", - "validationMessage": "The prefix must be between 3 and 20 characters long and contain letters, numbers and hyphens(-). The name must begin with a letter, end with a letter or digit, and not contain consecutive hyphens." - }, - "visible": "[bool(basics('basicsOptional').basicsOptionalAcceptDefaults)]" - }, - { - "name": "wlsDomainName", - "type": "Microsoft.Common.TextBox", - "label": "WebLogic Domain Name", - "toolTip": "The name of the WebLogic Domain to create.", - "defaultValue": "domain1", - "constraints": { - "required": true, - "regex": "^[a-z0-9A-Z]{3,20}$", - "validationMessage": "The Domain Name must be between 3 and 20 characters long and contain letters, numbers only." - }, - "visible": "[bool(basics('basicsOptional').basicsOptionalAcceptDefaults)]" - }, - { - "name": "wlsDomainUID", - "type": "Microsoft.Common.TextBox", - "label": "WebLogic Domain UID", - "toolTip": "The UID of the WebLogic Domain to create.", - "defaultValue": "sample-domain1", - "constraints": { - "required": true, - "regex": "^(?=.{3,20}$)[a-zA-Z](?!.*--)[a-zA-Z0-9-]*[a-zA-Z0-9]$", - "validationMessage": "The prefix must be between 3 and 20 characters long and contain letters, numbers and hyphens(-). The name must begin with a letter, end with a letter or digit, and not contain consecutive hyphens." - }, - "visible": "[bool(basics('basicsOptional').basicsOptionalAcceptDefaults)]" - }, - { - "name": "wlsClusterSize", - "type": "Microsoft.Common.Slider", - "min": 5, - "max": 1000, - "label": "Maximum dynamic cluster size", - "defaultValue": 5, - "showStepMarkers": false, - "toolTip": "The maximum size of the dynamic WebLogic cluster.", - "constraints": { - "required": true - }, - "visible": "[bool(basics('basicsOptional').basicsOptionalAcceptDefaults)]" - }, - { - "name": "wlsJavaOption", - "type": "Microsoft.Common.TextBox", - "label": "Custom Java Options to start WebLogic Server", - "placeholder": "-Xms1200m -XX:MaxNewSize=300m -Dweblogic.webservice.i18n.charset=utf-8", - "toolTip": "Specify Java options to start WebLogic Server.", - "constraints": { - "regex": "^-[a-z0-9A-Z:./+_=-]+(\\s-[a-z0-9A-Z:./+_=-]+){0,99}$", - "validationMessage": "Allow letters, numbers, space, colon(:), plus(+), minus(-), full stop(.), slash(/), equal sign(=), underscore(_), and the value must be less then 100 Java options." - }, - "visible": "[bool(basics('basicsOptional').basicsOptionalAcceptDefaults)]" - }, - { - "name": "enableT3TunnelingTextBlock", - "type": "Microsoft.Common.TextBlock", - "visible": false, - "options": { - "text": "If checked, configure the necessary settings to enable T3 tunneling. You must take additional action on the Networking tab if either of these are checked.", - "link": { - "label": "Learn more", - "uri": "https://aka.ms/wls-aks-t3-tunneling" - } - } - }, - { - "name": "enableAdminT3Tunneling", - "type": "Microsoft.Common.CheckBox", - "label": "Enable T3 tunneling for Administration Server", - "toolTip": "If checked, enable T3 tunneling for Administration Server", - "visible": false - }, - { - "name": "enableClusterT3Tunneling", - "type": "Microsoft.Common.CheckBox", - "label": "Enable T3 tunneling for WebLogic cluster", - "toolTip": "If checked, enable T3 tunneling for WebLogic cluster.", - "visible": false - } - ], - "visible": true - }, - { - "name": "howToReportIssues", - "type": "Microsoft.Common.Section", - "label": "Report issues, get help, and share feedback", - "elements": [ - { - "name": "help", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "See the documentation for this offer in the Oracle WebLogic Kubernetes Operator.", - "link": { - "label": "Offer documentation", - "uri": "https://aka.ms/wls-aks-docs" - } - } - }, - { - "name": "howToReportIssueText", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "If you encounter problems during the deployment of Oracle WebLogic Server, report them here.", - "link": { - "label": "Issue tracker", - "uri": "https://aka.ms/arm-oraclelinux-wls-issues?version=${project.version}" - } - } - }, - { - "name": "howToJoinSlack", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "If you want to interact directly with the Oracle WebLogic community, join the public Slack channel named 'oracle-weblogic'.", - "link": { - "label": "Join Slack", - "uri": "https://aka.ms/arm-oraclelinux-wls-slack" - } - } - }, - { - "name": "survey", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "To get free help with Azure migration from the development team, fill out this survey.", - "link": { - "label": "Take survey", - "uri": "https://aka.ms/wls-on-azure-survey" - } - } - } - ], - "visible": true - } - ], - "steps": [ - { - "name": "section_aks", - "label": "AKS", - "subLabel": { - "preValidation": "Provide required info for AKS cluster configuration", - "postValidation": "Done" - }, - "bladeTitle": "AKS", - "elements": [ - { - "name": "clusterInfo", - "type": "Microsoft.Common.Section", - "label": "Azure Kubernetes Service", - "elements": [ - { - "name": "createAKSCluster", - "type": "Microsoft.Common.OptionsGroup", - "label": "Create a new AKS cluster?", - "defaultValue": "Yes", - "toolTip": "Select 'Yes' to create a new AKS cluster, or select 'No' to provide an existing AKS cluster.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": "true" - }, - { - "label": "No", - "value": "false" - } - ], - "required": true - } - }, - { - "name": "infoBoxAks", - "type": "Microsoft.Common.InfoBox", - "visible": "[not(bool(steps('section_aks').clusterInfo.createAKSCluster))]", - "options": { - "text": "Ensure that the AKS cluster is configured with the following networking settings:
  • Container networking: Azure CNI Node Subnet
  • Network policy: Azure
  • " - } - }, - { - "name": "aksClusterSelector", - "type": "Microsoft.Solutions.ResourceSelector", - "label": "Select AKS cluster", - "toolTip": "Select the existing AKS cluster.", - "resourceType": "Microsoft.ContainerService/managedClusters", - "options": { - "filter": { - "subscription": "onBasics", - "location": "onBasics" - } - }, - "visible": "[not(bool(steps('section_aks').clusterInfo.createAKSCluster))]" - }, - { - "name": "aksSupportedVersionTextBlock", - "type": "Microsoft.Common.TextBlock", - "visible": "[bool(steps('section_aks').clusterInfo.createAKSCluster)]", - "options": { - "icon": "Info", - "text": "AKS supports a range of Kubernetes versions. This offer is tested with a specific Kubernetes version known to work with WebLogic Server on AKS; click 'Learn more' to find the version information.", - "link": { - "label": "Learn more", - "uri": "https://aka.ms/wls-aks-well-tested-version" - } - } - }, - { - "name": "nodeVMSizeSelector", - "type": "Microsoft.Compute.SizeSelector", - "label": "Node size", - "toolTip": "The size of virtual machine to provision.", - "recommendedSizes": [ - "Standard_DS2_v2" - ], - "constraints": { - "excludedSizes": [ - "Standard_A0", - "Standard_A1", - "Standard_A1_v2", - "Standard_F1", - "Standard_F1s", - "Standard_DS1_v2", - "Standard_B12ms", - "Standard_B16als_v2", - "Standard_B16as_v2", - "Standard_B16ls_v2", - "Standard_B16ms", - "Standard_B16pls_v2", - "Standard_B16ps_v2", - "Standard_B16s_v2", - "Standard_B1ls", - "Standard_B1ms", - "Standard_B1s", - "Standard_B20ms", - "Standard_B2als_v2", - "Standard_B2as_v2", - "Standard_B2ats_v2", - "Standard_B2ls_v2", - "Standard_B2ms", - "Standard_B2pls_v2", - "Standard_B2ps_v2", - "Standard_B2pts_v2", - "Standard_B2s", - "Standard_B2s_v2", - "Standard_B2ts_v2", - "Standard_B32als_v2", - "Standard_B32as_v2", - "Standard_B32ls_v2", - "Standard_B32s_v2", - "Standard_B4als_v2", - "Standard_B4as_v2", - "Standard_B4ls_v2", - "Standard_B4ms", - "Standard_B4pls_v2", - "Standard_B4ps_v2", - "Standard_B4s_v2", - "Standard_B8als_v2", - "Standard_B8as_v2", - "Standard_B8ls_v2", - "Standard_B8ms", - "Standard_B8pls_v2", - "Standard_B8ps_v2", - "Standard_B8s_v2" - ] - }, - "options": { - "hideDiskTypeFilter": false - }, - "osPlatform": "Linux", - "count": "[steps('section_aks').clusterInfo.aksNodeCount]", - "visible": "[bool(steps('section_aks').clusterInfo.createAKSCluster)]" - }, - { - "name": "aksNodeCount", - "type": "Microsoft.Common.Slider", - "min": "[add(1, div(add(12288, mul(if(bool(basics('basicsOptional').basicsOptionalAcceptDefaults), basics('basicsOptional').wlsClusterSize, 5), 1536)), first(filter(basics('basicsRequired').listVMSizes.value, (item) => equals(item.name, steps('section_aks').clusterInfo.nodeVMSizeSelector))).memoryInMB))]", - "defaultValue": 3, - "max": 998, - "label": "Minimum node count", - "showStepMarkers": false, - "toolTip": "Set the minimum node count for the cluster.", - "constraints": { - "required": true - }, - "visible": "[bool(steps('section_aks').clusterInfo.createAKSCluster)]" - }, - { - "name": "aksNodeMaxCount", - "type": "Microsoft.Common.Slider", - "min": "[add(steps('section_aks').clusterInfo.aksNodeCount,2)]", - "defaultValue": 3, - "max": 1000, - "label": "Maximum node count", - "showStepMarkers": false, - "toolTip": "Set the maximum node count for the cluster.", - "constraints": { - "required": true - }, - "visible": "[bool(steps('section_aks').clusterInfo.createAKSCluster)]" - } - ] - }, - { - "name": "imageInfo", - "type": "Microsoft.Common.Section", - "label": "Image selection", - "elements": [ - { - "name": "oracleCreateACR", - "type": "Microsoft.Common.OptionsGroup", - "visible": true, - "label": "Create a new Azure Container Registry to store application images?", - "defaultValue": "Yes", - "toolTip": "Select 'Yes' to create a new ACR instance, or select 'No' to provide an existing ACR instance.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": "true" - }, - { - "label": "No", - "value": "false" - } - ], - "required": true - } - }, - { - "name": "oracleAcrInfo", - "type": "Microsoft.Common.InfoBox", - "visible": "[not(bool(steps('section_aks').imageInfo.oracleCreateACR))]", - "options": { - "icon": "Info", - "text": "Make sure the Azure Container Registry has enabled the admin user.", - "uri": "https://docs.microsoft.com/en-us/azure/container-registry/container-registry-authentication#admin-account" - } - }, - { - "name": "oracleAcrSelector", - "type": "Microsoft.Solutions.ResourceSelector", - "label": "Select ACR instance", - "toolTip": "Select the existing ACR instance.", - "resourceType": "Microsoft.ContainerRegistry/registries", - "options": { - "filter": { - "subscription": "onBasics", - "location": "onBasics" - } - }, - "visible": "[not(bool(steps('section_aks').imageInfo.oracleCreateACR))]" - }, - { - "name": "ocrSSOInfo", - "type": "Microsoft.Common.InfoBox", - "visible": true, - "options": { - "icon": "Info", - "text": "Provide an Oracle Single Sign-On (SSO) account to access the Oracle Registry Server. Select the link to create an Oracle SSO account.", - "uri": "https://aka.ms/wls-aks-create-sso-account" - } - }, - { - "name": "ocrSSOUserName", - "type": "Microsoft.Common.TextBox", - "label": "Username for Oracle Single Sign-On authentication", - "defaultValue": "example@contoso.com", - "toolTip": "Username for Oracle Single Sign-On authentication to login the Oracle Container Registry.", - "constraints": { - "required": true, - "regex": "^([a-zA-Z0-9_\\-\\.]+)@([a-zA-Z0-9_\\-\\.]+)\\.([a-zA-Z]{2,5})$", - "validationMessage": "The value must be an email address." - }, - "visible": true - }, - { - "name": "ocrSSOPassword", - "type": "Microsoft.Common.PasswordBox", - "label": { - "password": "Password for Oracle Single Sign-On authentication", - "confirmPassword": "Confirm password" - }, - "toolTip": "Password for Oracle Single Sign-On authentication to login the Oracle Container Registry.", - "constraints": { - "required": true, - "regex": "^(?=.*[A-Z])(?=.*[a-z])(?=.*\\d)[A-Za-z\\d\\$\\&\\+\\,:\\=\\?@#|'.\\^\\*!\\-_~/'\\[\\]\\{\\}\"]{8,}$", - "validationMessage": "The password must contain at least 8 characters, with at least 1 uppercase letter, 1 lowercase letter and 1 number, and special characters, but should not contain > < ( ) % ; \\." - }, - "options": { - "hideConfirmation": false - }, - "visible": true - }, - { - "name": "fromImageInfo", - "type": "Microsoft.Common.InfoBox", - "visible": true, - "options": { - "icon": "Warning", - "text": "Before moving forward, you must accept the Oracle Standard Terms and Restrictions for the WebLogic Server
    image in the Oracle Container Registry (OCR). The deployment will fail if you have not accepted the terms.

    If you have an Oracle support contract, we recommend using the Patched WebLogic Server Images.
    Otherwise, you can use the General WebLogic Server Images.

    To use the General WebLogic Server Images:To use the Patched WebLogic Server Images:Once you have accepted the terms in OCR, make sure to select the right type of image below." - } - }, - { - "name": "isSSOSupportEntitled", - "type": "Microsoft.Common.OptionsGroup", - "label": "Select the type of WebLogic Server Images.", - "defaultValue": "General WebLogic Server Images", - "toolTip": "If 'Patched WebLogic Server Images' is selected, the deployment process will pull from the Patched WebLogic Server Images repository. If 'General WebLogic Server Images' is selected the deployment process will pull from the General WebLogic Server Images repository.", - "constraints": { - "allowedValues": [ - { - "label": "General WebLogic Server Images", - "value": "false" - }, - { - "label": "Patched WebLogic Server Images", - "value": "true" - } - ], - "required": true - }, - "visible": true - }, - { - "name": "oracleImageSelector", - "type": "Microsoft.Common.DropDown", - "label": "Select desired combination of WebLogic Server, JDK and Operating System or fully qualified Docker tag", - "defaultValue": "14.1.1.0-11", - "multiLine": true, - "toolTip": "Select image", - "constraints": { - "allowedValues": [ - { - "label": "14.1.1.0-8", - "description": "14c on JDK 8 on Oracle Linux 7", - "value": "14.1.1.0-8" - }, - { - "label": "14.1.1.0-11", - "description": "14c on JDK 11 on Oracle Linux 7", - "value": "14.1.1.0-11" - }, - { - "label": "12.2.1.4", - "description": "12cR2 (12.2.1.4) on JDK 8 on Oracle Linux 7", - "value": "12.2.1.4" - }, - { - "label": "14.1.1.0-8-ol8", - "description": "14c on JDK 8 on Oracle Linux 8", - "value": "14.1.1.0-8-ol8" - }, - { - "label": "14.1.1.0-11-ol8", - "description": "14c on JDK 11 on Oracle Linux 8", - "value": "14.1.1.0-11-ol8" - }, - { - "label": "12.2.1.4-ol8", - "description": "12cR2 (12.2.1.4) on JDK 8 on Oracle Linux 8", - "value": "12.2.1.4-ol8" - }, - { - "label": "Others", - "description": "Specify fully qualified Oracle Container Registry tag", - "value": "others" - } - ], - "required": true - }, - "visible": true - }, - { - "name": "fromOracleImage", - "type": "Microsoft.Common.TextBox", - "visible": "[equals(steps('section_aks').imageInfo.oracleImageSelector, 'others')]", - "label": "WebLogic Docker tag", - "defaultValue": "14.1.1.0-slim-11", - "toolTip": "Docker tag that comes after 'container-registry.oracle.com/middleware/weblogic:' in the fromOracleImage option to 'imagetool'.", - "constraints": { - "required": true, - "validations": [ - { - "regex": "^[a-z0-9\\-\\.]+$", - "message": "Must be a valid Docker tag for WebLogic on Oracle Container Registry" - } - ] - } - }, - { - "name": "unsupportedPlatformInfo1", - "type": "Microsoft.Common.InfoBox", - "visible": "[and(contains(steps('section_aks').clusterInfo.nodeVMSizeSelector,'p'), not(contains(parse('[\"14.1.1.0-11\", \"14.1.1.0-8\", \"14.1.1.0-slim-11\", \"14.1.1.0-slim-8\", \"12.2.1.4\", \"12.2.1.4-slim\"]'),if(equals(steps('section_aks').imageInfo.oracleImageSelector, 'others'), steps('section_aks').imageInfo.fromOracleImage, steps('section_aks').imageInfo.oracleImageSelector))))]", - "options": { - "icon": "Error", - "text": "The selected image is not compatible with the ARM64 platform. Please choose a different image or select a different size from AKS -> Azure Kubernetes Service -> Node size. For more information, see the Azure documentation." - } - } - ], - "visible": true - }, - { - "name": "jeeAppInfo", - "type": "Microsoft.Common.Section", - "label": "Application", - "elements": [ - { - "name": "uploadAppPackage", - "type": "Microsoft.Common.OptionsGroup", - "label": "Deploy an application?", - "defaultValue": "No", - "toolTip": "Select 'Yes' to deploy your application.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": "true" - }, - { - "label": "No", - "value": "false" - } - ], - "required": true - } - }, - { - "name": "appInfoBox", - "type": "Microsoft.Common.InfoBox", - "options": { - "icon": "Info", - "text": "You must select the application files from Azure Storage Account.
    Follow the steps to upload your applications to an Azure Storage Account:
  • Create a Storage Account
  • Create a container and upload application files
  • " - }, - "visible": "[bool(steps('section_aks').jeeAppInfo.uploadAppPackage)]" - }, - { - "name": "appPackageUrl", - "type": "Microsoft.Common.FileUpload", - "label": "Application package (.war,.ear,.jar)", - "toolTip": "The application package to deploy.", - "constraints": { - "required": true, - "accept": ".war,.ear,.jar" - }, - "options": { - "multiple": true, - "uploadMode": "url", - "openMode": "binary" - }, - "visible": "[bool(steps('section_aks').jeeAppInfo.uploadAppPackage)]" - }, - { - "name": "validateApplicationsInfo", - "type": "Microsoft.Common.InfoBox", - "visible": false, - "options": { - "icon": "Info", - "text": "If checked, verify the deployed app reaches the ACTIVE state and fail the deployment if it does not. See the documentation link for more information.", - "uri": "https://aka.ms/wls-aks-deployment-state" - } - }, - { - "name": "validateApplications", - "type": "Microsoft.Common.CheckBox", - "label": "Fail deployment if application does not become ACTIVE.", - "toolTip": "If checked, verify the deployed app reaches the ACTIVE state and fail the deployment if it does not. See the documentation link for more information.", - "visible": false - }, - { - "name": "appReplicas", - "type": "Microsoft.Common.TextBox", - "label": "Number of WebLogic Managed Server replicas", - "defaultValue": "2", - "toolTip": "The number of WebLogic Managed Server replicas to deploy.", - "constraints": { - "required": true, - "regex": "^(1|2|3|4|5){1}$", - "validationMessage": "Number of WebLogic Managed Server replicas to deploy, limit 1-5." - } - } - ], - "visible": true - }, - { - "name": "aksAdvancedConfig", - "type": "Microsoft.Common.OptionsGroup", - "label": "Show advanced configuration?", - "defaultValue": "No", - "toolTip": "Select 'Yes' to edit advanced configuration.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": "true" - }, - { - "label": "No", - "value": "false" - } - ], - "required": true - } - }, - { - "name": "aksAdvancedInfo", - "type": "Microsoft.Common.Section", - "label": "Advanced", - "elements": [ - { - "name": "enableAzureMonitoringTextBlock", - "type": "Microsoft.Common.TextBlock", - "visible": "[bool(steps('section_aks').clusterInfo.createAKSCluster)]", - "options": { - "icon": "Info", - "text": "If checked, configure the necessary settings to integrate with Container insights. Container insights gives you performance visibility by collecting memory and processor metrics from controllers, nodes, and containers that are available in Kubernetes through the Metrics API. Container logs are also collected. Metrics are written to the metrics store and log data is written to the logs store associated with your Log Analytics workspace.", - "link": { - "label": "Learn more", - "uri": "https://aka.ms/wls-aks-container-insights" - } - } - }, - { - "name": "enableAzureMonitoring", - "type": "Microsoft.Common.CheckBox", - "label": "Enable Container insights", - "toolTip": "If checked, configure the necessary settings to integrate with Container insights.", - "visible": "[bool(steps('section_aks').clusterInfo.createAKSCluster)]" - }, - { - "name": "enableAzureFileShareTextBlock", - "type": "Microsoft.Common.TextBlock", - "visible": "[bool(steps('section_aks').clusterInfo.createAKSCluster)]", - "options": { - "icon": "Info", - "text": "If checked, configure the necessary settings to mount a persistent volume to the nodes of the AKS cluster. This can be useful for storing log files outside of the AKS cluster, among other possible uses. An Azure Storage Account and an Azure Files share will be provisioned; static persistent volume with the Azure Files share will be mounted to the nodes of the AKS cluster.", - "link": { - "label": "Learn more", - "uri": "https://aka.ms/wls-aks-persistent-storage" - } - } - }, - { - "name": "enableAzureFileShare", - "toolTip": "If checked, configure the necessary settings to mount a persistent volume to the nodes of the AKS cluster.", - "type": "Microsoft.Common.CheckBox", - "label": "Create Persistent Volume using Azure File share service", - "visible": "[bool(steps('section_aks').clusterInfo.createAKSCluster)]" - }, - { - "name": "useAcrImage", - "type": "Microsoft.Common.CheckBox", - "label": "Bring your own WebLogic Server Docker image from Azure Container Registry?", - "toolTip": "Select 'Yes' to use a pre-existing Docker image, assumed to be a compatible WebLogic Server image, from the specified ACR instance. This allows the use of custom images, such as with a specific set of patches (PSUs)." - }, - { - "name": "userProvidedAcrInfo", - "type": "Microsoft.Common.InfoBox", - "visible": "[bool(steps('section_aks').aksAdvancedInfo.useAcrImage)]", - "options": { - "icon": "Info", - "text": "Make sure the Azure Container Registry has enabled the admin user.", - "uri": "https://docs.microsoft.com/en-us/azure/container-registry/container-registry-authentication#admin-account" - } - }, - { - "name": "userProvidedAcrSelector", - "type": "Microsoft.Solutions.ResourceSelector", - "label": "Select existing ACR instance", - "toolTip": "Select the existing ACR instance.", - "resourceType": "Microsoft.ContainerRegistry/registries", - "options": { - "filter": { - "subscription": "onBasics", - "location": "onBasics" - } - }, - "visible": "[bool(steps('section_aks').aksAdvancedInfo.useAcrImage)]" - }, - { - "name": "userProvidedImagePath", - "type": "Microsoft.Common.TextBox", - "visible": "[bool(steps('section_aks').aksAdvancedInfo.useAcrImage)]", - "label": "Please provide the image path", - "toolTip": "Please provide the image path, the image must be stored in the selected ACR above", - "defaultValue": "", - "constraints": { - "required": true, - "regex": "[concat(coalesce(last(split(steps('section_aks').aksAdvancedInfo.userProvidedAcrSelector.id, '/')), ''), '.*$')]", - "validationMessage": "The image must be stored in the selected ACR above" - } - } - ], - "visible": "[bool(steps('section_aks').aksAdvancedConfig)]" - } - ] - }, - { - "name": "section_sslConfiguration", - "type": "Microsoft.Common.Section", - "label": "TLS/SSL", - "elements": [ - { - "name": "sslConfigurationText", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "Selecting 'Yes' here will cause the offer to configure WebLogic Server Administration Console, Remote Console and cluster to use HTTPS (Secure) ports, with your own TLS/SSL certificate.", - "link": { - "label": "Learn more", - "uri": "https://aka.ms/arm-oraclelinux-wls-ssl-config" - } - } - }, - { - "name": "enableCustomSSL", - "type": "Microsoft.Common.OptionsGroup", - "label": "Configure end to end TLS/SSL to WebLogic Server Administration Console and cluster on HTTPS (Secure) port, with your own certificate?", - "defaultValue": "No", - "toolTip": "Select 'Yes' to configure end to end TLS/SSL to WebLogic Server Administration Console and cluster on HTTPS (Secure) port, with your own certificate.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": true - }, - { - "label": "No", - "value": false - } - ], - "required": false - } - }, - { - "name": "uploadedCustomSSLSettings", - "type": "Microsoft.Common.Section", - "visible": "[steps('section_sslConfiguration').enableCustomSSL]", - "label": "TLS/SSL configuration settings", - "elements": [ - { - "name": "sslKeystoreInfo0", - "type": "Microsoft.Common.InfoBox", - "visible": "true", - "options": { - "icon": "Info", - "text": "You must provide different files for identity and trust KeyStores. Select here for more details.", - "uri": "https://aka.ms/arm-oraclelinux-wls-ssl-configuration" - } - }, - { - "name": "uploadedCustomIdentityKeyStoreData", - "type": "Microsoft.Common.FileUpload", - "label": "Identity KeyStore Data file(.jks,.p12)", - "toolTip": "Identity KeyStore for TLS/SSL configuration", - "constraints": { - "required": true, - "accept": ".jks,.p12" - }, - "options": { - "multiple": false, - "uploadMode": "file", - "openMode": "binary" - }, - "visible": true - }, - { - "name": "uploadedCustomIdentityKeyStorePassphrase", - "type": "Microsoft.Common.PasswordBox", - "label": { - "password": "Password", - "confirmPassword": "Confirm password" - }, - "toolTip": " The passphrase for the Identity KeyStore", - "constraints": { - "required": true, - "regex": "^.{6,}$", - "validationMessage": "Keypass must be at least 6 characters long." - }, - "options": { - "hideConfirmation": false - }, - "visible": true - }, - { - "name": "uploadedCustomIdentityKeyStoreType", - "type": "Microsoft.Common.DropDown", - "visible": "true", - "label": "The Identity KeyStore type (JKS,PKCS12)", - "defaultValue": "JKS", - "toolTip": "One of the supported KeyStore types", - "constraints": { - "allowedValues": [ - { - "label": "JKS", - "value": "JKS" - }, - { - "label": "PKCS12", - "value": "PKCS12" - } - ], - "required": true - } - }, - { - "name": "uploadedPrivateKeyAlias", - "type": "Microsoft.Common.TextBox", - "visible": "true", - "label": "The alias of the server's private key within the Identity KeyStore", - "defaultValue": "", - "toolTip": "Use only letters and numbers", - "constraints": { - "required": true, - "regex": "^[a-z0-9A-Z]{1,30}$", - "validationMessage": "The value must be 1-30 characters long and must only contain letters and numbers." - } - }, - { - "name": "uploadedPrivateKeyPassPhrase", - "type": "Microsoft.Common.PasswordBox", - "visible": "true", - "label": { - "password": "The passphrase for the server's private key within the Identity KeyStore", - "confirmPassword": "Confirm passphrase" - }, - "toolTip": "Use only letters and numbers", - "constraints": { - "required": true, - "regex": "^.{6,}$", - "validationMessage": "Keypass must be at least 6 characters long." - }, - "options": { - "hideConfirmation": false - } - }, - { - "name": "uploadedCustomTrustKeyStoreData", - "type": "Microsoft.Common.FileUpload", - "label": "Trust KeyStore Data file(.jks,.p12)", - "toolTip": "Trust KeyStore for TLS/SSL configuration.", - "constraints": { - "required": true, - "accept": ".jks,.p12" - }, - "options": { - "multiple": false, - "uploadMode": "file", - "openMode": "binary" - }, - "visible": true - }, - { - "name": "uploadedCustomTrustKeyStorePassPhrase", - "type": "Microsoft.Common.PasswordBox", - "label": { - "password": "Password", - "confirmPassword": "Confirm password" - }, - "toolTip": " The passphrase for the Trust KeyStore", - "constraints": { - "required": true, - "regex": "^.{6,}$", - "validationMessage": "Keypass must be at least 6 characters long." - }, - "options": { - "hideConfirmation": false - }, - "visible": true - }, - { - "name": "uploadedCustomTrustKeyStoreType", - "type": "Microsoft.Common.DropDown", - "visible": "true", - "label": "The Trust KeyStore type (JKS,PKCS12)", - "defaultValue": "JKS", - "toolTip": "One of the supported KeyStore types", - "constraints": { - "allowedValues": [ - { - "label": "JKS", - "value": "JKS" - }, - { - "label": "PKCS12", - "value": "PKCS12" - } - ], - "required": true - } - } - ] - } - ] - }, - { - "name": "section_appGateway", - "type": "Microsoft.Common.Section", - "label": "Load balancing", - "subLabel": { - "preValidation": "Provide required information for load balancing", - "postValidation": "Done" - }, - "bladeTitle": "Load balancing", - "elements": [ - { - "name": "connectToAGText", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "This blade allows configuring options for load balancing and ingress controller." - } - }, - { - "name": "loadBalancingOptions", - "type": "Microsoft.Common.OptionsGroup", - "label": "Load Balancing Options", - "defaultValue": "Application Gateway Ingress Controller", - "toolTip": "Select load balancing option.", - "constraints": { - "allowedValues": [ - { - "label": "Application Gateway Ingress Controller", - "value": "agic" - }, - { - "label": "Standard Load Balancer Service", - "value": "lbservice" - }, - { - "label": "No Load Balancer", - "value": "none" - } - ], - "required": true - }, - "visible": true - }, - { - "name": "appgwIngress", - "type": "Microsoft.Common.Section", - "label": "Application Gateway Ingress Controller", - "elements": [ - { - "name": "enableAppGatewayText", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "This option will cause the offer to configure an Application Gateway Ingress Controller", - "link": { - "label": "Learn more", - "uri": "https://aka.ms/wls-aks-app-gateway-ingress-controller" - } - } - }, - { - "name": "vnetInfo", - "type": "Microsoft.Common.InfoBox", - "visible": true, - "options": { - "icon": "Info", - "text": "When creating a new virtual network, the subnet's address prefix is calculated automatically based on the virtual
    network's address prefix. When using an existing virtual network, a minimum virtual network size of /24 and a
    minimum subnet size of /24 are required. Additionally, the subnet must be dedicated only for use by the
    Application Gateway." - } - }, - { - "name": "vnetForApplicationGateway", - "type": "Microsoft.Network.VirtualNetworkCombo", - "label": { - "virtualNetwork": "Virtual network", - "subnets": "Subnets" - }, - "toolTip": { - "virtualNetwork": "Select a virtual network in which to place the Application Gateway.", - "subnets": "The subnet must be dedicated only for use by the Application Gateway." - }, - "defaultValue": { - "name": "[concat('wlsaks-vnet',take(guid(), 8))]", - "addressPrefixSize": "/24" - }, - "constraints": { - "minAddressPrefixSize": "/24" - }, - "options": { - "hideExisting": false - }, - "subnets": { - "gatewaySubnet": { - "label": "Subnet", - "defaultValue": { - "name": "wls-aks-gateway-subnet", - "addressPrefixSize": "/24" - }, - "constraints": { - "minAddressPrefixSize": "/24", - "minAddressCount": 250, - "requireContiguousAddresses": false - } - } - }, - "visible": true - }, - { - "name": "appgwUsePrivateIP", - "type": "Microsoft.Common.CheckBox", - "label": "Configure frontend IP with private IP address", - "toolTip": "If checked, expose WebLogic Server with private IP address.", - "visible": false - }, - { - "name": "sslCertText00", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "Choose an option for providing the TLS/SSL certificate:" - } - }, - { - "name": "sslCertText01", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "    ⁃ Upload a TLS/SSL certificate: Upload the pre-signed certificate now." - } - }, - { - "name": "sslCertText02", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "    ⁃ Generate a self-signed front-end certificate: Generate a self-signed front-end certificate and apply it during deployment.", - "link": { - "label": "Learn more", - "uri": "https://aka.ms/wls-aks-application-gateway-ssl-key-vault" - } - } - }, - { - "name": "certificateOption", - "type": "Microsoft.Common.OptionsGroup", - "label": "Select desired TLS/SSL certificate option", - "defaultValue": "Generate a self-signed front-end certificate", - "toolTip": "Select desired TLS/SSL certificate option", - "constraints": { - "allowedValues": [ - { - "label": "Generate a self-signed front-end certificate", - "value": "generateCert" - }, - { - "label": "Upload a TLS/SSL certificate", - "value": "haveCert" - } - ], - "required": true - }, - "visible": true - }, - { - "name": "appGatewaySSLCertData", - "type": "Microsoft.Common.FileUpload", - "label": "Front-End TLS/SSL certificate(.pfx)", - "toolTip": "TLS/SSL certificate used for App Gateway", - "constraints": { - "required": true, - "accept": ".pfx" - }, - "options": { - "multiple": false, - "uploadMode": "file", - "openMode": "binary" - }, - "visible": "[equals(steps('section_appGateway').appgwIngress.certificateOption, 'haveCert')]" - }, - { - "name": "appGatewaySSLCertPassword", - "type": "Microsoft.Common.PasswordBox", - "label": { - "password": "Password", - "confirmPassword": "Confirm password" - }, - "toolTip": "Front-End TLS/SSL certificate password", - "constraints": { - "required": "[equals(steps('section_appGateway').appgwIngress.certificateOption, 'haveCert')]", - "regex": "^((?=.*[0-9])(?=.*[a-z])|(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])|(?=.*[0-9])(?=.*[a-z])(?=.*[!@#$%^&*])|(?=.*[0-9])(?=.*[A-Z])(?=.*[!@#$%^&*])|(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*])).{6,128}$", - "validationMessage": "The password must contain at least 6 characters, with at least 1 uppercase letter, 1 lowercase letter and 1 number." - }, - "options": { - "hideConfirmation": false - }, - "visible": "[equals(steps('section_appGateway').appgwIngress.certificateOption, 'haveCert')]" - }, - { - "name": "uploadedSSLCertData", - "type": "Microsoft.Common.FileUpload", - "label": "Trusted root certificate(.cer, .cert)", - "toolTip": "Trusted root certificate (CA certificate) used to set up end to end TLS/SSL", - "constraints": { - "required": true, - "accept": ".cer, .cert" - }, - "options": { - "multiple": false, - "uploadMode": "file", - "openMode": "binary" - }, - "visible": "[steps('section_sslConfiguration').enableCustomSSL]" - }, - { - "name": "enableCookieBasedAffinity", - "type": "Microsoft.Common.CheckBox", - "label": "Disable cookie based affinity", - "toolTip": "If checked, disable cookie based affinity", - "visible": true - }, - { - "name": "appgwForAdminServer", - "type": "Microsoft.Common.OptionsGroup", - "label": "Create ingress for Administration Console. Make sure no application with path /console*, it will cause conflict with Administration Console path.", - "defaultValue": "No", - "toolTip": "Select 'Yes' to Create ingress for Administration Console. Make sure no application with path /console*, it will cause conflict with Administration Console path.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": true - }, - { - "label": "No", - "value": false - } - ] - }, - "visible": true - }, - { - "name": "appgwForAdminRemote", - "type": "Microsoft.Common.OptionsGroup", - "label": "Create ingress for WebLogic Remote Console. Make sure no application with path /remoteconsole*, it will cause conflict with WebLogic Remote Console path.", - "defaultValue": "No", - "toolTip": "Select 'Yes' to Create ingress for WebLogic Remote Console. Make sure no application with path /remoteconsole*, it will cause conflict with WebLogic Remote Console path.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": true - }, - { - "label": "No", - "value": false - } - ] - }, - "visible": true - } - ], - "visible": "[equals(steps('section_appGateway').loadBalancingOptions, 'agic')]" - }, - { - "name": "lbSVCInfo", - "type": "Microsoft.Common.Section", - "label": "Standard Load Balancer Service", - "elements": [ - { - "name": "enableLBSVCText", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "This option will cause the offer to provision the Azure Load Balancer service to expose the WebLogic Server Administration Console and the cluster.", - "link": { - "label": "Learn more", - "uri": "https://aka.ms/wls-aks-standard-load-balancer" - } - } - }, - { - "name": "enableInternalLBText", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "If checked, the offer will configure the load balancer as an internal load balancer.", - "link": { - "label": "Learn more", - "uri": "https://aka.ms/wls-aks-internal-load-balancer" - } - } - }, - { - "name": "enableInternalLB", - "type": "Microsoft.Common.CheckBox", - "label": "Use Internal Load Balancer", - "toolTip": "If checked, the offer will configure the load balancer as an internal load balancer.", - "visible": true - }, - { - "name": "infoBoxForLbSvc", - "type": "Microsoft.Common.InfoBox", - "visible": true, - "options": { - "icon": "info", - "text": "There must be at least one and at most two entries." - } - }, - { - "name": "lbSVC", - "type": "Microsoft.Common.EditableGrid", - "ariaLabel": "Enter information", - "label": "Standard Load Balancer service", - "toolTip": "Create Azure Standard Load Balancer service for Administration Console and cluster.", - "visible": true, - "constraints": { - "width": "Full", - "rows": { - "count": { - "min": 1, - "max": 2 - } - }, - "columns": [ - { - "id": "colName", - "header": "Service name prefix", - "width": "2fr", - "element": { - "type": "Microsoft.Common.TextBox", - "placeholder": "Input a prefix...", - "toolTip": "Input a prefix for service name. For example, inputing 'domain1-admin-server' will cause provisioning a Load Balancer service named with 'domain1-admin-server*' and exposing the Oracle WebLogic Administration Server to Internet.", - "constraints": { - "required": true, - "validations": [ - { - "isValid": "[lessOrEquals(length(filter(steps('section_appGateway').lbSVCInfo.lbSVC, (item) => equals(item.colName, last(take(steps('section_appGateway').lbSVCInfo.lbSVC, $rowIndex)).colName))),1)]", - "message": "You can not input the same service prefix repeadly, please change any of the value." - }, - { - "regex": "^(?=.{3,20}$)[a-zA-Z](?!.*--)[a-zA-Z0-9-]*[a-zA-Z0-9]$", - "message": "The prefix must be between 3 and 20 characters long and contain letters, numbers and hyphens(-). The name must begin with a letter, end with a letter or digit, and not contain consecutive hyphens." - } - ] - } - } - }, - { - "id": "colTarget", - "header": "Target", - "width": "2fr", - "element": { - "type": "Microsoft.Common.DropDown", - "placeholder": "Select a target...", - "toolTip": "Create Azure Standard Load Balancer Servicer for the selected target.", - "constraints": { - "allowedValues": [ - { - "label": "admin-server", - "value": "adminServer" - }, - { - "label": "cluster-1", - "value": "cluster1" - } - ], - "required": true - } - } - }, - { - "id": "colPort", - "header": "Port", - "width": "1fr", - "element": { - "type": "Microsoft.Common.TextBox", - "placeholder": "Input a port...", - "toolTip": "Public port for the target service, it's suggested to use 7001 for Oracle WebLogic Administration Server, and 8001 for cluster.", - "constraints": { - "required": true, - "validations": [ - { - "isValid": "[lessOrEquals(length(filter(steps('section_appGateway').lbSVCInfo.lbSVC, (item) => equals(item.colTarget, last(take(steps('section_appGateway').lbSVCInfo.lbSVC, $rowIndex)).colTarget))),1)]", - "message": "You can not select the same target repeatedly." - }, - { - "regex": "^()([1-9]|[1-5]?[0-9]{2,4}|6[1-4][0-9]{3}|65[1-4][0-9]{2}|655[1-2][0-9]|6553[1-5])$", - "message": "Only numbers are allowed, and the value must be 1-65535." - } - ] - } - } - } - ] - } - } - ], - "visible": "[equals(steps('section_appGateway').loadBalancingOptions, 'lbservice')]" - } - ] - }, - { - "name": "section_dnsConfiguration", - "type": "Microsoft.Common.Section", - "label": "DNS", - "elements": [ - { - "name": "dnsConfigurationText", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "Selecting 'Yes' here will cause the offer to provision Oracle WebLogic Server Administration Console, cluster, and Remote Console using custom DNS Name (example: admin.contoso.com)", - "link": { - "label": "Learn more", - "uri": "https://aka.ms/arm-oraclelinux-wls-dns" - } - } - }, - { - "name": "enableDNSConfiguration", - "type": "Microsoft.Common.OptionsGroup", - "label": "Custom DNS Alias", - "defaultValue": "No", - "toolTip": "Select 'Yes' to configure Custom DNS Alias.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": true - }, - { - "label": "No", - "value": false - } - ], - "required": false - } - }, - { - "name": "bringDNSZone", - "type": "Microsoft.Common.OptionsGroup", - "label": "Use an existing Azure DNS Zone", - "defaultValue": "No", - "toolTip": "Select 'Yes' to configure Custom DNS Alias based on an existing Azure DNS Zone. Select 'No' to create an Azure DNS Zone and Custom DNS Alias.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": true - }, - { - "label": "No", - "value": false - } - ] - }, - "visible": "[steps('section_dnsConfiguration').enableDNSConfiguration]" - }, - { - "name": "dnszoneName", - "type": "Microsoft.Common.TextBox", - "label": "DNS Zone Name", - "defaultValue": "", - "toolTip": "Each label must only contain letters, numbers, underscores, and dashes. Use periods to separate Domains", - "constraints": { - "required": true, - "regex": "^([0-9a-zA-Z_-]{1,63}\\.){1,33}[0-9a-zA-Z_-]{1,63}$", - "validationMessage": "There must be between 2 and 34 labels. For example, \"contoso.com\" has 2 labels. Each label must contain between 1 and 63 characters. Each label must only contain letters, numbers, underscores, and dashes." - }, - "visible": "[steps('section_dnsConfiguration').enableDNSConfiguration]" - }, - { - "name": "dnsZoneResourceGroup", - "type": "Microsoft.Common.TextBox", - "label": "Name of the resource group contains the DNS Zone in current subscription", - "defaultValue": "", - "toolTip": "Name of the resource group which contains the DNS Zone in current subscription", - "constraints": { - "required": true, - "regex": "^[a-z0-9A-Z.\\-_()]{0,89}([a-z0-9A-Z\\-_()]{1}){3,63}$", - "validationMessage": "[if(greater(length(steps('section_dnsConfiguration').dnsZoneResourceGroup), 90),'Resource group names only allow up to 90 characters.', 'Resource group names only allow alphanumeric characters, periods, underscores, hyphens and parenthesis and cannot end in a period.')]" - }, - "visible": "[and(steps('section_dnsConfiguration').enableDNSConfiguration,steps('section_dnsConfiguration').bringDNSZone)]" - }, - { - "name": "dnszoneAdminConsoleLabel", - "type": "Microsoft.Common.TextBox", - "label": "Label for Oracle WebLogic Server Administration Console", - "defaultValue": "admin", - "toolTip": "Specify a label to generate subdomain of Oracle WebLogic Server Administration Console", - "constraints": { - "required": true, - "validations": [ - { - "regex": "^([0-9a-zA-Z_-]{1,63}\\.){0,33}[0-9a-zA-Z_-]{1,63}$", - "message": "Each label must contain between 1 and 63 characters. Each label must only contain letters, numbers, underscores, and dashes." - }, - { - "isValid": "[less(sub(length(concat(steps('section_dnsConfiguration').dnszoneAdminConsoleLabel,'.',steps('section_dnsConfiguration').dnszoneName)),length(replace(concat(steps('section_dnsConfiguration').dnszoneAdminConsoleLabel,'.',steps('section_dnsConfiguration').dnszoneName), '.', ''))),34)]", - "message": "Subdomain must be between 2 and 34 labels. For example, \"admin.contoso.com\" has 3 labels." - } - ] - }, - "visible": "[and(steps('section_dnsConfiguration').enableDNSConfiguration, not(equals(steps('section_appGateway').loadBalancingOptions,'none')))]" - }, - { - "name": "dnszoneAdminT3ChannelLabel", - "type": "Microsoft.Common.TextBox", - "label": "Label for Oracle WebLogic Administration Server T3 channel", - "defaultValue": "admin-t3", - "toolTip": "Specify a label to generate subdomain of Oracle WebLogic Administration Server T3 channel", - "constraints": { - "required": true, - "validations": [ - { - "regex": "^([0-9a-zA-Z_-]{1,63}\\.){0,33}[0-9a-zA-Z_-]{1,63}$", - "message": "Each label must contain between 1 and 63 characters. Each label must only contain letters, numbers, underscores, and dashes." - }, - { - "isValid": "[less(sub(length(concat(steps('section_dnsConfiguration').dnszoneAdminT3ChannelLabel,'.',steps('section_dnsConfiguration').dnszoneName)),length(replace(concat(steps('section_dnsConfiguration').dnszoneAdminT3ChannelLabel,'.',steps('section_dnsConfiguration').dnszoneName), '.', ''))),34)]", - "message": "Subdomain must be between 2 and 34 labels. For example, \"admin-t3.contoso.com\" has 3 labels." - } - ] - }, - "visible": "[and(steps('section_dnsConfiguration').enableDNSConfiguration,basics('basicsOptional').enableAdminT3Tunneling, equals(steps('section_appGateway').loadBalancingOptions,'lbservice'))]" - }, - { - "name": "dnszoneGatewayLabel", - "type": "Microsoft.Common.TextBox", - "label": "Label for WebLogic Cluster", - "defaultValue": "www", - "toolTip": "Specify a label to generate subdomain of WebLogic Cluster", - "constraints": { - "required": true, - "validations": [ - { - "regex": "^([0-9a-zA-Z_-]{1,63}\\.){0,33}[0-9a-zA-Z_-]{1,63}$", - "message": "Each label must contain between 1 and 63 characters. Each label must only contain letters, numbers, underscores, and dashes." - }, - { - "isValid": "[less(sub(length(concat(if(empty(steps('section_dnsConfiguration').dnszoneGatewayLabel), '', steps('section_dnsConfiguration').dnszoneGatewayLabel),'.',steps('section_dnsConfiguration').dnszoneName)),length(replace(concat(if(empty(steps('section_dnsConfiguration').dnszoneGatewayLabel), '', steps('section_dnsConfiguration').dnszoneGatewayLabel),'.',steps('section_dnsConfiguration').dnszoneName), '.', ''))),34)]", - "message": "Subdomain must be between 2 and 34 labels. For example, \"applications.contoso.com\" has 3 labels." - } - ] - }, - "visible": "[and(steps('section_dnsConfiguration').enableDNSConfiguration, not(equals(steps('section_appGateway').loadBalancingOptions,'none')))]" - }, - { - "name": "dnszoneClusterT3ChannelLabel", - "type": "Microsoft.Common.TextBox", - "label": "Label for Oracle WebLogic cluster T3 channel", - "defaultValue": "cluster-t3", - "toolTip": "Specify a label to generate subdomain of Oracle WebLogic cluster T3 channel", - "constraints": { - "required": true, - "validations": [ - { - "regex": "^([0-9a-zA-Z_-]{1,63}\\.){0,33}[0-9a-zA-Z_-]{1,63}$", - "message": "Each label must contain between 1 and 63 characters. Each label must only contain letters, numbers, underscores, and dashes." - }, - { - "isValid": "[less(sub(length(concat(steps('section_dnsConfiguration').dnszoneClusterT3ChannelLabel,'.',steps('section_dnsConfiguration').dnszoneName)),length(replace(concat(steps('section_dnsConfiguration').dnszoneClusterT3ChannelLabel,'.',steps('section_dnsConfiguration').dnszoneName), '.', ''))),34)]", - "message": "Subdomain must be between 2 and 34 labels. For example, \"application-t3.contoso.com\" has 3 labels." - } - ] - }, - "visible": "[and(steps('section_dnsConfiguration').enableDNSConfiguration,basics('basicsOptional').enableClusterT3Tunneling, equals(steps('section_appGateway').loadBalancingOptions,'lbservice'))]" - } - ] - }, - { - "name": "section_database", - "type": "Microsoft.Common.Section", - "label": "Database", - "subLabel": { - "preValidation": "Configure integrations to database", - "postValidation": "Done" - }, - "bladeTitle": "Database", - "elements": [ - { - "name": "aboutDatabase", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "Selecting 'Yes' here and providing the configuration will cause the offer to configure the WebLogic Server to connect to the desired pre-existing database. The database must be network accessible to the VNET and subnets created by the offer." - } - }, - { - "name": "enableDB", - "type": "Microsoft.Common.OptionsGroup", - "label": "Connect to database?", - "defaultValue": "No", - "toolTip": "Select 'Yes' and provide required info to configure the connection to a database.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": "true" - }, - { - "label": "No", - "value": "false" - } - ], - "required": true - } - }, - { - "name": "databaseConnectionInfo", - "type": "Microsoft.Common.Section", - "label": "Connection settings", - "elements": [ - { - "name": "databaseType", - "type": "Microsoft.Common.DropDown", - "label": "Choose database type", - "toolTip": "Choose database type", - "defaultValue": "Oracle database", - "constraints": { - "allowedValues": [ - { - "label": "PostgreSQL (Supports passwordless connection)", - "value": "postgresql" - }, - { - "label": "Oracle database", - "value": "oracle" - }, - { - "label": "Microsoft SQL Server (Supports passwordless connection)", - "value": "sqlserver" - }, - { - "label": "MySQL (Supports passwordless connection)", - "value": "mysql" - }, - { - "label": "Other", - "value": "otherdb" - } - ], - "required": true - }, - "visible": true - }, - { - "name": "mysqlJDBCDriverInfo", - "type": "Microsoft.Common.InfoBox", - "visible": "[and(bool(steps('section_database').enableDB),equals(steps('section_database').databaseConnectionInfo.databaseType, 'mysql'))]", - "options": { - "icon": "Info", - "text": "To support passwordless connection and various functionalities, the offer will upgrade the
    Oracle WebLogic Server MySQL driver with recent MySQL Connector Java driver." - } - }, - { - "name": "jdbcDataSourceName", - "type": "Microsoft.Common.TextBox", - "label": "JNDI Name", - "toolTip": "The JNDI name for the database JDBC connection", - "defaultValue": "", - "constraints": { - "required": true, - "regex": "^[a-zA-Z0-9./_-]{1,30}$", - "validationMessage": "The value must be 1-30 characters long and must only contain letters, numbers, hyphens (-), underscores (_), periods (.) and slashes (/)." - }, - "visible": true - }, - { - "name": "dsConnectionURL", - "type": "Microsoft.Common.TextBox", - "label": "DataSource Connection String", - "toolTip": "The JDBC connection string for the database", - "defaultValue": "", - "constraints": { - "required": true, - "validations": [ - { - "regex": "^jdbc:.*$", - "message": "A valid JDBC URL must start with 'jdbc:'." - }, - { - "isValid": "[startsWith(steps('section_database').databaseConnectionInfo.dsConnectionURL, concat('jdbc:', steps('section_database').databaseConnectionInfo.databaseType))]", - "message": "A valid JDBC URL for the chosen database type must be provided." - }, - { - "isValid": "[if(and(bool(steps('section_database').databaseConnectionInfo.enablePswlessConnection), equals(steps('section_database').databaseConnectionInfo.databaseType, 'mysql')), and(not(contains(steps('section_database').databaseConnectionInfo.dsConnectionURL, 'defaultAuthenticationPlugin')),not(contains(steps('section_database').databaseConnectionInfo.dsConnectionURL, 'authenticationPlugins')), not(contains(steps('section_database').databaseConnectionInfo.dsConnectionURL, 'azure.clientId'))), 'true')]", - "message": "The offer will append defaultAuthenticationPlugin, authenticationPlugins with Azure provided plugins, and append azure.clientId with your managed identity client ID automatically, please do not specify them in your connection string." - }, - { - "isValid": "[if(and(bool(steps('section_database').databaseConnectionInfo.enablePswlessConnection), equals(steps('section_database').databaseConnectionInfo.databaseType, 'postgresql')), and(not(contains(steps('section_database').databaseConnectionInfo.dsConnectionURL, 'authenticationPluginClassName')),not(contains(steps('section_database').databaseConnectionInfo.dsConnectionURL, 'azure.clientId'))), 'true')]", - "message": "The offer will append authenticationPluginClassName with Azure provided plugins, and append azure.clientId with your managed identity client ID automatically, please do not specify them in your connection string." - }, - { - "isValid": "[if(and(bool(steps('section_database').databaseConnectionInfo.enablePswlessConnection0),equals(steps('section_database').databaseConnectionInfo.databaseType, 'sqlserver')), greater(length(steps('section_database').databaseConnectionInfo.dbIdentity.userAssignedIdentities),0), bool('true'))]", - "message": "You must select at least one managed identity that has access to your database." - } - ] - }, - "visible": "[and(bool(steps('section_database').enableDB), not(equals(steps('section_database').databaseConnectionInfo.databaseType, 'otherdb')))]" - }, - { - "name": "dsConnectionURL2", - "type": "Microsoft.Common.TextBox", - "label": "DataSource Connection String", - "toolTip": "The JDBC connection string for the database", - "defaultValue": "", - "constraints": { - "required": true, - "regex": "^jdbc:.*$", - "validationMessage": "A valid JDBC URL for the chosen database type must be provided" - }, - "visible": "[and(bool(steps('section_database').enableDB), equals(steps('section_database').databaseConnectionInfo.databaseType, 'otherdb'))]" - }, - { - "name": "dbGlobalTranPro", - "type": "Microsoft.Common.DropDown", - "label": "Global transactions protocol", - "defaultValue": "OnePhaseCommit", - "multiLine": true, - "toolTip": "Determines the transaction protocol (global transaction processing behavior) for the data source.", - "constraints": { - "allowedValues": [ - { - "label": "TwoPhaseCommit", - "description": "Standard XA transaction processing. Requires an XA driver.", - "value": "TwoPhaseCommit" - }, - { - "label": "LoggingLastResource", - "description": "A performance enhancement for one non-XA resource.", - "value": "LoggingLastResource" - }, - { - "label": "EmulateTwoPhaseCommit", - "description": "Enables one non-XA resource to participate in a global transaction, but has some risk to data.", - "value": "EmulateTwoPhaseCommit" - }, - { - "label": "OnePhaseCommit", - "description": "One-phase XA transaction processing using a non-XA driver. This is the default setting.", - "value": "OnePhaseCommit" - }, - { - "label": "None", - "description": "Support for local transactions only.", - "value": "None" - } - ], - "required": true - }, - "visible": true - }, - { - "name": "enablePswlessConnection0", - "type": "Microsoft.Common.CheckBox", - "label": "Use passwordless datasource connection", - "toolTip": "Use passwordless datasource connection.", - "visible": "[and(bool(steps('section_database').enableDB),equals(steps('section_database').databaseConnectionInfo.databaseType, 'sqlserver'))]" - }, - { - "name": "dbUser", - "type": "Microsoft.Common.TextBox", - "label": "Database username", - "toolTip": "Use only letters and numbers", - "defaultValue": "", - "constraints": { - "required": true, - "validations": [ - { - "regex": "^(?=.{1,128}$)[a-zA-Z](?!.*--)(?!.*@@)(?!.*-@)(?!.*@-)[a-zA-Z0-9-@]*[a-zA-Z0-9]$", - "message": "The value must be 1-128 characters long and must only contain letters, numbers, hyphen(-) and the at sign, no hyphen allowed at the beginning and the end of database username." - }, - { - "isValid": "[if(bool(steps('section_database').databaseConnectionInfo.enablePswlessConnection), greater(length(steps('section_database').databaseConnectionInfo.dbIdentity.userAssignedIdentities),0), bool('true'))]", - "message": "You must select at least one managed identity that has access to your database." - } - ] - }, - "visible": "[and(bool(steps('section_database').enableDB), not(and(steps('section_database').databaseConnectionInfo.enablePswlessConnection0, equals(steps('section_database').databaseConnectionInfo.databaseType, 'sqlserver'))))]" - }, - { - "name": "enablePswlessConnection", - "type": "Microsoft.Common.CheckBox", - "label": "Use passwordless datasource connection", - "toolTip": "Use passwordless datasource connection.", - "visible": "[and(bool(steps('section_database').enableDB),or(equals(steps('section_database').databaseConnectionInfo.databaseType, 'mysql'),equals(steps('section_database').databaseConnectionInfo.databaseType, 'postgresql')))]" - }, - { - "name": "dbPassword", - "type": "Microsoft.Common.PasswordBox", - "label": { - "password": "Database Password", - "confirmPassword": "Confirm password" - }, - "toolTip": "Database Password", - "constraints": { - "required": true, - "regex": "^((?=.*[0-9])(?=.*[a-zA-Z!@#$%^&*])).{6,128}$", - "validationMessage": "The password must be between 6 and 128 characters long and have at least one number." - }, - "options": { - "hideConfirmation": false - }, - "visible": "[and(bool(steps('section_database').enableDB), not(or(steps('section_database').databaseConnectionInfo.enablePswlessConnection, steps('section_database').databaseConnectionInfo.enablePswlessConnection0)))]" - }, - { - "name": "dbIdentity", - "type": "Microsoft.ManagedIdentity.IdentitySelector", - "label": "Connect database with Managed Identity", - "toolTip": { - "userAssignedIdentity": "Select a user assigned identity that has access to your database. For how to create a database user for your managed identity, see https://aka.ms/javaee-db-identity." - }, - "defaultValue": { - "systemAssignedIdentity": "Off" - }, - "options": { - "hideSystemAssignedIdentity": true, - "hideUserAssignedIdentity": false - }, - "visible": "[and(bool(steps('section_database').enableDB), or(steps('section_database').databaseConnectionInfo.enablePswlessConnection, steps('section_database').databaseConnectionInfo.enablePswlessConnection0))]" - }, - { - "name": "dbDriverLibraries", - "type": "Microsoft.Common.FileUpload", - "label": "DataSource driver (.jar)", - "toolTip": "The datasource driver jar package for the specified database.", - "constraints": { - "required": true, - "accept": ".jar" - }, - "options": { - "multiple": true, - "uploadMode": "url", - "openMode": "binary" - }, - "visible": "[and(bool(steps('section_database').enableDB), equals(steps('section_database').databaseConnectionInfo.databaseType, 'otherdb'))]" - }, - { - "name": "dbDriverInfoBox", - "type": "Microsoft.Common.InfoBox", - "options": { - "icon": "Info", - "text": "WebLogic Server provides support for application data access to any database using a JDBC-compliant driver.
    Select here for more details.", - "uri": "https://aka.ms/wls-aks-dbdriver" - }, - "visible": "[and(bool(steps('section_database').enableDB), equals(steps('section_database').databaseConnectionInfo.databaseType, 'otherdb'))]" - }, - { - "name": "dbDriverName", - "type": "Microsoft.Common.TextBox", - "label": "DataSource driver name", - "toolTip": "The driver name for the database", - "placeholder": "com.informix.jdbc.IfxDriver", - "constraints": { - "required": true, - "regex": "^[a-zA-Z_][a-zA-Z0-9_]+(\\.[a-zA-Z_][a-zA-Z0-9_]+){1,50}$", - "validationMessage": "A valid driver name for the chosen database type must be provided" - }, - "visible": "[and(bool(steps('section_database').enableDB), equals(steps('section_database').databaseConnectionInfo.databaseType, 'otherdb'))]" - }, - { - "name": "dbTestTableName", - "type": "Microsoft.Common.TextBox", - "label": "Test table name", - "toolTip": "The name of the database table to use when testing physical database connections. ", - "constraints": { - "required": true, - "regex": "^.*$", - "validationMessage": "A test table name for the chosen database type must be provided" - }, - "visible": "[and(bool(steps('section_database').enableDB), equals(steps('section_database').databaseConnectionInfo.databaseType, 'otherdb'))]" - } - ], - "visible": "[bool(steps('section_database').enableDB)]" - } - ] - }, - { - "name": "section_autoScaling", - "type": "Microsoft.Common.Section", - "label": "Autoscaling", - "subLabel": { - "preValidation": "Configure Horizontal Autoscaling", - "postValidation": "Done" - }, - "bladeTitle": "Horizontal Autoscaling", - "elements": [ - { - "name": "aboutAutoscaling", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "Selecting 'Yes' here and providing the configuration will cause the offer configure metric to scale the WebLogic cluster." - } - }, - { - "name": "enableAutoscaling", - "type": "Microsoft.Common.OptionsGroup", - "label": "Provision resources for horizontal autoscaling?", - "defaultValue": "No", - "toolTip": "Select 'Yes' and provide required info to configure horizontal autoscaling.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": "true" - }, - { - "label": "No", - "value": "false" - } - ], - "required": true - } - }, - { - "name": "autoScalingInfo", - "type": "Microsoft.Common.Section", - "label": "Horizontal autoscaling settings", - "elements": [ - { - "name": "metricSource", - "type": "Microsoft.Common.OptionsGroup", - "label": "Select autoscaling option. ", - "defaultValue": "Kubernetes Metrics Server (simple autoscaling)", - "toolTip": "If you select Kubernetes Metrics Server, this offer configures WebLogic Server to scale based on CPU or memory utilization. If you select WebLogic Monitoring Exporter, this offer configures WebLogic Monitoring Exporter to scrape WebLogic Server metrics and feed them to Azure Monitor Managed Service for Prometheus; integrates KEDA with your AKS cluster to monitor Azure Monitor workspace and feed data to AKS. You can create KEDA scaler based on Java metrics from Azure Monitor workspace", - "constraints": { - "allowedValues": [ - { - "label": "Kubernetes Metrics Server (simple autoscaling)", - "value": "kms" - }, - { - "label": "WebLogic Monitoring Exporter (advanced autoscaling)", - "value": "wme" - } - ], - "required": true - }, - "visible": true - }, - { - "name": "infoKms", - "type": "Microsoft.Common.InfoBox", - "visible": "[equals(steps('section_autoScaling').autoScalingInfo.metricSource, 'kms')]", - "options": { - "icon": "None", - "text": "This option configures and runs Kubernetes Horizontal Pod Autoscaler (HPA) to scale a WebLogic cluster, based on the CPU or memory utilization. The HPA autoscales WebLogic Server instances from a minimum of 1 cluster members up to maximum of cluster members, and the scale up or down action occur when the average CPU/memory is consistently over the utilization.
  • Default maximum of cluster member is 5. You can set it from Basics -> Optional Basic Configuration -> Maximum dynamic cluster size.
  • Default CPU request is 200m.
  • Default memory request is 1.5Gi.
  • ", - "uri": "https://aka.ms/wlsoperator-autoscaling-hpa" - } - }, - { - "name": "infoWme", - "type": "Microsoft.Common.InfoBox", - "visible": "[equals(steps('section_autoScaling').autoScalingInfo.metricSource, 'wme')]", - "options": { - "icon": "None", - "text": "This option installs all the software necessary to allow you to create Java metric aware KEDA scaling rules.
    The offer provisions the following deployments. Right-click and select Open Link in New Tab to follow links:
    After the provisioning is completed, you can create KEDA scaling rules. A sample rule is provided in the deployment outputs. The following steps show how to see the sample rule.
    • View the resource group for this deployment in the Azure portal.
    • In the Settings section, select Deployments.
    • Select the oldest deployment. The name of the deployment looks similar to oracle.20210620-wls-on-aks.
    • Select Outputs.
    • The shellCmdtoOutputKedaScalerSample value is the base64 string of a scaler sample. Copy the value and run it in your terminal.
    • For guidance on how to complete the configuration, see Tutorial: Migrate Oracle WebLogic Server to AKS with KEDA scaler based on Prometheus Metrics
    ", - "uri": "https://aka.ms/wls-aks-keda-scaler" - } - }, - { - "name": "kmsMetrics", - "type": "Microsoft.Common.OptionsGroup", - "label": "Select metric. ", - "defaultValue": "Average CPU Utilization", - "toolTip": "Select metric.", - "constraints": { - "allowedValues": [ - { - "label": "Average CPU Utilization", - "value": "cpu" - }, - { - "label": "Average Memory Utilization", - "value": "memory" - } - ], - "required": true - }, - "visible": "[equals(steps('section_autoScaling').autoScalingInfo.metricSource, 'kms')]" - }, - { - "name": "averageCpuUtilization", - "type": "Microsoft.Common.Slider", - "min": 10, - "max": 100, - "label": "Average CPU Utilization", - "subLabel": "Percent", - "defaultValue": 60, - "showStepMarkers": false, - "toolTip": "Pick Average CPU Utilization in Percent", - "constraints": { - "required": false - }, - "visible": "[equals(steps('section_autoScaling').autoScalingInfo.kmsMetrics, 'cpu')]" - }, - { - "name": "averageMemoryUtilization", - "type": "Microsoft.Common.Slider", - "min": 10, - "max": 100, - "label": "Average Memory Utilization", - "subLabel": "Percent", - "defaultValue": 60, - "showStepMarkers": false, - "toolTip": "Pick Average Memory Utilization in Percent", - "constraints": { - "required": false - }, - "visible": "[equals(steps('section_autoScaling').autoScalingInfo.kmsMetrics, 'memory')]" - } - ], - "visible": "[bool(steps('section_autoScaling').enableAutoscaling)]" - } - ] - }, - { - "name": "tags", - "label": "Tags", - "elements": [ - { - "name": "tagsByResource", - "type": "Microsoft.Common.TagsByResource", - "resources": [ - "${identifier.managedClusters}", - "${identifier.applicationGateways}", - "${identifier.registries}", - "${identifier.virtualMachines}", - "${identifier.virtualMachinesExtensions}", - "${identifier.virtualNetworks}", - "${identifier.networkInterfaces}", - "${identifier.networkSecurityGroups}", - "${identifier.publicIPAddresses}", - "${identifier.storageAccounts}", - "${identifier.vaults}", - "${identifier.userAssignedIdentities}", - "${identifier.dnszones}", - "${identifier.workspaces}", - "${identifier.accounts}", - "${identifier.deploymentScripts}" - ], - "toolTip": "Tags help you organize your resources and categorize them for billing or management purposes. You can apply tags to resources deployed by the offer." - } - ] - } - ], - "outputs": { - "acrName": "[last(split(steps('section_aks').imageInfo.oracleAcrSelector.id, '/'))]", - "acrResourceGroupName": "[last(take(split(steps('section_aks').imageInfo.oracleAcrSelector.id, '/'),5))]", - "aksAgentPoolNodeCount": "[steps('section_aks').clusterInfo.aksNodeCount]", - "aksAgentPoolNodeMaxCount": "[steps('section_aks').clusterInfo.aksNodeMaxCount]", - "aksClusterName": "[last(split(steps('section_aks').clusterInfo.aksClusterSelector.id, '/'))]", - "aksClusterRGName": "[last(take(split(steps('section_aks').clusterInfo.aksClusterSelector.id, '/'), 5))]", - "appGatewayCertificateOption": "[steps('section_appGateway').appgwIngress.certificateOption]", - "appGatewaySSLBackendRootCertData": "[steps('section_appGateway').appgwIngress.uploadedSSLCertData]", - "appGatewaySSLCertData": "[steps('section_appGateway').appgwIngress.appGatewaySSLCertData]", - "appGatewaySSLCertPassword": "[steps('section_appGateway').appgwIngress.appGatewaySSLCertPassword]", - "appgwForAdminServer": "[steps('section_appGateway').appgwIngress.appgwForAdminServer]", - "appgwForRemoteConsole": "[steps('section_appGateway').appgwIngress.appgwForAdminRemote]", - "appgwUsePrivateIP": "[steps('section_appGateway').appgwIngress.appgwUsePrivateIP]", - "appPackageUrls": "[steps('section_aks').jeeAppInfo.appPackageUrl]", - "appReplicas": "[int(steps('section_aks').jeeAppInfo.appReplicas)]", - "averageCpuUtilization": "[steps('section_autoScaling').autoScalingInfo.averageCpuUtilization]", - "averageMemoryUtilization": "[steps('section_autoScaling').autoScalingInfo.averageMemoryUtilization]", - "createACR": "[bool(steps('section_aks').imageInfo.oracleCreateACR)]", - "createAKSCluster": "[bool(steps('section_aks').clusterInfo.createAKSCluster)]", - "createDNSZone": "[not(bool(steps('section_dnsConfiguration').bringDNSZone))]", - "dbDriverLibrariesUrls": "[steps('section_database').databaseConnectionInfo.dbDriverLibraries]", - "dbDriverName": "[steps('section_database').databaseConnectionInfo.dbDriverName]", - "dbGlobalTranPro": "[steps('section_database').databaseConnectionInfo.dbGlobalTranPro]", - "dbIdentity": "[steps('section_database').databaseConnectionInfo.dbIdentity]", - "dbPassword": "[steps('section_database').databaseConnectionInfo.dbPassword]", - "dbTestTableName": "[steps('section_database').databaseConnectionInfo.dbTestTableName]", - "dbUser": "[steps('section_database').databaseConnectionInfo.dbUser]", - "databaseType": "[steps('section_database').databaseConnectionInfo.databaseType]", - "dnszoneAdminConsoleLabel": "[steps('section_dnsConfiguration').dnszoneAdminConsoleLabel]", - "dnszoneAdminT3ChannelLabel": "[steps('section_dnsConfiguration').dnszoneAdminT3ChannelLabel]", - "dnszoneClusterLabel": "[steps('section_dnsConfiguration').dnszoneGatewayLabel]", - "dnszoneClusterT3ChannelLabel": "[steps('section_dnsConfiguration').dnszoneClusterT3ChannelLabel]", - "dnszoneName": "[steps('section_dnsConfiguration').dnszoneName]", - "dnszoneRGName": "[steps('section_dnsConfiguration').dnsZoneResourceGroup]", - "dsConnectionURL": "[coalesce(steps('section_database').databaseConnectionInfo.dsConnectionURL, steps('section_database').databaseConnectionInfo.dsConnectionURL2, 'null')]", - "enableAppGWIngress": "[equals(steps('section_appGateway').loadBalancingOptions, 'agic')]", - "enableAutoscaling": "[bool(steps('section_autoScaling').enableAutoscaling)]", - "enableAzureMonitoring": "[bool(steps('section_aks').aksAdvancedInfo.enableAzureMonitoring)]", - "enableAzureFileShare": "[bool(steps('section_aks').aksAdvancedInfo.enableAzureFileShare)]", - "enableCookieBasedAffinity": "[not(bool(steps('section_appGateway').appgwIngress.enableCookieBasedAffinity))]", - "enableCustomSSL": "[bool(steps('section_sslConfiguration').enableCustomSSL)]", - "enableDB": "[bool(steps('section_database').enableDB)]", - "enableDNSConfiguration": "[bool(steps('section_dnsConfiguration').enableDNSConfiguration)]", - "enableAdminT3Tunneling": "[basics('basicsOptional').enableAdminT3Tunneling]", - "enableClusterT3Tunneling": "[basics('basicsOptional').enableClusterT3Tunneling]", - "enablePswlessConnection": "[or(bool(steps('section_database').databaseConnectionInfo.enablePswlessConnection), bool(steps('section_database').databaseConnectionInfo.enablePswlessConnection0))]", - "jdbcDataSourceName": "[steps('section_database').databaseConnectionInfo.jdbcDataSourceName]", - "isSSOSupportEntitled": "[bool(steps('section_aks').imageInfo.isSSOSupportEntitled)]", - "lbSvcValues": "[if(not(empty(first(if(empty(steps('section_appGateway').lbSVCInfo.lbSVC),parse('[{\"colName\":\"\"}]'), steps('section_appGateway').lbSVCInfo.lbSVC)).colName)),steps('section_appGateway').lbSVCInfo.lbSVC, parse('[]'))]", - "location": "[location()]", - "hpaScaleType": "[steps('section_autoScaling').autoScalingInfo.kmsMetrics]", - "managedServerPrefix": "[basics('basicsOptional').managedServerPrefix]", - "newOrExistingVnetForApplicationGateway": "[steps('section_appGateway').appgwIngress.vnetForApplicationGateway.newOrExisting]", - "ocrSSOPSW": "[steps('section_aks').imageInfo.ocrSSOPassword]", - "ocrSSOUser": "[steps('section_aks').imageInfo.ocrSSOUserName]", - "sslUploadedCustomIdentityKeyStoreData": "[steps('section_sslConfiguration').uploadedCustomSSLSettings.uploadedCustomIdentityKeyStoreData]", - "sslUploadedCustomIdentityKeyStorePassphrase": "[steps('section_sslConfiguration').uploadedCustomSSLSettings.uploadedCustomIdentityKeyStorePassphrase]", - "sslUploadedCustomIdentityKeyStoreType": "[steps('section_sslConfiguration').uploadedCustomSSLSettings.uploadedCustomIdentityKeyStoreType]", - "sslUploadedCustomTrustKeyStoreData": "[steps('section_sslConfiguration').uploadedCustomSSLSettings.uploadedCustomTrustKeyStoreData]", - "sslUploadedCustomTrustKeyStorePassPhrase": "[steps('section_sslConfiguration').uploadedCustomSSLSettings.uploadedCustomTrustKeyStorePassPhrase]", - "sslUploadedCustomTrustKeyStoreType": "[steps('section_sslConfiguration').uploadedCustomSSLSettings.uploadedCustomTrustKeyStoreType]", - "sslUploadedPrivateKeyAlias": "[steps('section_sslConfiguration').uploadedCustomSSLSettings.uploadedPrivateKeyAlias]", - "sslUploadedPrivateKeyPassPhrase": "[steps('section_sslConfiguration').uploadedCustomSSLSettings.uploadedPrivateKeyPassPhrase]", - "useHpa": "[if(equals(steps('section_autoScaling').autoScalingInfo.metricSource, 'kms'), true, false)]", - "useInternalLB": "[bool(steps('section_appGateway').lbSVCInfo.enableInternalLB)]", - "useOracleImage": "[if(bool(steps('section_aks').aksAdvancedInfo.useAcrImage), false, true)]", - "userProvidedAcr": "[last(split(steps('section_aks').aksAdvancedInfo.userProvidedAcrSelector.id, '/'))]", - "userProvidedAcrRgName": "[last(take(split(steps('section_aks').aksAdvancedInfo.userProvidedAcrSelector.id, '/'),5))]", - "userProvidedImagePath": "[steps('section_aks').aksAdvancedInfo.userProvidedImagePath]", - "validateApplications": true, - "vnetForApplicationGateway": "[steps('section_appGateway').appgwIngress.vnetForApplicationGateway]", - "vnetRGNameForApplicationGateway": "[steps('section_appGateway').appgwIngress.vnetForApplicationGateway.resourceGroup]", - "vmSize": "[steps('section_aks').clusterInfo.nodeVMSizeSelector]", - "wdtRuntimePassword": "[basics('basicsRequired').wdtRuntimePassword]", - "wlsClusterSize": "[basics('basicsOptional').wlsClusterSize]", - "wlsDomainName": "[basics('basicsOptional').wlsDomainName]", - "wlsDomainUID": "[basics('basicsOptional').wlsDomainUID]", - "wlsImageTag": "[if(equals(steps('section_aks').imageInfo.oracleImageSelector, 'others'), steps('section_aks').imageInfo.fromOracleImage, steps('section_aks').imageInfo.oracleImageSelector)]", - "wlsJavaOption": "[basics('basicsOptional').wlsJavaOption]", - "wlsPassword": "[basics('basicsRequired').wlsPassword]", - "wlsUserName": "[basics('basicsRequired').wlsUserName]", - "tagsByResource": "[steps('tags').tagsByResource]" - } - } -} diff --git a/weblogic-azure-aks/src/main/arm/scripts/buildWLSDockerImage.sh b/weblogic-azure-aks/src/main/arm/scripts/buildWLSDockerImage.sh deleted file mode 100644 index 03dc722df..000000000 --- a/weblogic-azure-aks/src/main/arm/scripts/buildWLSDockerImage.sh +++ /dev/null @@ -1,478 +0,0 @@ -# Copyright (c) 2021, Oracle Corporation and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -echo "Script ${0} starts" - -#Function to output message to StdErr -function echo_stderr() { - echo "$@" >&2 -} - -# read and from stdin -function read_sensitive_parameters_from_stdin() { - read azureACRPassword ocrSSOPSW -} - -#Function to display usage message -function usage() { - echo " | ./buildWLSDockerImage.sh " - if [ $1 -eq 1 ]; then - exit 1 - fi -} - -# Validate teminal status with $?, exit if errors happen. -function validate_status() { - if [ $? == 1 ]; then - echo "$@" >&2 - echo "Errors happen, exit 1." - exit 1 - fi -} - -function validate_inputs() { - if [ -z "$useOracleImage" ]; then - echo_stderr "userProvidedImagePath is required. " - usage 1 - fi - - if [ -z "$wlsImagePath" ]; then - echo_stderr "wlsImagePath is required. " - usage 1 - fi - - if [ -z "$azureACRServer" ]; then - echo_stderr "azureACRServer is required. " - usage 1 - fi - - if [ -z "$azureACRUserName" ]; then - echo_stderr "azureACRUserName is required. " - usage 1 - fi - - if [ -z "$azureACRPassword" ]; then - echo_stderr "azureACRPassword is required. " - usage 1 - fi - - if [ -z "$imageTag" ]; then - echo_stderr "imageTag is required. " - usage 1 - fi - - if [ -z "$appPackageUrls" ]; then - echo_stderr "appPackageUrls is required. " - usage 1 - fi - - if [[ "${useOracleImage,,}" == "${constTrue}" ]] && [ -z "$ocrSSOUser" ]; then - echo_stderr "ocrSSOUser is required. " - usage 1 - fi - - if [[ "${useOracleImage,,}" == "${constTrue}" ]] && [ -z "$ocrSSOPSW" ]; then - echo_stderr "ocrSSOPSW is required. " - usage 1 - fi - - if [ -z "$wlsClusterSize" ]; then - echo_stderr "wlsClusterSize is required. " - usage 1 - fi - - if [ -z "$enableSSL" ]; then - echo_stderr "enableSSL is required. " - usage 1 - fi - - if [ -z "$enableAdminT3Tunneling" ]; then - echo_stderr "enableAdminT3Tunneling is required. " - usage 1 - fi - - if [ -z "$enableClusterT3Tunneling" ]; then - echo_stderr "enableClusterT3Tunneling is required. " - usage 1 - fi - - if [ -z "${dbDriversUrls}" ]; then - echo_stderr "dbDriversUrls is required. " - usage 1 - fi - - appPackageUrls=$(echo $appPackageUrls | base64 -d) - dbDriversUrls=$(echo $dbDriversUrls | base64 -d) -} - -function initialize() { - if [ -d "model-images" ]; then - rm model-images -f -r - fi - - mkdir model-images - cd model-images - - # Create Model directory - mkdir wlsdeploy - mkdir wlsdeploy/config - mkdir wlsdeploy/applications - mkdir wlsdeploy/classpathLibraries - mkdir wlsdeploy/${externalJDBCLibrariesDirectoryName} -} - -function download_wdt_wit() { - local wlsToolingFamilyJsonFile=weblogic_tooling_family.json - # download the json file that has wls operator version from weblogic-azure repo. - curl -m ${curlMaxTime} --retry ${retryMaxAttempt} -fsL "${gitUrl4WLSToolingFamilyJsonFile}" -o ${wlsToolingFamilyJsonFile} - if [ $? -eq 0 ]; then - wdtDownloadURL=$(cat ${wlsToolingFamilyJsonFile} | jq ".items[] | select(.key==\"WDT\") | .downloadURL" | tr -d "\"") - echo "WDT URL: ${wdtDownloadURL}" - witDownloadURL=$(cat ${wlsToolingFamilyJsonFile} | jq ".items[] | select(.key==\"WIT\") | .downloadURL" | tr -d "\"") - echo "WIT URL: ${witDownloadURL}" - else - echo "Use latest WDT and WIT." - wdtDownloadURL="https://github.com/oracle/weblogic-deploy-tooling/releases/latest/download/weblogic-deploy.zip" - witDownloadURL="https://github.com/oracle/weblogic-image-tool/releases/latest/download/imagetool.zip" - fi - - # Download weblogic tools - curl -m ${curlMaxTime} --retry ${retryMaxAttempt} -fsL ${wdtDownloadURL} -o weblogic-deploy.zip - validate_status "Check status of weblogic-deploy.zip." - - curl -m ${curlMaxTime} --retry ${retryMaxAttempt} -fsL ${witDownloadURL} -o imagetool.zip - validate_status "Check status of imagetool.zip." -} - -function download_azure_identity_extensions() { - local myPom=pom.xml - curl -m ${curlMaxTime} --retry ${retryMaxAttempt} -fsL "${gitUrl4AzureIdentityExtensionsPomFile}" -o ${myPom} - validate_status "Check status of downloading Azure Identity Provider JDBC MySQL Pom file." - - echo "download dependencies" - mvn dependency:copy-dependencies -f ${myPom} - if [ $? -eq 0 ]; then - ls -l target/dependency/ - - mkdir wlsdeploy/classpathLibraries/azureLibraries - mkdir wlsdeploy/classpathLibraries/jackson - # fix JARs conflict issue in GA images, put jackson libraries to PRE_CLASSPATH to upgrade the existing libs. - mv target/dependency/jackson-annotations-*.jar wlsdeploy/classpathLibraries/jackson/ - mv target/dependency/jackson-core-*.jar wlsdeploy/classpathLibraries/jackson/ - mv target/dependency/jackson-databind-*.jar wlsdeploy/classpathLibraries/jackson/ - mv target/dependency/jackson-dataformat-xml-*.jar wlsdeploy/classpathLibraries/jackson/ - # Thoes jars will be appended to CLASSPATH - mv target/dependency/*.jar wlsdeploy/classpathLibraries/azureLibraries/ - else - echo "Failed to download dependencies for azure-identity-extensions" - exit 1 - fi -} - -function download_mysql_driver() { - local myPom=mysqlpom.xml - curl -m ${curlMaxTime} --retry ${retryMaxAttempt} -fsL "${gitUrl4MySQLDriverPomFile}" -o ${myPom} - validate_status "Check status of downloading MySQL driver Pom file." - - echo "download dependencies" - mvn dependency:copy-dependencies -f ${myPom} - if [ $? -eq 0 ]; then - ls -l target/dependency/ - - mkdir wlsdeploy/${constPreclassDirectoryName} - mv target/dependency/*.jar wlsdeploy/${constPreclassDirectoryName}/ - else - echo "Failed to download dependencies for mysql driver." - exit 1 - fi -} - -function install_docker_multi_arch(){ - # Install docker https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository - # Add Docker's official GPG key: - sudo apt-get -q update - sudo apt-get -y -q install ca-certificates curl - sudo install -m 0755 -d /etc/apt/keyrings - sudo curl -m ${curlMaxTime} --retry ${retryMaxAttempt} -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc - sudo chmod a+r /etc/apt/keyrings/docker.asc - - # Add the repository to Apt sources: - echo \ - "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ - $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ - sudo tee /etc/apt/sources.list.d/docker.list > /dev/null - sudo apt-get -q update - sudo apt-get -y -q install docker-ce docker-ce-cli containerd.io - - echo "docker version" - sudo docker --version - validate_status "Check status of docker." - sudo systemctl start docker -} - -function install_openjdk11_x64(){ - # Install Microsoft OpenJDK - # Valid values are only '18.04', '20.04', and '22.04' - ubuntu_release=`lsb_release -rs` - wget https://packages.microsoft.com/config/ubuntu/${ubuntu_release}/packages-microsoft-prod.deb -O packages-microsoft-prod.deb - sudo dpkg -i packages-microsoft-prod.deb - - sudo apt-get -y -q install apt-transport-https - sudo apt-get -q update - sudo apt-get -y -q install msopenjdk-11 - - echo "java version" - java -version - validate_status "Check status of OpenJDK 11." - - - export JAVA_HOME=/usr/lib/jvm/msopenjdk-11-$(dpkg --print-architecture) - if [ ! -d "${JAVA_HOME}" ]; then - echo "Java home ${JAVA_HOME} does not exist." - exit 1 - fi -} - -function install_openjdk11_arm64(){ - local zipFileName="microsoft-jdk-11.tar.gz" - sudo curl -m ${curlMaxTime} --retry ${retryMaxAttempt} -fsSL ${jdkArm64Url} -o ${zipFileName} - sudo mkdir -p /usr/lib/jvm - local dirName=$(sudo tar -xzvf ${zipFileName} | head -1 | cut -f1 -d"/") - sudo tar -xzvf ${zipFileName} - sudo mv ${dirName} msopenjdk-11-amd64 - sudo mv -f msopenjdk-11-amd64 /usr/lib/jvm/ - - export JAVA_HOME=/usr/lib/jvm/msopenjdk-11-amd64 - if [ ! -d "${JAVA_HOME}" ]; then - echo "Java home ${JAVA_HOME} does not exist" - exit 1 - fi -} - -# Install docker, zip, unzip and java -# Download WebLogic Tools -function install_utilities() { - install_docker_multi_arch - - if [[ "$(dpkg --print-architecture)" == "arm64" ]]; then - install_openjdk11_arm64 - else - install_openjdk11_x64 - fi - - sudo apt -y -q install zip - zip --help - validate_status "Check status of zip." - - sudo apt -y -q install unzip - echo "unzip version" - unzip --help - validate_status "Check status of unzip." - - sudo apt-get -y -q install jq - echo "jq version" - jq --help - validate_status "Check status of unzip." - - sudo apt -y -q install maven - mvn --help - validate_status "Check status of mvn." - - download_wdt_wit - - if [[ "${dbType}" == "postgresql" ]]; then - curl -m ${curlMaxTime} \ - --retry ${retryMaxAttempt} \ - -fL ${wlsPostgresqlDriverUrl} \ - -o ${scriptDir}/model-images/wlsdeploy/${externalJDBCLibrariesDirectoryName}/${constPostgreDriverName} - validate_status "Install postgresql driver." - fi - - if [[ "${dbType}" == "sqlserver" ]]; then - curl -m ${curlMaxTime} \ - --retry ${retryMaxAttempt} \ - -fL ${wlsMSSQLDriverUrl} \ - -o ${scriptDir}/model-images/wlsdeploy/${externalJDBCLibrariesDirectoryName}/${constMSSQLDriverName} - validate_status "Install mssql driver." - fi - - if [[ "${dbType}" == "mysql" ]]; then - download_mysql_driver - fi - - # for sqlserver. no need to install azure identity extensions - if [[ "${enablePswlessConnection,,}" == "true" ]] && [[ "${dbType}" == "mysql" || "${dbType}" == "postgresql" ]]; then - download_azure_identity_extensions - fi -} - -function install_db_drivers() { - if [ "${dbDriversUrls}" == "[]" ] || [ -z "${dbDriversUrls}" ]; then - return - fi - - local dbDriversUrls=$(echo "${dbDriversUrls:1:${#dbDriversUrls}-2}") - local dbDriversUrlsArray=$(echo $dbDriversUrls | tr "," "\n") - - for item in $dbDriversUrlsArray; do - echo ${item} - # e.g. https://wlsaksapp.blob.core.windows.net/japps/mariadb-java-client-2.7.4.jar?sp=r&se=2021-04-29T15:12:38Z&sv=2020-02-10&sr=b&sig=7grL4qP%2BcJ%2BLfDJgHXiDeQ2ZvlWosRLRQ1ciLk0Kl7M%3D - local urlWithoutQueryString="${item%\?*}" - echo $urlWithoutQueryString - local fileName="${urlWithoutQueryString##*/}" - echo $fileName - - curl -m ${curlMaxTime} --retry ${retryMaxAttempt} -fL "$item" -o ${scriptDir}/model-images/wlsdeploy/${externalJDBCLibrariesDirectoryName}/${fileName} - if [ $? -ne 0 ];then - echo "Failed to download $item" - exit 1 - fi - done -} - -# Login in OCR -# Pull weblogic image -function get_wls_image_from_ocr() { - sudo docker logout - sudo docker login ${ocrLoginServer} -u ${ocrSSOUser} -p ${ocrSSOPSW} - echo "Start to pull oracle image ${wlsImagePath} ${ocrLoginServer} ${ocrSSOUser} ${ocrSSOPSW}" - sudo docker pull -q ${wlsImagePath} - validate_status "Finish pulling image from OCR." -} - -# Get user provided image -function get_user_provided_wls_image_from_acr() { - sudo docker logout - sudo docker login ${azureACRServer} -u ${azureACRUserName} -p ${azureACRPassword} - echo "Start to pull user provided image ${wlsImagePath} ${azureACRServer} ${azureACRUserName} ${azureACRPassword}" - sudo docker pull -q ${wlsImagePath} - validate_status "Finish pulling image from OCR." -} - -# Generate model configurations -function prepare_wls_models() { - # Create configuration in model.properties - echo "Create configuration in properties file" - cat <>${scriptDir}/model.properties -CLUSTER_SIZE=${wlsClusterSize} -EOF - - echo "Starting generation of image model file..." - modelFilePath="$scriptDir/model.yaml" - - chmod ugo+x $scriptDir/genImageModel.sh - bash $scriptDir/genImageModel.sh \ - ${modelFilePath} \ - ${appPackageUrls} \ - ${enableSSL} \ - ${enableAdminT3Tunneling} \ - ${enableClusterT3Tunneling} - validate_status "Generate image model file." -} - -# Build weblogic image -# Push the image to ACR -function build_wls_image() { - # Add WDT - unzip imagetool.zip - ./imagetool/bin/imagetool.sh cache addInstaller \ - --type wdt \ - --version latest \ - --path ${scriptDir}/model-images/weblogic-deploy.zip - - # Zip wls model and applications - zip -r ${scriptDir}/model-images/archive.zip wlsdeploy - - # inspect user/group of the base image - local imageInfo=$(./imagetool/bin/imagetool.sh inspect --image ${wlsImagePath}) - # { - # "os" : { - # "id" : "ol", - # "name" : "Oracle Linux Server", - # "version" : "7.9" - # }, - # "javaHome" : "/u01/jdk", - # "javaVersion" : "1.8.0_271", - # "oracleHome" : "/u01/oracle", - # "oracleHomeGroup" : "oracle", - # "oracleHomeUser" : "oracle", - # "oracleInstalledProducts" : "WLS,COH,TOPLINK", - # "packageManager" : "YUM", - # "wlsVersion" : "12.2.1.4.0" - # } - echo ${imageInfo} - local user=${imageInfo#*oracleHomeUser} - local user=$(echo ${user%%\,*} | tr -d "\"\:\ ") - local group=${imageInfo#*oracleHomeGroup} - local group=$(echo ${group%%\,*} | tr -d "\"\:\ ") - echo "use ${user}:${group} to update the image" - - # Build image - echo "Start building WLS image." - ./imagetool/bin/imagetool.sh update \ - --tag model-in-image:WLS-v1 \ - --fromImage ${wlsImagePath} \ - --wdtModel ${scriptDir}/model.yaml \ - --wdtVariables ${scriptDir}/model.properties \ - --wdtArchive ${scriptDir}/model-images/archive.zip \ - --wdtModelOnly \ - --wdtDomainType WLS \ - --platform ${cpuPlatform} \ - --chown ${user}:${group} - - validate_status "Check status of building WLS domain image." - - sudo docker tag model-in-image:WLS-v1 ${acrImagePath} - - # Push image to ACR - sudo docker logout - sudo docker login $azureACRServer -u ${azureACRUserName} -p ${azureACRPassword} - echo "Start pushing image ${acrImagePath} to $azureACRServer." - sudo docker push -q ${acrImagePath} - validate_status "Check status of pushing WLS domain image." - echo "Finish pushing image ${acrImagePath} to $azureACRServer." -} - -# Initialize -export script="${BASH_SOURCE[0]}" -export scriptDir="$(cd "$(dirname "${script}")" && pwd)" - -source ${scriptDir}/common.sh - -export wlsImagePath=$1 -export azureACRServer=$2 -export azureACRUserName=$3 -export imageTag=$4 -export appPackageUrls=$5 -export ocrSSOUser=$6 -export wlsClusterSize=$7 -export enableSSL=$8 -export enableAdminT3Tunneling=$9 -export enableClusterT3Tunneling=${10} -export useOracleImage=${11} -export dbDriversUrls=${12} -export enablePswlessConnection=${13} -export dbType=${14} -export cpuPlatform=${15} - -export acrImagePath="$azureACRServer/aks-wls-images:${imageTag}" - -read_sensitive_parameters_from_stdin - -validate_inputs - -initialize - -install_utilities - -install_db_drivers - -if [[ "${useOracleImage,,}" == "${constTrue}" ]]; then - get_wls_image_from_ocr -else - get_user_provided_wls_image_from_acr -fi - -prepare_wls_models - -build_wls_image diff --git a/weblogic-azure-aks/src/main/arm/scripts/checkApplicationStatus.py b/weblogic-azure-aks/src/main/arm/scripts/checkApplicationStatus.py deleted file mode 100644 index 0936b1ffd..000000000 --- a/weblogic-azure-aks/src/main/arm/scripts/checkApplicationStatus.py +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright (c) 2021, Oracle Corporation and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -import sys - -def usage(): - print(sys.argv[0] + '-user -password -t3ChannelAddress
    -t3ChannelPort ') - -if len(sys.argv) < 4: - usage() - sys.exit(0) - -#domainUser is hard-coded to weblogic. You can change to other name of your choice. Command line paramter -user. -domainUser = 'weblogic' -#domainPassword will be passed by Command line parameter -password. -domainPassword = None -t3ChannelPort = None -t3ChannelAddress = None - -i = 1 -while i < len(sys.argv): - if sys.argv[i] == '-user': - domainUser = sys.argv[i + 1] - i += 2 - elif sys.argv[i] == '-password': - domainPassword = sys.argv[i + 1] - i += 2 - elif sys.argv[i] == '-t3ChannelAddress': - t3ChannelAddress = sys.argv[i + 1] - i += 2 - elif sys.argv[i] == '-t3ChannelPort': - t3ChannelPort = sys.argv[i + 1] - i += 2 - else: - print('Unexpected argument switch at position ' + str(i) + ': ' + str(sys.argv[i])) - usage() - sys.exit(1) - -t3ConnectionUri='t3://'+t3ChannelAddress+':'+t3ChannelPort -connect(domainUser, domainPassword, t3ConnectionUri) -myapps=cmo.getAppDeployments() -inactiveApp=0 -for app in myapps: - bean=getMBean('/AppDeployments/'+app.getName()+'/Targets/') - targetsbean=bean.getTargets() - for target in targetsbean: - domainRuntime() - cd('AppRuntimeStateRuntime/AppRuntimeStateRuntime') - appstatus=cmo.getCurrentState(app.getName(),target.getName()) - if appstatus != 'STATE_ACTIVE': - inactiveApp=inactiveApp+1 - serverConfig() - -# TIGHT COUPLING: this exact print text is expected to indicate a successful return. -if inactiveApp == 0: - print("Summary: all applications are active!") -else: - print("Summary: number of inactive application: " + str(inactiveApp) + '.') diff --git a/weblogic-azure-aks/src/main/arm/scripts/common.sh b/weblogic-azure-aks/src/main/arm/scripts/common.sh deleted file mode 100644 index 49b17c2df..000000000 --- a/weblogic-azure-aks/src/main/arm/scripts/common.sh +++ /dev/null @@ -1,69 +0,0 @@ -# Copyright (c) 2021, 2024, Oracle Corporation and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# This script runs on Azure Container Instance with Alpine Linux that Azure Deployment script creates. - -export checkPodStatusInterval=20 # interval of checking pod status. -export checkPodStatusMaxAttemps=200 # max attempt to check pod status. -export checkPVStateInterval=5 # interval of checking pvc status. -export checkPVStateMaxAttempt=10 # max attempt to check pvc status. -export checkSVCStateMaxAttempt=50 -export checkSVCInterval=30 #seconds -export checkAGICStatusMaxAttempt=10 -export checkAGICStatusInterval=30 -export checkIngressStateMaxAttempt=50 -export checkAcrInterval=30 -export checkAcrMaxAttempt=10 -export checkAgicInterval=30 -export checkAgicMaxAttempt=50 -export checkKedaInteval=30 -export checkKedaMaxAttempt=20 - -export constAdminT3AddressEnvName="T3_TUNNELING_ADMIN_ADDRESS" -export constAdminServerName='admin-server' -export constClusterName='cluster-1' -export constClusterT3AddressEnvName="T3_TUNNELING_CLUSTER_ADDRESS" -export constARM64Platform="arm64" -export constX86Platform="amd64" -export constMultiArchPlatform="Multi-architecture" -export constDBTypeMySQL="mysql" -export constDBTypeSqlServer="sqlserver" -export constDefaultJavaOptions="-Dlog4j2.formatMsgNoLookups=true -Dweblogic.StdoutDebugEnabled=false" # the java options will be applied to the cluster -export constDefaultJVMArgs="-Djava.security.egd=file:/dev/./urandom -Xms256m -Xmx512m -XX:MinRAMPercentage=25.0 -XX:MaxRAMPercentage=50.0 " # the JVM options will be applied to the cluster -export constDefaultAKSVersion="default" -export externalJDBCLibrariesDirectoryName="externalJDBCLibraries" -export constFalse="false" -export constTrue="true" -export constIntrospectorJobActiveDeadlineSeconds=300 # for Guaranteed Qos -export constPostgreDriverName="postgresql-42.5.1.jar" -export constMSSQLDriverName="mssql-jdbc-10.2.1.jre8.jar" -export constAzureCoreVersion="1.34.0" -export constDbPodIdentitySelector="db-pod-identity" # do not change the value -export constPreclassDirectoryName="preclassLibraries" -export constLivenessProbePeriodSeconds=30 -export constLivenessProbeTimeoutSeconds=5 -export constLivenessProbeFailureThreshold=20 -export constReadinessProbeProbePeriodSeconds=10 -export constReadinessProbeTimeoutSeconds=5 -export constReadinessProbeFailureThreshold=3 - -export curlMaxTime=120 # seconds -export ocrLoginServer="container-registry.oracle.com" -export ocrGaImagePath="middleware/weblogic" -export ocrCpuImagePath="middleware/weblogic_cpu" -export gitUrl4CpuImages="https://raw.githubusercontent.com/oracle/weblogic-azure/main/weblogic-azure-aks/src/main/resources/weblogic_cpu_images.json" -export gitUrl4AksWellTestedVersionJsonFile="https://raw.githubusercontent.com/oracle/weblogic-azure/main/weblogic-azure-aks/src/main/resources/aks_well_tested_version.json" -export gitUrl4AksToolingWellTestedVersionJsonFile="https://raw.githubusercontent.com/oracle/weblogic-azure/main/weblogic-azure-aks/src/main/resources/aks_tooling_well_tested_versions.json" -export gitUrl4WLSToolingFamilyJsonFile="https://raw.githubusercontent.com/oracle/weblogic-azure/main/weblogic-azure-aks/src/main/resources/weblogic_tooling_family.json" -export gitUrl4AzureIdentityExtensionsPomFile="https://raw.githubusercontent.com/oracle/weblogic-azure/main/weblogic-azure-aks/src/main/resources/azure-identity-extensions.xml" -export gitUrl4MySQLDriverPomFile="https://raw.githubusercontent.com/oracle/weblogic-azure/main/weblogic-azure-aks/src/main/resources/mysql-connector-java.xml" - -export optUninstallMaxTry=5 # Max attempts to wait for the operator uninstalled -export optUninstallInterval=10 - -export retryMaxAttempt=5 # retry attempt for curl command -export retryInterval=10 - -export wlsContainerName="weblogic-server" -export wlsPostgresqlDriverUrl="https://jdbc.postgresql.org/download/postgresql-42.5.1.jar" -export wlsMSSQLDriverUrl="https://repo.maven.apache.org/maven2/com/microsoft/sqlserver/mssql-jdbc/10.2.1.jre8/mssql-jdbc-10.2.1.jre8.jar" -export jdkArm64Url="https://aka.ms/download-jdk/microsoft-jdk-11.0.23-linux-aarch64.tar.gz" \ No newline at end of file diff --git a/weblogic-azure-aks/src/main/arm/scripts/createAppGatewayIngress.sh b/weblogic-azure-aks/src/main/arm/scripts/createAppGatewayIngress.sh deleted file mode 100644 index 49916b55d..000000000 --- a/weblogic-azure-aks/src/main/arm/scripts/createAppGatewayIngress.sh +++ /dev/null @@ -1,562 +0,0 @@ -# Copyright (c) 2021, 2024, Oracle Corporation and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Description: to create Azure Application Gateway ingress for the following targets. -# * [Optional] Admin console, with path host/console -# * [Optional] Admin remote console, with path host/remoteconsole -# * Cluster, with path host/* - -echo "Script ${0} starts" - -function generate_appgw_cluster_config_file_expose_https() { - clusterIngressHttpsName=${WLS_DOMAIN_UID}-cluster-appgw-ingress-https-svc - clusterAppgwIngressHttpsYamlPath=${scriptDir}/appgw-cluster-ingress-https-svc.yaml - cat <${clusterAppgwIngressHttpsYamlPath} -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: ${clusterIngressHttpsName} - namespace: ${wlsDomainNS} - labels: - weblogic.domainUID: "${WLS_DOMAIN_UID}" - azure.weblogic.target: "${constClusterName}" - azure.weblogc.createdByWlsOffer: "true" - annotations: - appgw.ingress.kubernetes.io/appgw-ssl-certificate: "${APPGW_SSL_CERT_NAME}" - appgw.ingress.kubernetes.io/use-private-ip: "${APPGW_USE_PRIVATE_IP}" - appgw.ingress.kubernetes.io/cookie-based-affinity: "${ENABLE_COOKIE_BASED_AFFINITY}" - appgw.ingress.kubernetes.io/backend-path-prefix: "/" -spec: - ingressClassName: azure-application-gateway - rules: - - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: ${svcCluster} - port: - number: ${clusterTargetPort} -EOF -} - -function generate_appgw_cluster_config_file_nossl() { - clusterIngressName=${WLS_DOMAIN_UID}-cluster-appgw-ingress-svc - clusterAppgwIngressYamlPath=${scriptDir}/appgw-cluster-ingress-svc.yaml - cat <${clusterAppgwIngressYamlPath} -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: ${clusterIngressName} - namespace: ${wlsDomainNS} - labels: - weblogic.domainUID: "${WLS_DOMAIN_UID}" - azure.weblogic.target: "${constClusterName}" - azure.weblogc.createdByWlsOffer: "true" - annotations: - appgw.ingress.kubernetes.io/use-private-ip: "${APPGW_USE_PRIVATE_IP}" - appgw.ingress.kubernetes.io/cookie-based-affinity: "${ENABLE_COOKIE_BASED_AFFINITY}" - appgw.ingress.kubernetes.io/backend-path-prefix: "/" -spec: - ingressClassName: azure-application-gateway - rules: - - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: ${svcCluster} - port: - number: ${clusterTargetPort} -EOF -} - -function generate_appgw_cluster_config_file_ssl() { - clusterIngressName=${WLS_DOMAIN_UID}-cluster-appgw-ingress-svc - clusterAppgwIngressYamlPath=${scriptDir}/appgw-cluster-ingress-svc.yaml - cat <${clusterAppgwIngressYamlPath} -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: ${clusterIngressName} - namespace: ${wlsDomainNS} - labels: - weblogic.domainUID: "${WLS_DOMAIN_UID}" - azure.weblogic.target: "${constClusterName}" - azure.weblogc.createdByWlsOffer: "true" - annotations: - appgw.ingress.kubernetes.io/ssl-redirect: "true" - appgw.ingress.kubernetes.io/backend-protocol: "https" - appgw.ingress.kubernetes.io/appgw-ssl-certificate: "${APPGW_SSL_CERT_NAME}" - appgw.ingress.kubernetes.io/use-private-ip: "${APPGW_USE_PRIVATE_IP}" - appgw.ingress.kubernetes.io/cookie-based-affinity: "${ENABLE_COOKIE_BASED_AFFINITY}" - appgw.ingress.kubernetes.io/backend-path-prefix: "/" -EOF - if [[ "${ENABLE_DNS_CONFIGURATION,,}" == "true" ]]; then - cat <>${clusterAppgwIngressYamlPath} - appgw.ingress.kubernetes.io/backend-hostname: "${DNS_CLUSTER_LABEL}.${DNS_ZONE_NAME}" -EOF - else - cat <>${clusterAppgwIngressYamlPath} - appgw.ingress.kubernetes.io/backend-hostname: "${APPGW_ALIAS}" -EOF - fi - - cat <>${clusterAppgwIngressYamlPath} - appgw.ingress.kubernetes.io/appgw-trusted-root-certificate: "${APPGW_TRUSTED_ROOT_CERT_NAME}" - -spec: - ingressClassName: azure-application-gateway - rules: - - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: ${svcCluster} - port: - number: ${clusterTargetPort} -EOF -} - -function generate_appgw_admin_config_file_nossl() { - adminIngressName=${WLS_DOMAIN_UID}-admin-appgw-ingress-svc - adminAppgwIngressYamlPath=${scriptDir}/appgw-admin-ingress-svc.yaml - cat <${adminAppgwIngressYamlPath} -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: ${adminIngressName} - namespace: ${wlsDomainNS} - labels: - weblogic.domainUID: "${WLS_DOMAIN_UID}" - azure.weblogic.target: "${constAdminServerName}" - azure.weblogc.createdByWlsOffer: "true" - annotations: - appgw.ingress.kubernetes.io/use-private-ip: "${APPGW_USE_PRIVATE_IP}" - appgw.ingress.kubernetes.io/cookie-based-affinity: "${ENABLE_COOKIE_BASED_AFFINITY}" -spec: - ingressClassName: azure-application-gateway - rules: - - http: - paths: - - path: /console* - pathType: Prefix - backend: - service: - name: ${svcAdminServer} - port: - number: ${adminTargetPort} -EOF -} - -function generate_appgw_admin_remote_config_file_nossl() { - cat <${adminRemoteAppgwIngressYamlPath} -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: ${adminRemoteIngressName} - namespace: ${wlsDomainNS} - labels: - weblogic.domainUID: "${WLS_DOMAIN_UID}" - azure.weblogic.target: "${constAdminServerName}-remote-console" - azure.weblogc.createdByWlsOffer: "true" - annotations: - appgw.ingress.kubernetes.io/backend-path-prefix: "/" - appgw.ingress.kubernetes.io/use-private-ip: "${APPGW_USE_PRIVATE_IP}" - appgw.ingress.kubernetes.io/cookie-based-affinity: "${ENABLE_COOKIE_BASED_AFFINITY}" -spec: - ingressClassName: azure-application-gateway - rules: - - http: - paths: - - path: /remoteconsole* - pathType: Prefix - backend: - service: - name: ${svcAdminServer} - port: - number: ${adminTargetPort} -EOF -} - -function generate_appgw_admin_config_file_ssl() { - adminIngressName=${WLS_DOMAIN_UID}-admin-appgw-ingress-svc - adminAppgwIngressYamlPath=${scriptDir}/appgw-admin-ingress-svc.yaml - cat <${adminAppgwIngressYamlPath} -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: ${adminIngressName} - namespace: ${wlsDomainNS} - labels: - weblogic.domainUID: "${WLS_DOMAIN_UID}" - azure.weblogic.target: "${constAdminServerName}" - azure.weblogc.createdByWlsOffer: "true" - annotations: - appgw.ingress.kubernetes.io/ssl-redirect: "true" - appgw.ingress.kubernetes.io/backend-protocol: "https" - appgw.ingress.kubernetes.io/appgw-ssl-certificate: "${APPGW_SSL_CERT_NAME}" - appgw.ingress.kubernetes.io/use-private-ip: "${APPGW_USE_PRIVATE_IP}" - appgw.ingress.kubernetes.io/cookie-based-affinity: "${ENABLE_COOKIE_BASED_AFFINITY}" -EOF - - if [[ "${ENABLE_DNS_CONFIGURATION,,}" == "true" ]]; then - cat <>${adminAppgwIngressYamlPath} - appgw.ingress.kubernetes.io/backend-hostname: "${DNS_ADMIN_LABEL}.${DNS_ZONE_NAME}" -EOF - else - cat <>${adminAppgwIngressYamlPath} - appgw.ingress.kubernetes.io/backend-hostname: "${APPGW_ALIAS}" -EOF - fi - - cat <>${adminAppgwIngressYamlPath} - appgw.ingress.kubernetes.io/appgw-trusted-root-certificate: "${APPGW_TRUSTED_ROOT_CERT_NAME}" - -spec: - ingressClassName: azure-application-gateway - rules: - - http: - paths: - - path: /console* - pathType: Prefix - backend: - service: - name: ${svcAdminServer} - port: - number: ${adminTargetPort} -EOF -} - -function generate_appgw_admin_remote_config_file_ssl() { - cat <${adminRemoteAppgwIngressYamlPath} -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: ${adminRemoteIngressName} - namespace: ${wlsDomainNS} - labels: - weblogic.domainUID: "${WLS_DOMAIN_UID}" - azure.weblogic.target: "${constAdminServerName}-remote-console" - azure.weblogc.createdByWlsOffer: "true" - annotations: - appgw.ingress.kubernetes.io/backend-path-prefix: "/" - appgw.ingress.kubernetes.io/ssl-redirect: "true" - appgw.ingress.kubernetes.io/backend-protocol: "https" - appgw.ingress.kubernetes.io/appgw-ssl-certificate: "${APPGW_SSL_CERT_NAME}" - appgw.ingress.kubernetes.io/use-private-ip: "${APPGW_USE_PRIVATE_IP}" - appgw.ingress.kubernetes.io/cookie-based-affinity: "${ENABLE_COOKIE_BASED_AFFINITY}" -EOF - - if [[ "${ENABLE_DNS_CONFIGURATION,,}" == "true" ]]; then - cat <>${adminRemoteAppgwIngressYamlPath} - appgw.ingress.kubernetes.io/backend-hostname: "${DNS_ADMIN_LABEL}.${DNS_ZONE_NAME}" -EOF - else - cat <>${adminRemoteAppgwIngressYamlPath} - appgw.ingress.kubernetes.io/backend-hostname: "${APPGW_ALIAS}" -EOF - fi - - cat <>${adminRemoteAppgwIngressYamlPath} - appgw.ingress.kubernetes.io/appgw-trusted-root-certificate: "${APPGW_TRUSTED_ROOT_CERT_NAME}" - -spec: - ingressClassName: azure-application-gateway - rules: - - http: - paths: - - path: /remoteconsole* - pathType: Prefix - backend: - service: - name: ${svcAdminServer} - port: - number: ${adminTargetPort} -EOF -} - -function query_admin_target_port() { - if [[ "${ENABLE_CUSTOM_SSL,,}" == "true" ]]; then - adminTargetPort=$(utility_query_service_port ${svcAdminServer} ${wlsDomainNS} 'internal-t3s') - else - adminTargetPort=$(utility_query_service_port ${svcAdminServer} ${wlsDomainNS} 'internal-t3') - fi - - echo "Admin port of ${adminServerName}: ${adminTargetPort}" -} - -# Create network peers for aks and appgw -function network_peers_aks_appgw() { - # To successfully peer two virtual networks command 'az network vnet peering create' must be called twice with the values - # for --vnet-name and --remote-vnet reversed. - - local aksMCRGName=$(az aks show -n $AKS_CLUSTER_NAME -g $AKS_CLUSTER_RG_NAME -o tsv --query "nodeResourceGroup") - local ret=$(az group exists -n ${aksMCRGName}) - if [ "${ret,,}" == "false" ]; then - echo_stderr "AKS namaged resource group ${aksMCRGName} does not exist." - exit 1 - fi - - # query vnet from managed resource group - local aksNetWorkId=$(az resource list -g ${aksMCRGName} --resource-type Microsoft.Network/virtualNetworks -o tsv --query '[*].id') - - # no vnet in managed resource group, then query vnet from aks agent - if [ -z "${aksNetWorkId}" ]; then - # assume all the agent pools are in the same vnet - # e.g. /subscriptions/xxxx-xxxx-xxxx-xxxx/resourceGroups/foo-rg/providers/Microsoft.Network/virtualNetworks/foo-aks-vnet/subnets/default - local aksAgent1Subnet=$(az aks show -n $AKS_CLUSTER_NAME -g $AKS_CLUSTER_RG_NAME | jq '.agentPoolProfiles[0] | .vnetSubnetId' | tr -d "\"") - utility_validate_status "Get subnet id of aks agent 0." - aksNetWorkId=${aksAgent1Subnet%\/subnets\/*} - fi - - local aksNetworkName=${aksNetWorkId#*\/virtualNetworks\/} - local aksNetworkRgName=${aksNetWorkId#*\/resourceGroups\/} - local aksNetworkRgName=${aksNetworkRgName%\/providers\/*} - - local appGatewaySubnetId=$(az network application-gateway show -g ${CURRENT_RG_NAME} --name ${APPGW_NAME} -o tsv --query "gatewayIPConfigurations[0].subnet.id") - local appGatewayVnetResourceGroup=$(az network application-gateway show -g ${CURRENT_RG_NAME} --name ${APPGW_NAME} -o tsv --query "gatewayIPConfigurations[0].subnet.resourceGroup") - local appgwNetworkId=${appGatewaySubnetId%\/subnets\/*} - local appgwVnetName=$(az resource show --ids ${appgwNetworkId} --query "name" -o tsv) - - local toPeer=true - # if the AKS and App Gateway have the same VNET, need not peer. - if [ "${aksNetWorkId}" == "${appgwNetworkId}" ]; then - echo_stdout "AKS and Application Gateway are in the same virtual network: ${appgwNetworkId}." - toPeer=false - fi - - # check if the Vnets have been peered. - local ret=$(az network vnet peering list \ - --resource-group ${appGatewayVnetResourceGroup} \ - --vnet-name ${appgwVnetName} -o json | - jq ".[] | select(.remoteVirtualNetwork.id==\"${aksNetWorkId}\")") - if [ -n "$ret" ]; then - echo_stdout "VNET of AKS ${aksNetWorkId} and Application Gateway ${appgwNetworkId} is peering." - toPeer=false - fi - - if [ "${toPeer}" == "true" ]; then - az network vnet peering create \ - --name aks-appgw-peer \ - --remote-vnet ${aksNetWorkId} \ - --resource-group ${appGatewayVnetResourceGroup} \ - --vnet-name ${appgwVnetName} \ - --allow-vnet-access - utility_validate_status "Create network peers for $aksNetWorkId and ${appgwNetworkId}." - - az network vnet peering create \ - --name aks-appgw-peer \ - --remote-vnet ${appgwNetworkId} \ - --resource-group ${aksNetworkRgName} \ - --vnet-name ${aksNetworkName} \ - --allow-vnet-access - - utility_validate_status "Complete creating network peers for $aksNetWorkId and ${appgwNetworkId}." - fi - - # For kubenet network plugin: https://azure.github.io/application-gateway-kubernetes-ingress/how-tos/networking/#with-kubenet - # find route table used by aks cluster - local networkPlugin=$(az aks show -n $AKS_CLUSTER_NAME -g $AKS_CLUSTER_RG_NAME --query "networkProfile.networkPlugin" -o tsv) - if [[ "${networkPlugin}" == "kubenet" ]]; then - # the route table is in MC_ resource group - routeTableId=$(az network route-table list -g $aksMCRGName --query "[].id | [0]" -o tsv) - - # associate the route table to Application Gateway's subnet - az network vnet subnet update \ - --ids $appGatewaySubnetId \ - --route-table $routeTableId - - utility_validate_status "Associate the route table ${routeTableId} to Application Gateway's subnet ${appGatewaySubnetId}" - fi -} - -function query_cluster_target_port() { - if [[ "${ENABLE_CUSTOM_SSL,,}" == "true" ]]; then - clusterTargetPort=$(utility_query_service_port ${svcCluster} ${wlsDomainNS} 'default-secure') - else - clusterTargetPort=$(utility_query_service_port ${svcCluster} ${wlsDomainNS} 'default') - fi - - echo "Cluster port of ${clusterName}: ${clusterTargetPort}" -} - -function generate_appgw_cluster_config_file() { - if [[ "${ENABLE_CUSTOM_SSL,,}" == "true" ]]; then - generate_appgw_cluster_config_file_ssl - else - generate_appgw_cluster_config_file_nossl - generate_appgw_cluster_config_file_expose_https - fi -} - -function generate_appgw_admin_config_file() { - if [[ "${ENABLE_CUSTOM_SSL,,}" == "true" ]]; then - generate_appgw_admin_config_file_ssl - else - generate_appgw_admin_config_file_nossl - fi -} - -function generate_appgw_admin_remote_config_file() { - if [[ "${ENABLE_CUSTOM_SSL,,}" == "true" ]]; then - generate_appgw_admin_remote_config_file_ssl - else - generate_appgw_admin_remote_config_file_nossl - fi -} - -# Currently, ingress controller does not have a tag that identifies it's ready to create ingress. -# This function is to create an ingress and check it's status. If the ingress is not available, then re-create it again. -function waitfor_agic_ready_and_create_ingress() { - local svcName=$1 - local ymlFilePath=$2 - - local ready=false - local attempt=0 - while [[ "${ready}" == "false" && $attempt -lt ${checkAGICStatusMaxAttempt} ]]; do - echo "Waiting for AGIC ready... ${attempt}" - attempt=$((attempt + 1)) - kubectl apply -f ${ymlFilePath} - - # wait for the ingress ready, if the ingress is not available then delete it - local svcAttempts=0 - local svcState="running" - while [ "$svcState" == "running" ] && [ $svcAttempts -lt ${checkIngressStateMaxAttempt} ]; do - svcAttempts=$((svcAttempts + 1)) - echo Waiting for job completed...${svcAttempts} - sleep ${checkSVCInterval} - - ip=$(kubectl get ingress ${svcName} -n ${wlsDomainNS} -o json | - jq '.status.loadBalancer.ingress[0].ip') - echo "ip: ${ip}" - if [[ "${ip}" != "null" ]]; then - svcState="completed" - ready=true - fi - done - - if [[ "${ready}" == "false" ]]; then - kubectl delete -f ${ymlFilePath} - sleep ${checkAGICStatusInterval} - fi - done - - if [ ${attempt} -ge ${checkAGICStatusMaxAttempt} ]; then - echo_stderr "azure igress is not ready to create ingress. " - exit 1 - fi - -} - -function appgw_ingress_svc_for_cluster() { - # generate ingress svc config for cluster - generate_appgw_cluster_config_file - kubectl apply -f ${clusterAppgwIngressYamlPath} - utility_validate_status "Create appgw ingress svc." - waitfor_agic_ready_and_create_ingress \ - ${clusterIngressName} \ - ${clusterAppgwIngressYamlPath} - - # expose https for cluster if e2e ssl is not set up. - if [[ "${ENABLE_CUSTOM_SSL,,}" != "true" ]]; then - kubectl apply -f ${clusterAppgwIngressHttpsYamlPath} - utility_validate_status "Create appgw ingress https svc." - utility_waitfor_ingress_completed \ - ${clusterIngressHttpsName} \ - ${wlsDomainNS} \ - ${checkSVCStateMaxAttempt} \ - ${checkSVCInterval} - fi -} - -function appgw_ingress_svc_for_admin_server() { - generate_appgw_admin_config_file - kubectl apply -f ${adminAppgwIngressYamlPath} - utility_validate_status "Create appgw ingress svc." - utility_waitfor_ingress_completed \ - ${adminIngressName} \ - ${wlsDomainNS} \ - ${checkSVCStateMaxAttempt} \ - ${checkSVCInterval} -} - -function appgw_ingress_svc_for_remote_console() { - adminRemoteIngressName=${WLS_DOMAIN_UID}-admin-remote-appgw-ingress-svc - adminRemoteAppgwIngressYamlPath=${scriptDir}/appgw-admin-remote-ingress-svc.yaml - generate_appgw_admin_remote_config_file - - kubectl apply -f ${adminRemoteAppgwIngressYamlPath} - utility_validate_status "Create appgw ingress svc." - utility_waitfor_ingress_completed \ - ${adminRemoteIngressName} \ - ${wlsDomainNS} \ - ${checkSVCStateMaxAttempt} \ - ${checkSVCInterval} -} - -function create_dns_record() { - if [[ "${ENABLE_DNS_CONFIGURATION,,}" == "true" ]]; then - create_dns_CNAME_record \ - ${APPGW_ALIAS} \ - ${DNS_CLUSTER_LABEL} \ - ${DNS_ZONE_RG_NAME} \ - ${DNS_ZONE_NAME} - fi - - if [[ "${ENABLE_DNS_CONFIGURATION,,}" == "true" ]] && - [[ "${APPGW_FOR_ADMIN_SERVER,,}" == "true" ]]; then - create_dns_CNAME_record \ - ${APPGW_ALIAS} \ - ${DNS_ADMIN_LABEL} \ - ${DNS_ZONE_RG_NAME} \ - ${DNS_ZONE_NAME} - fi -} - -function create_gateway_ingress() { - # query admin server port used for non-ssl or ssl - query_admin_target_port - # query cluster port used for non-ssl or ssl - query_cluster_target_port - # create network peers between gateway vnet and aks vnet - network_peers_aks_appgw - - # create ingress svc for cluster - appgw_ingress_svc_for_cluster - - # create ingress svc for admin console - if [[ "${APPGW_FOR_ADMIN_SERVER,,}" == "true" ]]; then - appgw_ingress_svc_for_admin_server - fi - - # create ingress svc for admin remote console - if [[ "${APPGW_FOR_REMOTE_CONSOLE,,}" == "true" ]]; then - appgw_ingress_svc_for_remote_console - fi - - create_dns_record -} - -# Initialize -script="${BASH_SOURCE[0]}" -scriptDir="$(cd "$(dirname "${script}")" && pwd)" - -source ${scriptDir}/common.sh -source ${scriptDir}/utility.sh -source ${scriptDir}/createDnsRecord.sh - -set -Eo pipefail - -adminServerName=${constAdminServerName} # define in common.sh -azureAppgwIngressVersion="1.5.1" -clusterName=${constClusterName} -svcAdminServer="${WLS_DOMAIN_UID}-${adminServerName}" -svcCluster="${WLS_DOMAIN_UID}-cluster-${clusterName}" -wlsDomainNS="${WLS_DOMAIN_UID}-ns" - -create_gateway_ingress diff --git a/weblogic-azure-aks/src/main/arm/scripts/createDnsRecord.sh b/weblogic-azure-aks/src/main/arm/scripts/createDnsRecord.sh deleted file mode 100644 index 61492c9d7..000000000 --- a/weblogic-azure-aks/src/main/arm/scripts/createDnsRecord.sh +++ /dev/null @@ -1,62 +0,0 @@ -# Copyright (c) 2021, Oracle Corporation and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Description: to create DNS record in an existing DNS Zone. - -echo "Script ${0} starts" - -# Initialize -export script="${BASH_SOURCE[0]}" -export scriptDir="$(cd "$(dirname "${script}")" && pwd)" - -source ${scriptDir}/utility.sh - -# create dns alias for lb service -# $1: ipv4 address -# $2: label of subdomain -# $3: resource group name that has the DNS Zone. -# $4: DNS Zone name -function create_dns_A_record() { - ipv4Addr=$1 - label=$2 - dnsRGName=$3 - dnsZoneName=$4 - - az network dns record-set a add-record --ipv4-address ${ipv4Addr} \ - --record-set-name ${label} \ - --resource-group ${dnsRGName} \ - --zone-name ${dnsZoneName} - - if [ $? != 0 ]; then - echo_stderr "Failed to create DNS record: ${label}.${dnsZoneName}, ipv4: ${ipv4Addr}" - exit 1 - fi -} - -# create dns alias for app gateway -# $1: ipv4 address -# $2: label of subdomain -# $3: resource group name that has the DNS Zone. -# $4: DNS Zone name -function create_dns_CNAME_record() { - cname=$1 - label=$2 - dnsRGName=$3 - dnsZoneName=$4 - - az network dns record-set cname create \ - -g ${dnsRGName} \ - -z ${dnsZoneName} \ - -n ${label} - - az network dns record-set cname set-record \ - -g ${dnsRGName} \ - -z ${dnsZoneName} \ - --cname ${cname} \ - --record-set-name ${label} - - if [ $? != 0 ]; then - echo_stderr "Failed to create DNS record: ${label}.${dnsZoneName}, cname: ${cname}" - exit 1 - fi -} diff --git a/weblogic-azure-aks/src/main/arm/scripts/createLbSvc.sh b/weblogic-azure-aks/src/main/arm/scripts/createLbSvc.sh deleted file mode 100644 index b170253ca..000000000 --- a/weblogic-azure-aks/src/main/arm/scripts/createLbSvc.sh +++ /dev/null @@ -1,503 +0,0 @@ -# Copyright (c) 2021, 2024, Oracle Corporation and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Description: to create Load Balancer Service for the following targets. -# * [Optional] admin server default channel -# * [Optional] admin server T3 channel -# * [Optional] cluster default channel -# * [Optional] cluster T3 channel -# -# Special parameter example: -# * LB_SVC_VALUES: [{"colName":"admin-t3","colTarget":"adminServerT3","colPort":"7005"},{"colName":"cluster","colTarget":"cluster1T3","colPort":"8011"}] - -echo "Script ${0} starts" - -function generate_admin_lb_definicion() { - cat <${scriptDir}/admin-server-lb.yaml -apiVersion: v1 -kind: Service -metadata: - name: ${adminServerLBSVCName} - namespace: ${wlsDomainNS} - labels: - weblogic.domainUID: "${WLS_DOMAIN_UID}" - azure.weblogic.target: "${constAdminServerName}" - azure.weblogc.createdByWlsOffer: "true" -EOF - - # to create internal load balancer service - if [[ "${USE_INTERNAL_LB,,}" == "true" ]]; then - cat <>${scriptDir}/admin-server-lb.yaml - annotations: - service.beta.kubernetes.io/azure-load-balancer-internal: "true" -EOF - fi - - cat <>${scriptDir}/admin-server-lb.yaml -spec: - ports: - - name: default - port: ${adminLBPort} - protocol: TCP - targetPort: ${adminTargetPort} - selector: - weblogic.domainUID: ${WLS_DOMAIN_UID} - weblogic.serverName: ${adminServerName} - sessionAffinity: None - type: LoadBalancer -EOF -} - -function generate_admin_t3_lb_definicion() { - cat <${adminServerT3LBDefinitionPath} -apiVersion: v1 -kind: Service -metadata: - name: ${adminServerT3LBSVCName} - namespace: ${wlsDomainNS} - labels: - weblogic.domainUID: "${WLS_DOMAIN_UID}" - azure.weblogic.target: "${constAdminServerName}-t3-channel" - azure.weblogc.createdByWlsOffer: "true" -EOF - - # to create internal load balancer service - if [[ "${USE_INTERNAL_LB,,}" == "true" ]]; then - cat <>${adminServerT3LBDefinitionPath} - annotations: - service.beta.kubernetes.io/azure-load-balancer-internal: "true" -EOF - fi - - cat <>${adminServerT3LBDefinitionPath} -spec: - ports: - - name: default - port: ${adminT3LBPort} - protocol: TCP - targetPort: ${adminT3Port} - selector: - weblogic.domainUID: ${WLS_DOMAIN_UID} - weblogic.serverName: ${adminServerName} - sessionAffinity: None - type: LoadBalancer -EOF -} - -function generate_cluster_lb_definicion() { - cat <${scriptDir}/cluster-lb.yaml -apiVersion: v1 -kind: Service -metadata: - name: ${clusterLBSVCName} - namespace: ${wlsDomainNS} - labels: - weblogic.domainUID: "${WLS_DOMAIN_UID}" - azure.weblogic.target: "${constClusterName}" - azure.weblogc.createdByWlsOffer: "true" -EOF - - # to create internal load balancer service - if [[ "${USE_INTERNAL_LB,,}" == "true" ]]; then - cat <>${scriptDir}/cluster-lb.yaml - annotations: - service.beta.kubernetes.io/azure-load-balancer-internal: "true" -EOF - fi - - cat <>${scriptDir}/cluster-lb.yaml -spec: - ports: - - name: default - port: ${clusterLBPort} - protocol: TCP - targetPort: ${clusterTargetPort} - selector: - weblogic.domainUID: ${WLS_DOMAIN_UID} - weblogic.clusterName: ${clusterName} - sessionAffinity: None - type: LoadBalancer -EOF -} - -function generate_cluster_t3_lb_definicion() { - cat <${clusterT3LBDefinitionPath} -apiVersion: v1 -kind: Service -metadata: - name: ${clusterT3LBSVCName} - namespace: ${wlsDomainNS} - labels: - weblogic.domainUID: "${WLS_DOMAIN_UID}" - azure.weblogic.target: "${constClusterName}-t3-channel" - azure.weblogc.createdByWlsOffer: "true" -EOF - - # to create internal load balancer service - if [[ "${USE_INTERNAL_LB,,}" == "true" ]]; then - cat <>${clusterT3LBDefinitionPath} - annotations: - service.beta.kubernetes.io/azure-load-balancer-internal: "true" -EOF - fi - - cat <>${clusterT3LBDefinitionPath} -spec: - ports: - - name: default - port: ${clusterT3LBPort} - protocol: TCP - targetPort: ${clusterT3Port} - selector: - weblogic.domainUID: ${WLS_DOMAIN_UID} - weblogic.clusterName: ${clusterName} - sessionAffinity: None - type: LoadBalancer -EOF -} - -function query_admin_target_port() { - if [[ "${ENABLE_CUSTOM_SSL,,}" == "true" ]]; then - adminTargetPort=$(utility_query_service_port ${svcAdminServer} ${wlsDomainNS} 'internal-t3s') - else - adminTargetPort=$(utility_query_service_port ${svcAdminServer} ${wlsDomainNS} 'internal-t3') - fi - - echo "Admin port of ${adminServerName}: ${adminTargetPort}" -} - -function query_cluster_target_port() { - if [[ "${ENABLE_CUSTOM_SSL,,}" == "true" ]]; then - clusterTargetPort=$(utility_query_service_port ${svcCluster} ${wlsDomainNS} 'default-secure') - else - clusterTargetPort=$(utility_query_service_port ${svcCluster} ${wlsDomainNS} 'default') - fi - - echo "Cluster port of ${clusterName}: ${clusterTargetPort}" -} - -function create_lb_svc_for_admin_server_default_channel() { - item=$1 # input values - - echo ${item} - - adminServerLBSVCNamePrefix=$(cut -d',' -f1 <<<$item) - adminServerLBSVCName="${adminServerLBSVCNamePrefix}-svc-lb-admin" - adminLBPort=$(cut -d',' -f3 <<<$item) - - generate_admin_lb_definicion - - kubectl apply -f ${scriptDir}/admin-server-lb.yaml - utility_validate_status "create lb service for admin server" - utility_waitfor_lb_svc_completed ${adminServerLBSVCName} \ - ${wlsDomainNS} \ - ${checkSVCStateMaxAttempt} \ - ${checkSVCInterval} - - adminServerEndpoint=$(kubectl get svc ${adminServerLBSVCName} -n ${wlsDomainNS} \ - -o=jsonpath='{.status.loadBalancer.ingress[0].ip}:{.spec.ports[0].port}') - - if [ "${ENABLE_DNS_CONFIGURATION,,}" == "true" ]; then - create_dns_A_record "${adminServerEndpoint%%:*}" ${DNS_ADMIN_LABEL} ${DNS_ZONE_RG_NAME} ${DNS_ZONE_NAME} - adminServerEndpoint="${DNS_ADMIN_LABEL}.${DNS_ZONE_NAME}:${adminServerEndpoint#*:}" - fi - - adminConsoleEndpoint="${adminServerEndpoint}/console" - adminRemoteEndpoint=${adminServerEndpoint} -} - -function create_lb_svc_for_admin_t3_channel() { - item=$1 # input values - - adminServerT3LBSVCNamePrefix=$(cut -d',' -f1 <<<$item) - adminServerT3LBSVCName="${adminServerT3LBSVCNamePrefix}-svc-t3-lb-admin" - adminT3LBPort=$(cut -d',' -f3 <<<$item) - - adminServerT3LBDefinitionPath=${scriptDir}/admin-server-t3-lb.yaml - generate_admin_t3_lb_definicion - - kubectl apply -f ${adminServerT3LBDefinitionPath} - utility_validate_status "create lb service for admin server t3 channel" - utility_waitfor_lb_svc_completed ${adminServerT3LBSVCName} \ - ${wlsDomainNS} \ - ${checkSVCStateMaxAttempt} \ - ${checkSVCInterval} - - adminServerT3Endpoint=$(kubectl get svc ${adminServerT3LBSVCName} -n ${wlsDomainNS} \ - -o=jsonpath='{.status.loadBalancer.ingress[0].ip}:{.spec.ports[0].port}') - - if [ "${ENABLE_DNS_CONFIGURATION,,}" == "true" ]; then - create_dns_A_record "${adminServerT3Endpoint%%:*}" "${DNS_ADMIN_T3_LABEL}" ${DNS_ZONE_RG_NAME} ${DNS_ZONE_NAME} - adminServerT3Endpoint="${DNS_ADMIN_T3_LABEL}.${DNS_ZONE_NAME}:${adminServerT3Endpoint#*:}" - fi -} - -function create_lb_svc_for_cluster_default_channel() { - item=$1 # input values - - clusterLBSVCNamePrefix=$(cut -d',' -f1 <<<$item) - clusterLBSVCName="${clusterLBSVCNamePrefix}-svc-lb-cluster" - clusterLBPort=$(cut -d',' -f3 <<<$item) - - generate_cluster_lb_definicion - - kubectl apply -f ${scriptDir}/cluster-lb.yaml - utility_validate_status "create lb service for cluster" - utility_waitfor_lb_svc_completed ${clusterLBSVCName} \ - ${wlsDomainNS} \ - ${checkSVCStateMaxAttempt} \ - ${checkSVCInterval} - - clusterEndpoint=$(kubectl get svc ${clusterLBSVCName} -n ${wlsDomainNS} -o=jsonpath='{.status.loadBalancer.ingress[0].ip}:{.spec.ports[0].port}') - - if [ "${ENABLE_DNS_CONFIGURATION,,}" == "true" ]; then - create_dns_A_record "${clusterEndpoint%%:*}" ${DNS_CLUSTER_LABEL} ${DNS_ZONE_RG_NAME} ${DNS_ZONE_NAME} - clusterEndpoint="${DNS_CLUSTER_LABEL}.${DNS_ZONE_NAME}:${clusterEndpoint#*:}" - fi -} - -function create_lb_svc_for_cluster_t3_channel() { - item=$1 # input values - - clusterT3LBSVCNamePrefix=$(cut -d',' -f1 <<<$item) - clusterT3LBSVCName="${clusterT3LBSVCNamePrefix}-svc-lb-cluster" - clusterT3LBPort=$(cut -d',' -f3 <<<$item) - - clusterT3LBDefinitionPath=${scriptDir}/cluster-t3-lb.yaml - generate_cluster_t3_lb_definicion - - kubectl apply -f ${clusterT3LBDefinitionPath} - utility_validate_status "create lb service for cluster t3 channel" - utility_waitfor_lb_svc_completed ${clusterT3LBSVCName} \ - ${wlsDomainNS} \ - ${checkSVCStateMaxAttempt} \ - ${checkSVCInterval} - - clusterT3Endpoint=$(kubectl get svc ${clusterT3LBSVCName} -n ${wlsDomainNS} \ - -o=jsonpath='{.status.loadBalancer.ingress[0].ip}:{.spec.ports[0].port}') - - if [ "${ENABLE_DNS_CONFIGURATION,,}" == "true" ]; then - create_dns_A_record "${clusterT3Endpoint%%:*}" ${DNS_CLUSTER_T3_LABEL} ${DNS_ZONE_RG_NAME} ${DNS_ZONE_NAME} - clusterT3Endpoint="${DNS_CLUSTER_T3_LABEL}.${DNS_ZONE_NAME}:${clusterT3Endpoint#*:}" - fi -} - -function patch_admin_t3_public_address() { - # patch admin t3 public address - if [ "${ENABLE_DNS_CONFIGURATION,,}" == "true" ]; then - adminT3Address="${DNS_ADMIN_T3_LABEL}.${DNS_ZONE_NAME}" - else - adminT3Address=$(kubectl -n ${wlsDomainNS} get svc ${adminServerT3LBSVCName} -o json | - jq '. | .status.loadBalancer.ingress[0].ip' | - tr -d "\"") - fi - - if [ $? == 1 ]; then - echo_stderr "Failed to query public IP of admin t3 channel." - fi - - currentDomainConfig=$(echo ${currentDomainConfig} | - jq \ - --arg match "${constAdminT3AddressEnvName}" \ - --arg replace "${adminT3Address}" \ - '.spec.serverPod.env |= map(if .name==$match then (.value=$replace) else . end)') -} - -function patch_cluster_t3_public_address() { - #patch cluster t3 pubilc address - if [ "${ENABLE_DNS_CONFIGURATION,,}" == "true" ]; then - clusterT3Adress="${DNS_CLUSTER_T3_LABEL}.${DNS_ZONE_NAME}" - else - clusterT3Adress=$(kubectl -n ${wlsDomainNS} get svc ${clusterT3LBSVCName} -o json | - jq '. | .status.loadBalancer.ingress[0].ip' | - tr -d "\"") - fi - - if [ $? == 1 ]; then - echo_stderr "Failed to query public IP of cluster t3 channel." - fi - - currentDomainConfig=$(echo ${currentDomainConfig} | - jq \ - --arg match "${constClusterT3AddressEnvName}" \ - --arg replace "${clusterT3Adress}" \ - '.spec.serverPod.env |= map(if .name==$match then (.value=$replace) else . end)') -} - -function rolling_update_with_t3_public_address() { - timestampBeforePatchingDomain=$(date +%s) - currentDomainConfig=$(kubectl -n ${wlsDomainNS} get domain ${WLS_DOMAIN_UID} -o json) - cat <${scriptDir}/domainPreviousConfiguration.yaml -${currentDomainConfig} -EOF - - # update public address of t3 channel - if [[ "${enableAdminT3Channel,,}" == "true" ]]; then - patch_admin_t3_public_address - fi - - if [[ "${enableClusterT3Channel,,}" == "true" ]]; then - patch_cluster_t3_public_address - fi - - if [[ "${enableClusterT3Channel,,}" == "true" ]] || [[ "${enableAdminT3Channel,,}" == "true" ]]; then - # restart cluster - restartVersion=$(kubectl -n ${wlsDomainNS} get domain ${WLS_DOMAIN_UID} -o json | - jq '. | .spec.restartVersion' | - tr -d "\"") - restartVersion=$((restartVersion + 1)) - - currentDomainConfig=$(echo ${currentDomainConfig} | - jq \ - --arg version "${restartVersion}" \ - '.spec.restartVersion |= $version') - - echo "rolling restart the cluster with t3 public address." - # echo the configuration for debugging - cat <${scriptDir}/domainNewConfiguration.yaml -${currentDomainConfig} -EOF - echo ${currentDomainConfig} | kubectl -n ${wlsDomainNS} apply -f - - - local clusterName=$(kubectl get cluster -n ${wlsDomainNS} -o json | jq -r '.items[0].metadata.name') - local replicas=$(kubectl -n ${wlsDomainNS} get cluster ${clusterName} -o json \ - | jq '. | .spec.replicas') - - # wait for the restart completed. - utility_wait_for_pod_restarted \ - ${timestampBeforePatchingDomain} \ - ${replicas} \ - ${WLS_DOMAIN_UID} \ - ${checkPodStatusMaxAttemps} \ - ${checkPodStatusInterval} - - utility_wait_for_pod_completed \ - ${replicas} \ - ${wlsDomainNS} \ - ${checkPodStatusMaxAttemps} \ - ${checkPodStatusInterval} - fi -} - -function validate_admin_console_url() { - local podName=$(kubectl -n ${wlsDomainNS} get pod -l weblogic.serverName=${constAdminServerName} -o json | - jq '.items[0] | .metadata.name' | - tr -d "\"") - - if [[ "${podName}" == "null" ]]; then - echo "Ensure your domain has at least one admin server." - exit 1 - fi - - adminTargetPort=$(kubectl get svc ${svcAdminServer} -n ${wlsDomainNS} -o json | - jq '.spec.ports[] | select(.name=="internal-t3") | .port') - local adminConsoleUrl="http://${svcAdminServer}.${wlsDomainNS}:${adminTargetPort}/console/" - - kubectl exec -it ${podName} -n ${wlsDomainNS} -c ${wlsContainerName} \ - -- bash -c 'curl --write-out "%{http_code}\n" --silent --output /dev/null "'${adminConsoleUrl}'" | grep "302"' - - if [ $? == 1 ]; then - echo "admin console is not accessible." - # reset admin console endpoint - adminConsoleEndpoint="null" - fi -} - -#Output value to deployment scripts -function output_result() { - echo ${adminConsoleEndpoint} - echo ${clusterEndpoint} - echo ${adminServerT3Endpoint} - echo ${clusterT3Endpoint} - echo ${adminRemoteEndpoint} - - # check if the admin console is accessible, do not output it - validate_admin_console_url - - result=$(jq -n -c \ - --arg adminEndpoint $adminConsoleEndpoint \ - --arg clusterEndpoint $clusterEndpoint \ - --arg adminT3Endpoint $adminServerT3Endpoint \ - --arg clusterT3Endpoint $clusterT3Endpoint \ - --arg adminRemoteEndpoint ${adminRemoteEndpoint} \ - '{adminConsoleEndpoint: $adminEndpoint, clusterEndpoint: $clusterEndpoint, adminServerT3Endpoint: $adminT3Endpoint, clusterT3Endpoint: $clusterT3Endpoint, adminRemoteEndpoint: $adminRemoteEndpoint}') - echo "result is: $result" - echo $result >$AZ_SCRIPTS_OUTPUT_PATH -} - -function create_svc_lb() { - query_admin_target_port - query_cluster_target_port - - cat <${scriptDir}/lbConfiguration.json -${LB_SVC_VALUES} -EOF - - array=$(jq -r '.[] | "\(.colName),\(.colTarget),\(.colPort)"' ${scriptDir}/lbConfiguration.json) - for item in $array; do - # LB config for admin-server - target=$(cut -d',' -f2 <<<$item) - if [[ "${target}" == "adminServer" ]]; then - create_lb_svc_for_admin_server_default_channel ${item} - elif [[ "${target}" == "cluster1" ]]; then - create_lb_svc_for_cluster_default_channel ${item} - elif [[ "${target}" == "adminServerT3" ]]; then - echo "query admin t3 port" - adminT3Port=$(utility_query_service_port ${svcAdminServer} ${wlsDomainNS} 't3channel') - adminT3sPort=$(utility_query_service_port ${svcAdminServer} ${wlsDomainNS} 't3schannel') - - if [[ "${adminT3Port}" == "null" ]] && [[ "${adminT3sPort}" == "null" ]]; then - continue - fi - - if [[ "${adminT3sPort}" != "null" ]]; then - adminT3Port=${adminT3sPort} - fi - - create_lb_svc_for_admin_t3_channel $item - enableAdminT3Channel=true - elif [[ "${target}" == "cluster1T3" ]]; then - echo "query cluster t3 port" - clusterT3Port=$(utility_query_service_port ${svcCluster} ${wlsDomainNS} 't3channel') - clusterT3sPort=$(utility_query_service_port ${svcCluster} ${wlsDomainNS} 't3schannel') - - if [[ "${clusterT3Port}" == "null" ]] && [[ "${clusterT3sPort}" == "null" ]]; then - continue - fi - - if [[ "${clusterT3sPort}" != "null" ]]; then - clusterT3Port=${clusterT3sPort} - fi - - create_lb_svc_for_cluster_t3_channel ${item} - enableClusterT3Channel=true - fi - done - - rolling_update_with_t3_public_address -} - -# Initialize -script="${BASH_SOURCE[0]}" -scriptDir="$(cd "$(dirname "${script}")" && pwd)" - -source ${scriptDir}/common.sh -source ${scriptDir}/utility.sh -source ${scriptDir}/createDnsRecord.sh - -adminConsoleEndpoint="null" -adminServerName=${constAdminServerName} # define in common.sh -adminServerT3Endpoint="null" -adminRemoteEndpoint="null" -clusterEndpoint="null" -clusterName=${constClusterName} -clusterT3Endpoint="null" -svcAdminServer="${WLS_DOMAIN_UID}-${adminServerName}" -svcCluster="${WLS_DOMAIN_UID}-cluster-${clusterName}" -wlsDomainNS="${WLS_DOMAIN_UID}-ns" - -echo ${LB_SVC_VALUES} - -create_svc_lb - -output_result diff --git a/weblogic-azure-aks/src/main/arm/scripts/createVMAndBuildImage.sh b/weblogic-azure-aks/src/main/arm/scripts/createVMAndBuildImage.sh deleted file mode 100644 index 1394adad6..000000000 --- a/weblogic-azure-aks/src/main/arm/scripts/createVMAndBuildImage.sh +++ /dev/null @@ -1,180 +0,0 @@ -# Copyright (c) 2021, Oracle Corporation and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# env inputs: -# URL_3RD_DATASOURCE -# ORACLE_ACCOUNT_ENTITLED - -echo "Script ${0} starts" - -# read from stdin -function read_sensitive_parameters_from_stdin() { - read acrPassword -} - -function cleanup_vm() { - echo "deleting vm resources..." - #Remove VM resources - az extension add --name resource-graph - # query vm id - vmId=$(az graph query -q "Resources \ -| where type =~ 'microsoft.compute/virtualmachines' \ -| where name=~ '${vmName}' \ -| where resourceGroup =~ '${CURRENT_RESOURCEGROUP_NAME}' \ -| project vmid = id" --query "data[0].vmid" -o tsv) - - # query nic id - nicId=$(az graph query -q "Resources \ -| where type =~ 'microsoft.compute/virtualmachines' \ -| where name=~ '${vmName}' \ -| where resourceGroup =~ '${CURRENT_RESOURCEGROUP_NAME}' \ -| extend nics=array_length(properties.networkProfile.networkInterfaces) \ -| mv-expand nic=properties.networkProfile.networkInterfaces \ -| where nics == 1 or nic.properties.primary =~ 'true' or isempty(nic) \ -| project nicId = tostring(nic.id)" --query "data[0].nicId" -o tsv) - - # query os disk id - osDiskId=$(az graph query -q "Resources \ -| where type =~ 'microsoft.compute/virtualmachines' \ -| where name=~ '${vmName}' \ -| where resourceGroup =~ '${CURRENT_RESOURCEGROUP_NAME}' \ -| project osDiskId = tostring(properties.storageProfile.osDisk.managedDisk.id)" --query "data[0].osDiskId" -o tsv) - - # query vnet id - vnetId=$(az graph query -q "Resources \ -| where type =~ 'Microsoft.Network/virtualNetworks' \ -| where name=~ '${vmName}VNET' \ -| where resourceGroup =~ '${CURRENT_RESOURCEGROUP_NAME}' \ -| project vNetId = id" --query "data[0].vNetId" -o tsv) - - # query nsg id - nsgId=$(az graph query -q "Resources \ -| where type =~ 'Microsoft.Network/networkSecurityGroups' \ -| where name=~ '${vmName}NSG' \ -| where resourceGroup =~ '${CURRENT_RESOURCEGROUP_NAME}' \ -| project nsgId = id" --query "data[0].nsgId" -o tsv) - - # Delete VM NIC IP VNET NSG resoruces - echo "deleting vm ${vmId}" - az vm delete --ids $vmId --yes - echo "deleting nic ${nicId}" - az network nic delete --ids ${nicId} - echo "deleting disk ${osDiskId}" - az disk delete --yes --ids ${osDiskId} - echo "deleting vnet ${vnetId}" - az network vnet delete --ids ${vnetId} - echo "deleting nsg ${nsgId}" - az network nsg delete --ids ${nsgId} -} - -# generate image full path based on the oracle account -function get_ocr_image_full_path() { - local ocrImageFullPath="${ocrLoginServer}/${ocrGaImagePath}:${WLS_IMAGE_TAG}" - - if [[ "${ORACLE_ACCOUNT_ENTITLED,,}" == "true" ]]; then - - # download the ga cpu image mapping file. - local cpuImagesListFile=weblogic_cpu_images.json - curl -L ${gitUrl4CpuImages} --retry ${retryMaxAttempt} -o ${cpuImagesListFile} - local cpuTag=$(cat ${cpuImagesListFile} | jq ".items[] | select(.gaTag==\"${WLS_IMAGE_TAG}\") | .cpuTag" | tr -d "\"") - # if we can not find a matched image, keep the tag name the same as GA tag. - if [[ "${cpuTag}" == "" || "${cpuTag,,}" == "null" ]]; then - cpuTag=${WLS_IMAGE_TAG} - fi - - ocrImageFullPath="${ocrLoginServer}/${ocrCpuImagePath}:${cpuTag}" - fi - - wlsImagePath=${ocrImageFullPath} -} - -# Build docker image -# * Create Ubuntu machine VM-UBUNTU -# * Running vm extension to run buildWLSDockerImage.sh, the script will: -# * build a docker image with domain model, applications based on specified WebLogic Standard image -# * push the image to ACR -function build_docker_image() { - # Create vm to build docker image - vmName="VM-UBUNTU-WLS-AKS-$(date +%s)" - - # az vm image list --publisher Canonical --offer UbuntuServer --all -o table - ubuntuImage="Canonical:UbuntuServer:18.04-LTS:latest" - - if [[ "${CPU_PLATFORM}" == "${constARM64Platform}" ]]; then - ubuntuImage="Canonical:UbuntuServer:18_04-lts-arm64:latest" - fi - - # query AKS vm size - # use the same VM size to create the Ubuntu machine, make sure the architecture is matched. - local vmSize=$(az aks show --name ${AKS_CLUSTER_NAME} --resource-group ${AKS_CLUSTER_RESOURCEGROUP_NAME} \ - | jq '.agentPoolProfiles[] | select(.name=="agentpool") | .vmSize' \ - | tr -d "\"") - - # if vmSize is empty or null, exit - if [[ "${vmSize}" == "" || "${vmSize}" == "null" ]]; then - echo_stderr "Failed to obtain VM size of AKS ${AKS_CLUSTER_NAME} in ${AKS_CLUSTER_RESOURCEGROUP_NAME}." - exit 1 - fi - - echo_stdout "TAG_VM: ${TAG_VM}" - export TAG_VM=$(echo "${TAG_VM}" \ - | jq -r 'to_entries | map("\"" + .key + "\"=" + (if .value|type == "string" then "\"\(.value)\"" else "\(.value)" end)) | join(" ")') - - # MICROSOFT_INTERNAL - # Specify tag 'SkipASMAzSecPack' to skip policy 'linuxazuresecuritypackautodeployiaas_1.6' - # Specify tag 'SkipNRMS*' to skip Microsoft internal NRMS policy, which causes vm-redeployed issue - az vm create \ - --resource-group ${CURRENT_RESOURCEGROUP_NAME} \ - --name ${vmName} \ - --image "${ubuntuImage}" \ - --admin-username azureuser \ - --generate-ssh-keys \ - --nsg-rule NONE \ - --enable-agent true \ - --vnet-name ${vmName}VNET \ - --enable-auto-update false \ - --public-ip-address "" \ - --size ${vmSize} \ - --tags ${TAG_VM} SkipASMAzSecPack=true SkipNRMSCorp=true SkipNRMSDatabricks=true SkipNRMSDB=true SkipNRMSHigh=true SkipNRMSMedium=true SkipNRMSRDPSSH=true SkipNRMSSAW=true SkipNRMSMgmt=true --verbose - - if [[ "${USE_ORACLE_IMAGE,,}" == "${constTrue}" ]]; then - get_ocr_image_full_path - else - wlsImagePath="${USER_PROVIDED_IMAGE_PATH}" - fi - - echo_stdout "wlsImagePath: ${wlsImagePath}" - URL_3RD_DATASOURCE=$(echo $URL_3RD_DATASOURCE | tr -d "\"") # remove " from the string - URL_3RD_DATASOURCE=$(echo $URL_3RD_DATASOURCE | base64 -w0) - # Tag for VM extension is not supported yet, see https://github.com/Azure/azure-cli/issues/14341 - az vm extension set --name CustomScript \ - --extension-instance-name wls-image-script \ - --resource-group ${CURRENT_RESOURCEGROUP_NAME} \ - --vm-name ${vmName} \ - --publisher Microsoft.Azure.Extensions \ - --version 2.0 \ - --settings "{ \"fileUris\": [\"${SCRIPT_LOCATION}model.properties\",\"${SCRIPT_LOCATION}genImageModel.sh\",\"${SCRIPT_LOCATION}buildWLSDockerImage.sh\",\"${SCRIPT_LOCATION}common.sh\"]}" \ - --protected-settings "{\"commandToExecute\":\"echo ${acrPassword} ${ORACLE_ACCOUNT_PASSWORD} | bash buildWLSDockerImage.sh ${wlsImagePath} ${acrLoginServer} ${acrUser} ${newImageTag} ${WLS_APP_PACKAGE_URLS} ${ORACLE_ACCOUNT_NAME} ${WLS_CLUSTER_SIZE} ${ENABLE_CUSTOM_SSL} ${ENABLE_ADMIN_CUSTOM_T3} ${ENABLE_CLUSTER_CUSTOM_T3} ${USE_ORACLE_IMAGE} ${URL_3RD_DATASOURCE} ${ENABLE_PASSWORDLESS_DB_CONNECTION} ${DB_TYPE} ${CPU_PLATFORM} \"}" - - cleanup_vm -} - -# Shell Global settings -set -Eeo pipefail #Exit immediately if a command exits with a non-zero status. - -# Main script -export script="${BASH_SOURCE[0]}" -export scriptDir="$(cd "$(dirname "${script}")" && pwd)" - -source ${scriptDir}/common.sh -source ${scriptDir}/utility.sh - -export newImageTag=$1 -export acrLoginServer=$2 -export acrUser=$3 - -read_sensitive_parameters_from_stdin - -build_docker_image - - - diff --git a/weblogic-azure-aks/src/main/arm/scripts/dbUtility.sh b/weblogic-azure-aks/src/main/arm/scripts/dbUtility.sh deleted file mode 100644 index dfa47c3a9..000000000 --- a/weblogic-azure-aks/src/main/arm/scripts/dbUtility.sh +++ /dev/null @@ -1,177 +0,0 @@ -# Copyright (c) 2021, Oracle Corporation and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -echo "Script ${0} starts" - -function generate_ds_model() { - databaseDriver=${driverOracle} - databaseTestTableName=${testTableOracle} - if [[ "${DATABASE_TYPE}" == "${dbTypePostgre}" ]]; then - databaseDriver=${driverPostgre} - databaseTestTableName=${testTablePostgre} - elif [[ "${DATABASE_TYPE}" == "${dbTypeSQLServer}" ]]; then - databaseDriver=${driverSQLServer} - databaseTestTableName=${testTableSQLServer} - elif [[ "${DATABASE_TYPE}" == "${dbTypeMySQL}" ]]; then - databaseDriver=${driverMySQL} - databaseTestTableName=${testTableMySQL} - - if [[ "${ENABLE_PASSWORDLESS_CONNECTION,,}" == "true" ]]; then - databaseDriver=${driverMySQLCj} - fi - elif [[ "${DATABASE_TYPE}" == "${dbTypeOthers}" ]]; then - databaseDriver=${DB_DRIVER_NAME} - databaseTestTableName=${TEST_TABLE_NAME} - fi - - echo "generate data source model file" - chmod ugo+x $scriptDir/genDatasourceModel.sh - dsModelFilePath=$scriptDir/${dbSecretName}.yaml - bash $scriptDir/genDatasourceModel.sh \ - ${dsModelFilePath} \ - "${JDBC_DATASOURCE_NAME}" \ - "${clusterName}" \ - "${databaseDriver}" \ - "${databaseTestTableName}" \ - "${dbSecretName}" -} - -function export_models_and_delete_configmap() { - # create folder to store model files - modelFilePath=$scriptDir/models - if [ -d "${modelFilePath}" ]; then - rm ${modelFilePath} -f -r - fi - - mkdir ${modelFilePath} - - echo "check if configmap ${wlsConfigmapName} exists" - ret=$(kubectl -n ${domainNamespace} get configmap | grep "${wlsConfigmapName}") - if [ -n "${ret}" ]; then - echo "configmap ${wlsConfigmapName} exists, update it with the datasource model." - export wlsConfigmap=${scriptDir}/wdtconfigmap.json - rm -f ${scriptDir}/wdtconfigmap.json - kubectl -n ${domainNamespace} get configmap ${wlsConfigmapName} -o json >${wlsConfigmap} - - echo "query model keys" - keyList=$(cat ${wlsConfigmap} | jq '.data | keys[]' | tr -d "\"") - for item in $keyList; do - echo "key: $item" - if [[ "${item}" == "${dbSecretName}.yaml" ]]; then - continue - fi - - data=$(cat ${wlsConfigmap} | jq ".data[\"${item}\"]") - data=$(echo "${data:1:${#data}-2}") - echo -e "${data}" >${modelFilePath}/${item} - done - - # remove current configmap and create a new one - kubectl -n ${domainNamespace} delete configmap ${wlsConfigmapName} - fi -} - -function cleanup_secret_and_model() { - echo "check if the datasource secret exists" - jndiLabel=${JDBC_DATASOURCE_NAME//\//\_} - secretLen=$(kubectl get secret -n ${domainNamespace} -l datasource.JNDI="${jndiLabel}" -o json | - jq '.items | length') - if [ ${secretLen} -ge 1 ]; then - echo "secret for ${JDBC_DATASOURCE_NAME} exists" - # delete the secrets - index=0 - while [ $index -lt ${secretLen} ]; do - # get secret name - secretName=$(kubectl get secret -n ${domainNamespace} -l datasource.JNDI="${jndiLabel}" -o json | - jq ".items[$index].metadata.name" | - tr -d "\"") - # remove the secret - kubectl delete secret ${secretName} -n ${domainNamespace} - # remove model if there is. - rm -f ${modelFilePath}/${secretName}.yaml - - index=$((index + 1)) - done - fi -} - -function create_datasource_secret() { - cleanup_secret_and_model - - echo "create/update secret ${dbSecretName} for ${JDBC_DATASOURCE_NAME}" - kubectl -n ${domainNamespace} create secret generic \ - ${dbSecretName} \ - --from-literal=password="${DB_PASSWORD}" \ - --from-literal=url="${DB_CONNECTION_STRING}" \ - --from-literal=user="${DB_USER}" - - kubectl -n sample-domain1-ns label secret \ - ${dbSecretName} \ - weblogic.domainUID=${WLS_DOMAIN_UID} \ - datasource.JNDI="${jndiLabel}" -} - -function update_configmap() { - echo "output all the models from configmap" - export_models_and_delete_configmap - # remove existing model if there is - rm -f ${modelFilePath}/${dbSecretName}.yaml - # copy the new model to model folder - cp ${dsModelFilePath} ${modelFilePath}/${dbSecretName}.yaml - - echo "update configmap" - kubectl -n ${domainNamespace} create configmap ${wlsConfigmapName} \ - --from-file=${modelFilePath} - kubectl -n ${domainNamespace} label configmap ${wlsConfigmapName} \ - weblogic.domainUID=${WLS_DOMAIN_UID} -} - -function delete_model_and_secret() { - # delete db models and secrets for the specified jndi name. - echo "output all the models from configmap" - export_models_and_delete_configmap - - cleanup_secret_and_model - - echo "update configmap" - kubectl -n ${domainNamespace} create configmap ${wlsConfigmapName} \ - --from-file=${modelFilePath} - kubectl -n ${domainNamespace} label configmap ${wlsConfigmapName} \ - weblogic.domainUID=${WLS_DOMAIN_UID} -} - -# Main script -set -Eo pipefail - -export script="${BASH_SOURCE[0]}" -export scriptDir="$(cd "$(dirname "${script}")" && pwd)" - -export dbSecretName=$1 -export operationType=$2 - -export domainNamespace=${WLS_DOMAIN_UID}-ns -export clusterName="cluster-1" -export dbTypeOracle="oracle" -export dbTypePostgre="postgresql" -export dbTypeSQLServer="sqlserver" -export dbTypeMySQL='mysql' -export dbTypeOthers="otherdb" -export driverOracle="oracle.jdbc.OracleDriver" -export driverPostgre="org.postgresql.Driver" -export driverSQLServer="com.microsoft.sqlserver.jdbc.SQLServerDriver" -export driverMySQL="com.mysql.jdbc.Driver" -export driverMySQLCj="com.mysql.cj.jdbc.Driver" -export optTypeDelete='delete' -export testTableOracle="SQL ISVALID" -export testTablePostgre="SQL SELECT 1" -export testTableSQLServer="SQL SELECT 1" -export testTableMySQL="SQL SELECT 1" -export wlsConfigmapName="${WLS_DOMAIN_UID}-wdt-config-map" - -if [[ "${operationType}" == "${optTypeDelete}" ]]; then - delete_model_and_secret -else - generate_ds_model - update_configmap - create_datasource_secret -fi diff --git a/weblogic-azure-aks/src/main/arm/scripts/genDatasourceModel.sh b/weblogic-azure-aks/src/main/arm/scripts/genDatasourceModel.sh deleted file mode 100644 index ec7e5ad0e..000000000 --- a/weblogic-azure-aks/src/main/arm/scripts/genDatasourceModel.sh +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) 2021, Oracle Corporation and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Initialize -export script="${BASH_SOURCE[0]}" -export scriptDir="$(cd "$(dirname "${script}")" && pwd)" - -export filePath=$1 -export jndiName=$2 -export target=$3 -export driver=$4 -export testTableName=$5 -export secretName=$6 - -cat <${filePath} -# Copyright (c) 2020, 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -resources: - JDBCSystemResource: - ${jndiName}: - Target: '${target}' - JdbcResource: - JDBCDataSourceParams: - JNDIName: [ - ${jndiName} - ] - GlobalTransactionsProtocol: ${GLOBAL_TRANSATION_PROTOCOL} - JDBCDriverParams: - DriverName: ${driver} - URL: '@@SECRET:${secretName}:url@@' - PasswordEncrypted: '@@SECRET:${secretName}:password@@' - Properties: - user: - Value: '@@SECRET:${secretName}:user@@' - JDBCConnectionPoolParams: - TestTableName: ${testTableName} - TestConnectionsOnReserve: true -EOF diff --git a/weblogic-azure-aks/src/main/arm/scripts/genDomainConfig.sh b/weblogic-azure-aks/src/main/arm/scripts/genDomainConfig.sh deleted file mode 100644 index 59850674f..000000000 --- a/weblogic-azure-aks/src/main/arm/scripts/genDomainConfig.sh +++ /dev/null @@ -1,261 +0,0 @@ -# Copyright (c) 2021, Oracle Corporation and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -export script="${BASH_SOURCE[0]}" -export scriptDir="$(cd "$(dirname "${script}")" && pwd)" - -export filePath=$1 -export wlsImagePath=$2 -export javaOptions=$3 - -export adminServiceUrl="${WLS_DOMAIN_UID}-admin-server.${WLS_DOMAIN_UID}-ns.svc.cluster.local" -export clusterServiceUrl="${WLS_DOMAIN_UID}-cluster-${constClusterName}.${WLS_DOMAIN_UID}-ns.svc.cluster.local" - -# set classpath -preClassPath="" -classPath="/u01/domains/${WLS_DOMAIN_UID}/wlsdeploy/${externalJDBCLibrariesDirectoryName}/*" - -if [[ "${DB_TYPE}" == "mysql" ]]; then - preClassPath="/u01/domains/${WLS_DOMAIN_UID}/wlsdeploy/${constPreclassDirectoryName}/*:" -fi - -if [[ "${ENABLE_PASSWORDLESS_DB_CONNECTION,,}" == "true" ]] && [[ "${DB_TYPE}" == "mysql" || "${DB_TYPE}" == "postgresql" ]]; then - # append jackson libraries to pre-classpath to upgrade existing libs in GA images - preClassPath="${preClassPath}/u01/domains/${WLS_DOMAIN_UID}/wlsdeploy/classpathLibraries/jackson/*" - classPath="${classPath}:/u01/domains/${WLS_DOMAIN_UID}/wlsdeploy/classpathLibraries/azureLibraries/*" -fi - -cat <$filePath -# Copyright (c) 2021, Oracle Corporation and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. -# -# Based on ./kubernetes/samples/scripts/create-weblogic-domain/model-in-image/domain-resources/WLS/mii-initial-d1-WLS-v1.yaml -# in https://github.com/oracle/weblogic-kubernetes-operator. -# This is an example of how to define a Domain resource. -# -apiVersion: "weblogic.oracle/v9" -kind: Domain -metadata: - name: "${WLS_DOMAIN_UID}" - namespace: "${WLS_DOMAIN_UID}-ns" - labels: - weblogic.domainUID: "${WLS_DOMAIN_UID}" - -spec: - # Set to 'FromModel' to indicate 'Model in Image'. - domainHomeSourceType: FromModel - - # The WebLogic Domain Home, this must be a location within - # the image for 'Model in Image' domains. - domainHome: /u01/domains/${WLS_DOMAIN_UID} - - # The WebLogic Server image that the Operator uses to start the domain - image: "${wlsImagePath}" - - # Defaults to "Always" if image tag (version) is ':latest' - imagePullPolicy: "IfNotPresent" - - # Identify which Secret contains the credentials for pulling an image - imagePullSecrets: - - name: regsecret - - # Identify which Secret contains the WebLogic Admin credentials, - # the secret must contain 'username' and 'password' fields. - webLogicCredentialsSecret: - name: "${WLS_DOMAIN_UID}-weblogic-credentials" - - # Whether to include the WebLogic Server stdout in the pod's stdout, default is true - includeServerOutInPodLog: true - - # Whether to enable overriding your log file location, see also 'logHome' - #logHomeEnabled: false - - # The location for domain log, server logs, server out, introspector out, and Node Manager log files - # see also 'logHomeEnabled', 'volumes', and 'volumeMounts'. - #logHome: /shared/logs/${WLS_DOMAIN_UID} - - # Set which WebLogic Servers the Operator will start - # - "Never" will not start any server in the domain - # - "AdminOnly" will start up only the administration server (no managed servers will be started) - # - "IfNeeded" will start all non-clustered servers, including the administration server, and clustered servers up to their replica count. - serverStartPolicy: IfNeeded - - # Settings for all server pods in the domain including the introspector job pod - serverPod: - # Tune for small VM sizes - # https://oracle.github.io/weblogic-kubernetes-operator/managing-domains/domain-lifecycle/liveness-readiness-probe-customization/ - livenessProbe: - periodSeconds: ${constLivenessProbePeriodSeconds} - timeoutSeconds: ${constLivenessProbeTimeoutSeconds} - failureThreshold: ${constLivenessProbeFailureThreshold} - readinessProbe: - periodSeconds: ${constReadinessProbeProbePeriodSeconds} - timeoutSeconds: ${constReadinessProbeTimeoutSeconds} - failureThreshold: ${constReadinessProbeFailureThreshold} - # Optional new or overridden environment variables for the domain's pods - # - This sample uses CUSTOM_DOMAIN_NAME in its image model file - # to set the Weblogic domain name - env: - - name: CUSTOM_DOMAIN_NAME - value: "${WLS_DOMAIN_NAME}" - - name: JAVA_OPTIONS - value: "${constDefaultJavaOptions} ${javaOptions}" - - name: USER_MEM_ARGS - value: "${constDefaultJVMArgs}" - - name: MANAGED_SERVER_PREFIX - value: "${WLS_MANAGED_SERVER_PREFIX}" - - name: PRE_CLASSPATH - value: "${preClassPath}" - - name: CLASSPATH - value: "${classPath}" -EOF - -if [[ "${ENABLE_CUSTOM_SSL,,}" == "true" ]]; then - cat <>$filePath - - name: SSL_IDENTITY_PRIVATE_KEY_ALIAS - valueFrom: - secretKeyRef: - key: sslidentitykeyalias - name: ${WLS_DOMAIN_UID}-weblogic-ssl-credentials - - name: SSL_IDENTITY_PRIVATE_KEY_PSW - valueFrom: - secretKeyRef: - key: sslidentitykeypassword - name: ${WLS_DOMAIN_UID}-weblogic-ssl-credentials - - name: SSL_IDENTITY_PRIVATE_KEYSTORE_PATH - valueFrom: - secretKeyRef: - key: sslidentitystorepath - name: ${WLS_DOMAIN_UID}-weblogic-ssl-credentials - - name: SSL_IDENTITY_PRIVATE_KEYSTORE_TYPE - valueFrom: - secretKeyRef: - key: sslidentitystoretype - name: ${WLS_DOMAIN_UID}-weblogic-ssl-credentials - - name: SSL_IDENTITY_PRIVATE_KEYSTORE_PSW - valueFrom: - secretKeyRef: - key: sslidentitystorepassword - name: ${WLS_DOMAIN_UID}-weblogic-ssl-credentials - - name: SSL_TRUST_KEYSTORE_PATH - valueFrom: - secretKeyRef: - key: ssltruststorepath - name: ${WLS_DOMAIN_UID}-weblogic-ssl-credentials - - name: SSL_TRUST_KEYSTORE_TYPE - valueFrom: - secretKeyRef: - key: ssltruststoretype - name: ${WLS_DOMAIN_UID}-weblogic-ssl-credentials - - name: SSL_TRUST_KEYSTORE_PSW - valueFrom: - secretKeyRef: - key: ssltruststorepassword - name: ${WLS_DOMAIN_UID}-weblogic-ssl-credentials -EOF -fi - -if [[ "${ENABLE_ADMIN_CUSTOM_T3,,}" == "true" ]]; then - cat <>$filePath - - name: T3_TUNNELING_ADMIN_PORT - value: "${WLS_T3_ADMIN_PORT}" - - name: T3_TUNNELING_ADMIN_ADDRESS - value: "${adminServiceUrl}" -EOF -fi - -if [[ "${ENABLE_CLUSTER_CUSTOM_T3,,}" == "true" ]]; then - cat <>$filePath - - name: T3_TUNNELING_CLUSTER_PORT - value: "${WLS_T3_CLUSTER_PORT}" - - name: T3_TUNNELING_CLUSTER_ADDRESS - value: "${clusterServiceUrl}" -EOF -fi - -# Resources -cat <>$filePath - resources: - requests: - cpu: "${WLS_RESOURCE_REQUEST_CPU}" - memory: "${WLS_RESOURCE_REQUEST_MEMORY}" -EOF - -# enable db pod identity, all of the selector of pod identities are "db-pod-idenity" -if [[ "${ENABLE_PASSWORDLESS_DB_CONNECTION,,}" == "true" ]]; then - cat <>$filePath - labels: - aadpodidbinding: "${constDbPodIdentitySelector}" -EOF -fi - -if [[ "${ENABLE_PV,,}" == "true" ]]; then - cat <>$filePath - # Optional volumes and mounts for the domain's pods. See also 'logHome'. - volumes: - - name: ${WLS_DOMAIN_UID}-pv-azurefile - persistentVolumeClaim: - claimName: ${WLS_DOMAIN_UID}-pvc-azurefile - volumeMounts: - - mountPath: /shared - name: ${WLS_DOMAIN_UID}-pv-azurefile -EOF -fi - -cat <>$filePath - # The desired behavior for starting the domain's administration server. - adminServer: - # Setup a Kubernetes node port for the administration server default channel - #adminService: - # channels: - # - channelName: default - # nodePort: 30701 - - # The number of admin servers to start for unlisted clusters - replicas: 1 - - # The name of each Cluster resource - clusters: - - name: ${WLS_DOMAIN_UID}-cluster-1 - - # Change the restartVersion to force the introspector job to rerun - # and apply any new model configuration, to also force a subsequent - # roll of your domain's WebLogic Server pods. - restartVersion: '1' - - configuration: - - # Settings for domainHomeSourceType 'FromModel' - model: - # Valid model domain types are 'WLS', 'JRF', and 'RestrictedJRF', default is 'WLS' - domainType: "WLS" - - # Optional configmap for additional models and variable files - #configMap: ${WLS_DOMAIN_UID}-wdt-config-map - - # All 'FromModel' domains require a runtimeEncryptionSecret with a 'password' field - runtimeEncryptionSecret: "${WLS_DOMAIN_UID}-runtime-encryption-secret" - - # Secrets that are referenced by model yaml macros - # (the model yaml in the optional configMap or in the image) - #secrets: - #- ${WLS_DOMAIN_UID}-datasource-secret - ---- - -apiVersion: "weblogic.oracle/v1" -kind: Cluster -metadata: - name: ${WLS_DOMAIN_UID}-cluster-1 - # Update this with the namespace your domain will run in: - namespace: ${WLS_DOMAIN_UID}-ns - labels: - # Update this with the domainUID of your domain: - weblogic.domainUID: ${WLS_DOMAIN_UID} -spec: - # This must match a cluster name that is specified in the WebLogic configuration - clusterName: cluster-1 - # The number of managed servers to start for this cluster - replicas: 2 - -EOF \ No newline at end of file diff --git a/weblogic-azure-aks/src/main/arm/scripts/genImageModel.sh b/weblogic-azure-aks/src/main/arm/scripts/genImageModel.sh deleted file mode 100644 index 63495d256..000000000 --- a/weblogic-azure-aks/src/main/arm/scripts/genImageModel.sh +++ /dev/null @@ -1,201 +0,0 @@ -# Copyright (c) 2021, Oracle Corporation and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Initialize -export script="${BASH_SOURCE[0]}" -export scriptDir="$(cd "$(dirname "${script}")" && pwd)" - -source ${scriptDir}/common.sh - -export filePath=$1 -export appPackageUrls=$2 -export enableCustomSSL=$3 -export enableAdminT3Tunneling=$4 -export enableClusterT3Tunneling=$5 - -export enableT3s=${enableCustomSSL,,} -export t3Protocol="t3" -export t3ChannelName="T3Channel" - -if [ "${enableCustomSSL,,}" == "true" ]; then - t3Protocol="t3s" - t3ChannelName="T3sChannel" -fi - -cat <${filePath} -# Copyright (c) 2020, 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Based on ./kubernetes/samples/scripts/create-weblogic-domain/model-in-image/model-images/model-in-image__WLS-v1/model.10.yaml -# in https://github.com/oracle/weblogic-kubernetes-operator. - -domainInfo: - AdminUserName: "@@SECRET:__weblogic-credentials__:username@@" - AdminPassword: "@@SECRET:__weblogic-credentials__:password@@" - ServerStartMode: "prod" - -topology: - Name: "@@ENV:CUSTOM_DOMAIN_NAME@@" - ProductionModeEnabled: true - AdminServerName: "admin-server" - Cluster: - "cluster-1": - DynamicServers: - ServerTemplate: "cluster-1-template" - ServerNamePrefix: "@@ENV:MANAGED_SERVER_PREFIX@@" - DynamicClusterSize: "@@PROP:CLUSTER_SIZE@@" - MaxDynamicClusterSize: "@@PROP:CLUSTER_SIZE@@" - MinDynamicClusterSize: "0" - CalculatedListenPorts: false - Server: - "admin-server": - ListenPort: 7001 -EOF - -if [[ "${enableAdminT3Tunneling,,}" == "true" ]];then - cat <>${filePath} - NetworkAccessPoint: - ${t3ChannelName}: - Protocol: '${t3Protocol}' - ListenPort: "@@ENV:T3_TUNNELING_ADMIN_PORT@@" - PublicPort: "@@ENV:T3_TUNNELING_ADMIN_PORT@@" - HttpEnabledForThisProtocol: true - OutboundEnabled: false - Enabled: true - TwoWaySSLEnabled: ${enableT3s} - ClientCertificateEnforced: false - TunnelingEnabled: true - PublicAddress: '@@ENV:T3_TUNNELING_ADMIN_ADDRESS@@' -EOF -fi - -if [[ "${enableCustomSSL,,}" == "true" ]]; then - cat <>${filePath} - SSL: - HostnameVerificationIgnored: true - ListenPort: 7002 - Enabled: true - HostnameVerifier: 'None' - ServerPrivateKeyAlias: "@@ENV:SSL_IDENTITY_PRIVATE_KEY_ALIAS@@" - ServerPrivateKeyPassPhraseEncrypted: "@@ENV:SSL_IDENTITY_PRIVATE_KEY_PSW@@" - KeyStores: 'CustomIdentityAndCustomTrust' - CustomIdentityKeyStoreFileName: "@@ENV:SSL_IDENTITY_PRIVATE_KEYSTORE_PATH@@" - CustomIdentityKeyStoreType: "@@ENV:SSL_IDENTITY_PRIVATE_KEYSTORE_TYPE@@" - CustomIdentityKeyStorePassPhraseEncrypted: "@@ENV:SSL_IDENTITY_PRIVATE_KEYSTORE_PSW@@" - CustomTrustKeyStoreFileName: "@@ENV:SSL_TRUST_KEYSTORE_PATH@@" - CustomTrustKeyStoreType: "@@ENV:SSL_TRUST_KEYSTORE_TYPE@@" - CustomTrustKeyStorePassPhraseEncrypted: "@@ENV:SSL_TRUST_KEYSTORE_PSW@@" -EOF -fi - -cat <>${filePath} - ServerTemplate: - "cluster-1-template": - Cluster: "cluster-1" - ListenPort: 8001 -EOF - -if [[ "${enableClusterT3Tunneling,,}" == "true" ]];then - cat <>${filePath} - NetworkAccessPoint: - ${t3ChannelName}: - Protocol: '${t3Protocol}' - ListenPort: "@@ENV:T3_TUNNELING_CLUSTER_PORT@@" - PublicPort: "@@ENV:T3_TUNNELING_CLUSTER_PORT@@" - HttpEnabledForThisProtocol: true - OutboundEnabled: false - Enabled: true - TwoWaySSLEnabled: ${enableT3s} - ClientCertificateEnforced: false - TunnelingEnabled: true - PublicAddress: '@@ENV:T3_TUNNELING_CLUSTER_ADDRESS@@' -EOF -fi - -if [[ "${enableCustomSSL,,}" == "true" ]];then - cat <>${filePath} - SSL: - HostnameVerificationIgnored: true - ListenPort: 8002 - Enabled: true - HostnameVerifier: 'None' - ServerPrivateKeyAlias: "@@ENV:SSL_IDENTITY_PRIVATE_KEY_ALIAS@@" - ServerPrivateKeyPassPhraseEncrypted: "@@ENV:SSL_IDENTITY_PRIVATE_KEY_PSW@@" - KeyStores: 'CustomIdentityAndCustomTrust' - CustomIdentityKeyStoreFileName: "@@ENV:SSL_IDENTITY_PRIVATE_KEYSTORE_PATH@@" - CustomIdentityKeyStoreType: "@@ENV:SSL_IDENTITY_PRIVATE_KEYSTORE_TYPE@@" - CustomIdentityKeyStorePassPhraseEncrypted: "@@ENV:SSL_IDENTITY_PRIVATE_KEYSTORE_PSW@@" - CustomTrustKeyStoreFileName: "@@ENV:SSL_TRUST_KEYSTORE_PATH@@" - CustomTrustKeyStoreType: "@@ENV:SSL_TRUST_KEYSTORE_TYPE@@" - CustomTrustKeyStorePassPhraseEncrypted: "@@ENV:SSL_TRUST_KEYSTORE_PSW@@" -EOF -fi - -cat <>${filePath} - SecurityConfiguration: - NodeManagerUsername: "@@SECRET:__weblogic-credentials__:username@@" - NodeManagerPasswordEncrypted: "@@SECRET:__weblogic-credentials__:password@@" - -resources: - SelfTuning: - MinThreadsConstraint: - SampleMinThreads: - Target: "cluster-1" - Count: 1 - MaxThreadsConstraint: - SampleMaxThreads: - Target: "cluster-1" - Count: 10 - WorkManager: - SampleWM: - Target: "cluster-1" - MinThreadsConstraint: "SampleMinThreads" - MaxThreadsConstraint: "SampleMaxThreads" - -EOF - -if [ "${appPackageUrls}" == "[]" ]; then - exit 0 -fi - - cat <>${filePath} -appDeployments: - Application: -EOF - appPackageUrls=$(echo "${appPackageUrls:1:${#appPackageUrls}-2}") - appUrlArray=$(echo $appPackageUrls | tr "," "\n") - - index=1 - for item in $appUrlArray; do - echo ${item} - item=$(echo $item | tr -d "\"") # remove "" - # e.g. https://wlsaksapp.blob.core.windows.net/japps/testwebapp.war?sp=r&se=2021-04-29T15:12:38Z&sv=2020-02-10&sr=b&sig=7grL4qP%2BcJ%2BLfDJgHXiDeQ2ZvlWosRLRQ1ciLk0Kl7M%3D - urlWithoutQueryString="${item%\?*}" - echo $urlWithoutQueryString - fileName="${urlWithoutQueryString##*/}" - echo $fileName - fileExtension="${fileName##*.}" - echo ${fileExtension} - # support .ear, .war, .jar files. - if [[ "${fileExtension,,}" != "ear" ]] && - [[ "${fileExtension,,}" != "war" ]] && - [[ "${fileExtension,,}" != "jar" ]]; then - continue - fi - - curl -m ${curlMaxTime} --retry ${retryMaxAttempt} -fL "$item" -o ${scriptDir}/model-images/wlsdeploy/applications/${fileName} - if [ $? -ne 0 ];then - echo "Failed to download $item" - exit 1 - fi - cat <>${filePath} - app${index}: - SourcePath: 'wlsdeploy/applications/${fileName}' - ModuleType: ${fileExtension} - Target: 'cluster-1' -EOF - index=$((index + 1)) - done - -# print model -cat ${filePath} \ No newline at end of file diff --git a/weblogic-azure-aks/src/main/arm/scripts/inline-scripts/enableAgic.sh b/weblogic-azure-aks/src/main/arm/scripts/inline-scripts/enableAgic.sh deleted file mode 100644 index 2660d9d2b..000000000 --- a/weblogic-azure-aks/src/main/arm/scripts/inline-scripts/enableAgic.sh +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (c) 2021, 2024, Oracle Corporation and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -function enable_aks_msi() { - local identityLength=$(az aks show -g ${AKS_CLUSTER_RG_NAME} -n ${AKS_CLUSTER_NAME} | jq '.identity | length') - echo "identityLength ${identityLength}" - - if [ $identityLength -lt 1 ]; then - echo "enable managed identity..." - # Your cluster is using service principal, and you are going to update the cluster to use systemassigned managed identity. - # After updating, your cluster's control plane and addon pods will switch to use managed identity, but kubelet will KEEP USING SERVICE PRINCIPAL until you upgrade your agentpool. - az aks update -y -g ${AKS_CLUSTER_RG_NAME} -n ${AKS_CLUSTER_NAME} --enable-managed-identity - - utility_validate_status "Enable managed identity for ${AKS_CLUSTER_NAME}." - fi -} - -function install_azure_ingress() { - local agicEnabled=$(az aks show -n ${AKS_CLUSTER_NAME} -g ${AKS_CLUSTER_RG_NAME} | - jq '.addonProfiles.ingressApplicationGateway.enabled') - local agicGatewayId="" - - if [[ "${agicEnabled,,}" == "true" ]]; then - agicGatewayId=$(az aks show -n ${AKS_CLUSTER_NAME} -g ${AKS_CLUSTER_RG_NAME} | - jq '.addonProfiles.ingressApplicationGateway.config.applicationGatewayId' | - tr -d "\"") - fi - - local appgwId=$(az network application-gateway show \ - -n ${APPGW_NAME} \ - -g ${CURRENT_RG_NAME} -o tsv --query "id") - - if [[ "${agicGatewayId}" != "${appgwId}" ]]; then - az aks enable-addons -n ${AKS_CLUSTER_NAME} -g ${AKS_CLUSTER_RG_NAME} --addons ingress-appgw --appgw-id $appgwId - utility_validate_status "Install app gateway ingress controller." - fi -} - -# Main script -set -Eo pipefail - -enable_aks_msi - -install_azure_ingress diff --git a/weblogic-azure-aks/src/main/arm/scripts/inline-scripts/enableHpa.sh b/weblogic-azure-aks/src/main/arm/scripts/inline-scripts/enableHpa.sh deleted file mode 100644 index 36524bae5..000000000 --- a/weblogic-azure-aks/src/main/arm/scripts/inline-scripts/enableHpa.sh +++ /dev/null @@ -1,68 +0,0 @@ -# Copyright (c) 2024, Oracle Corporation and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -function get_cluster_uid(){ - local clusterUid=$(kubectl get clusters -n ${WLS_NAMESPACE} -o=jsonpath='{.items[].metadata.name}') - utility_validate_status "Obtain cluster UID." - export WLS_CLUSTER_UID=${clusterUid} -} - -function scaling_basedon_cpu(){ - kubectl autoscale cluster ${WLS_CLUSTER_UID} \ - --cpu-percent=${UTILIZATION_PERCENTAGE} \ - --min=1 \ - --max=${WLS_CLUSTER_SIZE} \ - -n ${WLS_NAMESPACE} - utility_validate_status "Enable HPA based on CPU utilization." -} - -function scaling_basedon_memory(){ - cat <scaler-memory.yaml -apiVersion: autoscaling/v2 -kind: HorizontalPodAutoscaler -metadata: - name: ${WLS_CLUSTER_UID} - namespace: ${WLS_NAMESPACE} -spec: - scaleTargetRef: - apiVersion: weblogic.oracle/v1 - kind: Cluster - name: ${WLS_CLUSTER_UID} - minReplicas: 1 - maxReplicas: ${WLS_CLUSTER_SIZE} - metrics: - - type: Resource - resource: - name: memory - target: - averageUtilization: ${UTILIZATION_PERCENTAGE} - type: Utilization -EOF - - kubectl apply -f scaler-memory.yaml - utility_validate_status "Enable HPA based on memory utilization." -} - -function check_kubernetes_metrics_server(){ - # $?=1 if there is no running kms pod. - kubectl get pod -l k8s-app=metrics-server -n kube-system | grep "Running" - # exit if $?=1 - utility_validate_status "There should be at least one pod of kubernetes metrics server running." -} - -# Main script -set -Eo pipefail - -install_kubectl - -connect_aks $AKS_CLUSTER_NAME $AKS_CLUSTER_RG_NAME - -get_cluster_uid - -check_kubernetes_metrics_server - -if [ "$HPA_SCALE_TYPE" == "cpu" ]; then - scaling_basedon_cpu -elif [ "$HPA_SCALE_TYPE" == "memory" ]; then - scaling_basedon_memory -fi diff --git a/weblogic-azure-aks/src/main/arm/scripts/inline-scripts/enablePrometheusMetrics.sh b/weblogic-azure-aks/src/main/arm/scripts/inline-scripts/enablePrometheusMetrics.sh deleted file mode 100644 index 874ff613f..000000000 --- a/weblogic-azure-aks/src/main/arm/scripts/inline-scripts/enablePrometheusMetrics.sh +++ /dev/null @@ -1,405 +0,0 @@ -# Copyright (c) 2024, Oracle Corporation and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -#!/bin/bash - -function enable_promethues_metrics(){ - # See https://learn.microsoft.com/en-us/azure/azure-monitor/containers/kubernetes-monitoring-enable?tabs=cli#enable-prometheus-and-grafana - az extension add --name k8s-extension && true - - ### Use existing Azure Monitor workspace - az aks update --enable-azure-monitor-metrics \ - --name ${AKS_CLUSTER_NAME} \ - --resource-group ${AKS_CLUSTER_RG_NAME} \ - --azure-monitor-workspace-resource-id "${AMA_WORKSPACE_ID}" \ - --only-show-errors - - utility_validate_status "Enable Promethues Metrics." - - az extension add --name aks-preview && true - az extension remove --name k8s-extension && true - - #Verify that the DaemonSet was deployed properly on the Linux node pools - #https://learn.microsoft.com/en-us/azure/azure-monitor/containers/kubernetes-monitoring-enable?tabs=cli#managed-prometheus - kubectl get ds ama-metrics-node --namespace=kube-system - #if the deployment fails, $?=1. - utility_validate_status "Validate promethues metrics is enabled." -} - -# https://learn.microsoft.com/en-us/azure/azure-monitor/containers/prometheus-metrics-scrape-configuration -function deploy_customize_scraping(){ - # https://learn.microsoft.com/en-us/azure/azure-monitor/containers/prometheus-metrics-scrape-configuration?tabs=CRDConfig%2CCRDScrapeConfig#basic-authentication - local wlsPswBase64=$(echo -n "${WLS_ADMIN_PASSWORD}" | base64) - cat <prometheus-config -global: - scrape_interval: 30s -scrape_configs: -- job_name: '${WLS_DOMAIN_UID}' - kubernetes_sd_configs: - - role: pod - namespaces: - names: [${WLS_NAMESPACE}] - basic_auth: - username: ${WLS_ADMIN_USERNAME} - password_file: /etc/prometheus/certs/password1 -EOF - - #validate the scrape config file - local podNamesinKubeSystem=$(kubectl get pods -l rsName=ama-metrics -n=kube-system -o json | jq -r '.items[].metadata.name') - mkdir promconfigvalidator - for podname in ${podNamesinKubeSystem} - do - kubectl cp -n=kube-system "${podname}":/opt/promconfigvalidator ./promconfigvalidator/promconfigvalidator - kubectl cp -n=kube-system "${podname}":/opt/microsoft/otelcollector/collector-config-template.yml ./promconfigvalidator/collector-config-template.yml - chmod 500 ./promconfigvalidator/promconfigvalidator - done - - if [ ! -f "./promconfigvalidator/promconfigvalidator" ]; then - echo_stderr "Failed to download promconfigvalidator tool that is shipped inside the Azure Monitor metrics addon pod(s)." - exit 1 - fi - - ./promconfigvalidator/promconfigvalidator --config "./prometheus-config" --otelTemplate "./promconfigvalidator/collector-config-template.yml" - utility_validate_status "Validate prometheus-config using promconfigvalidator." - - kubectl create configmap ama-metrics-prometheus-config --from-file=prometheus-config -n kube-system - utility_validate_status "Create ama-metrics-prometheus-config in kube-system namespace." -} - -function get_wls_monitoring_exporter_image_url() { - local wlsToolingFamilyJsonFile=weblogic_tooling_family.json - local imageUrl="ghcr.io/oracle/weblogic-monitoring-exporter:2.1.9" - - # download the json file that has well tested monitoring exporter image url from weblogic-azure repo. - curl -m ${curlMaxTime} --retry ${retryMaxAttempt} -fsL "${gitUrl4WLSToolingFamilyJsonFile}" -o ${wlsToolingFamilyJsonFile} - if [ $? -eq 0 ]; then - imageURL=$(cat ${wlsToolingFamilyJsonFile} | jq ".items[] | select(.key==\"WME\") | .imageURL" | tr -d "\"") - echo_stdout "well tested monitoring exporter image url: ${imageURL}" - fi - - echo_stdout "Use monitoring exporter image: ${imageURL} " - export WME_IMAGE_URL=${imageUrl} -} - -# https://github.com/oracle/weblogic-monitoring-exporter -function deploy_webLogic_monitoring_exporter(){ - local wlsVersion=$(kubectl -n ${WLS_NAMESPACE} get domain ${WLS_DOMAIN_UID} -o=jsonpath='{.spec.restartVersion}' | tr -d "\"") - wlsVersion=$((wlsVersion+1)) - - cat <patch-file.json -[ - { - "op": "replace", - "path": "/spec/restartVersion", - "value": "${wlsVersion}" - }, - { - "op": "add", - "path": "/spec/monitoringExporter", - "value": { - "configuration": { - "domainQualifier": true, - "metricsNameSnakeCase": true, - "queries": [ - { - "applicationRuntimes": { - "componentRuntimes": { - "key": "name", - "prefix": "webapp_config_", - "servlets": { - "key": "servletName", - "prefix": "weblogic_servlet_", - "values": [ - "invocationTotalCount", - "reloadTotal", - "executionTimeAverage", - "poolMaxCapacity", - "executionTimeTotal", - "reloadTotalCount", - "executionTimeHigh", - "executionTimeLow" - ] - }, - "type": "WebAppComponentRuntime", - "values": [ - "deploymentState", - "contextRoot", - "sourceInfo", - "openSessionsHighCount", - "openSessionsCurrentCount", - "sessionsOpenedTotalCount", - "sessionCookieMaxAgeSecs", - "sessionInvalidationIntervalSecs", - "sessionTimeoutSecs", - "singleThreadedServletPoolSize", - "sessionIDLength", - "servletReloadCheckSecs", - "jSPPageCheckSecs" - ] - }, - "workManagerRuntimes": { - "prefix": "workmanager_", - "key": "applicationName", - "values": [ - "pendingRequests", - "completedRequests", - "stuckThreadCount"] - }, - "key": "name", - "keyName": "app" - }, - "JVMRuntime": { - "key": "name", - "values": [ - "heapFreeCurrent", - "heapFreePercent", - "heapSizeCurrent", - "heapSizeMax", - "uptime", - "processCpuLoad" - ] - }, - "key": "name", - "keyName": "server" - } - ] - }, - "image": "${WME_IMAGE_URL}", - "port": 8080 - } - } -] -EOF - - kubectl -n ${WLS_NAMESPACE} patch domain ${WLS_DOMAIN_UID} \ - --type=json \ - --patch-file patch-file.json - utility_validate_status "Enable WebLogic Monitoring Exporter." - - local timestampBeforePatchingDomain=$(date +%s) - local clusterName=$(kubectl get cluster -n ${WLS_NAMESPACE} -o json | jq -r '.items[0].metadata.name') - local replicas=$(kubectl -n ${WLS_NAMESPACE} get cluster ${clusterName} -o json \ - | jq '. | .spec.replicas') - - # wait for the restart completed. - utility_wait_for_pod_restarted \ - ${timestampBeforePatchingDomain} \ - ${replicas} \ - ${WLS_DOMAIN_UID} \ - ${checkPodStatusMaxAttemps} \ - ${checkPodStatusInterval} -} - -function wait_for_keda_ready(){ - local ready=false - local attempt=0 - - while [[ "${ready}" == "false" && $attempt -le ${checkKedaMaxAttempt} ]]; do - echo_stdout "Check if KEDA is ready, attempt: ${attempt}." - ready=true - - local podCount=$(kubectl get pods -n ${KEDA_NAMESPACE} -o json | jq -r '.items | length') - if [ $podCount -lt 3 ];then - ready=false - fi - - local podnames=$(kubectl get pods -n ${KEDA_NAMESPACE} -o json | jq -r '.items[].metadata.name') - for podname in ${podnames} - do - kubectl get pod ${podname} -n ${KEDA_NAMESPACE} | grep "Running" - - if [ $? -eq 1 ];then - ready=false - fi - done - - attempt=$((attempt + 1)) - sleep ${checkKedaInteval} - done - - if [ ${attempt} -gt ${checkKedaMaxAttempt} ]; then - echo_stderr "Failed to enable KEDA." - exit 1 - fi - - echo_stderr "KEDA is running." -} - -function get_keda_latest_version() { - local kedaVersion - kedaVersion=$(helm search repo kedacore/keda --versions | awk '/^kedacore\/keda/ {print $2; exit}') - export KEDA_VERSION="${kedaVersion}" - echo_stderr "Use latest KEDA. KEDA version: ${KEDA_VERSION}" -} - - -function get_keda_version() { - local versionJsonFileName="aks_tooling_well_tested_version.json" - local kedaWellTestedVersion - - # Download the version JSON file - curl -L "${gitUrl4AksToolingWellTestedVersionJsonFile}" --retry "${retryMaxAttempt}" -o "${versionJsonFileName}" - - # Extract KEDA version from JSON - kedaWellTestedVersion=$(jq -r '.items[] | select(.key == "keda") | .version' "${versionJsonFileName}") - - # Check if version is available - if [ $? -ne 0 ]; then - get_keda_latest_version - return 0 - fi - - # Print KEDA well-tested version - echo_stderr "KEDA well-tested version: ${kedaWellTestedVersion}" - - # Search for KEDA version in Helm repo - if ! helm search repo kedacore/keda --versions | grep -q "${kedaWellTestedVersion}"; then - get_keda_latest_version - return 0 - fi - - # Export KEDA version - export KEDA_VERSION="${kedaWellTestedVersion}" - echo_stderr "KEDA version: ${KEDA_VERSION}" -} - -# https://learn.microsoft.com/en-us/azure/azure-monitor/containers/integrate-keda -function enable_keda_addon() { - local oidcEnabled=$(az aks show --resource-group $AKS_CLUSTER_RG_NAME --name $AKS_CLUSTER_NAME --query oidcIssuerProfile.enabled) - local workloadIdentity=$(az aks show --resource-group $AKS_CLUSTER_RG_NAME --name $AKS_CLUSTER_NAME --query securityProfile.workloadIdentity) - - if [[ "${oidcEnabled,,}" == "false" || -z "${workloadIdentity}" ]]; then - # mitigate https://github.com/Azure/azure-cli/issues/28649 - pip install --upgrade azure-core - az aks update -g $AKS_CLUSTER_RG_NAME -n $AKS_CLUSTER_NAME --enable-workload-identity --enable-oidc-issuer - utility_validate_status "Enable oidc and worload identity in AKS $AKS_CLUSTER_NAME." - fi - - export OIDC_ISSUER_URL=$(az aks show -n $AKS_CLUSTER_NAME -g $AKS_CLUSTER_RG_NAME --query "oidcIssuerProfile.issuerUrl" -otsv) - export KEDA_UAMI_CLIENT_ID=$(az identity show --resource-group $CURRENT_RG_NAME --name $KEDA_UAMI_NAME --query 'clientId' -otsv) - local tenantId=$(az identity show --resource-group $CURRENT_RG_NAME --name $KEDA_UAMI_NAME --query 'tenantId' -otsv) - - kubectl create namespace ${KEDA_NAMESPACE} - - cat <kedascalersample.yaml -apiVersion: keda.sh/v1alpha1 -kind: TriggerAuthentication -metadata: - name: azure-managed-prometheus-trigger-auth - namespace: ${WLS_NAMESPACE} -spec: - podIdentity: - provider: azure-workload - identityId: ${KEDA_UAMI_CLIENT_ID} ---- -apiVersion: keda.sh/v1alpha1 -kind: ScaledObject -metadata: - name: azure-managed-prometheus-scaler - namespace: ${WLS_NAMESPACE} -spec: - scaleTargetRef: - apiVersion: weblogic.oracle/v1 - kind: Cluster - name: ${clusterName} - minReplicaCount: 1 - maxReplicaCount: ${WLS_CLUSTER_SIZE} - triggers: - - type: prometheus - metadata: - serverAddress: ${kedaServerAddress} - metricName: webapp_config_open_sessions_high_count - query: sum(webapp_config_open_sessions_high_count{app=""}) # Note: query must return a vector/scalar single element response - threshold: '10' - activationThreshold: '1' - authenticationRef: - name: azure-managed-prometheus-trigger-auth -EOF - - local base64ofKedaScalerSample=$(cat ./kedascalersample.yaml | base64) - local result=$(jq -n -c \ - --arg kedaScalerServerAddress "$kedaServerAddress" \ - --arg base64ofKedaScalerSample "${base64ofKedaScalerSample}" \ - '{kedaScalerServerAddress: $kedaScalerServerAddress, base64ofKedaScalerSample: $base64ofKedaScalerSample}') - echo "result is: $result" - echo $result >$AZ_SCRIPTS_OUTPUT_PATH -} - -# TBD see if we can query some of the metrics - -# Main script -set -Eo pipefail - -install_kubectl - -install_helm - -connect_aks $AKS_CLUSTER_NAME $AKS_CLUSTER_RG_NAME - -get_wls_monitoring_exporter_image_url - -deploy_webLogic_monitoring_exporter - -enable_promethues_metrics - -deploy_customize_scraping - -enable_keda_addon - -output diff --git a/weblogic-azure-aks/src/main/arm/scripts/inline-scripts/queryDomainConfigurations.sh b/weblogic-azure-aks/src/main/arm/scripts/inline-scripts/queryDomainConfigurations.sh deleted file mode 100644 index 85121f908..000000000 --- a/weblogic-azure-aks/src/main/arm/scripts/inline-scripts/queryDomainConfigurations.sh +++ /dev/null @@ -1,81 +0,0 @@ -# Copyright (c) 2021, 2024 Oracle Corporation and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# This script runs on Azure Container Instance with Alpine Linux that Azure Deployment script creates. -# -# env inputs: -# AKS_CLUSTER_NAME -# AKS_CLUSTER_RESOURCEGROUP_NAME -# WLS_CLUSTER_NAME -# WLS_DOMAIN_UID - -# Main script -wlsContainerName="weblogic-server" - -echo "install kubectl" -az aks install-cli - -echo "Connect AKS" -connect_aks $AKS_CLUSTER_NAME $AKS_CLUSTER_RESOURCEGROUP_NAME - -wlsDomainNS="${WLS_DOMAIN_UID}-ns" - -domainConfigurationYaml=/tmp/domain.yaml -rm -f ${domainConfigurationYaml} -kubectl get domain ${WLS_DOMAIN_UID} -n ${wlsDomainNS} -o yaml >${domainConfigurationYaml} - -podNum=$(kubectl -n ${wlsDomainNS} get pod -l weblogic.clusterName=${WLS_CLUSTER_NAME} -o json | jq '.items| length') - if [ ${podNum} -le 0 ]; then - echo_stderr "Ensure your cluster has at least one pod." - exit 1 - fi - -podName=$(kubectl -n ${wlsDomainNS} get pod -l weblogic.clusterName=${WLS_CLUSTER_NAME} -o json \ - | jq '.items[0] | .metadata.name' \ - | tr -d "\"") - -echo "Copy model.yaml from /u01/wdt/models" -targetModelYaml=/tmp/model.yaml -rm -f ${targetModelYaml} -kubectl cp -n ${wlsDomainNS} -c ${wlsContainerName} ${podName}:/u01/wdt/models/model.yaml ${targetModelYaml} -if [ $? != 0 ]; then - echo >&2 "Fail to copy ${podName}:/u01/wdt/models/model.yaml." - exit 1 -fi - -echo "Copy model.properties from from /u01/wdt/models" -targetModelProperties=/tmp/model.properties -rm -f ${targetModelProperties} -kubectl cp -n ${wlsDomainNS} -c ${wlsContainerName} ${podName}:/u01/wdt/models/model.properties ${targetModelProperties} -if [ $? != 0 ]; then - echo >&2 "Fail to copy ${podName}:/u01/wdt/models/model.properties." - exit 1 -fi - -echo "Query WebLogic version and patch numbers" -targetFile4Versions=/tmp/version.info -kubectl exec -it ${podName} -n ${wlsDomainNS} -c ${wlsContainerName} \ - -- bash -c 'source $ORACLE_HOME/wlserver/server/bin/setWLSEnv.sh > /dev/null 2>&1 && java weblogic.version -verbose >"'${targetFile4Versions}'"' -if [ $? != 0 ]; then - echo >&2 "Fail to run java weblogic.version." - exit 1 -fi -rm -f ${targetFile4Versions} -kubectl cp -n ${wlsDomainNS} -c ${wlsContainerName} ${podName}:${targetFile4Versions} ${targetFile4Versions} -if [ $? != 0 ]; then - echo >&2 "Fail to copy ${podName}:${targetFile4Versions}." - exit 1 -fi - -base64ofDomainYaml=$(cat ${domainConfigurationYaml} | base64) -base64ofModelYaml=$(cat ${targetModelYaml} | base64) -base64ofModelProperties=$(cat ${targetModelProperties} | base64) -base64ofWLSVersionDetails=$(cat ${targetFile4Versions} | base64) - -result=$(jq -n -c \ - --arg domainDeploymentYaml "$base64ofDomainYaml" \ - --arg wlsImageModelYaml "$base64ofModelYaml" \ - --arg wlsImageProperties "$base64ofModelProperties" \ - --arg wlsVersionDetails "${base64ofWLSVersionDetails}" \ - '{domainDeploymentYaml: $domainDeploymentYaml, wlsImageModelYaml: $wlsImageModelYaml, wlsImageProperties: $wlsImageProperties, wlsVersionDetails: $wlsVersionDetails}') -echo "result is: $result" -echo $result >$AZ_SCRIPTS_OUTPUT_PATH diff --git a/weblogic-azure-aks/src/main/arm/scripts/inline-scripts/queryPrivateIPForAppGateway.sh b/weblogic-azure-aks/src/main/arm/scripts/inline-scripts/queryPrivateIPForAppGateway.sh deleted file mode 100644 index 1db3a69c3..000000000 --- a/weblogic-azure-aks/src/main/arm/scripts/inline-scripts/queryPrivateIPForAppGateway.sh +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (c) 2022, Oracle Corporation and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# This script runs on Azure Container Instance with Alpine Linux that Azure Deployment script creates. -# -# env inputs: -# SUBNET_ID -# KNOWN_IP - -function query_ip() { - echo_stdout "Subnet Id: ${SUBNET_ID}" - - # select a available private IP - # azure reserves the first 3 private IPs. - local ret=$(az network vnet check-ip-address \ - --ids ${SUBNET_ID} \ - --ip-address ${KNOWN_IP}) - local available=$(echo ${ret} | jq -r .available) - if [[ "${available,,}" == "true" ]]; then - outputPrivateIP=${KNOWN_IP} - else - local privateIPAddress=$(echo ${ret} | jq -r .availableIpAddresses[0]) - if [[ -z "${privateIPAddress}" ]] || [[ "${privateIPAddress}"=="null" ]]; then - echo_stderr "ERROR: make sure there is available IP for application gateway in your subnet." - fi - - outputPrivateIP=${privateIPAddress} - fi -} - -function output_result() { - echo "Available Private IP: ${outputPrivateIP}" - result=$(jq -n -c \ - --arg privateIP "$outputPrivateIP" \ - '{privateIP: $privateIP}') - echo "result is: $result" - echo $result >$AZ_SCRIPTS_OUTPUT_PATH -} - -# main script -outputPrivateIP="10.0.0.1" - -query_ip - -output_result \ No newline at end of file diff --git a/weblogic-azure-aks/src/main/arm/scripts/inline-scripts/validateAgic.sh b/weblogic-azure-aks/src/main/arm/scripts/inline-scripts/validateAgic.sh deleted file mode 100644 index a7756cf14..000000000 --- a/weblogic-azure-aks/src/main/arm/scripts/inline-scripts/validateAgic.sh +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (c) 2024, Oracle Corporation and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -function wait_for_azure_ingress_ready() { - local ready=false - local attempt=0 - - while [[ "${ready}" == "false" && $attempt -le ${checkAgicMaxAttempt} ]]; do - echo_stdout "Check if ACIG is ready, attempt: ${attempt}." - ready=true - - local ret=$(kubectl get pod -n kube-system | grep "ingress-appgw-deployment-*" | grep "Running") - if [ -z "${ret}" ]; then - ready=false - fi - - attempt=$((attempt + 1)) - sleep ${checkAgicInterval} - done - - if [ ${attempt} -gt ${checkAgicMaxAttempt} ]; then - echo_stderr "Failed to enable Application Gateway Ingress Controler." - exit 1 - fi - - echo "Application Gateway Ingress Controler is running." -} - -# Main script -set -Eo pipefail - -install_kubectl - -connect_aks $AKS_CLUSTER_NAME $AKS_CLUSTER_RG_NAME - -wait_for_azure_ingress_ready diff --git a/weblogic-azure-aks/src/main/arm/scripts/inline-scripts/validateParameters.sh b/weblogic-azure-aks/src/main/arm/scripts/inline-scripts/validateParameters.sh deleted file mode 100644 index 801019785..000000000 --- a/weblogic-azure-aks/src/main/arm/scripts/inline-scripts/validateParameters.sh +++ /dev/null @@ -1,588 +0,0 @@ -# Copyright (c) 2021, 2024, Oracle Corporation and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# This script runs on Azure Container Instance with Alpine Linux that Azure Deployment script creates. -# -# env inputs: -# ORACLE_ACCOUNT_NAME -# ORACLE_ACCOUNT_PASSWORD -# ACR_NAME -# AKS_CLUSTER_NAME -# AKS_CLUSTER_RESOURCEGROUP_NAME -# BASE64_FOR_SERVICE_PRINCIPAL -# WLS_SSL_IDENTITY_DATA -# WLS_SSL_IDENTITY_PASSWORD -# WLS_SSL_IDENTITY_TYPE -# WLS_SSL_TRUST_DATA -# WLS_SSL_TRUST_PASSWORD -# WLS_SSL_TRUST_TYPE -# WLS_SSL_PRIVATE_KEY_ALIAS -# WLS_SSL_PRIVATE_KEY_PASSWORD -# APPLICATION_GATEWAY_SSL_FRONTEND_CERT_DATA -# APPLICATION_GATEWAY_SSL_FRONTEND_CERT_PASSWORD -# DNS_ZONE_NAME -# DNS_ZONE_RESOURCEGROUP_NAME -# AKS_VERSION -# USE_AKS_WELL_TESTED_VERSION -# VNET_FOR_APPLICATIONGATEWAY - -#Validate teminal status with $?, exit with exception if errors happen. -# $1 - error message -# $2 - root cause message -function validate_status() { - if [ $? != 0 ]; then - echo_stderr "Errors happen during: $1." $2 - exit 1 - else - echo_stdout "$1" - fi -} - -# Validate compute resources -# Check points: -# - there is enough resource for AKS cluster -# - there is enough resource for VM to build the image -# Example to list the vm usage: -# az vm list-usage --location "East US" -o table -# Name CurrentValue Limit -# ---------------------------------------- -------------- ------- -# Availability Sets 0 2500 -# Total Regional vCPUs 2 200 -# Virtual Machines 1 25000 -# Virtual Machine Scale Sets 0 2500 -# Dedicated vCPUs 0 3000 -# Cloud Services 0 2500 -# Total Regional Low-priority vCPUs 0 100 -# Standard DSv2 Family vCPUs 0 100 -# Standard Av2 Family vCPUs 2 100 -# Basic A Family vCPUs 0 100 -# Standard A0-A7 Family vCPUs 0 200 -# Standard A8-A11 Family vCPUs 0 100 -# Standard D Family vCPUs 0 100 -# Standard Dv2 Family vCPUs 0 100 -# Standard DS Family vCPUs 0 100 -# Standard G Family vCPUs 0 100 -# Standard GS Family vCPUs 0 100 -# Standard F Family vCPUs 0 100 -# Standard FS Family vCPUs 0 100 -# ... ... -function validate_compute_resources() { - # Resource for ubuntu machine - # 2 Standard Av2 Family vCPUs - - # query total cores - local vmUsage=$(az vm list-usage -l ${location} -o json) - local totalCPUs=$(echo ${vmUsage} | jq '.[] | select(.name.value=="cores") | .limit' | tr -d "\"") - local currentCPUs=$(echo ${vmUsage} | jq '.[] | select(.name.value=="cores") | .currentValue' | tr -d "\"") - local aksCPUs=0 - - # if creating new AKS cluster - if [[ "${createAKSCluster,,}" == "true" ]]; then - local aksVMDetails=$(az vm list-skus --size ${aksAgentPoolVMSize} -l ${location} --query [0]) - local vmFamily=$(echo ${aksVMDetails} | jq '.family' | tr -d "\"") - local vmCPUs=$(echo ${aksVMDetails} | jq '.capabilities[] | select(.name=="vCPUs") | .value' | tr -d "\"") - aksCPUs=$((vmCPUs * aksAgentPoolNodeCount)) - - # query CPU usage of the vm family - local familyLimit=$(echo ${vmUsage} | jq '.[] | select(.name.value=="'${vmFamily}'") | .limit' | tr -d "\"") - local familyUsage=$(echo ${vmUsage} | jq '.[] | select(.name.value=="'${vmFamily}'") | .currentValue' | tr -d "\"") - local requiredFamilyCPUs=$((aksCPUs + familyUsage)) - # make sure thers is enough vCPUs of the family for AKS - if [ ${requiredFamilyCPUs} -gt ${familyLimit} ]; then - echo_stderr "It requires ${aksCPUs} ${vmFamily} vCPUs to create the AKS cluster, ${vmFamily} vCPUs quota is limited to ${familyLimit}, current usage is ${familyUsage}." - exit 1 - fi - fi - - local vmFamilyOfUbuntu="standardAv2Family" - local familyLimit=$(echo ${vmUsage} | jq '.[] | select(.name.value=="'${vmFamilyOfUbuntu}'") | .limit' | tr -d "\"") - local familyUsage=$(echo ${vmUsage} | jq '.[] | select(.name.value=="'${vmFamilyOfUbuntu}'") | .currentValue' | tr -d "\"") - local requiredFamilyCPUs=$((2 + familyUsage)) - # make sure thers is enough vCPUs of the family for ubuntu machine - if [ ${requiredFamilyCPUs} -gt ${familyLimit} ]; then - echo_stderr "It requires 2 ${vmFamilyOfUbuntu} vCPUs to create an ubuntu machine for docker image, ${vmFamilyOfUbuntu} vCPUs quota is limited to ${familyLimit}, current usage is ${familyUsage}." - exit 1 - fi - - local requiredCPU=$((aksCPUs + 2 + currentCPUs)) - if [ ${requiredCPU} -gt ${totalCPUs} ]; then - echo_stderr "It requires ${requiredCPU} vCPUs to run WLS on AKS, vCPUs quota is limited to ${totalCPUs}, current usage is ${currentCPUs}." - exit 1 - fi - - echo_stdout "Check compute resources: passed!" -} - -# Ensure the cluster has enough memory resources. -# The offer deploys a WLS cluster with 1 + ${APP_REPLICAS} pods, each pod requestes 1.5GB and 0.25CPU. -# Minimum memory requirement: 12 + (APP_REPLICAS + 1)*1.5 GB -function validate_memory_resources() { - if [[ "${createAKSCluster,,}" == "true" ]]; then - local requiredMemoryinGB=$(echo "12+($APP_REPLICAS+1)*1.5" | bc) - - local vmDetails=$(az vm list-skus --size ${aksAgentPoolVMSize} -l ${location} --query [0]) - validate_status "Query VM details of ${aksAgentPoolVMSize} in ${location}." - - local memoryGB=$(echo ${vmDetails} | jq '.capabilities[] | select(.name=="MemoryGB") | .value' | tr -d "\"") - local requestedMemory=$(echo "$aksAgentPoolNodeCount*$memoryGB" | bc) - echo_stdout "Current requested memory is ${requestedMemory}GB." - if [[ $(echo "${requestedMemory}<${requiredMemoryinGB}" | bc) -eq 1 ]]; then - echo_stderr "It requires ${requiredMemoryinGB} GiB memory to create the AKS cluster, you have to select a larger VM size or increase node count." - exit 1 - fi - - fi - - echo_stdout "Check memory resources: passed!" -} - -function validate_ocr_account() { - # ORACLE_ACCOUNT_NAME - # ORACLE_ACCOUNT_PASSWORD - docker logout - echo "${ORACLE_ACCOUNT_PASSWORD}" | docker login ${ocrLoginServer} -u ${ORACLE_ACCOUNT_NAME} --password-stdin - validate_status "login OCR with user ${ORACLE_ACCOUNT_NAME}" - - echo_stdout "Check OCR account: passed!" -} - -function check_acr() { - local ready=false - local attempt=0 - while [[ "${ready}" == "false" && $attempt -le ${checkAcrMaxAttempt} ]]; do - echo_stdout "Check if ACR ${ACR_NAME} is ready, attempt: ${attempt}." - ready=true - - local ret=$(az acr show --name ${ACR_NAME} --resource-group ${ACR_RESOURCE_GROUP}) - if [ -z "${ret}" ]; then - ready=false - fi - - attempt=$((attempt + 1)) - sleep ${checkAcrInterval} - done - - if [ ${attempt} -gt ${checkAcrMaxAttempt} ]; then - echo_stderr "ACR ${ACR_NAME} is not ready." - exit 1 - fi - - echo_stdout "Check if ACR ${ACR_NAME} is ready to import image." -} - -function obtain_image_architecture() { - local acrName=$1 - local repoName=$2 - local tag=$3 - local imageUri="${acrName}.azurecr.io/${repoName}:${tag}" - - local imageArch=$(az acr manifest list-metadata -r ${acrName} -n ${repoName} \ - | jq '.[] | select(.tags != null) | select(.tags[] | length >0 ) | select(.tags[0]=="'${tag}'") | .architecture' \ - | tr -d "\"") - - if [[ "${imageArch}" == "null" ]]; then - # if the image is multi-architecture, the value is empty. - # Use the docker manifest inspect command to get the architecture. - # https://learn.microsoft.com/en-us/azure/container-registry/push-multi-architecture-images - local acrUserName=$(az acr credential show -n ${acrName} --query "username" | tr -d "\"") - local acrPassword=$(az acr credential show -n ${acrName} --query "passwords[0].value" | tr -d "\"") - local acrServer="${acrName}.azurecr.io" - - docker login ${acrServer} -u ${acrUserName} -p ${acrPassword} - local ret=$(docker manifest inspect ${imageUri} | jq '.manifests[] | .platform.architecture') - - if [[ $ret == *"${constX86Platform}"* && $ret == *"${constARM64Platform}"* ]]; then - imageArch="${constMultiArchPlatform}" - elif [[ $ret == *"${constX86Platform}"* ]]; then - imageArch="${constX86Platform}" - elif [[ $ret == *"${constARM64Platform}"* ]]; then - imageArch="${constARM64Platform}" - else - echo_stderr "The architecture of image is not supported. Currently only ARM64 and AMD64 are supported." - exit 1 - fi - fi - echo_stdout "Architecture of image is ${imageArch}." - - export IMAGE_ARCHITECTURE=${imageArch} -} - -function validate_ocr_image() { - local ocrImageFullPath="${ocrLoginServer}/${ocrGaImagePath}:${wlsImageTag}" - - if [[ "${ORACLE_ACCOUNT_ENTITLED,,}" == "true" ]]; then - - # download the ga cpu image mapping file. - local cpuImagesListFile=weblogic_cpu_images.json - curl -L "${gitUrl4CpuImages}" --retry ${retryMaxAttempt} -o ${cpuImagesListFile} - local cpuTag=$(cat ${cpuImagesListFile} | jq ".items[] | select(.gaTag == \"${wlsImageTag}\") | .cpuTag" | tr -d "\"") - echo_stdout "cpu tag: ${cpuTag}" - # if we can not find a matched image, keep the input tag. - if [[ "${cpuTag}" == "" || "${cpuTag,,}" == "null" ]]; then - cpuTag=${wlsImageTag} - fi - - ocrImageFullPath="${ocrLoginServer}/${ocrCpuImagePath}:${cpuTag}" - fi - - echo_stdout "image path: ${ocrImageFullPath}" - - # to mitigate error in https://learn.microsoft.com/en-us/answers/questions/1188413/the-resource-with-name-name-and-type-microsoft-con - az provider register -n Microsoft.ContainerRegistry - - check_acr - - # validate the image by importing it to ACR. - # if failure happens, the image should be unavailable - local tmpRepo="tmp$(date +%s)" - local tmpImagePath="${tmpRepo}:${wlsImageTag}" - az acr import --name ${ACR_NAME} \ - --resource-group ${ACR_RESOURCE_GROUP} \ - --source ${ocrImageFullPath} \ - -u ${ORACLE_ACCOUNT_NAME} \ - -p ${ORACLE_ACCOUNT_PASSWORD} \ - --image ${tmpImagePath} \ - --only-show-errors - - # $? equals 0 even though failure happens. - # check if the image is imported successfully. - local ret=$(az acr repository show --name $ACR_NAME --image ${tmpImagePath}) - if [ -n "${ret}" ]; then - obtain_image_architecture ${ACR_NAME} ${tmpRepo} ${wlsImageTag} - # delete the image from ACR. - az acr repository delete --name ${ACR_NAME} --image ${tmpImagePath} --yes - else - echo_stderr $ret - echo_stderr "" - echo_stderr "Image ${ocrImageFullPath} is not available! Please make sure you have accepted the Oracle Standard Terms and Restrictions and the image exists in https://container-registry.oracle.com/ " - if [[ "${ORACLE_ACCOUNT_ENTITLED,,}" == "true" ]]; then - echo_stderr "Make sure you are entitled to access middleware/weblogic_cpu repository." - fi - - exit 1 - fi - - echo_stdout "Check OCR image ${ocrImageFullPath}: passed!" -} - -function check_acr_admin_enabled() { - local acrName=$1 - local acrRgName=$2 - echo_stdout "check if admin user enabled in ACR $acrName " - local adminUserEnabled=$(az acr show --name $acrName --resource-group ${acrRgName} --query "adminUserEnabled") - validate_status "query 'adminUserEnabled' property of ACR ${acrName}" "Invalid ACR: ${acrName}" - - if [[ "${adminUserEnabled}" == "false" ]]; then - echo_stderr "Make sure admin user is enabled in ACR $acrName. Please find steps in https://docs.microsoft.com/en-us/azure/container-registry/container-registry-authentication?WT.mc_id=Portal-Microsoft_Azure_CreateUIDef&tabs=azure-cli#admin-account" - exit 1 - fi -} - -function validate_acr_image() { - echo_stdout "user provided ACR: $ACR_NAME_FOR_USER_PROVIDED_IMAGE" - - local pathWithoutTag=${userProvidedImagePath%\:*} - local repository=${pathWithoutTag#*\/} - local tag="${userProvidedImagePath##*:}" - - local tagIndex=$(az acr repository show-tags --name $ACR_NAME_FOR_USER_PROVIDED_IMAGE --repository ${repository} | jq 'index("'${tag}'")') - validate_status "check if tag ${tag} exists." "Invalid image path ${userProvidedImagePath}" - if [[ "${tagIndex}" == "null" ]]; then - echo_stderr "Image ${tag} does not exist in ${repository}." - exit 1 - fi - - obtain_image_architecture ${ACR_NAME_FOR_USER_PROVIDED_IMAGE} ${repository} ${tag} - - echo_stdout "Check ACR image: passed!" -} - -function validate_base_image_path() { - if [[ "${useOracleImage,,}" == "true" ]]; then - validate_ocr_account - validate_ocr_image - else - validate_acr_image - fi -} - -function validate_acr_admin_enabled() -{ - if [[ "${useOracleImage,,}" == "true" ]]; then - check_acr_admin_enabled "${ACR_NAME}" "${ACR_RESOURCE_GROUP}" - else - check_acr_admin_enabled "${ACR_NAME_FOR_USER_PROVIDED_IMAGE}" "${ACR_RG_NAME_FOR_USER_PROVIDED_IMAGE}" - fi -} - -# Validate whether image architecture is matched with the architecture of the VM. -# Azure supports both AMD based processor and ARM based CPU, see https://learn.microsoft.com/en-us/azure/virtual-machines/vm-naming-conventions. - # For ARM cpu, the VM size name includes letter 'p'. - # For AMD cpu, the VM size name does not include letter 'p'. -# Validate cases: - # 1. If the VM size is AMD based, the image should be amd64 or multi-platform. - # 2. If the VM size is ARM based, the image should be arm64 or multi-platform. -# IMAGE_ARCHITECTURE value may be "amd64", "arm64" or "Multi-architecture (amd64 and arm64)". -function validate_image_compatibility -{ - if [[ $aksAgentPoolVMSize == *"p"* ]]; then - if [[ "${IMAGE_ARCHITECTURE}" != "${constARM64Platform}" && "${IMAGE_ARCHITECTURE}" != "${constMultiArchPlatform}" ]]; then - echo_stderr "The image architecture ${IMAGE_ARCHITECTURE} is not compatible with the ARM based VM size ${aksAgentPoolVMSize}." - exit 1 - fi - else - if [[ "${IMAGE_ARCHITECTURE}" != "${constX86Platform}" && "${IMAGE_ARCHITECTURE}" != "${constMultiArchPlatform}" ]]; then - echo_stderr "The image architecture ${IMAGE_ARCHITECTURE} is not compatible with the AMD based VM size ${aksAgentPoolVMSize}." - exit 1 - fi - fi -} - -function validate_wls_ssl_certificates() { - local wlsIdentityKeyStoreFileName=${AZ_SCRIPTS_PATH_OUTPUT_DIRECTORY}/identity.keystore - local wlsTrustKeyStoreFileName=${AZ_SCRIPTS_PATH_OUTPUT_DIRECTORY}/trust.keystore - echo "$WLS_SSL_IDENTITY_DATA" | base64 -d >$wlsIdentityKeyStoreFileName - echo "$WLS_SSL_TRUST_DATA" | base64 -d >$wlsTrustKeyStoreFileName - - # use default Java, if no, install open jdk 11. - # why not using Microsoft open jdk? - # No apk installation package! - export JAVA_HOME=/usr/lib/jvm/default-jvm/ - if [ ! -d "${JAVA_HOME}" ]; then - install_jdk - JAVA_HOME=/usr/lib/jvm/java-11-openjdk - fi - #validate if identity keystore has entry - ${JAVA_HOME}/bin/keytool -list -v \ - -keystore $wlsIdentityKeyStoreFileName \ - -storepass $WLS_SSL_IDENTITY_PASSWORD \ - -storetype $WLS_SSL_IDENTITY_TYPE | - grep 'Entry type:' | - grep 'PrivateKeyEntry' - - validate_status "validate Identity Keystore." - - #validate if trust keystore has entry - ${JAVA_HOME}/bin/keytool -list -v \ - -keystore ${wlsTrustKeyStoreFileName} \ - -storepass $WLS_SSL_TRUST_PASSWORD \ - -storetype $WLS_SSL_TRUST_TYPE | - grep 'Entry type:' | - grep 'trustedCertEntry' - - validate_status "validate Trust Keystore." - - echo_stdout "validate SSL key stores: passed!" -} - -function validate_gateway_frontend_certificates() { - if [[ "${appGatewayCertificateOption}" == "generateCert" ]]; then - return - fi - - local appgwFrontCertFileName=${AZ_SCRIPTS_PATH_OUTPUT_DIRECTORY}/gatewaycert.pfx - echo "$APPLICATION_GATEWAY_SSL_FRONTEND_CERT_DATA" | base64 -d >$appgwFrontCertFileName - - openssl pkcs12 \ - -in $appgwFrontCertFileName \ - -nocerts \ - -out ${AZ_SCRIPTS_PATH_OUTPUT_DIRECTORY}/cert.key \ - -passin pass:${APPLICATION_GATEWAY_SSL_FRONTEND_CERT_PASSWORD} \ - -passout pass:${APPLICATION_GATEWAY_SSL_FRONTEND_CERT_PASSWORD} - - validate_status "access application gateway frontend key." "Make sure the Application Gateway frontend certificate is correct." -} - -function validate_dns_zone() { - if [[ "${checkDNSZone,,}" == "true" ]]; then - az network dns zone show -n ${DNS_ZONE_NAME} -g ${DNS_ZONE_RESOURCEGROUP_NAME} - validate_status "check DNS Zone ${DNS_ZONE_NAME}" "Make sure the DNS Zone exists." - - echo_stdout "Check DNS Zone: passed!" - fi -} - -function get_aks_default_version() { - constDefaultAKSVersion=$(az aks get-versions --location ${location} \ - | jq '.orchestrators[] | select(.default==true) | .orchestratorVersion' \ - | tr -d "\"") - - validate_status "get AKS default version ${constDefaultAKSVersion}" -} - -function validate_aks_version() { - if [[ "${USE_AKS_WELL_TESTED_VERSION,,}" == "true" ]]; then - local aksWellTestedVersionFile=aks_well_tested_version.json - # download the json file that has well-tested version from weblogic-azure repo. - curl -L "${gitUrl4AksWellTestedVersionJsonFile}" --retry ${retryMaxAttempt} -o ${aksWellTestedVersionFile} - local aksWellTestedVersion=$(cat ${aksWellTestedVersionFile} | jq ".value" | tr -d "\"") - echo "AKS well-tested version: ${aksWellTestedVersion}" - # check if the well-tested version is supported in the location - local ret=$(az aks get-versions --location ${location} \ - | jq ".orchestrators[] | select(.orchestratorVersion == \"${aksWellTestedVersion}\") | .orchestratorVersion" \ - | tr -d "\"") - if [[ "${aksWellTestedVersion}" != "" ]] && [[ "${ret}" == "${aksWellTestedVersion}" ]]; then - outputAksVersion=${aksWellTestedVersion} - else - # if the well-tested version is invalid, use default version. - get_aks_default_version - outputAksVersion=${constDefaultAKSVersion} - fi - else - # check if the input version is supported in the location - local ret=$(az aks get-versions --location ${location} \ - | jq ".orchestrators[] | select(.orchestratorVersion == \"${AKS_VERSION}\") | .orchestratorVersion" \ - | tr -d "\"") - if [[ "${ret}" == "${AKS_VERSION}" ]]; then - outputAksVersion=${AKS_VERSION} - else - echo_stderr "ERROR: invalid aks version ${AKS_VERSION} in ${location}." - exit 1 - fi - fi -} - -function validate_aks_networking() { - local networkPluginMode=$(az aks show -g ${AKS_CLUSTER_RESOURCEGROUP_NAME} -n ${AKS_CLUSTER_NAME} | jq '.networkProfile.networkPluginMode' | tr -d "\"") - local networkPlugin=$(az aks show -g ${AKS_CLUSTER_RESOURCEGROUP_NAME} -n ${AKS_CLUSTER_NAME} | jq '.networkProfile.networkPlugin' | tr -d "\"") - - if [[ "${networkPluginMode}" != "null" ]]; then - echo_stderr "ERROR: invalid network plugin mode ${networkPluginMode} for ${AKS_CLUSTER_NAME}." - exit 1 - fi - - if [[ "${networkPlugin}" != "azure" ]]; then - echo_stderr "ERROR: invalid network plugin ${networkPlugin} for ${AKS_CLUSTER_NAME}." - exit 1 - fi -} - -function enable_aks_managed_identity() { - local identityLength=$(az aks show -g ${AKS_CLUSTER_RESOURCEGROUP_NAME} -n ${AKS_CLUSTER_NAME} | jq '.identity | length') - echo "identityLength ${identityLength}" - - if [ $identityLength -lt 1 ]; then - echo "enable managed identity..." - # Your cluster is using service principal, and you are going to update the cluster to use systemassigned managed identity. - # After updating, your cluster's control plane and addon pods will switch to use managed identity, but kubelet will KEEP USING SERVICE PRINCIPAL until you upgrade your agentpool. - az aks update -y -g ${AKS_CLUSTER_RESOURCEGROUP_NAME} -n ${AKS_CLUSTER_NAME} --enable-managed-identity - - validate_status "Enable Applciation Gateway Ingress Controller for ${AKS_CLUSTER_NAME}." - fi -} - -# VNET input sample: -# { -# "name": "wlsaks-vnet", -# "resourceGroup": "haiche-test", -# "addressPrefixes": [ -# "10.3.0.0/28" -# ], -# "addressPrefix": "10.3.0.0/28", -# "newOrExisting": "new", -# "subnets": { -# "gatewaySubnet": { -# "name": "wls-aks-gateway-subnet", -# "addressPrefix": "10.3.0.0/29", -# "startAddress": "10.3.0.4" -# } -# } -# } -# To make sure the subnet only have application gateway -function validate_appgateway_vnet() { - echo_stdout "VNET for application gateway: ${VNET_FOR_APPLICATIONGATEWAY}" - local vnetName=$(echo ${VNET_FOR_APPLICATIONGATEWAY} | jq '.name' | tr -d "\"") - local vnetResourceGroup=$(echo ${VNET_FOR_APPLICATIONGATEWAY} | jq '.resourceGroup' | tr -d "\"") - local newOrExisting=$(echo ${VNET_FOR_APPLICATIONGATEWAY} | jq '.newOrExisting' | tr -d "\"") - local subnetName=$(echo ${VNET_FOR_APPLICATIONGATEWAY} | jq '.subnets.gatewaySubnet.name' | tr -d "\"") - - if [[ "${newOrExisting,,}" != "new" ]]; then - # the subnet can only have Application Gateway. - # query ipConfigurations: - # if lenght of ipConfigurations is greater than 0, the subnet fails to meet requirement of Application Gateway. - local ret=$(az network vnet show \ - -g ${vnetResourceGroup} \ - --name ${vnetName} \ - | jq ".subnets[] | select(.name==\"${subnetName}\") | .ipConfigurations | length") - - if [ $ret -gt 0 ]; then - echo_stderr "ERROR: invalid subnet for Application Gateway, the subnet has ${ret} connected device(s). Make sure the subnet is only for Application Gateway." - exit 1 - fi - fi -} - -function query_available_zones() { - if [[ "${createAKSCluster,,}" == "true" ]]; then - outputAvailableZones=$(az vm list-skus -l ${location} --size ${aksAgentPoolVMSize} --zone true | jq -c '.[] | .locationInfo[] | .zones') - fi - - if [ -z "${outputAvailableZones}" ]; then - outputAvailableZones="[]" - fi - - export outputAvailableZones="${outputAvailableZones}" -} - -function output_result() { - echo "AKS version: ${outputAksVersion}" - result=$(jq -n -c \ - --arg aksVersion "$outputAksVersion" \ - --arg agentAvailabilityZones "${outputAvailableZones}" \ - '{aksVersion: $aksVersion, agentAvailabilityZones: $agentAvailabilityZones}') - echo "result is: $result" - echo $result >$AZ_SCRIPTS_OUTPUT_PATH -} - -# main -location=$1 -createAKSCluster=$2 -aksAgentPoolVMSize=$3 -aksAgentPoolNodeCount=$4 -useOracleImage=$5 -wlsImageTag=$6 -userProvidedImagePath=$7 -enableCustomSSL=$8 -appGatewayCertificateOption=${9} -enableAppGWIngress=${10} -checkDNSZone=${11} - -outputAksVersion=${constDefaultAKSVersion} - -# install docker cli -install_docker - -validate_compute_resources - -validate_memory_resources - -validate_base_image_path - -validate_acr_admin_enabled - -validate_image_compatibility - -if [[ "${enableCustomSSL,,}" == "true" ]]; then - validate_wls_ssl_certificates -fi - -if [[ "${enableAppGWIngress,,}" == "true" ]]; then - validate_gateway_frontend_certificates -fi - -validate_dns_zone - -if [[ "${createAKSCluster,,}" == "true" ]]; then - validate_aks_version -fi - -# validate existing aks cluster -if [[ "${createAKSCluster,,}" != "true" ]]; then - validate_aks_networking - enable_aks_managed_identity -fi - -validate_appgateway_vnet - -query_available_zones - -output_result diff --git a/weblogic-azure-aks/src/main/arm/scripts/invokeUpdateApplications.sh b/weblogic-azure-aks/src/main/arm/scripts/invokeUpdateApplications.sh deleted file mode 100644 index 7d3b7ca0c..000000000 --- a/weblogic-azure-aks/src/main/arm/scripts/invokeUpdateApplications.sh +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright (c) 2021, Oracle Corporation and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# This script runs on Azure Container Instance with Alpine Linux that Azure Deployment script creates. - -#Function to display usage message -function usage() { - usage=$(cat <<-END -Usage: -./invokeUpdateApplications.sh - - - - - - - - - - - - - - - -END -) - echo_stdout "${usage}" - if [ $1 -eq 1 ]; then - echo_stderr "${usage}" - exit 1 - fi -} - -# Main script -export script="${BASH_SOURCE[0]}" -export scriptDir="$(cd "$(dirname "${script}")" && pwd)" - -source ${scriptDir}/utility.sh - -export ocrSSOUser=$1 -ocrSSOPSW=$2 -export aksClusterRGName=$3 -export aksClusterName=$4 -export wlsImageTag=$5 -export acrName=$6 -export wlsDomainName=$7 -export wlsDomainUID=$8 -export currentResourceGroup=$9 -export appPackageUrls=${10} -export scriptURL=${11} -export appStorageAccountName=${12} -export appContainerName=${13} -export userProvidedImagePath=${14} -export useOracleImage=${15} - -echo ${ocrSSOPSW} | \ - bash ./updateApplications.sh \ - ${ocrSSOUser} \ - ${aksClusterRGName} \ - ${aksClusterName} \ - ${wlsImageTag} \ - ${acrName} \ - ${wlsDomainName} \ - ${wlsDomainUID} \ - ${currentResourceGroup} \ - ${appPackageUrls} \ - ${scriptURL} \ - ${appStorageAccountName} \ - ${appContainerName} \ - ${userProvidedImagePath} \ - ${useOracleImage} - -if [ $? -ne 0 ]; then - usage 1 -fi diff --git a/weblogic-azure-aks/src/main/arm/scripts/model.properties b/weblogic-azure-aks/src/main/arm/scripts/model.properties deleted file mode 100644 index 3db0f8e3c..000000000 --- a/weblogic-azure-aks/src/main/arm/scripts/model.properties +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (c) 2021, Oracle Corporation and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Based on ./kubernetes/samples/scripts/create-weblogic-domain/model-in-image/model-images/model-in-image__WLS-v1/model.10.properties -# in https://github.com/oracle/weblogic-kubernetes-operator. - diff --git a/weblogic-azure-aks/src/main/arm/scripts/pv.yaml.template b/weblogic-azure-aks/src/main/arm/scripts/pv.yaml.template deleted file mode 100644 index 74ee054b1..000000000 --- a/weblogic-azure-aks/src/main/arm/scripts/pv.yaml.template +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) 2021, Oracle Corporation and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Based on ./kubernetes/samples/scripts/create-weblogic-domain-on-azure-kubernetes-service/azure-file-pv-template.yaml -# in https://github.com/oracle/weblogic-kubernetes-operator. - -apiVersion: v1 -kind: PersistentVolume -metadata: - name: @PV_NAME@ - labels: - storageAccount: @STORAGE_ACCOUNT@ -spec: - capacity: - storage: 5Gi - accessModes: - - ReadWriteMany - storageClassName: azurefile - claimRef: - name: @PVC_NAME@ - namespace: @NAMESPACE@ - azureFile: - secretName: azure-secret - shareName: @FILE_SHARE_NAME@ - readOnly: false - mountOptions: - - dir_mode=0777 - - file_mode=0777 - - uid=1000 - - gid=1000 - - mfsymlinks - - nobrl \ No newline at end of file diff --git a/weblogic-azure-aks/src/main/arm/scripts/pvc.yaml.template b/weblogic-azure-aks/src/main/arm/scripts/pvc.yaml.template deleted file mode 100644 index da17ffd4a..000000000 --- a/weblogic-azure-aks/src/main/arm/scripts/pvc.yaml.template +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c) 2021, Oracle Corporation and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Based on ./kubernetes/samples/scripts/create-weblogic-domain-on-azure-kubernetes-service/azure-file-pvc-template.yaml -# in https://github.com/oracle/weblogic-kubernetes-operator. - -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: @PVC_NAME@ - namespace: @NAMESPACE@ - labels: - storageAccount: @STORAGE_ACCOUNT@ -spec: - accessModes: - - ReadWriteMany - storageClassName: azurefile - resources: - requests: - storage: 5Gi \ No newline at end of file diff --git a/weblogic-azure-aks/src/main/arm/scripts/setupDBConnections.sh b/weblogic-azure-aks/src/main/arm/scripts/setupDBConnections.sh deleted file mode 100644 index 8d208b341..000000000 --- a/weblogic-azure-aks/src/main/arm/scripts/setupDBConnections.sh +++ /dev/null @@ -1,297 +0,0 @@ -# Copyright (c) 2021, 2024 Oracle Corporation and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -echo "Script ${0} starts" - -#Function to display usage message -function usage() { - usage=$(cat <<-END -Usage: -You must specify the following environment variables: -AKS_RESOURCE_GROUP_NAME: the name of resource group that runs the AKS cluster. -AKS_NAME: the name of the AKS cluster. -DATABASE_TYPE: one of the supported database types. -DB_CONFIGURATION_TYPE: createOrUpdate: create a new data source connection, or update an existing data source connection. delete: delete an existing data source connection. -DB_PASSWORD: password for Database. -DB_USER: user id of Database. -DB_CONNECTION_STRING: JDBC Connection String. -DB_DRIVER_NAME: datasource driver name, must be specified if database type is otherdb. -ENABLE_PASSWORDLESS_CONNECTION: true to enable passwordless connection -GLOBAL_TRANSATION_PROTOCOL: Determines the transaction protocol (global transaction processing behavior) for the data source. -JDBC_DATASOURCE_NAME: JNDI Name for JDBC Datasource. -TEST_TABLE_NAME: the name of the database table to use when testing physical database connections. This name is required when you specify a Test Frequency and enable Test Reserved Connections. -WLS_DOMAIN_UID: UID of WebLogic domain, used in WebLogic Operator. -WLS_DOMAIN_USER: user name for WebLogic Administrator. -WLS_DOMAIN_PASSWORD: passowrd for WebLogic Administrator. -END -) - - echo_stdout "${usage}" - if [ $1 -eq 1 ]; then - echo_stderr "${usage}" - exit 1 - fi -} - -#Function to validate input -function validate_input() { - if [[ -z "$AKS_RESOURCE_GROUP_NAME" || -z "${AKS_NAME}" ]]; then - echo_stderr "AKS_RESOURCE_GROUP_NAME and AKS_NAME are required. " - usage 1 - fi - - if [ -z "$DATABASE_TYPE" ]; then - echo_stderr "DATABASE_TYPE is required. " - usage 1 - fi - - if [[ -z "${DB_PASSWORD}" || -z "${DB_USER}" ]]; then - echo_stderr "DB_PASSWORD and DB_USER are required. " - usage 1 - fi - - if [ -z "$DB_CONNECTION_STRING" ]; then - echo_stderr "DB_CONNECTION_STRING is required. " - usage 1 - fi - - if [ -z "$JDBC_DATASOURCE_NAME" ]; then - echo_stderr "JDBC_DATASOURCE_NAME is required. " - usage 1 - fi - - if [ -z "$WLS_DOMAIN_UID" ]; then - echo_stderr "WLS_DOMAIN_UID is required. " - usage 1 - fi - - if [[ -z "$WLS_DOMAIN_USER" || -z "${WLS_DOMAIN_PASSWORD}" ]]; then - echo_stderr "WLS_DOMAIN_USER and WLS_DOMAIN_PASSWORD are required. " - usage 1 - fi - - # reset password - if [[ "${ENABLE_PASSWORDLESS_CONNECTION,,}" == "true" ]]; then - DB_PASSWORD="" - - if [[ "${DATABASE_TYPE}" == "${constDBTypeSqlServer}" ]]; then - DB_USER="" - fi - fi -} - -function create_datasource_model_configmap_and_secret() { - echo "get data source secret name" - jndiLabel=${JDBC_DATASOURCE_NAME//\//\_} - secretLen=$(kubectl get secret -n ${wlsDomainNS} -l datasource.JNDI="${jndiLabel}" -o json \ - | jq '.items | length') - if [ ${secretLen} -ge 1 ];then - dbSecretName=$(kubectl get secret -n ${wlsDomainNS} -l datasource.JNDI="${jndiLabel}" -o json \ - | jq ".items[0].metadata.name" \ - | tr -d "\"") - else - dbSecretName="ds-secret-${DATABASE_TYPE}-${datetime}" - fi - - echo "Data source secret name: ${dbSecretName}" - chmod ugo+x $scriptDir/dbUtility.sh - bash $scriptDir/dbUtility.sh ${dbSecretName} ${optTypeUpdate} -} - -function apply_datasource_to_domain() { - echo "apply datasoure" - # get domain configurations - domainConfigurationJsonFile=$scriptDir/domain.json - kubectl -n ${wlsDomainNS} get domain ${WLS_DOMAIN_UID} -o json >${domainConfigurationJsonFile} - - restartVersion=$(cat ${domainConfigurationJsonFile} | jq '. | .spec.restartVersion' | tr -d "\"") - secretList=$(cat ${domainConfigurationJsonFile} | jq -r '. | .spec.configuration.secrets') - restartVersion=$((restartVersion+1)) - - echo "current secrets: ${secretList}" - if [[ "${secretList}" != "null" ]];then - secretList=$(cat ${domainConfigurationJsonFile} | jq -r '. | .spec.configuration.secrets[]') - secretStrings="[" - for item in $secretList; do - if [[ "${item}" == "${dbSecretName}" ]]; then - continue - fi - secretStrings="${secretStrings}\"${item}\"," - done - - secretStrings="${secretStrings}\"${dbSecretName}\"]" - else - secretStrings="[\"${dbSecretName}\"]" - fi - - echo "secrets: ${secretStrings}" - - # apply the configmap - # apply the secret - # restart the domain - timestampBeforePatchingDomain=$(date +%s) - kubectl -n ${wlsDomainNS} patch domain ${WLS_DOMAIN_UID} \ - --type=json \ - -p '[{"op": "replace", "path": "/spec/restartVersion", "value": "'${restartVersion}'" }, {"op": "replace", "path": "/spec/configuration/model/configMap", "value":'${wlsConfigmapName}'}, {"op": "replace", "path": "/spec/configuration/secrets", "value": '${secretStrings}'}]' - - utility_validate_status "Patch DB configuration." -} - -function remove_datasource_from_domain() { - echo "remove datasoure secret from domain configuration" - # get domain configurations - domainConfigurationJsonFile=$scriptDir/domain.json - kubectl -n ${wlsDomainNS} get domain ${WLS_DOMAIN_UID} -o json >${domainConfigurationJsonFile} - - restartVersion=$(cat ${domainConfigurationJsonFile} | jq '. | .spec.restartVersion' | tr -d "\"") - secretList=$(cat ${domainConfigurationJsonFile} | jq -r '. | .spec.configuration.secrets') - restartVersion=$((restartVersion+1)) - - echo "current secrets: ${secretList}" - if [[ "${secretList}" != "null" ]];then - secretList=$(cat ${domainConfigurationJsonFile} | jq -r '. | .spec.configuration.secrets[]') - secretStrings="[" - index=0; - for item in $secretList; do - ret=$(kubectl -n ${wlsDomainNS} get secret | grep "${item}") - # the secret should have been deleted. - if [ -z "${ret}" ]; then - continue - fi - - secretStrings="${secretStrings}\"${item}\"," - index=$((index+1)) - done - - if [ $index -ge 1 ]; then - # remove the last comma - secretStrings=$(echo "${secretStrings:0:${#secretStrings}-1}") - fi - - secretStrings="${secretStrings}]" - else - secretStrings="[]" - fi - - echo "secrets: ${secretStrings}" - - # apply the configmap - # apply the secret - # restart the domain - timestampBeforePatchingDomain=$(date +%s) - kubectl -n ${wlsDomainNS} patch domain ${WLS_DOMAIN_UID} \ - --type=json \ - -p '[{"op": "replace", "path": "/spec/restartVersion", "value": "'${restartVersion}'" }, {"op": "replace", "path": "/spec/configuration/model/configMap", "value":'${wlsConfigmapName}'}, {"op": "replace", "path": "/spec/configuration/secrets", "value": '${secretStrings}'}]' - - utility_validate_status "Patch DB configuration." -} - -function wait_for_operation_completed() { - # Make sure all of the pods are running. - - clusterName=$(kubectl get cluster -n ${wlsDomainNS} -o json | jq -r '.items[0].metadata.name') - - replicas=$(kubectl -n ${wlsDomainNS} get cluster ${clusterName} -o json \ - | jq '. | .spec.replicas') - - utility_wait_for_pod_restarted \ - ${timestampBeforePatchingDomain} \ - ${replicas} \ - ${WLS_DOMAIN_UID} \ - ${checkPodStatusMaxAttemps} \ - ${checkPodStatusInterval} - - utility_wait_for_pod_completed \ - ${replicas} \ - ${wlsDomainNS} \ - ${checkPodStatusMaxAttemps} \ - ${checkPodStatusInterval} -} - -function delete_datasource() { - echo "remove secret and model of data source ${JDBC_DATASOURCE_NAME}" - # remove secret - # remove model - chmod ugo+x $scriptDir/dbUtility.sh - bash $scriptDir/dbUtility.sh ${dbSecretName} ${optTypeDelete} - - # update weblogic domain - remove_datasource_from_domain - - wait_for_operation_completed -} - -function validate_datasource() { - dsScriptFileName=get-datasource-status.py - testDatasourceScript=${scriptDir}/${dsScriptFileName} - podNum=$(kubectl -n ${wlsDomainNS} get pod -l weblogic.clusterName=${wlsClusterName} -o json | jq '.items| length') - if [ ${podNum} -le 0 ]; then - echo_stderr "Ensure your cluster has at least one pod." - exit 1 - fi - - podName=$(kubectl -n ${wlsDomainNS} get pod -l weblogic.clusterName=${wlsClusterName} -o json \ - | jq '.items[0] | .metadata.name' \ - | tr -d "\"") - - # get non-ssl port - clusterTargetPort=$(kubectl get svc ${wlsClusterSvcName} -n ${wlsDomainNS} -o json | jq '.spec.ports[] | select(.name=="default") | .port') - t3ConnectionString="t3://${wlsClusterSvcName}.${wlsDomainNS}.svc.cluster.local:${clusterTargetPort}" - cat <${testDatasourceScript} -connect('${WLS_DOMAIN_USER}', '${WLS_DOMAIN_PASSWORD}', '${t3ConnectionString}') -serverRuntime() -print 'start to query data source jndi bean' -dsMBeans = cmo.getJDBCServiceRuntime().getJDBCDataSourceRuntimeMBeans() -ds_name = '${JDBC_DATASOURCE_NAME}' -for ds in dsMBeans: - if (ds_name == ds.getName()): - print 'DS name is: '+ds.getName() - print 'State is ' +ds.getState() -EOF - - echo "copy test script ${testDatasourceScript} to pod path /tmp/${dsScriptFileName}" - targetDSFilePath=/tmp/${dsScriptFileName} - kubectl cp ${testDatasourceScript} -n ${wlsDomainNS} ${podName}:${targetDSFilePath} - kubectl exec -it ${podName} -n ${wlsDomainNS} -c ${wlsContainerName} -- bash -c "wlst.sh ${targetDSFilePath}" | grep "State is Running" - - if [ $? == 1 ];then - echo_stderr "Failed to configure datasource ${JDBC_DATASOURCE_NAME}. Please make sure the input values are correct." - delete_datasource - exit 1 - fi -} - - -# Main script -set -Eo pipefail - -export script="${BASH_SOURCE[0]}" -export scriptDir="$(cd "$(dirname "${script}")" && pwd)" - -source ${scriptDir}/common.sh -source ${scriptDir}/utility.sh - -export datetime=$(date +%s) -export optTypeDelete='delete' -export optTypeUpdate='createOrUpdate' -export wlsClusterName="cluster-1" -export wlsClusterSvcName="${WLS_DOMAIN_UID}-cluster-${wlsClusterName}" -export wlsConfigmapName="${WLS_DOMAIN_UID}-wdt-config-map" -export wlsDomainNS="${WLS_DOMAIN_UID}-ns" - -validate_input - -connect_aks $AKS_NAME $AKS_RESOURCE_GROUP_NAME - -install_kubectl - -if [[ "${DB_CONFIGURATION_TYPE}" == "${optTypeDelete}" ]];then - echo "delete date source: ${JDBC_DATASOURCE_NAME}" - delete_datasource -else - echo "create/update data source: ${JDBC_DATASOURCE_NAME}" - create_datasource_model_configmap_and_secret - apply_datasource_to_domain - wait_for_operation_completed - validate_datasource -fi diff --git a/weblogic-azure-aks/src/main/arm/scripts/setupNetworking.sh b/weblogic-azure-aks/src/main/arm/scripts/setupNetworking.sh deleted file mode 100644 index 084524d72..000000000 --- a/weblogic-azure-aks/src/main/arm/scripts/setupNetworking.sh +++ /dev/null @@ -1,149 +0,0 @@ -# Copyright (c) 2021, 2024 Oracle Corporation and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -echo "Script ${0} starts" - -# Install latest kubectl and Helm -function install_utilities() { - if [ -d "apps" ]; then - rm apps -f -r - fi - - mkdir apps - cd apps - - # Install kubectl - install_kubectl -} - -#Function to validate input -function validate_input() { - if [[ -z "$AKS_CLUSTER_RG_NAME" || -z "${AKS_CLUSTER_NAME}" ]]; then - echo_stderr "AKS cluster name and resource group name are required. " - exit 1 - fi - - if [[ -z "$WLS_DOMAIN_NAME" || -z "${WLS_DOMAIN_UID}" ]]; then - echo_stderr "WebLogic domain name and WebLogic domain UID are required. " - exit 1 - fi - - if [ -z "$LB_SVC_VALUES" ]; then - echo_stderr "LB_SVC_VALUES is required. " - exit 1 - fi - - if [ -z "$ENABLE_AGIC" ]; then - echo_stderr "ENABLE_AGIC is required. " - exit 1 - fi - - if [ -z "$CURRENT_RG_NAME" ]; then - echo_stderr "CURRENT_RG_NAME is required. " - exit 1 - fi - - if [ -z "$APPGW_NAME" ]; then - echo_stderr "APPGW_NAME is required. " - exit 1 - fi - - if [ -z "$APPGW_USE_PRIVATE_IP" ]; then - echo_stderr "APPGW_USE_PRIVATE_IP is required. " - exit 1 - fi - - if [ -z "$APPGW_FOR_ADMIN_SERVER" ]; then - echo_stderr "APPGW_FOR_ADMIN_SERVER is required. " - exit 1 - fi - - if [ -z "$ENABLE_DNS_CONFIGURATION" ]; then - echo_stderr "ENABLE_DNS_CONFIGURATION is required. " - exit 1 - fi - - if [[ -z "$DNS_ZONE_RG_NAME" || -z "${DNS_ZONE_NAME}" ]]; then - echo_stderr "DNS_ZONE_NAME and DNS_ZONE_RG_NAME are required. " - exit 1 - fi - - if [ -z "$DNS_ADMIN_LABEL" ]; then - echo_stderr "DNS_ADMIN_LABEL is required. " - exit 1 - fi - - if [ -z "$DNS_CLUSTER_LABEL" ]; then - echo_stderr "DNS_CLUSTER_LABEL is required. " - exit 1 - fi - - if [ -z "$APPGW_ALIAS" ]; then - echo_stderr "APPGW_ALIAS is required. " - exit 1 - fi - - if [ -z "$USE_INTERNAL_LB" ]; then - echo_stderr "USE_INTERNAL_LB is required. " - exit 1 - fi - - if [ -z "$ENABLE_CUSTOM_SSL" ]; then - echo_stderr "ENABLE_CUSTOM_SSL is required. " - exit 1 - fi - - if [ -z "$ENABLE_COOKIE_BASED_AFFINITY" ]; then - echo_stderr "ENABLE_COOKIE_BASED_AFFINITY is required. " - exit 1 - fi - - if [ -z "$APPGW_FOR_REMOTE_CONSOLE" ]; then - echo_stderr "APPGW_FOR_REMOTE_CONSOLE is required. " - exit 1 - fi - - if [ -z "$DNS_ADMIN_T3_LABEL" ]; then - echo_stderr "DNS_ADMIN_T3_LABEL is required. " - exit 1 - fi - - if [ -z "$DNS_CLUSTER_T3_LABEL" ]; then - echo_stderr "DNS_CLUSTER_T3_LABEL is required. " - exit 1 - fi -} - -function create_svc_lb() { - # No lb svc inputs - if [[ "${LB_SVC_VALUES}" != "[]" ]]; then - chmod ugo+x $scriptDir/createLbSvc.sh - bash $scriptDir/createLbSvc.sh - fi -} - -function create_appgw_ingress() { - if [[ "${ENABLE_AGIC,,}" == "true" ]]; then - chmod ugo+x $scriptDir/createAppGatewayIngress.sh - bash $scriptDir/createAppGatewayIngress.sh - fi -} - -# Main script -set -Eeuo pipefail - -export script="${BASH_SOURCE[0]}" -export scriptDir="$(cd "$(dirname "${script}")" && pwd)" - -source ${scriptDir}/common.sh -source ${scriptDir}/utility.sh - -validate_input - -install_utilities - -connect_aks $AKS_CLUSTER_NAME $AKS_CLUSTER_RG_NAME - -create_svc_lb - -create_appgw_ingress diff --git a/weblogic-azure-aks/src/main/arm/scripts/setupWLSDomain.sh b/weblogic-azure-aks/src/main/arm/scripts/setupWLSDomain.sh deleted file mode 100644 index 7462fc65a..000000000 --- a/weblogic-azure-aks/src/main/arm/scripts/setupWLSDomain.sh +++ /dev/null @@ -1,776 +0,0 @@ -# Copyright (c) 2021, 2024, Oracle Corporation and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# This script runs on Azure Container Instance with Alpine Linux that Azure Deployment script creates. -# env inputs: -# URL_3RD_DATASOURCE -# ORACLE_ACCOUNT_ENTITLED - -echo "Script ${0} starts" - -#Function to display usage message -function usage() { - usage=$( - cat <<-END -Specify the following ENV variables: -ACR_NAME -AKS_CLUSTER_NAME -AKS_CLUSTER_RESOURCEGROUP_NAME -CURRENT_RESOURCEGROUP_NAME -ENABLE_ADMIN_CUSTOM_T3 -ENABLE_CLUSTER_CUSTOM_T3 -ENABLE_CUSTOM_SSL -ENABLE_PV -ORACLE_ACCOUNT_NAME -ORACLE_ACCOUNT_PASSWORD -ORACLE_ACCOUNT_ENTITLED -SCRIPT_LOCATION -STORAGE_ACCOUNT_NAME -URL_3RD_DATASOURCE -USE_ORACLE_IMAGE -USER_PROVIDED_IMAGE_PATH -WLS_DOMAIN_NAME -WLS_DOMAIN_UID -WLS_ADMIN_PASSWORD -WLS_ADMIN_USER_NAME -WLS_APP_PACKAGE_URLS -WLS_APP_REPLICAS -WLS_CLUSTER_SIZE -WLS_IMAGE_TAG -WLS_JAVA_OPTIONS -WLS_MANAGED_SERVER_PREFIX -WLS_RESOURCE_REQUEST_CPU -WLS_RESOURCE_REQUEST_MEMORY -WLS_SSL_IDENTITY_DATA -WLS_SSL_IDENTITY_PASSWORD -WLS_SSL_IDENTITY_TYPE -WLS_SSL_TRUST_DATA -WLS_SSL_TRUST_PASSWORD -WLS_SSL_TRUST_TYPE -WLS_SSL_PRIVATE_KEY_ALIAS -WLS_SSL_PRIVATE_KEY_PASSWORD -WLS_T3_ADMIN_PORT -WLS_T3_CLUSTER_PORT -WLS_WDT_RUNTIME_PSW -END - ) - echo_stdout ${usage} - if [ $1 -eq 1 ]; then - echo_stderr ${usage} - exit 1 - fi -} - -#Function to validate input -function validate_input() { - if [ -z "$USE_ORACLE_IMAGE" ]; then - echo_stderr "USER_PROVIDED_IMAGE_PATH is required. " - usage 1 - fi - - if [[ "${USE_ORACLE_IMAGE,,}" == "${constTrue}" ]] && [[ -z "$ORACLE_ACCOUNT_NAME" || -z "${ORACLE_ACCOUNT_PASSWORD}" ]]; then - echo_stderr "Oracle SSO account is required. " - usage 1 - fi - - if [[ -z "$AKS_CLUSTER_RESOURCEGROUP_NAME" || -z "${AKS_CLUSTER_NAME}" ]]; then - echo_stderr "AKS cluster name and resource group name are required. " - usage 1 - fi - - if [ -z "$WLS_IMAGE_TAG" ]; then - echo_stderr "WLS_IMAGE_TAG is required. " - usage 1 - fi - - if [ -z "$ACR_NAME" ]; then - echo_stderr "ACR_NAME is required. " - usage 1 - fi - - if [ -z "$WLS_DOMAIN_NAME" ]; then - echo_stderr "WLS_DOMAIN_NAME is required. " - usage 1 - fi - - if [ -z "$WLS_DOMAIN_UID" ]; then - echo_stderr "WLS_DOMAIN_UID is required. " - usage 1 - fi - - if [ -z "$WLS_ADMIN_USER_NAME" ]; then - echo_stderr "WLS_ADMIN_USER_NAME is required. " - usage 1 - fi - - if [ -z "$WLS_ADMIN_PASSWORD" ]; then - echo_stderr "WLS_ADMIN_PASSWORD is required. " - usage 1 - fi - - if [ -z "$WLS_WDT_RUNTIME_PSW" ]; then - echo_stderr "WLS_WDT_RUNTIME_PSW is required. " - usage 1 - fi - - if [ -z "$WLS_RESOURCE_REQUEST_CPU" ]; then - echo_stderr "WLS_RESOURCE_REQUEST_CPU is required. " - usage 1 - fi - - if [ -z "$WLS_RESOURCE_REQUEST_MEMORY" ]; then - echo_stderr "WLS_RESOURCE_REQUEST_MEMORY is required. " - usage 1 - fi - - if [ -z "$WLS_MANAGED_SERVER_PREFIX" ]; then - echo_stderr "WLS_MANAGED_SERVER_PREFIX is required. " - usage 1 - fi - - if [ -z "$WLS_APP_REPLICAS" ]; then - echo_stderr "WLS_APP_REPLICAS is required. " - usage 1 - fi - - if [ -z "$WLS_APP_PACKAGE_URLS" ]; then - echo_stderr "WLS_APP_PACKAGE_URLS is required. " - usage 1 - fi - - if [ -z "$CURRENT_RESOURCEGROUP_NAME" ]; then - echo_stderr "CURRENT_RESOURCEGROUP_NAME is required. " - usage 1 - fi - - if [ -z "$SCRIPT_LOCATION" ]; then - echo_stderr "SCRIPT_LOCATION is required. " - usage 1 - fi - - if [ -z "$STORAGE_ACCOUNT_NAME" ]; then - echo_stderr "STORAGE_ACCOUNT_NAME is required. " - usage 1 - fi - - if [ -z "$WLS_CLUSTER_SIZE" ]; then - echo_stderr "WLS_CLUSTER_SIZE is required. " - usage 1 - fi - - if [ -z "$ENABLE_CUSTOM_SSL" ]; then - echo_stderr "ENABLE_CUSTOM_SSL is required. " - usage 1 - fi - - if [[ -z "$WLS_SSL_IDENTITY_DATA" || -z "${WLS_SSL_IDENTITY_PASSWORD}" ]]; then - echo_stderr "WLS_SSL_IDENTITY_PASSWORD and WLS_SSL_IDENTITY_DATA are required. " - usage 1 - fi - - if [ -z "$WLS_SSL_IDENTITY_TYPE" ]; then - echo_stderr "WLS_SSL_IDENTITY_TYPE is required. " - usage 1 - fi - - if [[ -z "$WLS_SSL_PRIVATE_KEY_ALIAS" || -z "${WLS_SSL_PRIVATE_KEY_PASSWORD}" ]]; then - echo_stderr "WLS_SSL_PRIVATE_KEY_ALIAS and WLS_SSL_PRIVATE_KEY_PASSWORD are required. " - usage 1 - fi - - if [[ -z "$WLS_SSL_TRUST_DATA" || -z "${WLS_SSL_TRUST_PASSWORD}" ]]; then - echo_stderr "WLS_SSL_TRUST_DATA and WLS_SSL_TRUST_PASSWORD are required. " - usage 1 - fi - - if [ -z "$WLS_SSL_TRUST_TYPE" ]; then - echo_stderr "WLS_SSL_TRUST_TYPE is required. " - usage 1 - fi - - if [ -z "$ENABLE_PV" ]; then - echo_stderr "ENABLE_PV is required. " - usage 1 - fi - - if [ -z "$ENABLE_ADMIN_CUSTOM_T3" ]; then - echo_stderr "ENABLE_ADMIN_CUSTOM_T3 is required. " - usage 1 - fi - - if [ -z "$ENABLE_CLUSTER_CUSTOM_T3" ]; then - echo_stderr "ENABLE_CLUSTER_CUSTOM_T3 is required. " - usage 1 - fi - - if [ -z "$WLS_T3_ADMIN_PORT" ]; then - echo_stderr "WLS_T3_ADMIN_PORT is required. " - usage 1 - fi - - if [ -z "$WLS_T3_CLUSTER_PORT" ]; then - echo_stderr "WLS_T3_CLUSTER_PORT is required. " - usage 1 - fi - - if [ -z "$WLS_JAVA_OPTIONS" ]; then - echo_stderr "WLS_JAVA_OPTIONS is required. " - usage 1 - fi - - if [[ "${WLS_JAVA_OPTIONS}" == "null" ]];then - WLS_JAVA_OPTIONS="" - fi - - if [[ "${USE_ORACLE_IMAGE,,}" == "${constFalse}" ]] && [ -z "$USER_PROVIDED_IMAGE_PATH" ]; then - echo_stderr "USER_PROVIDED_IMAGE_PATH is required. " - usage 1 - fi -} - -# Validate teminal status with $?, exit with exception if errors happen. -function validate_status() { - if [ $? == 1 ]; then - echo_stderr "$@" - echo_stderr "Errors happen, exit 1." - exit 1 - else - echo_stdout "$@" - fi -} - -function get_wls_operator_version() { - local wlsToolingFamilyJsonFile=weblogic_tooling_family.json - # download the json file that wls operator version from weblogic-azure repo. - curl -m ${curlMaxTime} --retry ${retryMaxAttempt} -fsL "${gitUrl4WLSToolingFamilyJsonFile}" -o ${wlsToolingFamilyJsonFile} - if [ $? -eq 0 ]; then - wlsOptVersion=$(cat ${wlsToolingFamilyJsonFile} | jq ".items[] | select(.key==\"WKO\") | .version" | tr -d "\"") - echo "WKO version: ${wlsOptVersion}" - else - echo "WKO version: latest" - fi -} - -# Install latest kubectl and Helm -function install_utilities() { - if [ -d "apps" ]; then - rm apps -f -r - fi - - mkdir apps - cd apps - - # Install kubectl - az aks install-cli - echo "kubectl version" - ret=$(kubectl --help) - validate_status ${ret} - - # Install Helm - browserURL=$(curl -m ${curlMaxTime} --retry ${retryMaxAttempt} -s https://api.github.com/repos/helm/helm/releases/latest | - grep "browser_download_url.*linux-amd64.tar.gz.asc" | - cut -d : -f 2,3 | - tr -d \") - helmLatestVersion=${browserURL#*download\/} - helmLatestVersion=${helmLatestVersion%%\/helm*} - helmPackageName=helm-${helmLatestVersion}-linux-amd64.tar.gz - curl -m ${curlMaxTime} --retry ${retryMaxAttempt} -fL https://get.helm.sh/${helmPackageName} -o /tmp/${helmPackageName} - tar -zxvf /tmp/${helmPackageName} -C /tmp - mv /tmp/linux-amd64/helm /usr/local/bin/helm - echo "Helm version" - helm version - validate_status "Finished installing Helm." - - echo "az cli version" - ret=$(az --version) - validate_status ${ret} -} - -# remove the operator if it is not running. -function uninstall_operator() { - echo "remove operator" - helm uninstall ${operatorName} -n ${wlsOptNameSpace} - attempts=0 - ret=$(helm list -n ${wlsOptNameSpace} | grep "${operatorName}") - while [ -n "$ret" ] && [ $attempts -lt ${optUninstallMaxTry} ]; do - sleep ${optUninstallInterval} - attempts=$((attempts + 1)) - ret=$(helm list -n ${wlsOptNameSpace} | grep "${operatorName}") - done - - if [ $attempts -ge ${optUninstallMaxTry} ]; then - echo_stderr "Failed to remove an unvaliable operator." - exit 1 - fi -} - -function validate_existing_operator() { - ret=$(helm list -n ${wlsOptNameSpace} | grep "${operatorName}" | grep "deployed") - if [ -n "${ret}" ]; then - echo "the operator has been deployed" - echo "${ret}" - - ret=$(kubectl get pod -n ${wlsOptNameSpace} | grep "Running" | grep "1/1") - if [ -n "${ret}" ]; then - echo "the operator is ready to use." - operatorStatus=${constTrue} - else - echo "the operator is unavailable." - uninstall_operator - fi - fi -} - -# Install WebLogic operator using charts from GitHub Repo -# * Create namespace weblogic-operator-ns -# * Create service account -# * install operator -function install_wls_operator() { - echo "check if the operator is installed" - ret=$(kubectl get namespace | grep "${wlsOptNameSpace}") - if [ -z "${ret}" ]; then - echo "create namespace ${wlsOptNameSpace}" - kubectl create namespace ${wlsOptNameSpace} - kubectl -n ${wlsOptNameSpace} create serviceaccount ${wlsOptSA} - - helm repo add ${wlsOptRelease} ${wlsOptHelmChart} --force-update - ret=$(helm repo list) - validate_status ${ret} - else - export operatorStatus=${constFalse} - validate_existing_operator - if [[ "${operatorStatus}" == "${constTrue}" ]]; then - return - fi - fi - - echo "install the operator" - if [[ -n "${wlsOptVersion}" ]]; then - helm install ${wlsOptRelease} weblogic-operator/weblogic-operator \ - --namespace ${wlsOptNameSpace} \ - --set serviceAccount=${wlsOptSA} \ - --set "enableClusterRoleBinding=true" \ - --set "domainNamespaceSelectionStrategy=LabelSelector" \ - --set "domainNamespaceLabelSelector=weblogic-operator\=enabled" \ - --version ${wlsOptVersion} \ - --wait - else - helm install ${wlsOptRelease} weblogic-operator/weblogic-operator \ - --namespace ${wlsOptNameSpace} \ - --set serviceAccount=${wlsOptSA} \ - --set "enableClusterRoleBinding=true" \ - --set "domainNamespaceSelectionStrategy=LabelSelector" \ - --set "domainNamespaceLabelSelector=weblogic-operator\=enabled" \ - --wait - fi - - validate_status "Installing WLS operator." - - # valiadate weblogic operator - ret=$(kubectl get pod -n ${wlsOptNameSpace} | grep "Running" | grep "1/1") - if [ -z "$ret" ]; then - echo_stderr "No WebLogic operator is running." - exit 1 - fi -} - -# Query ACR login server, username, password -function query_acr_credentials() { - # to mitigate error in https://learn.microsoft.com/en-us/answers/questions/1188413/the-resource-with-name-name-and-type-microsoft-con - az provider register -n Microsoft.ContainerRegistry - - ACR_LOGIN_SERVER=$(az acr show -n $ACR_NAME -g ${ACR_RESOURCEGROUP_NAME} --query 'loginServer' -o tsv) - validate_status ${ACR_LOGIN_SERVER} - - ACR_USER_NAME=$(az acr credential show -n $ACR_NAME -g ${ACR_RESOURCEGROUP_NAME} --query 'username' -o tsv) - validate_status "Query ACR credentials." - - ACR_PASSWORD=$(az acr credential show -n $ACR_NAME -g ${ACR_RESOURCEGROUP_NAME} --query 'passwords[0].value' -o tsv) - validate_status "Query ACR credentials." -} - -# Build docker image -# * Create Ubuntu machine VM-UBUNTU -# * Running vm extension to run buildWLSDockerImage.sh, the script will: -# * build a docker image with domain model, applications based on specified WebLogic Standard image -# * push the image to ACR -function build_docker_image() { - echo "build a new image including the new applications" - chmod ugo+x $scriptDir/createVMAndBuildImage.sh - echo ${ACR_PASSWORD} | bash $scriptDir/createVMAndBuildImage.sh $newImageTag ${ACR_LOGIN_SERVER} ${ACR_USER_NAME} - - # to mitigate error in https://learn.microsoft.com/en-us/answers/questions/1188413/the-resource-with-name-name-and-type-microsoft-con - az provider register -n Microsoft.ContainerRegistry - - az acr repository show -n ${ACR_NAME} --image aks-wls-images:${newImageTag} - if [ $? -ne 0 ]; then - echo "Failed to create image ${ACR_LOGIN_SERVER}/aks-wls-images:${newImageTag}" - exit 1 - fi -} - -function create_source_folder_for_certificates() { - mntRoot="/wls" - mntPath="$mntRoot/$STORAGE_ACCOUNT_NAME/$azFileShareName" - - mkdir -p $mntPath - - # Create a folder for certificates - securityDir=${mntPath}/security - if [ ! -d "${securityDir}" ]; then - mkdir ${mntPath}/security - else - rm -f ${mntPath}/$wlsIdentityKeyStoreFileName - rm -f ${mntPath}/$wlsTrustKeyStoreFileName - rm -f ${mntPath}/${wlsTrustKeyStoreJKSFileName} - fi -} - -function validate_ssl_keystores() { - #validate if trust keystore has entry - ${JAVA_HOME}/bin/keytool -list -v \ - -keystore ${mntPath}/${wlsTrustKeyStoreJKSFileName} \ - -storepass $WLS_SSL_TRUST_PASSWORD \ - -storetype jks | - grep 'Entry type:' | - grep 'trustedCertEntry' - - validate_status "validate Trust Keystore." - - echo "Validate SSL key stores successfull !!" -} - -function upload_certificates_to_fileshare() { - expiryData=$(($(date +%s) + ${sasTokenValidTime})) - sasTokenEnd=$(date -d@"$expiryData" -u '+%Y-%m-%dT%H:%MZ') - sasToken=$(az storage share generate-sas \ - --name ${azFileShareName} \ - --account-name ${STORAGE_ACCOUNT_NAME} \ - --https-only \ - --permissions dlrw \ - --expiry $sasTokenEnd -o tsv) - - echo "create directory security" - fsSecurityDirName="security" - utility_create_directory_to_fileshare \ - ${fsSecurityDirName} \ - ${azFileShareName} \ - ${STORAGE_ACCOUNT_NAME} \ - $sasToken - - echo "upload $wlsIdentityKeyStoreFileName" - utility_upload_file_to_fileshare \ - ${azFileShareName} \ - ${STORAGE_ACCOUNT_NAME} \ - "$wlsIdentityKeyStoreFileName" \ - ${mntPath}/$wlsIdentityKeyStoreFileName \ - $sasToken - - echo "upload $wlsTrustKeyStoreFileName" - utility_upload_file_to_fileshare \ - ${azFileShareName} \ - ${STORAGE_ACCOUNT_NAME} \ - "$wlsTrustKeyStoreFileName" \ - ${mntPath}/$wlsTrustKeyStoreFileName \ - $sasToken - - echo "upload $wlsTrustKeyStoreJKSFileName" - utility_upload_file_to_fileshare \ - ${azFileShareName} \ - ${STORAGE_ACCOUNT_NAME} \ - "$wlsTrustKeyStoreJKSFileName" \ - ${mntPath}/${wlsTrustKeyStoreJKSFileName} \ - $sasToken -} - -function output_ssl_keystore() { - echo "Custom SSL is enabled. Storing CertInfo as files..." - #decode cert data once again as it would got base64 encoded - echo "$WLS_SSL_IDENTITY_DATA" | base64 -d >${mntPath}/$wlsIdentityKeyStoreFileName - echo "$WLS_SSL_TRUST_DATA" | base64 -d >${mntPath}/$wlsTrustKeyStoreFileName - - # export jks file - # -Dweblogic.security.SSL.trustedCAKeyStorePassPhrase for PKCS12 is not working correctly - # we neet to convert PKCS12 file to JKS file and specify in domain.yaml via -Dweblogic.security.SSL.trustedCAKeyStore - if [[ "${WLS_SSL_TRUST_TYPE,,}" != "jks" ]]; then - ${JAVA_HOME}/bin/keytool -importkeystore \ - -srckeystore ${mntPath}/${wlsTrustKeyStoreFileName} \ - -srcstoretype ${WLS_SSL_TRUST_TYPE} \ - -srcstorepass ${WLS_SSL_TRUST_PASSWORD} \ - -destkeystore ${mntPath}/${wlsTrustKeyStoreJKSFileName} \ - -deststoretype jks \ - -deststorepass ${WLS_SSL_TRUST_PASSWORD} - - validate_status "Export trust JKS file." - else - echo "$WLS_SSL_TRUST_DATA" | base64 -d >${mntPath}/${wlsTrustKeyStoreJKSFileName} - fi -} - -# Create storage for AKS cluster -# * Create secret for storage account -# * Create PV using Azure file share -# * Create PVC -function create_pv() { - echo "check if pv/pvc have been created." - pvcName=${WLS_DOMAIN_UID}-pvc-azurefile - pvName=${WLS_DOMAIN_UID}-pv-azurefile - ret=$(kubectl -n ${wlsDomainNS} get pvc ${pvcName} | grep "Bound") - - if [ -n "$ret" ]; then - echo "pvc is bound to namespace ${wlsDomainNS}." - # this is a workaround for update domain using marketplace offer. - # the offer will create a new storage account in a new resource group. - # remove the new storage account. - currentStorageAccount=$(kubectl get pv ${pvName} -o json | jq '. | .metadata.labels.storageAccount' | tr -d "\"") - if [[ "${currentStorageAccount}" != "${STORAGE_ACCOUNT_NAME}" ]]; then - echo "the cluster is bound to pv on storage account ${currentStorageAccount}" - az storage account delete -n ${STORAGE_ACCOUNT_NAME} -g $CURRENT_RESOURCEGROUP_NAME -y - STORAGE_ACCOUNT_NAME=${currentStorageAccount} # update storage account name - echo "query storage account resource group" - storageResourceGroup=$(az storage account show --name ${STORAGE_ACCOUNT_NAME} | jq '.resourceGroup' | tr -d "\"") - echo "resource group that contains storage account ${STORAGE_ACCOUNT_NAME} is ${storageResourceGroup}" - fi - - return - fi - - echo "create pv/pvc." - export storageAccountKey=$(az storage account keys list --resource-group $storageResourceGroup --account-name $STORAGE_ACCOUNT_NAME --query "[0].value" -o tsv) - export azureSecretName="azure-secret" - kubectl -n ${wlsDomainNS} create secret generic ${azureSecretName} \ - --from-literal=azurestorageaccountname=${STORAGE_ACCOUNT_NAME} \ - --from-literal=azurestorageaccountkey=${storageAccountKey} - - # generate pv configurations - customPVYaml=${scriptDir}/pv.yaml - cp ${scriptDir}/pv.yaml.template ${customPVYaml} - sed -i -e "s:@NAMESPACE@:${wlsDomainNS}:g" ${customPVYaml} - sed -i -e "s:@PV_NAME@:${pvName}:g" ${customPVYaml} - sed -i -e "s:@PVC_NAME@:${pvcName}:g" ${customPVYaml} - sed -i -e "s:@STORAGE_ACCOUNT@:${STORAGE_ACCOUNT_NAME}:g" ${customPVYaml} - sed -i -e "s:@FILE_SHARE_NAME@:${FILE_SHARE_NAME}:g" ${customPVYaml} - - # generate pv configurations - customPVCYaml=${scriptDir}/pvc.yaml - cp ${scriptDir}/pvc.yaml.template ${customPVCYaml} - sed -i -e "s:@NAMESPACE@:${wlsDomainNS}:g" ${customPVCYaml} - sed -i -e "s:@PVC_NAME@:${pvcName}:g" ${customPVCYaml} - sed -i -e "s:@STORAGE_ACCOUNT@:${STORAGE_ACCOUNT_NAME}:g" ${customPVCYaml} - - kubectl apply -f ${customPVYaml} - utility_check_pv_state ${pvName} "Available" ${checkPVStateMaxAttempt} ${checkPVStateInterval} - kubectl apply -f ${customPVCYaml} - utility_check_pv_state ${pvName} "Bound" ${checkPVStateMaxAttempt} ${checkPVStateInterval} - - # validate PV PVC - ret=$(kubectl get pv | grep "${pvName}" | grep "${pvcName}") - if [ -z "$ret" ]; then - echo_stderr "Failed to create pv/pvc." - fi -} - -function wait_for_pod_completed() { - echo "Waiting for $((WLS_APP_REPLICAS + 1)) pods are running." - - utility_wait_for_pod_completed \ - ${WLS_APP_REPLICAS} \ - "${wlsDomainNS}" \ - ${checkPodStatusMaxAttemps} \ - ${checkPodStatusInterval} -} - -function wait_for_image_update_completed() { - # Make sure all of the pods are updated with new image. - # Assumption: we have only one cluster currently. - acrImagePath=${ACR_LOGIN_SERVER}/aks-wls-images:${newImageTag} - echo "Waiting for $((WLS_APP_REPLICAS + 1)) new pods created with image ${acrImagePath}" - - utility_wait_for_image_update_completed \ - "${acrImagePath}" \ - ${WLS_APP_REPLICAS} \ - "${wlsDomainNS}" \ - ${checkPodStatusMaxAttemps} \ - ${checkPodStatusInterval} -} - -function create_domain_namespace() { - echo "check if namespace ${wlsDomainNS} exists?" - ret=$(kubectl get namespace | grep "${wlsDomainNS}") - - updateNamepace=${constFalse} - if [ -z "${ret}" ]; then - echo "create namespace ${wlsDomainNS}" - kubectl create namespace ${wlsDomainNS} - kubectl label namespace ${wlsDomainNS} weblogic-operator=enabled - else - updateNamepace=${constTrue} - echo "Remove existing secrets and replace with new values" - kubectl -n ${wlsDomainNS} delete secret ${kubectlWLSCredentialName} - kubectl -n ${wlsDomainNS} delete secret ${kubectlWDTEncryptionSecret} - kubectl -n ${wlsDomainNS} delete secret ${kubectlSecretForACR} - fi - - kubectl -n ${wlsDomainNS} create secret generic \ - ${kubectlWLSCredentialName} \ - --from-literal=username=${WLS_ADMIN_USER_NAME} \ - --from-literal=password=${WLS_ADMIN_PASSWORD} - - kubectl -n ${wlsDomainNS} label secret ${kubectlWLSCredentialName} weblogic.domainUID=${WLS_DOMAIN_UID} - - kubectl -n ${wlsDomainNS} create secret generic ${kubectlWDTEncryptionSecret} \ - --from-literal=password=${WLS_WDT_RUNTIME_PSW} - kubectl -n ${wlsDomainNS} label secret ${kubectlWDTEncryptionSecret} weblogic.domainUID=${WLS_DOMAIN_UID} - - kubectl create secret docker-registry ${kubectlSecretForACR} \ - --docker-server=${ACR_LOGIN_SERVER} \ - --docker-username=${ACR_USER_NAME} \ - --docker-password=${ACR_PASSWORD} \ - -n ${wlsDomainNS} - - kubectl -n ${wlsDomainNS} label secret ${kubectlSecretForACR} weblogic.domainUID=${WLS_DOMAIN_UID} -} - -function parsing_ssl_certs_and_create_ssl_secret() { - if [[ "${ENABLE_CUSTOM_SSL,,}" == "${constTrue}" ]]; then - # use default Java, if no, install open jdk 11. - # why not use Microsoft open jdk? No apk installation package! - export JAVA_HOME=/usr/lib/jvm/default-jvm/ - if [ ! -d "${JAVA_HOME}" ]; then - install_jdk - JAVA_HOME=/usr/lib/jvm/java-11-openjdk - fi - - create_source_folder_for_certificates - output_ssl_keystore - validate_ssl_keystores - upload_certificates_to_fileshare - - echo "check if ${kubectlWLSSSLCredentialsName} exists." - ret=$(kubectl get secret -n ${wlsDomainNS} | grep "${kubectlWLSSSLCredentialsName}") - if [ -n "${ret}" ]; then - echo "delete secret ${kubectlWLSSSLCredentialsName}" - kubectl -n ${wlsDomainNS} delete secret ${kubectlWLSSSLCredentialsName} - fi - echo "create secret ${kubectlWLSSSLCredentialsName}" - kubectl -n ${wlsDomainNS} create secret generic ${kubectlWLSSSLCredentialsName} \ - --from-literal=sslidentitykeyalias=${WLS_SSL_PRIVATE_KEY_ALIAS} \ - --from-literal=sslidentitykeypassword=${WLS_SSL_PRIVATE_KEY_PASSWORD} \ - --from-literal=sslidentitystorepath=${sharedPath}/$wlsIdentityKeyStoreFileName \ - --from-literal=sslidentitystorepassword=${WLS_SSL_IDENTITY_PASSWORD} \ - --from-literal=sslidentitystoretype=${WLS_SSL_IDENTITY_TYPE} \ - --from-literal=ssltruststorepath=${sharedPath}/${wlsTrustKeyStoreFileName} \ - --from-literal=ssltruststoretype=${WLS_SSL_TRUST_TYPE} \ - --from-literal=ssltruststorepassword=${WLS_SSL_TRUST_PASSWORD} - - kubectl -n ${wlsDomainNS} label secret ${kubectlWLSSSLCredentialsName} weblogic.domainUID=${WLS_DOMAIN_UID} - javaOptions=" -Dweblogic.security.SSL.ignoreHostnameVerification=true -Dweblogic.security.SSL.trustedCAKeyStore=${sharedPath}/${wlsTrustKeyStoreJKSFileName} ${javaOptions}" - fi -} - -# Deploy WebLogic domain and cluster -# * Create namespace for domain -# * Create secret for weblogic -# * Create secret for Azure file -# * Create secret for ACR -# * Deploy WebLogic domain using image in ACR -# * Wait for the domain completed -function setup_wls_domain() { - export javaOptions=${WLS_JAVA_OPTIONS} - if [[ "${enableClusterT3Channel,,}" == "true" ]] || [[ "${enableAdminT3Channel,,}" == "true" ]]; then - # for remote t3/t3s access. - # refer to https://oracle.github.io/weblogic-kubernetes-operator/faq/external-clients/#enabling-unknown-host-access - javaOptions="-Dweblogic.rjvm.allowUnknownHost=true ${javaOptions}" - fi - - # create namespace - create_domain_namespace - - echo "constTrue": "${constTrue}" - if [[ "${ENABLE_PV,,}" == "${constTrue}" ]]; then - echo "start to create pv/pvc. " - create_pv - fi - - parsing_ssl_certs_and_create_ssl_secret - - # show resources - echo "print weblogic operator status" - kubectl -n ${wlsOptNameSpace} get pod -o wide - echo "print secrets that is ready to use" - kubectl -n ${wlsDomainNS} get secret -o wide - echo "print current configmap" - kubectl -n ${wlsDomainNS} get configmap -o wide - echo "print pvc info" - kubectl -n ${wlsDomainNS} get pvc -o wide - - customDomainYaml=${scriptDir}/custom-domain.yaml - if [[ "${updateNamepace}" == "${constTrue}" ]]; then - echo "start to update domain ${WLS_DOMAIN_UID}" - chmod ugo+x $scriptDir/updateDomainConfig.sh - bash $scriptDir/updateDomainConfig.sh \ - ${customDomainYaml} \ - "${ACR_LOGIN_SERVER}/aks-wls-images:${newImageTag}" \ - "${javaOptions}" - else - echo "start to create domain ${WLS_DOMAIN_UID}" - # generate domain yaml - chmod ugo+x $scriptDir/genDomainConfig.sh - bash $scriptDir/genDomainConfig.sh \ - ${customDomainYaml} \ - "${ACR_LOGIN_SERVER}/aks-wls-images:${newImageTag}" \ - "${javaOptions}" - fi - - kubectl apply -f ${customDomainYaml} - - wait_for_image_update_completed - - wait_for_pod_completed -} - -# Main script -export script="${BASH_SOURCE[0]}" -export scriptDir="$(cd "$(dirname "${script}")" && pwd)" - -source ${scriptDir}/common.sh -source ${scriptDir}/utility.sh - -export adminServerName="admin-server" -export azFileShareName=${FILE_SHARE_NAME} -export exitCode=0 -export kubectlSecretForACR="regsecret" -export kubectlWDTEncryptionSecret="${WLS_DOMAIN_UID}-runtime-encryption-secret" -export kubectlWLSCredentialName="${WLS_DOMAIN_UID}-weblogic-credentials" -export kubectlWLSSSLCredentialsName="${WLS_DOMAIN_UID}-weblogic-ssl-credentials" -export newImageTag=$(date +%s) -export operatorName="weblogic-operator" -# seconds -export sasTokenValidTime=3600 -export storageResourceGroup=${CURRENT_RESOURCEGROUP_NAME} -export sharedPath="/shared" -export wlsDomainNS="${WLS_DOMAIN_UID}-ns" -export wlsOptHelmChart="https://oracle.github.io/weblogic-kubernetes-operator/charts" -export wlsOptNameSpace="weblogic-operator-ns" -export wlsOptRelease="weblogic-operator" -export wlsOptSA="weblogic-operator-sa" -export wlsIdentityKeyStoreFileName="security/identity.keystore" -export wlsTrustKeyStoreFileName="security/trust.keystore" -export wlsTrustKeyStoreJKSFileName="security/trust.jks" - -validate_input - -get_wls_operator_version - -install_utilities - -query_acr_credentials - -build_docker_image - -connect_aks $AKS_CLUSTER_NAME $AKS_CLUSTER_RESOURCEGROUP_NAME - -install_wls_operator - -setup_wls_domain - -exit $exitCode diff --git a/weblogic-azure-aks/src/main/arm/scripts/updateApplications.sh b/weblogic-azure-aks/src/main/arm/scripts/updateApplications.sh deleted file mode 100644 index 9a6bf25a4..000000000 --- a/weblogic-azure-aks/src/main/arm/scripts/updateApplications.sh +++ /dev/null @@ -1,302 +0,0 @@ -# Copyright (c) 2021, 2024, Oracle Corporation and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -echo "Script ${0} starts" - -function usage() { - usage=$(cat <<-END -Specify the following ENV variables: -ACR_NAME -AKS_CLUSTER_NAME -AKS_CLUSTER_RESOURCEGROUP_NAME -CURRENT_RESOURCEGROUP_NAME -ORACLE_ACCOUNT_NAME -ORACLE_ACCOUNT_PASSWORD -STORAGE_ACCOUNT_NAME -STORAGE_ACCOUNT_CONTAINER_NAME -SCRIPT_LOCATION -USE_ORACLE_IMAGE -USER_PROVIDED_IMAGE_PATH -WLS_APP_PACKAGE_URLS -WLS_DOMAIN_NAME -WLS_DOMAIN_UID -WLS_IMAGE_TAG -END -) - echo_stdout "${usage}" - if [ $1 -eq 1 ]; then - echo_stderr "${usage}" - exit 1 - fi -} - -#Function to validate input -function validate_input() { - if [ -z "$USE_ORACLE_IMAGE" ]; then - echo_stderr "USER_PROVIDED_IMAGE_PATH is required. " - usage 1 - fi - - if [[ "${USE_ORACLE_IMAGE,,}" == "${constTrue}" ]] && [[ -z "$ORACLE_ACCOUNT_NAME" || -z "${ORACLE_ACCOUNT_PASSWORD}" ]]; then - echo_stderr "Oracle SSO account is required. " - usage 1 - fi - - if [[ -z "$AKS_CLUSTER_RESOURCEGROUP_NAME" || -z "${AKS_CLUSTER_NAME}" ]]; then - echo_stderr "AKS cluster name and resource group name are required. " - usage 1 - fi - - if [ -z "$WLS_IMAGE_TAG" ]; then - echo_stderr "WLS_IMAGE_TAG is required. " - usage 1 - fi - - if [ -z "$ACR_NAME" ]; then - echo_stderr "ACR_NAME is required. " - usage 1 - fi - - if [ -z "$WLS_DOMAIN_NAME" ]; then - echo_stderr "WLS_DOMAIN_NAME is required. " - usage 1 - fi - - if [ -z "$WLS_DOMAIN_UID" ]; then - echo_stderr "WLS_DOMAIN_UID is required. " - usage 1 - fi - - if [ -z "$CURRENT_RESOURCEGROUP_NAME" ]; then - echo_stderr "CURRENT_RESOURCEGROUP_NAME is required. " - usage 1 - fi - - if [ -z "$WLS_APP_PACKAGE_URLS" ]; then - echo_stderr "WLS_APP_PACKAGE_URLS is required. " - usage 1 - fi - - if [ -z "$SCRIPT_LOCATION" ]; then - echo_stderr "SCRIPT_LOCATION is required. " - usage 1 - fi - - if [ -z "$STORAGE_ACCOUNT_NAME" ]; then - echo_stderr "STORAGE_ACCOUNT_NAME is required. " - usage 1 - fi - - if [ -z "$STORAGE_ACCOUNT_CONTAINER_NAME" ]; then - echo_stderr "STORAGE_ACCOUNT_CONTAINER_NAME is required. " - usage 1 - fi - - if [[ "${USE_ORACLE_IMAGE,,}" == "${constFalse}" ]] && [ -z "$USER_PROVIDED_IMAGE_PATH" ]; then - echo_stderr "USER_PROVIDED_IMAGE_PATH is required. " - usage 1 - fi -} - -function query_wls_cluster_info(){ - WLS_CLUSTER_SIZE=$(kubectl -n ${wlsDomainNS} get domain ${WLS_DOMAIN_UID} -o json \ - | jq '. | .status.clusters[] | select(.clusterName == "'${constClusterName}'") | .maximumReplicas') - echo "cluster size: ${WLS_CLUSTER_SIZE}" - - ENABLE_CUSTOM_SSL=${constFalse} - sslIdentityEnv=$(kubectl -n ${wlsDomainNS} get domain ${WLS_DOMAIN_UID} -o json \ - | jq '. | .spec.serverPod.env[] | select(.name=="'${sslIdentityEnvName}'")') - if [ -n "${sslIdentityEnv}" ]; then - ENABLE_CUSTOM_SSL=${constTrue} - fi -} - -# Query ACR login server, username, password -function query_acr_credentials() { - echo "query credentials of ACR ${ACR_NAME}" - ACR_LOGIN_SERVER=$(az acr show -n $ACR_NAME --query 'loginServer' -o tsv) - ACR_USER_NAME=$(az acr credential show -n $ACR_NAME --query 'username' -o tsv) - ACR_PASSWORD=$(az acr credential show -n $ACR_NAME --query 'passwords[0].value' -o tsv) -} - -function get_app_sas_url() { - args=("$@") - appNumber=$# - index=0 - appSASUrlString="" - while [ $index -lt $appNumber ]; do - appName=${args[${index}]} - echo "app package file name: ${appName}" - if [[ "$appName" == *".war" || "$appName" == *".ear" || "$appName" == *".jar" ]]; then - appSaSUrl=$(az storage blob url --container-name ${STORAGE_ACCOUNT_CONTAINER_NAME} \ - --name ${appName} \ - --account-name ${STORAGE_ACCOUNT_NAME} \ - --sas-token ${sasToken} -o tsv) - echo ${appSaSUrl} - appSASUrlString="${appSASUrlString},${appSaSUrl}" - fi - - index=$((index+1)) - done - - # append urls - if [ "${WLS_APP_PACKAGE_URLS}" == "[]" ]; then - WLS_APP_PACKAGE_URLS="[${appSASUrlString:1:${#appSASUrlString}-1}]" # remove the beginning comma - else - WLS_APP_PACKAGE_URLS=$(echo "${WLS_APP_PACKAGE_URLS:1:${#WLS_APP_PACKAGE_URLS}-2}") # remove [] - WLS_APP_PACKAGE_URLS="[${WLS_APP_PACKAGE_URLS}${appSASUrlString}]" - fi - - echo $WLS_APP_PACKAGE_URLS -} - -function query_app_urls() { - echo "check if the storage account exists." - ret=$(az storage account check-name --name ${STORAGE_ACCOUNT_NAME} \ - | grep "AlreadyExists") - if [ -z "$ret" ]; then - echo "${STORAGE_ACCOUNT_NAME} does not exist." - return - fi - - appList=$(az storage blob list --container-name ${STORAGE_ACCOUNT_CONTAINER_NAME} \ - --account-name ${STORAGE_ACCOUNT_NAME} \ - | jq '.[] | .name' \ - | tr -d "\"") - - if [ $? == 1 ]; then - echo "Failed to query application from ${STORAGE_ACCOUNT_CONTAINER_NAME}" - return - fi - - expiryData=$(( `date +%s`+${sasTokenValidTime})) - sasTokenEnd=`date -d@"$expiryData" -u '+%Y-%m-%dT%H:%MZ'` - sasToken=$(az storage account generate-sas \ - --permissions r \ - --account-name ${STORAGE_ACCOUNT_NAME} \ - --services b \ - --resource-types sco \ - --expiry $sasTokenEnd -o tsv) - - get_app_sas_url ${appList} -} - -function build_docker_image() { - local adminT3AddressEnv=$(kubectl -n ${wlsDomainNS} get domain ${WLS_DOMAIN_UID} -o json \ - | jq '. | .spec.serverPod.env[] | select(.name=="'${constAdminT3AddressEnvName}'")') - if [ -n "${adminT3AddressEnv}" ]; then - ENABLE_ADMIN_CUSTOM_T3=${constTrue} - fi - - local clusterT3AddressEnv=$(kubectl -n ${wlsDomainNS} get domain ${WLS_DOMAIN_UID} -o json \ - | jq '. | .spec.serverPod.env[] | select(.name=="'${constClusterT3AddressEnvName}'")') - if [ -n "${clusterT3AddressEnv}" ]; then - ENABLE_CLUSTER_CUSTOM_T3=${constTrue} - fi - - export WLS_APP_PACKAGE_URLS=$(echo $WLS_APP_PACKAGE_URLS | base64 -w0) - echo "build a new image including the new applications" - chmod ugo+x $scriptDir/createVMAndBuildImage.sh - echo ${ACR_PASSWORD} \ - | bash $scriptDir/createVMAndBuildImage.sh $newImageTag ${ACR_LOGIN_SERVER} ${ACR_USER_NAME} - - az acr repository show -n ${ACR_NAME} --image aks-wls-images:${newImageTag} - if [ $? -ne 0 ]; then - echo "Failed to create image ${ACR_LOGIN_SERVER}/aks-wls-images:${newImageTag}" - exit 1 - fi -} - -function apply_new_image() { - acrImagePath="${ACR_LOGIN_SERVER}/aks-wls-images:${newImageTag}" - restartVersion=$(kubectl -n ${wlsDomainNS} get domain ${WLS_DOMAIN_UID} '-o=jsonpath={.spec.restartVersion}') - # increase restart version - restartVersion=$((restartVersion + 1)) - kubectl -n ${wlsDomainNS} patch domain ${WLS_DOMAIN_UID} \ - --type=json \ - '-p=[{"op": "replace", "path": "/spec/restartVersion", "value": "'${restartVersion}'" }, {"op": "replace", "path": "/spec/image", "value": "'${acrImagePath}'" }]' -} - -function wait_for_pod_completed() { - # Make sure all of the pods are running. - local clusterName=$(kubectl get cluster -n ${wlsDomainNS} -o json | jq -r '.items[0].metadata.name') - local replicas=$(kubectl -n ${wlsDomainNS} get cluster ${clusterName} -o json \ - | jq '. | .spec.replicas') - - utility_wait_for_pod_completed \ - ${replicas} \ - "${wlsDomainNS}" \ - ${checkPodStatusMaxAttemps} \ - ${checkPodStatusInterval} -} - -function wait_for_image_update_completed() { - # Make sure all of the pods are updated with new image. - # Assumption: we have only one cluster currently. - local clusterName=$(kubectl get cluster -n ${wlsDomainNS} -o json | jq -r '.items[0].metadata.name') - local replicas=$(kubectl -n ${wlsDomainNS} get cluster ${clusterName} -o json \ - | jq '. | .spec.replicas') - - utility_wait_for_image_update_completed \ - "${acrImagePath}" \ - ${replicas} \ - "${wlsDomainNS}" \ - ${checkPodStatusMaxAttemps} \ - ${checkPodStatusInterval} -} - -#Output value to deployment scripts -function output_image() { - echo ${acrImagePath} - - result=$(jq -n -c \ - --arg image $acrImagePath \ - '{image: $image}') - echo "output of deployment script: $result" - echo $result >$AZ_SCRIPTS_OUTPUT_PATH -} - -# Main script -export script="${BASH_SOURCE[0]}" -export scriptDir="$(cd "$(dirname "${script}")" && pwd)" - -source ${scriptDir}/common.sh -source ${scriptDir}/utility.sh - -export newImageTag=$(date +%s) -# seconds -export sasTokenValidTime=3600 -export sslIdentityEnvName="SSL_IDENTITY_PRIVATE_KEY_ALIAS" -export wlsDomainNS="${WLS_DOMAIN_UID}-ns" - -# export ENV var that will be used in createVMAndBuildImage.sh -export ENABLE_ADMIN_CUSTOM_T3=${constFalse} -export ENABLE_CLUSTER_CUSTOM_T3=${constFalse} -export ENABLE_CUSTOM_SSL=${constFalse} -export WLS_CLUSTER_SIZE=5 -export URL_3RD_DATASOURCE=$(echo "[]" | base64) - -# Main script -set -Eo pipefail - -validate_input - -install_kubectl - -connect_aks $AKS_CLUSTER_NAME $AKS_CLUSTER_RESOURCEGROUP_NAME - -query_wls_cluster_info - -query_acr_credentials - -query_app_urls - -build_docker_image - -apply_new_image - -wait_for_image_update_completed - -wait_for_pod_completed - -output_image diff --git a/weblogic-azure-aks/src/main/arm/scripts/updateDomainConfig.sh b/weblogic-azure-aks/src/main/arm/scripts/updateDomainConfig.sh deleted file mode 100644 index b2109c0ac..000000000 --- a/weblogic-azure-aks/src/main/arm/scripts/updateDomainConfig.sh +++ /dev/null @@ -1,284 +0,0 @@ -# Copyright (c) 2021, Oracle Corporation and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -export script="${BASH_SOURCE[0]}" -export scriptDir="$(cd "$(dirname "${script}")" && pwd)" - -export filePath=$1 -export wlsImagePath=$2 -export javaOptions=$3 - -export adminServiceUrl="${WLS_DOMAIN_UID}-admin-server.${WLS_DOMAIN_UID}-ns.svc.cluster.local" -export clusterServiceUrl="${WLS_DOMAIN_UID}-cluster-${constClusterName}.${WLS_DOMAIN_UID}-ns.svc.cluster.local" -export wlsDomainNS="${WLS_DOMAIN_UID}-ns" - -# output the existing domain configuration -export previousConfig=${scriptDir}/previousDomain.json -kubectl -n ${wlsDomainNS} get domain ${WLS_DOMAIN_UID} -o json >${previousConfig} - -# query logHomeEnabled -logHomeEnabled=$(cat ${previousConfig} | jq '. | .spec.logHomeEnabled') -logHome=$(cat ${previousConfig} | jq '. | .spec.logHome') -envList=$(cat ${previousConfig} | jq '. | .spec.serverPod.env') -envLength=$(cat ${previousConfig} | jq '. | .spec.serverPod.env | length') -restartVersion=$(cat ${previousConfig} | jq '. | .spec.restartVersion' | tr -d "\"") -configMap=$(cat ${previousConfig} | jq '. | .spec.configuration.model.configMap') -secretList=$(cat ${previousConfig} | jq '. | .spec.configuration.secrets') -restartVersion=$((restartVersion+1)) - -cat <$filePath -# Copyright (c) 2021, Oracle Corporation and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. -# -# Based on ./kubernetes/samples/scripts/create-weblogic-domain/model-in-image/domain-resources/WLS/mii-initial-d1-WLS-v1.yaml -# in https://github.com/oracle/weblogic-kubernetes-operator. -# This is an example of how to define a Domain resource. -# -apiVersion: "weblogic.oracle/v9" -kind: Domain -metadata: - name: "${WLS_DOMAIN_UID}" - namespace: "${wlsDomainNS}" - labels: - weblogic.domainUID: "${WLS_DOMAIN_UID}" - -spec: - # Set to 'FromModel' to indicate 'Model in Image'. - domainHomeSourceType: FromModel - - # The WebLogic Domain Home, this must be a location within - # the image for 'Model in Image' domains. - domainHome: /u01/domains/${WLS_DOMAIN_UID} - - # The WebLogic Server Docker image that the Operator uses to start the domain - image: "${wlsImagePath}" - - # Defaults to "Always" if image tag (version) is ':latest' - imagePullPolicy: "IfNotPresent" - - # Identify which Secret contains the credentials for pulling an image - imagePullSecrets: - - name: regsecret - - # Identify which Secret contains the WebLogic Admin credentials, - # the secret must contain 'username' and 'password' fields. - webLogicCredentialsSecret: - name: "${WLS_DOMAIN_UID}-weblogic-credentials" - - # Whether to include the WebLogic Server stdout in the pod's stdout, default is true - includeServerOutInPodLog: true - # Set which WebLogic Servers the Operator will start - # - "NEVER" will not start any server in the domain - # - "ADMIN_ONLY" will start up only the administration server (no managed servers will be started) - # - "IF_NEEDED" will start all non-clustered servers, including the administration server, and clustered servers up to their replica count. - serverStartPolicy: "IF_NEEDED" -EOF - -if [[ "${logHomeEnabled}" == "true" ]];then - cat <>$filePath - # Whether to enable overriding your log file location, see also 'logHome' - logHomeEnabled: true - - # The location for domain log, server logs, server out, introspector out, and Node Manager log files - # see also 'logHomeEnabled', 'volumes', and 'volumeMounts'. - logHome: ${logHome} -EOF -fi - -# Resources -cat <>$filePath - # Settings for all server pods in the domain including the introspector job pod - serverPod: - resources: - requests: - cpu: "${WLS_RESOURCE_REQUEST_CPU}" - memory: "${WLS_RESOURCE_REQUEST_MEMORY}" - # Optional new or overridden environment variables for the domain's pods - # - This sample uses CUSTOM_DOMAIN_NAME in its image model file - # to set the Weblogic domain name - env: -EOF - -if [[ "${ENABLE_CUSTOM_SSL,,}" == "true" ]]; then - cat <>$filePath - - name: SSL_IDENTITY_PRIVATE_KEY_ALIAS - valueFrom: - secretKeyRef: - key: sslidentitykeyalias - name: ${WLS_DOMAIN_UID}-weblogic-ssl-credentials - - name: SSL_IDENTITY_PRIVATE_KEY_PSW - valueFrom: - secretKeyRef: - key: sslidentitykeypassword - name: ${WLS_DOMAIN_UID}-weblogic-ssl-credentials - - name: SSL_IDENTITY_PRIVATE_KEYSTORE_PATH - valueFrom: - secretKeyRef: - key: sslidentitystorepath - name: ${WLS_DOMAIN_UID}-weblogic-ssl-credentials - - name: SSL_IDENTITY_PRIVATE_KEYSTORE_TYPE - valueFrom: - secretKeyRef: - key: sslidentitystoretype - name: ${WLS_DOMAIN_UID}-weblogic-ssl-credentials - - name: SSL_IDENTITY_PRIVATE_KEYSTORE_PSW - valueFrom: - secretKeyRef: - key: sslidentitystorepassword - name: ${WLS_DOMAIN_UID}-weblogic-ssl-credentials - - name: SSL_TRUST_KEYSTORE_PATH - valueFrom: - secretKeyRef: - key: ssltruststorepath - name: ${WLS_DOMAIN_UID}-weblogic-ssl-credentials - - name: SSL_TRUST_KEYSTORE_TYPE - valueFrom: - secretKeyRef: - key: ssltruststoretype - name: ${WLS_DOMAIN_UID}-weblogic-ssl-credentials - - name: SSL_TRUST_KEYSTORE_PSW - valueFrom: - secretKeyRef: - key: ssltruststorepassword - name: ${WLS_DOMAIN_UID}-weblogic-ssl-credentials -EOF -fi - -if [[ "${ENABLE_ADMIN_CUSTOM_T3,,}" == "true" ]]; then - cat <>$filePath - - name: T3_TUNNELING_ADMIN_PORT - value: "${WLS_T3_ADMIN_PORT}" - - name: T3_TUNNELING_ADMIN_ADDRESS - value: "${adminServiceUrl}" -EOF -fi - -if [[ "${ENABLE_CLUSTER_CUSTOM_T3,,}" == "true" ]]; then - cat <>$filePath - - name: T3_TUNNELING_CLUSTER_PORT - value: "${WLS_T3_CLUSTER_PORT}" - - name: T3_TUNNELING_CLUSTER_ADDRESS - value: "${clusterServiceUrl}" -EOF -fi - -index=0 -while [ $index -lt ${envLength} ]; do - envItemName=$(cat ${previousConfig} | jq ". | .spec.serverPod.env[$index] | .name" | tr -d "\"") - envItemValue=$(cat ${previousConfig} | jq ". | .spec.serverPod.env[$index] | .value") - index=$((index+1)) - - if [[ "${envItemName}" == "JAVA_OPTIONS" ]];then - envItemValue="\"${constDefaultJavaOptions} ${javaOptions}\"" - fi - - # do not copy value from SSL_ env - if [[ "${envItemName}" == "SSL_IDENTITY_PRIVATE_KEY_ALIAS" ]] \ - || [[ "${envItemName}" == "SSL_IDENTITY_PRIVATE_KEY_PSW" ]] \ - || [[ "${envItemName}" == "SSL_IDENTITY_PRIVATE_KEYSTORE_PATH" ]] \ - || [[ "${envItemName}" == "SSL_IDENTITY_PRIVATE_KEYSTORE_TYPE" ]] \ - || [[ "${envItemName}" == "SSL_IDENTITY_PRIVATE_KEYSTORE_PSW" ]] \ - || [[ "${envItemName}" == "SSL_TRUST_KEYSTORE_PATH" ]] \ - || [[ "${envItemName}" == "SSL_TRUST_KEYSTORE_TYPE" ]] \ - || [[ "${envItemName}" == "SSL_TRUST_KEYSTORE_PSW" ]] \ - || [[ "${envItemName}" == "T3_TUNNELING_ADMIN_PORT" ]] \ - || [[ "${envItemName}" == "T3_TUNNELING_ADMIN_ADDRESS" ]] \ - || [[ "${envItemName}" == "T3_TUNNELING_CLUSTER_PORT" ]] \ - || [[ "${envItemName}" == "T3_TUNNELING_CLUSTER_ADDRESS" ]];then - continue - fi - - cat <>$filePath - - name: "${envItemName}" - value: ${envItemValue} -EOF -done - -if [[ "${ENABLE_PV,,}" == "true" ]]; then - cat <>$filePath - # Optional volumes and mounts for the domain's pods. See also 'logHome'. - volumes: - - name: ${WLS_DOMAIN_UID}-pv-azurefile - persistentVolumeClaim: - claimName: ${WLS_DOMAIN_UID}-pvc-azurefile - volumeMounts: - - mountPath: /shared - name: ${WLS_DOMAIN_UID}-pv-azurefile -EOF -fi - -cat <>$filePath - # The desired behavior for starting the domain's administration server. - adminServer: - # Setup a Kubernetes node port for the administration server default channel - #adminService: - # channels: - # - channelName: default - # nodePort: 30701 - - # The number of admin servers to start for unlisted clusters - replicas: 1 - - # The name of each Cluster resource - clusters: - - name: ${WLS_DOMAIN_UID}-cluster-1 - - # Change the restartVersion to force the introspector job to rerun - # and apply any new model configuration, to also force a subsequent - # roll of your domain's WebLogic Server pods. - restartVersion: '${restartVersion}' - - configuration: - - # Settings for domainHomeSourceType 'FromModel' - model: - # Valid model domain types are 'WLS', 'JRF', and 'RestrictedJRF', default is 'WLS' - domainType: "WLS" - # All 'FromModel' domains require a runtimeEncryptionSecret with a 'password' field - runtimeEncryptionSecret: "${WLS_DOMAIN_UID}-runtime-encryption-secret" -EOF - -echo "set configmap..." -if [[ "${configMap}" != "null" ]];then - cat <>$filePath - # Optional configmap for additional models and variable files - configMap: ${configMap} -EOF -fi - -echo "set secrets" -if [[ "${secretList}" != "null" ]];then - secretLength=$(cat ${previousConfig} | jq '. | .spec.configuration.secrets | length') - cat <>$filePath - secrets: -EOF - index=0 - while [ $index -lt ${secretLength} ]; do - secretItemValue=$(cat ${previousConfig} | jq ". | .spec.configuration.secrets[$index]") - cat <>$filePath - - ${secretItemValue} -EOF - index=$((index+1)) - done -fi - -cat <>$filePath - ---- - -apiVersion: "weblogic.oracle/v1" -kind: Cluster -metadata: - name: ${WLS_DOMAIN_UID}-cluster-1 - # Update this with the namespace your domain will run in: - namespace: ${WLS_DOMAIN_UID}-ns - labels: - # Update this with the domainUID of your domain: - weblogic.domainUID: ${WLS_DOMAIN_UID} -spec: - # This must match a cluster name that is specified in the WebLogic configuration - clusterName: cluster-1 - # The number of managed servers to start for this cluster - replicas: 2 - -EOF \ No newline at end of file diff --git a/weblogic-azure-aks/src/main/arm/scripts/utility.sh b/weblogic-azure-aks/src/main/arm/scripts/utility.sh deleted file mode 100644 index 878267bcf..000000000 --- a/weblogic-azure-aks/src/main/arm/scripts/utility.sh +++ /dev/null @@ -1,434 +0,0 @@ -# Copyright (c) 2021, 2024 Oracle Corporation and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# This script runs on Azure Container Instance with Alpine Linux that Azure Deployment script creates. - -function echo_stderr() { - echo >&2 "$@" - # The function is used for scripts running within Azure Deployment Script - # The value of AZ_SCRIPTS_OUTPUT_PATH is /mnt/azscripts/azscriptoutput - echo -e "$@" >>${AZ_SCRIPTS_PATH_OUTPUT_DIRECTORY}/errors.log -} - -function echo_stdout() { - echo "$@" - # The function is used for scripts running within Azure Deployment Script - # The value of AZ_SCRIPTS_OUTPUT_PATH is /mnt/azscripts/azscriptoutput - echo -e "$@" >>${AZ_SCRIPTS_PATH_OUTPUT_DIRECTORY}/debug.log -} - -#Validate teminal status with $?, exit with exception if errors happen. -function utility_validate_status() { - if [ $? == 1 ]; then - echo_stderr "$@" - echo_stderr "Errors happen, exit 1." - exit 1 - else - echo_stdout "$@" - fi -} - -function connect_aks(){ - az aks get-credentials \ - -n $1 \ - -g $2 \ - --overwrite-existing \ - --only-show-errors - - utility_validate_status "Finished connecting to AKS cluster." -} - -# JAVA_HOME=/usr/lib/jvm/java-11-openjdk -function install_jdk() { - local ready=false - local attempt=0 - while [[ "${ready}" == "false" && $attempt -le ${retryMaxAttempt} ]]; do - echo "Installing openjdk11 ${attempt}" - ready=true - # Install Microsoft OpenJDK - apk upgrade - apk add openjdk11 \ - --no-cache \ - -q --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community - - echo "java version" - java -version - if [ $? -eq 1 ]; then - ready=false - fi - - attempt=$((attempt + 1)) - sleep ${retryInterval} - done - - if [ ${attempt} -gt ${retryMaxAttempt} ]; then - echo_stderr "Failed to install openjdk11." - exit 1 - fi -} - -function install_docker() { - local ready=false - local attempt=0 - while [[ "${ready}" == "false" && $attempt -le ${retryMaxAttempt} ]]; do - echo "Installing docker ${attempt}" - ready=true - apk add docker --no-cache --quiet - docker --help - if [ $? -eq 1 ]; then - ready=false - fi - - attempt=$((attempt + 1)) - sleep ${retryInterval} - done - - if [ ${attempt} -gt ${retryMaxAttempt} ]; then - echo_stderr "Failed to install docker." - exit 1 - fi -} - -function install_kubectl() { - local ready=false - local attempt=0 - while [[ "${ready}" == "false" && $attempt -le ${retryMaxAttempt} ]]; do - echo "Installing kubectl ${attempt}" - ready=true - # Install kubectl - az aks install-cli - echo "validate kubectl" - kubectl --help - if [ $? -eq 1 ]; then - ready=false - fi - - attempt=$((attempt + 1)) - sleep ${retryInterval} - done - - if [ ${attempt} -gt ${retryMaxAttempt} ]; then - echo_stderr "Failed to install kubectl." - exit 1 - fi -} - -function install_helm() { - # Install Helm - browserURL=$(curl -m ${curlMaxTime} --retry ${retryMaxAttempt} -s https://api.github.com/repos/helm/helm/releases/latest | - grep "browser_download_url.*linux-amd64.tar.gz.asc" | - cut -d : -f 2,3 | - tr -d \") - helmLatestVersion=${browserURL#*download\/} - helmLatestVersion=${helmLatestVersion%%\/helm*} - helmPackageName=helm-${helmLatestVersion}-linux-amd64.tar.gz - curl -m ${curlMaxTime} --retry ${retryMaxAttempt} -fL https://get.helm.sh/${helmPackageName} -o /tmp/${helmPackageName} - tar -zxvf /tmp/${helmPackageName} -C /tmp - mv /tmp/linux-amd64/helm /usr/local/bin/helm - echo "Helm version" - helm version - utility_validate_status "Finished installing Helm." -} - -# Query service port -# $1: service name -# $2: namespace -# $3: channel name -# return: port -# Notes: channel name will be different if istio is enabled. -function utility_query_service_port() { - local port=$(kubectl get service ${1} -n ${2} -o json | - jq ".spec.ports[] | select(.name==\"${3}\") | .port") - if [ $? != 0 ] || [[ "$port" == "null" ]]; then - echo_stderr "Failed to query port of ${1}/${3} in namespace ${2}" - exit 1 - fi - - echo $port -} - -# -# Check the state of a persistent volume. -# Leverage source code from function "checkPvState" in weblogic-operator, kubernetes\samples\scripts\common\utility.sh -# $1 - name of volume -# $2 - expected state of volume -# $3 - max attempt -# $4 - interval -function utility_check_pv_state { - - echo_stdout "Checking if the persistent volume ${1:?} is ${2:?}" - local pv_state=$(kubectl get pv $1 -o jsonpath='{.status.phase}') - attempts=0 - while [ ! "$pv_state" = "$2" ] && [ ! $attempts -eq $3 ]; do - attempts=$((attempts + 1)) - sleep $4 - pv_state=$(kubectl get pv $1 -o jsonpath='{.status.phase}') - done - if [ "$pv_state" != "$2" ]; then - echo_stderr "The persistent volume state should be $2 but is $pv_state" - exit 1 - fi -} - -# -# Create directory in specified file share -# $1 - name of directory -# $2 - name of file share -# $3 - name of storage account -# $4 - sas token -function utility_create_directory_to_fileshare() { - ret=$(az storage directory exists --name $1 --share-name $2 --account-name $3 --sas-token ${4} | jq '.exists') - if [[ "${ret,,}" == "false" ]]; then - az storage directory create --name $1 --share-name $2 --account-name $3 --sas-token ${4} --timeout 30 - fi - - if [ $? != 0 ]; then - echo_stderr "Failed to create directory ${1} in file share ${3}/${2}" - exit 1 - fi -} - -# -# Upload file to file share -# $1 - name of file share -# $2 - name of storage account -# $3 - path of file -# $4 - source path of file -# $5 - sas token -function utility_upload_file_to_fileshare() { - az storage file upload --share-name ${1} --account-name ${2} --path ${3} --source ${4} --sas-token ${5} --timeout 60 - if [ $? != 0 ]; then - echo_stderr "Failed to upload ${3} to file share ${2}/${1}" - exit 1 - fi -} - -# -# Make sure all the applications are running -# Exit with error if there is inactive application. -# $1 - namespace of the domain -# $2 - ClusterIP service name of admin server -# $3 - domain user -# $4 - domain password -# $5 - path of python script which checks application status, the script will run on admin server pod. -function utility_validate_application_status() { - local wlsDomainNS=$1 - local wlsAdminSvcName=$2 - local wlsUser=$3 - local wlsPassword=$4 - local pyScriptPath=$5 - - local podName=$(kubectl -n ${wlsDomainNS} get pod -l weblogic.serverName=admin-server -o json | - jq '.items[0] | .metadata.name' | - tr -d "\"") - - # get non-ssl port - local adminTargetPort=$(kubectl get svc ${wlsAdminSvcName} -n ${wlsDomainNS} -o json | jq '.spec.ports[] | select(.name=="internal-t3") | .port') - local t3ChannelAddress="${podName}.${wlsDomainNS}" - - local targetFilePath=/tmp/checkApplicationStatus.py - echo "copy ${pyScriptPath} to ${targetFilePath}" - kubectl cp ${pyScriptPath} -n ${wlsDomainNS} ${podName}:${targetFilePath} - kubectl exec -it ${podName} -n ${wlsDomainNS} -c "weblogic-server" \ - -- bash -c "wlst.sh ${targetFilePath} -user ${wlsUser} -password ${wlsPassword} -t3ChannelAddress ${t3ChannelAddress} -t3ChannelPort ${adminTargetPort}" | - grep "Summary: all applications are active" - - if [ $? == 1 ]; then - echo_stderr "Failed to deploy application to WLS cluster. Please make sure the configurations are correct." - exit 1 - fi -} - -# Call this function to make sure pods of a domain are running. -# * Make sure the admin server pod is running -# * Make sure all the managed server pods are running -# Assuming there is only one cluster in the domain -# Parameters: -# * appReplicas: replicas of the managed server -# * wlsDomainNS: name space -# * checkPodStatusMaxAttemps: max attempts to query the pods status if they are not all running. -# * checkPodStatusInterval: interval of query the pods status -function utility_wait_for_pod_completed() { - appReplicas=$1 - wlsDomainNS=$2 - checkPodStatusMaxAttemps=$3 - checkPodStatusInterval=$4 - - echo "Waiting for $((appReplicas + 1)) pods are running." - - readyPodNum=0 - attempt=0 - while [[ ${readyPodNum} -le ${appReplicas} && $attempt -le ${checkPodStatusMaxAttemps} ]]; do - ret=$(kubectl get pods -n ${wlsDomainNS} -o json | - jq '.items[] | .status.phase' | - grep "Running") - if [ -z "${ret}" ]; then - readyPodNum=0 - else - readyPodNum=$(kubectl get pods -n ${wlsDomainNS} -o json | - jq '.items[] | .status.phase' | - grep -c "Running") - fi - echo "Number of new running pod: ${readyPodNum}" - attempt=$((attempt + 1)) - sleep ${checkPodStatusInterval} - done - - if [ ${attempt} -gt ${checkPodStatusMaxAttemps} ]; then - echo_stderr "It takes too long to wait for all the pods to reach running state, please refer to https://aka.ms/wls-aks-troubleshooting." - exit 1 - fi -} - -# Call this function to make sure pods of a domain are updated with expected image. -# * Make sure the admin server pod is updated with expected image -# * Make sure all the managed server pods are updated with expected image -# Assuming there is only one cluster in the domain -# Parameters: -# * acrImagePath: image path -# * appReplicas: replicas of the managed server -# * wlsDomainNS: name space -# * checkPodStatusMaxAttemps: max attempts to query the pods status if they are not all running. -# * checkPodStatusInterval: interval of query the pods status -function utility_wait_for_image_update_completed() { - # Make sure all of the pods are updated with new image. - # Assumption: we have only one cluster currently. - acrImagePath=$1 - appReplicas=$2 - wlsDomainNS=$3 - checkPodStatusMaxAttemps=$4 - checkPodStatusInterval=$5 - - echo "Waiting for $((appReplicas + 1)) new pods created with image ${acrImagePath}" - - updatedPodNum=0 - attempt=0 - while [ ${updatedPodNum} -le ${appReplicas} ] && [ $attempt -le ${checkPodStatusMaxAttemps} ]; do - echo "attempts ${attempt}" - ret=$(kubectl get pods -n ${wlsDomainNS} -o json | - jq '.items[] | .spec | .containers[] | select(.name == "weblogic-server") | .image' | - grep "${acrImagePath}") - - if [ -z "${ret}" ]; then - updatedPodNum=0 - else - updatedPodNum=$(kubectl get pods -n ${wlsDomainNS} -o json | - jq '.items[] | .spec | .containers[] | select(.name == "weblogic-server") | .image' | - grep -c "${acrImagePath}") - fi - echo "Number of new pod: ${updatedPodNum}" - - attempt=$((attempt + 1)) - sleep ${checkPodStatusInterval} - done - - if [ ${attempt} -gt ${checkPodStatusMaxAttemps} ]; then - echo_stderr "Failed to update image ${acrImagePath} to all weblogic server pods. " - exit 1 - fi -} - -# Call this function to make sure pods of a domain are restarted. -# Assuming there is only one cluster in the domain -# Parameters: -# * baseTime: time stamp that should be earlier then pod restarts -# * appReplicas: replicas of the managed server -# * wlsDomainNS: name space -# * checkPodStatusMaxAttemps: max attempts to query the pods status if they are not all running. -# * checkPodStatusInterval: interval of query the pods status -function utility_wait_for_pod_restarted() { - baseTime=$1 - appReplicas=$2 - wlsDomainUID=$3 - checkPodStatusMaxAttemps=$4 - checkPodStatusInterval=$5 - - wlsDomainNS=${wlsDomainUID}-ns - - updatedPodNum=0 - attempt=0 - while [ ${updatedPodNum} -le ${appReplicas} ] && [ $attempt -le ${checkPodStatusMaxAttemps} ]; do - echo "attempts ${attempt}" - ret=$(kubectl get pods -n ${wlsDomainNS} -l weblogic.domainUID=${wlsDomainUID} -o json | - jq '.items[] | .metadata.creationTimestamp' | tr -d "\"") - - counter=0 - for item in $ret; do - # conver the time format from YYYY-MM-DDThh:mm:ssZ to YYYY.MM.DD-hh:mm:ss - alpineItem=$(echo "${item}" | sed -e "s/-/./g;s/T/-/g;s/Z//g") - podCreateTimeStamp=$(date -u -d "${alpineItem}" +"%s") - echo "pod create time: $podCreateTimeStamp, base time: ${baseTime}" - if [ ${podCreateTimeStamp} -gt ${baseTime} ]; then - counter=$((counter + 1)) - fi - done - - updatedPodNum=$counter - echo "Number of new pod: ${updatedPodNum}" - - attempt=$((attempt + 1)) - sleep ${checkPodStatusInterval} - done - - if [ ${attempt} -gt ${checkPodStatusMaxAttemps} ]; then - echo_stderr "Failed to restart all weblogic server pods. " - exit 1 - fi -} - -# Call this function to make sure the lb service is avaliable. -function utility_waitfor_lb_svc_completed() { - svcName=$1 - wlsDomainNS=$2 - perfSVCAttemps=$3 - perfRetryInterval=$4 - - attempts=0 - svcState="running" - while [ "$svcState" == "running" ] && [ $attempts -lt ${perfSVCAttemps} ]; do - svcState="completed" - attempts=$((attempts + 1)) - echo Waiting for job completed...${attempts} - sleep ${perfRetryInterval} - - ip=$(kubectl get svc ${svcName} -n ${wlsDomainNS} -o json | - jq '.status.loadBalancer.ingress[0].ip') - echo "ip: ${ip}" - if [[ "${ip}" == "null" ]]; then - svcState="running" - fi - done - - if [ "$svcState" == "running" ] && [ $attempts -ge ${perfSVCAttemps} ]; then - echo_stderr "Failed to create service: ${svcName}" - exit 1 - fi -} - -# Call this function to make sure the ingress is avaliable. -function utility_waitfor_ingress_completed() { - svcName=$1 - wlsDomainNS=$2 - perfSVCAttemps=$3 - perfRetryInterval=$4 - - attempts=0 - svcState="running" - while [ "$svcState" == "running" ] && [ $attempts -lt ${perfSVCAttemps} ]; do - svcState="completed" - attempts=$((attempts + 1)) - echo Waiting for job completed...${attempts} - sleep ${perfRetryInterval} - - ip=$(kubectl get ingress ${svcName} -n ${wlsDomainNS} -o json | - jq '.status.loadBalancer.ingress[0].ip') - echo "ip: ${ip}" - if [[ "${ip}" == "null" ]]; then - svcState="running" - fi - done - - if [ "$svcState" == "running" ] && [ $attempts -ge ${perfSVCAttemps} ]; then - echo_stderr "Failed to create service: ${svcName}" - exit 1 - fi -} diff --git a/weblogic-azure-aks/src/main/arm/scripts/validateApplications.sh b/weblogic-azure-aks/src/main/arm/scripts/validateApplications.sh deleted file mode 100644 index a9850775a..000000000 --- a/weblogic-azure-aks/src/main/arm/scripts/validateApplications.sh +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) 2021, 2024 Oracle Corporation and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# This script runs on Azure Container Instance with Alpine Linux that Azure Deployment script creates. - -function validate_app() { - # make sure all the application are active, if not, fail the deployment. - local wlsDomainNS="${WLS_DOMAIN_UID}-ns" - local wlsAdminSvcName="${WLS_DOMAIN_UID}-admin-server" - scriptCheckAppStatus=$scriptDir/checkApplicationStatus.py - chmod ugo+x $scriptDir/checkApplicationStatus.py - utility_validate_application_status \ - ${wlsDomainNS} \ - ${wlsAdminSvcName} \ - ${WLS_DOMAIN_USER} \ - ${WLS_DOMAIN_PASSWORD} \ - ${scriptCheckAppStatus} -} - -# Main script -export script="${BASH_SOURCE[0]}" -export scriptDir="$(cd "$(dirname "${script}")" && pwd)" - -source ${scriptDir}/utility.sh - -install_kubectl - -connect_aks $AKS_NAME $AKS_RESOURCE_GROUP_NAME - -validate_app \ No newline at end of file diff --git a/weblogic-azure-aks/src/main/bicep/mainTemplate.bicep b/weblogic-azure-aks/src/main/bicep/mainTemplate.bicep deleted file mode 100644 index ed56ded0c..000000000 --- a/weblogic-azure-aks/src/main/bicep/mainTemplate.bicep +++ /dev/null @@ -1,814 +0,0 @@ -/* -* Copyright (c) 2021, 2024, Oracle Corporation and/or its affiliates. -* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -* -* Terms: -* aci is short for Azure Container Insight -* aks is short for Azure Kubernetes Service -* acr is short for Azure Container Registry -* -* Run the template: -* $ bicep build mainTemplate.bicep -* $ az deployment group create -f mainTemplate.json -g -* -* Build marketplace offer for test: -* Replace the partner center pid in mainTemplate.bicep, then run the following command to generate the ARM package, and upload it to partner center. -* If using azure-javaee-iaas-parent less than 1.0.13, use: -* $ mvn -Pbicep -Passembly -Ddev clean install -* otherwise, use -* $ mvn -Pbicep-dev -Passembly clean install -*/ - -param _artifactsLocation string = deployment().properties.templateLink.uri -@secure() -param _artifactsLocationSasToken string = '' -@description('true to use resource or workspace permissions. false to require workspace permissions.') -param aciResourcePermissions bool = true -@description('Number of days to retain data in Azure Monitor workspace.') -param aciRetentionInDays int = 120 -@description('Pricing tier: PerGB2018 or legacy tiers (Free, Standalone, PerNode, Standard or Premium) which are not available to all customers.') -param aciWorkspaceSku string = 'pergb2018' -param acrName string = 'acr-contoso' -param acrResourceGroupName string = 'acr-contoso-rg' -@maxLength(12) -@minLength(1) -@description('The name for this node pool. Node pool must contain only lowercase letters and numbers. For Linux node pools the name cannot be longer than 12 characters.') -param aksAgentPoolName string = 'agentpool' -@maxValue(10000) -@minValue(1) -@description('Set the minimum node count for the cluster.') -param aksAgentPoolNodeCount int = 3 -@maxValue(1000) -@minValue(3) -@description('Set the maximum node count for the cluster.') -param aksAgentPoolNodeMaxCount int = 5 -@description('The size of the virtual machines that will form the nodes in the cluster. This cannot be changed after creating the cluster') -param vmSize string = 'Standard_DS2_v2' -@description('Resource group name of an existing AKS cluster.') -param aksClusterRGName string = 'aks-contoso-rg' -@description('Name of an existing AKS cluster.') -param aksClusterName string = 'aks-contoso' -@description('The AKS version.') -param aksVersion string = 'default' -@allowed([ - 'haveCert' - 'generateCert' -]) -@description('Three scenarios we support for deploying app gateway') -param appGatewayCertificateOption string = 'haveCert' -@description('Public IP Name for the Application Gateway') -param appGatewayPublicIPAddressName string = 'gwip' -@description('The one-line, base64 string of the backend SSL root certificate data.') -param appGatewaySSLBackendRootCertData string = newGuid() -@description('The one-line, base64 string of the SSL certificate data.') -param appGatewaySSLCertData string = newGuid() -@secure() -@description('The value of the password for the SSL Certificate') -param appGatewaySSLCertPassword string = newGuid() -@description('Create Application Gateway ingress for admin console.') -param appgwForAdminServer bool = true -@description('Create Application Gateway ingress for remote console.') -param appgwForRemoteConsole bool = true -@description('If true, configure Azure Application Gateway frontend IP with private IP.') -param appgwUsePrivateIP bool = false -@description('Urls of Java EE application packages.') -param appPackageUrls array = [] -@description('The number of managed server to start.') -param appReplicas int = 2 -@description('Scale up once average cpu utilization is larger then the input number ') -param averageCpuUtilization int = 60 -@description('Scale up once average memory utilization is larger then the input number ') -param averageMemoryUtilization int = 60 -@description('true to create a new Azure Container Registry.') -param createACR bool = false -@description('true to create a new AKS cluster.') -param createAKSCluster bool = true -@description('If true, the template will update records to the existing DNS Zone. If false, the template will create a new DNS Zone.') -param createDNSZone bool = false -@allowed([ - 'oracle' - 'postgresql' - 'sqlserver' - 'mysql' - 'otherdb' -]) -@description('One of the supported database types') -param databaseType string = 'oracle' -@allowed([ - 'createOrUpdate' - 'delete' -]) -@description('createOrUpdate: create a new data source connection, or update an existing data source connection. delete: delete an existing data source connection') -param dbConfigurationType string = 'createOrUpdate' -@description('Urls of datasource drivers, must be specified if database type is otherdb') -param dbDriverLibrariesUrls array = [] -@description('Datasource driver name, must be specified if database type is otherdb') -param dbDriverName string = 'org.contoso.Driver' -@description('Determines the transaction protocol (global transaction processing behavior) for the data source.') -param dbGlobalTranPro string = 'EmulateTwoPhaseCommit' -@description('Managed identity that has access to database') -param dbIdentity object = {} -@secure() -@description('Password for Database') -param dbPassword string = newGuid() -@description('The name of the database table to use when testing physical database connections. This name is required when you specify a Test Frequency and enable Test Reserved Connections.') -param dbTestTableName string = 'Null' -@description('User id of Database') -param dbUser string = 'contosoDbUser' -@description('DNS prefix for ApplicationGateway') -param dnsNameforApplicationGateway string = 'wlsgw' -@description('Specify a label used to generate subdomain of Admin server. The final subdomain name will be label.dnszoneName, e.g. admin.contoso.xyz') -param dnszoneAdminConsoleLabel string = 'admin' -@description('Specify a label used to generate subdomain of Admin server T3 channel. The final subdomain name will be label.dnszoneName, e.g. admin-t3.contoso.xyz') -param dnszoneAdminT3ChannelLabel string = 'admin-t3' -@description('Specify a label used to generate subdomain of WebLogic cluster. The final subdomain name will be label.dnszoneName, e.g. applications.contoso.xyz') -param dnszoneClusterLabel string = 'www' -param dnszoneClusterT3ChannelLabel string = 'cluster-t3' -@description('Azure DNS Zone name.') -param dnszoneName string = 'contoso.xyz' -param dnszoneRGName string = 'dns-contoso-rg' -@description('JDBC Connection String') -param dsConnectionURL string = 'jdbc:postgresql://contoso.postgres.database.azure.com:5432/postgres' -@description('true to set up Application Gateway ingress.') -param enableAppGWIngress bool = false -@description('true to enable Horizontal Autoscaling.') -param enableAutoscaling bool = false -@description('In addition to the CPU and memory metrics included in AKS by default, you can enable Container Insights for more comprehensive data on the overall performance and health of your cluster. Billing is based on data ingestion and retention settings.') -param enableAzureMonitoring bool = false -@description('true to create persistent volume using file share.') -param enableAzureFileShare bool = false -@description('true to enable cookie based affinity.') -param enableCookieBasedAffinity bool = false -param enableCustomSSL bool = false -param enableDB bool = false -param enableDNSConfiguration bool = false -@description('Configure a custom channel in Admin Server for the T3 protocol that enables HTTP tunneling') -param enableAdminT3Tunneling bool = false -@description('Configure a custom channel in WebLogic cluster for the T3 protocol that enables HTTP tunneling') -param enableClusterT3Tunneling bool = false -@description('Enable passwordless datasource connection.') -param enablePswlessConnection bool = false -@allowed([ - 'cpu' - 'memory' -]) -param hpaScaleType string = 'cpu' -@description('Is the specified SSO account associated with an active Oracle support contract?') -param isSSOSupportEntitled bool = false -@description('JNDI Name for JDBC Datasource') -param jdbcDataSourceName string = 'jdbc/contoso' -param location string -@description('Object array to define Load Balancer service, each object must include service name, service target[admin-server or cluster-1], port.') -param lbSvcValues array = [] -@description('Name prefix of managed server.') -param managedServerPrefix string = 'managed-server' -@description('To mitigate ARM-TTK error: Control Named vnetForApplicationGateway must output the newOrExisting property when hideExisting is false') -param newOrExistingVnetForApplicationGateway string = 'new' -@secure() -@description('Password of Oracle SSO account.') -param ocrSSOPSW string = newGuid() -@description('User name of Oracle SSO account.') -param ocrSSOUser string = 'null' -@description('Custom Identity Store Data') -@secure() -param sslUploadedCustomIdentityKeyStoreData string = newGuid() -@secure() -@description('Custom Identity Store passphrase') -param sslUploadedCustomIdentityKeyStorePassphrase string = newGuid() -@description('Weblogic Custom Identity Store Type') -@allowed([ - 'JKS' - 'PKCS12' -]) -param sslUploadedCustomIdentityKeyStoreType string = 'PKCS12' -@description('Custom Trust Store data') -@secure() -param sslUploadedCustomTrustKeyStoreData string = newGuid() -@secure() -@description('Custom Trust Store passphrase') -param sslUploadedCustomTrustKeyStorePassPhrase string = newGuid() -@description('Weblogic Custom Trust Store Type') -@allowed([ - 'JKS' - 'PKCS12' -]) -param sslUploadedCustomTrustKeyStoreType string = 'PKCS12' -@description('Alias of the private key') -@secure() -param sslUploadedPrivateKeyAlias string = newGuid() -@secure() -@description('Password of the private key') -param sslUploadedPrivateKeyPassPhrase string = newGuid() -@description('${label.tagsLabel}') -param tagsByResource object = {} -@description('Public port of the custom T3 channel in admin server') -param t3ChannelAdminPort int = 7005 -@description('Public port of the custom T3 channel in WebLoigc cluster') -param t3ChannelClusterPort int = 8011 -@description('True to use latest supported Kubernetes version.') -param useLatestSupportedAksVersion bool = true -@description('True to enable HPA for auto scaling.') -param useHpa bool = true -@description('True to set up internal load balancer service.') -param useInternalLB bool = false -param utcValue string = utcNow() -@description('User provided ACR for base image') -param userProvidedAcr string = 'null' -param userProvidedAcrRgName string = 'null' -@description('User provided base image path') -param userProvidedImagePath string = 'null' -@description('Use Oracle images or user provided patched images') -param useOracleImage bool = true -param validateApplications bool = false -@description('VNET for Application Gateway.') -param vnetForApplicationGateway object = { - name: 'wlsaks-app-gateway-vnet' - resourceGroup: resourceGroup().name - addressPrefixes: [ - '172.16.0.0/24' - ] - addressPrefix: '172.16.0.0/24' - newOrExisting: 'new' - subnets: { - gatewaySubnet: { - name: 'wlsaks-gateway-subnet' - addressPrefix: '172.16.0.0/24' - startAddress: '172.16.0.4' - } - } -} -@description('To mitigate ARM-TTK error: Control Named vnetForApplicationGateway must output the resourceGroup property when hideExisting is false') -param vnetRGNameForApplicationGateway string = 'vnet-contoso-rg-name' -@secure() -@description('Password for model WebLogic Deploy Tooling runtime encrytion.') -param wdtRuntimePassword string -@description('Maximum cluster size.') -param wlsClusterSize int = 5 -@description('Requests for CPU resources for admin server and managed server.') -param wlsCPU string = '200m' -@description('Name of WebLogic domain to create.') -param wlsDomainName string = 'domain1' -@description('UID of WebLogic domain, used in WebLogic Operator.') -param wlsDomainUID string = 'sample-domain1' -@description('Docker tag that comes after "container-registry.oracle.com/middleware/weblogic:"') -param wlsImageTag string = '12.2.1.4' -param wlsJavaOption string = 'null' -@description('Memory requests for admin server and managed server.') -param wlsMemory string = '1.5Gi' -@secure() -param wlsPassword string -@description('User name for WebLogic Administrator.') -param wlsUserName string = 'weblogic' - -// To mitigate arm-ttk error: Type Mismatch: Parameter in nested template is defined as string, but the parent template defines it as bool. -var _enableCustomSSL = enableCustomSSL -var _enableAppGWIngress = enableAppGWIngress -// We can streamline the following code with a user-defined function, but it is not supported in Partner Center. -// For status, see https://dev.azure.com/edburns-msft/Open%20Standard%20Enterprise%20Java%20(Java%20EE)%20on%20Azure/_workitems/edit/6219 -var _objTagsByResource = { - '${identifier.accounts}': contains(tagsByResource, '${identifier.accounts}') ? tagsByResource['${identifier.accounts}'] : json('{}') - '${identifier.managedClusters}': contains(tagsByResource, '${identifier.managedClusters}') ? tagsByResource['${identifier.managedClusters}'] : json('{}') - '${identifier.applicationGateways}': contains(tagsByResource, '${identifier.applicationGateways}') ? tagsByResource['${identifier.applicationGateways}'] : json('{}') - '${identifier.registries}': contains(tagsByResource, '${identifier.registries}') ? tagsByResource['${identifier.registries}'] : json('{}') - '${identifier.virtualMachines}': contains(tagsByResource, '${identifier.virtualMachines}') ? tagsByResource['${identifier.virtualMachines}'] : json('{}') - '${identifier.virtualMachinesExtensions}': contains(tagsByResource, '${identifier.virtualMachinesExtensions}') ? tagsByResource['${identifier.virtualMachinesExtensions}'] : json('{}') - '${identifier.virtualNetworks}': contains(tagsByResource, '${identifier.virtualNetworks}') ? tagsByResource['${identifier.virtualNetworks}'] : json('{}') - '${identifier.networkInterfaces}': contains(tagsByResource, '${identifier.networkInterfaces}') ? tagsByResource['${identifier.networkInterfaces}'] : json('{}') - '${identifier.networkSecurityGroups}': contains(tagsByResource, '${identifier.networkSecurityGroups}') ? tagsByResource['${identifier.networkSecurityGroups}'] : json('{}') - '${identifier.publicIPAddresses}': contains(tagsByResource, '${identifier.publicIPAddresses}') ? tagsByResource['${identifier.publicIPAddresses}'] : json('{}') - '${identifier.storageAccounts}': contains(tagsByResource, '${identifier.storageAccounts}') ? tagsByResource['${identifier.storageAccounts}'] : json('{}') - '${identifier.vaults}': contains(tagsByResource, '${identifier.vaults}') ? tagsByResource['${identifier.vaults}'] : json('{}') - '${identifier.userAssignedIdentities}': contains(tagsByResource, '${identifier.userAssignedIdentities}') ? tagsByResource['${identifier.userAssignedIdentities}'] : json('{}') - '${identifier.dnszones}': contains(tagsByResource, '${identifier.dnszones}') ? tagsByResource['${identifier.dnszones}'] : json('{}') - '${identifier.workspaces}': contains(tagsByResource, '${identifier.workspaces}') ? tagsByResource['${identifier.workspaces}'] : json('{}') - '${identifier.deploymentScripts}': contains(tagsByResource, '${identifier.deploymentScripts}') ? tagsByResource['${identifier.deploymentScripts}'] : json('{}') -} -var const_aksName = createAKSCluster ? 'wlsonaks${const_globalResourceNameSuffix}' : aksClusterName -var const_appGatewaySSLCertOptionGenerateCert = 'generateCert' -var const_appGatewayPublicIPAddressName = format('{0}-{1}', appGatewayPublicIPAddressName, const_globalResourceNameSuffix) -var const_acrName = (createACR) ? 'acrwlsaks${const_globalResourceNameSuffix}' : acrName -var const_azcliVersion = '2.53.0' -var const_azureSubjectName = format('{0}.{1}.{2}', name_domainLabelforApplicationGateway, location, 'cloudapp.azure.com') -var const_bValidateApplications= validateApplications && (length(appPackageUrls) > 0) -var const_cpuPlatform = (contains(vmSize, 'p') ? 'arm64' : 'amd64') -var const_createNewAcr = useOracleImage && createACR -var const_defaultKeystoreType = 'PKCS12' -var const_enableNetworking = (length(lbSvcValues) > 0) || enableAppGWIngress -var const_enablePV = enableCustomSSL || enableAzureFileShare -var const_fileShareName = 'weblogic-${const_globalResourceNameSuffix}' -var const_globalResourceNameSuffix = '${uniqueString(utcValue)}' -var const_nsgName = 'wls-aks-nsg-${const_globalResourceNameSuffix}' -var const_showAdminConsoleExUrl = (length(lbSvcValues) > 0) || (enableAppGWIngress && appgwForAdminServer) -var const_showRemoteAdminConsoleExUrl = ((length(lbSvcValues) > 0) || (enableAppGWIngress && appgwForRemoteConsole)) && !enableCustomSSL -var const_showRemoteAdminConsoleSecuredExUrl = ((length(lbSvcValues) > 0) || (enableAppGWIngress && appgwForRemoteConsole)) && enableCustomSSL -var const_wlsClusterName = 'cluster-1' -var const_wlsJavaOptions = wlsJavaOption == '' ? 'null' : wlsJavaOption -var name_appgwFrontendSSLCertName = 'appGatewaySslCert' -var name_appgwBackendRootCertName = 'appGatewayTrustedRootCert' -var name_defaultPidDeployment = 'pid' -var name_dnsNameforApplicationGateway = '${dnsNameforApplicationGateway}${const_globalResourceNameSuffix}' -var name_domainLabelforApplicationGateway = take('${name_dnsNameforApplicationGateway}-${toLower(name_rgNameWithoutSpecialCharacter)}-${toLower(wlsDomainName)}', 63) -var name_rgNameWithoutSpecialCharacter = replace(replace(replace(replace(resourceGroup().name, '.', ''), '(', ''), ')', ''), '_', '') // remove . () _ from resource group name -var name_storageAccountName = 'wls${const_globalResourceNameSuffix}' -var ref_wlsDomainDeployment = _enableCustomSSL ? wlsDomainWithCustomSSLDeployment : wlsDomainDeployment -var obj_uamiForDeploymentScript = { - type: 'UserAssigned' - userAssignedIdentities: { - '${uamiDeployment.outputs.uamiIdForDeploymentScript}': {} - } -} - -/* -* Beginning of the offer deployment -*/ -module pids './modules/_pids/_pid.bicep' = { - name: 'initialization' -} - -// Due to lack of preprocessor solution for the way we use bicep, must hard-code the pid here. -// For test, replace the pid with testing one, and build the package. -module partnerCenterPid './modules/_pids/_empty.bicep' = { - name: 'pid-a1775ed4-512c-4cfa-9e68-f0b09b36de90-partnercenter' -} - -module uamiDeployment 'modules/_globalUamiAndRoles.bicep' = { - name: 'uami-deployment' - params: { - _globalResourceNameSuffix: const_globalResourceNameSuffix - location: location - tagsByResource: _objTagsByResource - } -} - -/* -* Deploy ACR -*/ -module preAzureResourceDeployment './modules/_preDeployedAzureResources.bicep' = { - name: 'prerequisite-resources-deployment' - params: { - acrName: const_acrName - acrResourceGroupName: acrResourceGroupName - createNewAcr: const_createNewAcr - location: location - tagsByResource: _objTagsByResource - } -} - -module validateInputs 'modules/_deployment-scripts/_ds-validate-parameters.bicep' = { - name: 'validate-parameters-and-fail-fast' - params: { - _globalResourceNameSuffix: const_globalResourceNameSuffix - acrName: preAzureResourceDeployment.outputs.acrName - acrResourceGroupName: preAzureResourceDeployment.outputs.acrResourceGroupName - aksAgentPoolNodeCount: aksAgentPoolNodeCount - aksAgentPoolVMSize: vmSize - aksClusterRGName: aksClusterRGName - aksClusterName: aksClusterName - aksVersion: aksVersion - appGatewayCertificateOption: appGatewayCertificateOption - appGatewaySSLCertData: appGatewaySSLCertData - appGatewaySSLCertPassword: appGatewaySSLCertPassword - appReplicas: appReplicas - azCliVersion: const_azcliVersion - createAKSCluster: createAKSCluster - createDNSZone: createDNSZone - dnszoneName: dnszoneName - dnszoneRGName: dnszoneRGName - enableAppGWIngress: enableAppGWIngress - enableCustomSSL: enableCustomSSL - enableDNSConfiguration: enableDNSConfiguration - identity: obj_uamiForDeploymentScript - isSSOSupportEntitled: isSSOSupportEntitled - location: location - ocrSSOPSW: ocrSSOPSW - ocrSSOUser: ocrSSOUser - sslUploadedCustomIdentityKeyStoreData: sslUploadedCustomIdentityKeyStoreData - sslUploadedCustomIdentityKeyStorePassphrase: sslUploadedCustomIdentityKeyStorePassphrase - sslUploadedCustomIdentityKeyStoreType: sslUploadedCustomIdentityKeyStoreType - sslUploadedCustomTrustKeyStoreData: sslUploadedCustomTrustKeyStoreData - sslUploadedCustomTrustKeyStorePassPhrase: sslUploadedCustomTrustKeyStorePassPhrase - sslUploadedCustomTrustKeyStoreType: sslUploadedCustomTrustKeyStoreType - sslUploadedPrivateKeyAlias: sslUploadedPrivateKeyAlias - sslUploadedPrivateKeyPassPhrase: sslUploadedPrivateKeyPassPhrase - tagsByResource: _objTagsByResource - useAksWellTestedVersion: useLatestSupportedAksVersion - userProvidedAcr: userProvidedAcr // used in user provided images - userProvidedAcrRgName: userProvidedAcrRgName - userProvidedImagePath: userProvidedImagePath - useOracleImage: useOracleImage - vnetForApplicationGateway: vnetForApplicationGateway - wlsImageTag: wlsImageTag - } - dependsOn: [ - pids - preAzureResourceDeployment - uamiDeployment - ] -} - -module autoGeneratedSSLCert './modules/_azure-resoruces/_autoGeneratedPfxCertInKeyVault.bicep' = if (enableAppGWIngress && appGatewayCertificateOption == const_appGatewaySSLCertOptionGenerateCert) { - name: 'auto-generated-ssl-cert-for-app-gateway' - params: { - _globalResourceNameSuffix: const_globalResourceNameSuffix - identity: obj_uamiForDeploymentScript - keyVaultName: 'wlskv${const_globalResourceNameSuffix}' - location: location - secretName: name_appgwFrontendSSLCertName - subjectName: format('CN={0}', enableDNSConfiguration ? format('{0}.{1}', dnsNameforApplicationGateway, dnszoneName) : const_azureSubjectName) - tagsByResource: _objTagsByResource - } - dependsOn: [ - uamiDeployment - ] -} - -// To void space overlap with AKS VNet, must deploy the Applciation Gateway VNet before AKS deployment. -module appgatewayDeployment 'modules/_appGateway.bicep' = if (enableAppGWIngress) { - name: 'application-gateway-deployment' - params: { - _pidAppgwEnd: pids.outputs.appgwEnd == '' ? name_defaultPidDeployment : pids.outputs.appgwEnd - _pidAppgwStart: pids.outputs.appgwStart == '' ? name_defaultPidDeployment : pids.outputs.appgwStart - _pidAppgwWithCustomCert: pids.outputs.customCertForAppgw == '' ? name_defaultPidDeployment : pids.outputs.customCertForAppgw - appgwCertificateOption: appGatewayCertificateOption - appgwName: 'appgw${const_globalResourceNameSuffix}' - appgwPublicIPAddressName: const_appGatewayPublicIPAddressName - appgwSSLBackendRootCertData: appGatewaySSLBackendRootCertData - appgwUsePrivateIP: appgwUsePrivateIP - azCliVersion: const_azcliVersion - autoGeneratedSSLCertKeyVaultName: appGatewayCertificateOption == const_appGatewaySSLCertOptionGenerateCert ? autoGeneratedSSLCert.outputs.keyVaultName : '' - autoGeneratedSSLCertSecretName: appGatewayCertificateOption == const_appGatewaySSLCertOptionGenerateCert ? autoGeneratedSSLCert.outputs.secretName : '' - dnsNameforApplicationGateway: name_domainLabelforApplicationGateway - enableCustomSSL: enableCustomSSL - identity: obj_uamiForDeploymentScript - nsgName: const_nsgName - location: location - newOrExistingVnetForApplicationGateway: newOrExistingVnetForApplicationGateway - sslCertData: appGatewaySSLCertData - sslCertificateDeploymentName: name_appgwFrontendSSLCertName - sslCertPswData: appGatewaySSLCertPassword - trustedRootCertificateDeploymentName: name_appgwBackendRootCertName - vnetForApplicationGateway: vnetForApplicationGateway - vnetRGNameForApplicationGateway: vnetRGNameForApplicationGateway - tagsByResource: _objTagsByResource - } - dependsOn: [ - autoGeneratedSSLCert - ] -} - -module wlsDomainDeployment 'modules/setupWebLogicCluster.bicep' = if (!enableCustomSSL) { - name: 'setup-wls-cluster' - params: { - _artifactsLocation: _artifactsLocation - _artifactsLocationSasToken: _artifactsLocationSasToken - _globalResourceNameSuffix: const_globalResourceNameSuffix - _pidEnd: pids.outputs.wlsAKSEnd == '' ? name_defaultPidDeployment : pids.outputs.wlsAKSEnd - _pidSSLEnd: pids.outputs.sslEnd == '' ? name_defaultPidDeployment : pids.outputs.sslEnd - _pidSSLStart: pids.outputs.sslStart == '' ? name_defaultPidDeployment : pids.outputs.sslStart - _pidStart: pids.outputs.wlsAKSStart == '' ? name_defaultPidDeployment : pids.outputs.wlsAKSStart - aciResourcePermissions: aciResourcePermissions - aciRetentionInDays: aciRetentionInDays - aciWorkspaceSku: aciWorkspaceSku - acrName: preAzureResourceDeployment.outputs.acrName - acrResourceGroupName: preAzureResourceDeployment.outputs.acrResourceGroupName - aksAgentPoolName: aksAgentPoolName - aksAgentPoolNodeCount: aksAgentPoolNodeCount - aksAgentPoolNodeMaxCount: aksAgentPoolNodeMaxCount - vmSize: vmSize - aksClusterRGName: aksClusterRGName - aksClusterName: const_aksName - aksVersion: validateInputs.outputs.aksVersion - appPackageUrls: appPackageUrls - appReplicas: appReplicas - azCliVersion: const_azcliVersion - cpuPlatform: const_cpuPlatform - createAKSCluster: createAKSCluster - databaseType: databaseType - dbDriverLibrariesUrls: dbDriverLibrariesUrls - enableAzureMonitoring: enableAzureMonitoring - enableCustomSSL: enableCustomSSL - enableAdminT3Tunneling: enableAdminT3Tunneling - enableClusterT3Tunneling: enableClusterT3Tunneling - enablePswlessConnection: enablePswlessConnection - enablePV: const_enablePV - fileShareName: const_fileShareName - identity: obj_uamiForDeploymentScript - isSSOSupportEntitled: isSSOSupportEntitled - location: location - managedServerPrefix: managedServerPrefix - ocrSSOPSW: ocrSSOPSW - ocrSSOUser: ocrSSOUser - storageAccountName: name_storageAccountName - t3ChannelAdminPort: t3ChannelAdminPort - t3ChannelClusterPort: t3ChannelClusterPort - tagsByResource: _objTagsByResource - wdtRuntimePassword: wdtRuntimePassword - userProvidedAcr: userProvidedAcr - userProvidedAcrRgName: userProvidedAcrRgName - userProvidedImagePath: userProvidedImagePath - useOracleImage: useOracleImage - wlsClusterSize: wlsClusterSize - wlsCPU: wlsCPU - wlsDomainName: wlsDomainName - wlsDomainUID: wlsDomainUID - wlsIdentityKeyStoreData: sslUploadedCustomIdentityKeyStoreData - wlsIdentityKeyStorePassphrase: sslUploadedCustomIdentityKeyStorePassphrase - wlsIdentityKeyStoreType: const_defaultKeystoreType - wlsImageTag: wlsImageTag - wlsJavaOption: const_wlsJavaOptions - wlsMemory: wlsMemory - wlsPassword: wlsPassword - wlsPrivateKeyAlias: sslUploadedPrivateKeyAlias - wlsPrivateKeyPassPhrase: sslUploadedPrivateKeyPassPhrase - wlsTrustKeyStoreData: sslUploadedCustomTrustKeyStoreData - wlsTrustKeyStorePassPhrase: sslUploadedCustomTrustKeyStorePassPhrase - wlsTrustKeyStoreType: const_defaultKeystoreType - wlsUserName: wlsUserName - } - dependsOn: [ - validateInputs - ] -} - -module wlsDomainWithCustomSSLDeployment 'modules/setupWebLogicCluster.bicep' = if (enableCustomSSL) { - name: 'setup-wls-cluster-with-custom-ssl-enabled' - params: { - _artifactsLocation: _artifactsLocation - _artifactsLocationSasToken: _artifactsLocationSasToken - _globalResourceNameSuffix: const_globalResourceNameSuffix - _pidEnd: pids.outputs.wlsAKSEnd == '' ? name_defaultPidDeployment : pids.outputs.wlsAKSEnd - _pidStart: pids.outputs.wlsAKSStart == '' ? name_defaultPidDeployment : pids.outputs.wlsAKSStart - aciResourcePermissions: aciResourcePermissions - aciRetentionInDays: aciRetentionInDays - aciWorkspaceSku: aciWorkspaceSku - acrName: preAzureResourceDeployment.outputs.acrName - acrResourceGroupName: preAzureResourceDeployment.outputs.acrResourceGroupName - aksAgentPoolName: aksAgentPoolName - aksAgentPoolNodeCount: aksAgentPoolNodeCount - aksAgentPoolNodeMaxCount: aksAgentPoolNodeMaxCount - vmSize: vmSize - aksClusterRGName: aksClusterRGName - aksClusterName: const_aksName - aksVersion: validateInputs.outputs.aksVersion - appPackageUrls: appPackageUrls - appReplicas: appReplicas - azCliVersion: const_azcliVersion - cpuPlatform: const_cpuPlatform - createAKSCluster: createAKSCluster - databaseType: databaseType - dbDriverLibrariesUrls: dbDriverLibrariesUrls - enableAzureMonitoring: enableAzureMonitoring - enableCustomSSL: enableCustomSSL - enableAdminT3Tunneling: enableAdminT3Tunneling - enableClusterT3Tunneling: enableClusterT3Tunneling - enablePswlessConnection: enablePswlessConnection - enablePV: const_enablePV - fileShareName: const_fileShareName - identity: obj_uamiForDeploymentScript - isSSOSupportEntitled: isSSOSupportEntitled - location: location - managedServerPrefix: managedServerPrefix - ocrSSOPSW: ocrSSOPSW - ocrSSOUser: ocrSSOUser - storageAccountName: name_storageAccountName - t3ChannelAdminPort: t3ChannelAdminPort - t3ChannelClusterPort: t3ChannelClusterPort - userProvidedAcr: userProvidedAcr - userProvidedAcrRgName: userProvidedAcrRgName - userProvidedImagePath: userProvidedImagePath - useOracleImage: useOracleImage - tagsByResource: _objTagsByResource - wdtRuntimePassword: wdtRuntimePassword - wlsClusterSize: wlsClusterSize - wlsCPU: wlsCPU - wlsDomainName: wlsDomainName - wlsDomainUID: wlsDomainUID - wlsIdentityKeyStoreData: sslUploadedCustomIdentityKeyStoreData - wlsIdentityKeyStorePassphrase: sslUploadedCustomIdentityKeyStorePassphrase - wlsIdentityKeyStoreType: sslUploadedCustomIdentityKeyStoreType - wlsImageTag: wlsImageTag - wlsJavaOption: const_wlsJavaOptions - wlsMemory: wlsMemory - wlsPassword: wlsPassword - wlsPrivateKeyAlias: sslUploadedPrivateKeyAlias - wlsPrivateKeyPassPhrase: sslUploadedPrivateKeyPassPhrase - wlsTrustKeyStoreData: sslUploadedCustomTrustKeyStoreData - wlsTrustKeyStorePassPhrase: sslUploadedCustomTrustKeyStorePassPhrase - wlsTrustKeyStoreType: sslUploadedCustomTrustKeyStoreType - wlsUserName: wlsUserName - } - dependsOn: [ - validateInputs - ] -} - -module networkingDeployment 'modules/networking.bicep' = if (const_enableNetworking) { - name: 'networking-deployment' - params: { - _artifactsLocation: _artifactsLocation - _artifactsLocationSasToken: _artifactsLocationSasToken - _globalResourceNameSuffix: const_globalResourceNameSuffix - _pidNetworkingEnd: pids.outputs.networkingEnd == '' ? name_defaultPidDeployment : pids.outputs.networkingEnd - _pidNetworkingStart: pids.outputs.networkingStart == '' ? name_defaultPidDeployment : pids.outputs.networkingStart - aksClusterRGName: ref_wlsDomainDeployment.outputs.aksClusterRGName - aksClusterName: ref_wlsDomainDeployment.outputs.aksClusterName - appGatewayName: _enableAppGWIngress ? appgatewayDeployment.outputs.appGatewayName : '' - appGatewayAlias: _enableAppGWIngress ? appgatewayDeployment.outputs.appGatewayAlias : '' - appGatewaySecuredURL: _enableAppGWIngress ? appgatewayDeployment.outputs.appGatewaySecuredURL : '' - appGatewayURL: _enableAppGWIngress ? appgatewayDeployment.outputs.appGatewayURL : '' - appGatewaySslCert: name_appgwFrontendSSLCertName - appGatewayTrustedRootCert: name_appgwBackendRootCertName - appgwUsePrivateIP: appgwUsePrivateIP - appgwForAdminServer: appgwForAdminServer - appgwForRemoteConsole: appgwForRemoteConsole - azCliVersion: const_azcliVersion - createAKSCluster: createAKSCluster - createDNSZone: createDNSZone - dnszoneAdminConsoleLabel: dnszoneAdminConsoleLabel - dnszoneAdminT3ChannelLabel: dnszoneAdminT3ChannelLabel - dnszoneClusterLabel: dnszoneClusterLabel - dnszoneClusterT3ChannelLabel: dnszoneClusterT3ChannelLabel - dnszoneName: dnszoneName - dnszoneRGName: dnszoneRGName - enableAppGWIngress: enableAppGWIngress - enableCookieBasedAffinity: enableCookieBasedAffinity - enableCustomSSL: enableCustomSSL - enableDNSConfiguration: enableDNSConfiguration - identity: obj_uamiForDeploymentScript - location: location - lbSvcValues: lbSvcValues - tagsByResource: _objTagsByResource - useInternalLB: useInternalLB - wlsDomainName: wlsDomainName - wlsDomainUID: wlsDomainUID - } - dependsOn: [ - appgatewayDeployment - wlsDomainDeployment - wlsDomainWithCustomSSLDeployment - ] -} - -module datasourceDeployment 'modules/_setupDBConnection.bicep' = if (enableDB && !enablePswlessConnection) { - name: 'datasource-deployment' - params: { - _artifactsLocation: _artifactsLocation - _artifactsLocationSasToken: _artifactsLocationSasToken - _globalResourceNameSuffix: const_globalResourceNameSuffix - _pidEnd: pids.outputs.dbEnd - _pidStart: pids.outputs.dbStart - aksClusterRGName: ref_wlsDomainDeployment.outputs.aksClusterRGName - aksClusterName: ref_wlsDomainDeployment.outputs.aksClusterName - azCliVersion: const_azcliVersion - databaseType: databaseType - dbConfigurationType: dbConfigurationType - dbDriverName: dbDriverName - dbGlobalTranPro: dbGlobalTranPro - dbPassword: dbPassword - dbTestTableName: dbTestTableName - dbUser: dbUser - dsConnectionURL: dsConnectionURL - identity: obj_uamiForDeploymentScript - jdbcDataSourceName: jdbcDataSourceName - location: location - tagsByResource: _objTagsByResource - wlsDomainUID: wlsDomainUID - wlsPassword: wlsPassword - wlsUserName: wlsUserName - } - dependsOn: [ - networkingDeployment - ] -} - -module passwordlessDatasourceDeployment 'modules/_setupPasswordlessDBConnection.bicep' = if (enableDB && enablePswlessConnection) { - name: 'passwordless-datasource-deployment' - params: { - _artifactsLocation: _artifactsLocation - _artifactsLocationSasToken: _artifactsLocationSasToken - _globalResourceNameSuffix: const_globalResourceNameSuffix - _pidEnd: pids.outputs.pswlessDbEnd - _pidStart: pids.outputs.pswlessDbStart - aksClusterRGName: ref_wlsDomainDeployment.outputs.aksClusterRGName - aksClusterName: ref_wlsDomainDeployment.outputs.aksClusterName - aksNodeRGName: ref_wlsDomainDeployment.outputs.aksNodeRgName - azCliVersion: const_azcliVersion - databaseType: databaseType - dbConfigurationType: dbConfigurationType - dbGlobalTranPro: dbGlobalTranPro - dbUser: dbUser - dbIdentity: dbIdentity - dsConnectionURL: dsConnectionURL - identity: obj_uamiForDeploymentScript - jdbcDataSourceName: jdbcDataSourceName - location: location - tagsByResource: _objTagsByResource - wlsDomainUID: wlsDomainUID - wlsPassword: wlsPassword - wlsUserName: wlsUserName - } - dependsOn: [ - networkingDeployment - ] -} - -/* -* To check if all the applciations in WLS cluster become ACTIVE state after all configurations are completed. -* This should be the last step. -*/ -module validateApplciations 'modules/_deployment-scripts/_ds-validate-applications.bicep' = if (const_bValidateApplications) { - name: 'validate-wls-application-status' - params: { - _artifactsLocation: _artifactsLocation - _artifactsLocationSasToken: _artifactsLocationSasToken - _globalResourceNameSuffix: const_globalResourceNameSuffix - aksClusterRGName: ref_wlsDomainDeployment.outputs.aksClusterRGName - aksClusterName: ref_wlsDomainDeployment.outputs.aksClusterName - azCliVersion: const_azcliVersion - identity: obj_uamiForDeploymentScript - location: location - tagsByResource: _objTagsByResource - wlsDomainUID: wlsDomainUID - wlsPassword: wlsPassword - wlsUserName: wlsUserName - } - dependsOn: [ - datasourceDeployment - passwordlessDatasourceDeployment - ] -} - -module horizontalAutoscaling 'modules/_enableAutoScaling.bicep' = if (enableAutoscaling) { - name: 'enable-horizontal-autoscaling' - params: { - _pidCPUUtilization: pids.outputs.cpuUtilization - _pidEnd: pids.outputs.autoScalingEnd - _globalResourceNameSuffix: const_globalResourceNameSuffix - _pidMemoryUtilization: pids.outputs.memoryUtilization - _pidStart: pids.outputs.autoScalingStart - _pidWme: pids.outputs.enableWlsMonitoringExporter - aksClusterName: ref_wlsDomainDeployment.outputs.aksClusterName - aksClusterRGName: ref_wlsDomainDeployment.outputs.aksClusterRGName - azCliVersion: const_azcliVersion - hpaScaleType: hpaScaleType - identity: obj_uamiForDeploymentScript - location: location - tagsByResource: _objTagsByResource - useHpa: useHpa - utilizationPercentage: hpaScaleType == 'cpu' ? averageCpuUtilization : averageMemoryUtilization - wlsClusterSize: wlsClusterSize - wlsDomainUID: wlsDomainUID - wlsPassword: wlsPassword - wlsUserName: wlsUserName - - } - dependsOn: [ - validateApplciations - ] -} - -/* -* Query and output WebLogic domain configuration, including: -* - domain deployment description -* - image model -* - image properties -*/ -module queryWLSDomainConfig 'modules/_deployment-scripts/_ds-output-domain-configurations.bicep' = { - name: 'query-wls-domain-configurations' - params: { - _globalResourceNameSuffix: const_globalResourceNameSuffix - aksClusterRGName: ref_wlsDomainDeployment.outputs.aksClusterRGName - aksClusterName: ref_wlsDomainDeployment.outputs.aksClusterName - azCliVersion: const_azcliVersion - identity: obj_uamiForDeploymentScript - location: location - tagsByResource: _objTagsByResource - wlsClusterName: const_wlsClusterName - wlsDomainUID: wlsDomainUID - } - dependsOn: [ - horizontalAutoscaling - ] -} - -output aksClusterName string = ref_wlsDomainDeployment.outputs.aksClusterName -output adminConsoleInternalUrl string = ref_wlsDomainDeployment.outputs.adminServerEndpoint -output adminConsoleExternalUrl string = const_showAdminConsoleExUrl ? networkingDeployment.outputs.adminConsoleExternalEndpoint : '' -output adminConsoleExternalSecuredUrl string = const_showAdminConsoleExUrl ? networkingDeployment.outputs.adminConsoleExternalSecuredEndpoint : '' -// If TLS/SSL enabled, only secured url is working, will not output HTTP url. -output adminRemoteConsoleUrl string = const_showRemoteAdminConsoleExUrl ? networkingDeployment.outputs.adminRemoteConsoleEndpoint : '' -output adminRemoteConsoleSecuredUrl string = const_showRemoteAdminConsoleSecuredExUrl ? networkingDeployment.outputs.adminRemoteConsoleSecuredEndpoint : '' -output adminServerT3InternalUrl string = ref_wlsDomainDeployment.outputs.adminServerT3InternalEndpoint -output adminServerT3ExternalUrl string = enableAdminT3Tunneling && const_enableNetworking ? networkingDeployment.outputs.adminServerT3ChannelEndpoint : '' -output clusterInternalUrl string = ref_wlsDomainDeployment.outputs.clusterEndpoint -output clusterExternalUrl string = const_enableNetworking ? networkingDeployment.outputs.clusterExternalEndpoint : '' -output clusterExternalSecuredUrl string = const_enableNetworking ? networkingDeployment.outputs.clusterExternalSecuredEndpoint : '' -output clusterT3InternalUrl string = ref_wlsDomainDeployment.outputs.clusterT3InternalEndpoint -output clusterT3ExternalEndpoint string = enableClusterT3Tunneling && const_enableNetworking ? networkingDeployment.outputs.clusterT3ChannelEndpoint : '' -output kedaScalerServerAddress string = enableAutoscaling ? horizontalAutoscaling.outputs.kedaScalerServerAddress : '' -output shellCmdtoConnectAks string = format('az account set --subscription {0}; az aks get-credentials --resource-group {1} --name {2}', split(subscription().id, '/')[2], ref_wlsDomainDeployment.outputs.aksClusterRGName, ref_wlsDomainDeployment.outputs.aksClusterName) -output shellCmdtoOutputKedaScalerSample string = enableAutoscaling ? horizontalAutoscaling.outputs.base64ofKedaScalerSample : '' -output shellCmdtoOutputWlsDomainYaml string = queryWLSDomainConfig.outputs.shellCmdtoOutputWlsDomainYaml -output shellCmdtoOutputWlsImageModelYaml string = queryWLSDomainConfig.outputs.shellCmdtoOutputWlsImageModelYaml -output shellCmdtoOutputWlsImageProperties string = queryWLSDomainConfig.outputs.shellCmdtoOutputWlsImageProperties -output shellCmdtoOutputWlsVersionsandPatches string = queryWLSDomainConfig.outputs.shellCmdtoOutputWlsVersions diff --git a/weblogic-azure-aks/src/main/bicep/modules/_appGateway.bicep b/weblogic-azure-aks/src/main/bicep/modules/_appGateway.bicep deleted file mode 100644 index 3c35a64ce..000000000 --- a/weblogic-azure-aks/src/main/bicep/modules/_appGateway.bicep +++ /dev/null @@ -1,209 +0,0 @@ -// Copyright (c) 2021, Oracle Corporation and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -param _pidAppgwEnd string = 'pid-networking-appgateway-end' -param _pidAppgwStart string = 'pid-networking-appgateway-start' -param _pidAppgwWithCustomCert string = 'pid-networking-appgateway-with-custom-certificate' -@allowed([ - 'haveCert' - 'generateCert' -]) -param appgwCertificateOption string -param appgwName string -param appgwPublicIPAddressName string -@secure() -param appgwSSLBackendRootCertData string -param appgwUsePrivateIP bool -param azCliVersion string = '' -param autoGeneratedSSLCertKeyVaultName string -param autoGeneratedSSLCertSecretName string -param dnsNameforApplicationGateway string = 'wlsgw' -param enableCustomSSL bool -param identity object = {} -param nsgName string -param location string -param newOrExistingVnetForApplicationGateway string -@secure() -param sslCertData string -param sslCertificateDeploymentName string -@secure() -param sslCertPswData string -param trustedRootCertificateDeploymentName string -@secure() -param vnetForApplicationGateway object -param vnetRGNameForApplicationGateway string -@description('${label.tagsLabel}') -param tagsByResource object - -// To mitigate arm-ttk error: Type Mismatch: Parameter in nested template is defined as string, but the parent template defines it as bool. -var _appgwUsePrivateIP = appgwUsePrivateIP -var _selfSignedFrontendCertAndNoBackendCert = appgwCertificateOption == 'generateCert' && !enableCustomSSL -var _selfSignedFrontendCertAndBackendCert = appgwCertificateOption == 'generateCert' && enableCustomSSL -var _signedFrontendCertAndNoBackendCert = appgwCertificateOption == 'haveCert' && !enableCustomSSL -var _signedFrontendCertAndBackendCert = appgwCertificateOption == 'haveCert' && enableCustomSSL -var const_null = 'null' // To mitigate arm-ttk error: Parameter-Types-Should-Be-Consistent -var name_gatewayDeploymentPrefix = 'app-gateway-deployment-' -var ref_gatewayDeployment = _selfSignedFrontendCertAndNoBackendCert ? appgwDeployment1 : (_selfSignedFrontendCertAndBackendCert ? appgwDeployment2 : _signedFrontendCertAndNoBackendCert ? appgwDeployment3 : appgwDeployment4) - -module pidAppgwStart './_pids/_pid.bicep' = { - name: 'pid-app-gateway-start-deployment' - params: { - name: _pidAppgwStart - } -} -module pidAppgwWithCustomCertificate './_pids/_pid.bicep' = if (_signedFrontendCertAndNoBackendCert || _signedFrontendCertAndBackendCert) { - name: 'pid-app-gateway-with-custom-certificate' - params: { - name: _pidAppgwWithCustomCert - } -} - -// get key vault object from a resource group -resource existingKeyvault 'Microsoft.KeyVault/vaults@${azure.apiVersionForKeyVault}' existing = { - name: autoGeneratedSSLCertKeyVaultName -} - -module networkDeployment '_azure-resoruces/_vnetAppGateway.bicep' = { - name: 'vnet-application-gateway' - params: { - location: location - nsgName: nsgName - vnetForApplicationGateway: vnetForApplicationGateway - tagsByResource: tagsByResource - } - dependsOn: [ - pidAppgwStart - ] -} - -module queryPrivateIPFromSubnet '_deployment-scripts/_ds_query_available_private_ip_from_subnet.bicep' = if (appgwUsePrivateIP) { - name: 'query-available-private-ip-for-app-gateway' - params: { - azCliVersion: azCliVersion - identity: identity - location: location - subnetId: networkDeployment.outputs.subIdForApplicationGateway - knownIP: networkDeployment.outputs.knownIPAddress - tagsByResource: tagsByResource - } - dependsOn: [ - networkDeployment - ] -} - -module appgwDeployment1 '_azure-resoruces/_appgateway.bicep' = if (_selfSignedFrontendCertAndNoBackendCert) { - name: '${name_gatewayDeploymentPrefix}1' - params: { - dnsNameforApplicationGateway: dnsNameforApplicationGateway - enableCustomSSL: enableCustomSSL - gatewayName: appgwName - gatewayPublicIPAddressName: appgwPublicIPAddressName - gatewaySubnetId: networkDeployment.outputs.subIdForApplicationGateway - gatewaySslCertName: sslCertificateDeploymentName - gatewayTrustedRootCertName: trustedRootCertificateDeploymentName - location: location - noSslCertPsw: true - sslCertData: existingKeyvault.getSecret(autoGeneratedSSLCertSecretName) - sslCertPswData: const_null - staticPrivateFrontentIP: _appgwUsePrivateIP ? queryPrivateIPFromSubnet.outputs.privateIP : '' - trustedRootCertData: const_null - usePrivateIP: appgwUsePrivateIP - tagsByResource: tagsByResource - } - dependsOn: [ - queryPrivateIPFromSubnet - ] -} - -module appgwDeployment2 '_azure-resoruces/_appgateway.bicep' = if (_selfSignedFrontendCertAndBackendCert) { - name: '${name_gatewayDeploymentPrefix}2' - params: { - dnsNameforApplicationGateway: dnsNameforApplicationGateway - enableCustomSSL: enableCustomSSL - gatewayName: appgwName - gatewayPublicIPAddressName: appgwPublicIPAddressName - gatewaySubnetId: networkDeployment.outputs.subIdForApplicationGateway - gatewaySslCertName: sslCertificateDeploymentName - gatewayTrustedRootCertName: trustedRootCertificateDeploymentName - location: location - noSslCertPsw: true - sslCertData: existingKeyvault.getSecret(autoGeneratedSSLCertSecretName) - sslCertPswData: const_null - staticPrivateFrontentIP: _appgwUsePrivateIP ? queryPrivateIPFromSubnet.outputs.privateIP : '' - trustedRootCertData: appgwSSLBackendRootCertData - usePrivateIP: appgwUsePrivateIP - tagsByResource: tagsByResource - } - dependsOn: [ - queryPrivateIPFromSubnet - ] -} - -module appgwDeployment3 '_azure-resoruces/_appgateway.bicep' = if (_signedFrontendCertAndNoBackendCert) { - name: '${name_gatewayDeploymentPrefix}3' - params: { - dnsNameforApplicationGateway: dnsNameforApplicationGateway - enableCustomSSL: enableCustomSSL - gatewayName: appgwName - gatewayPublicIPAddressName: appgwPublicIPAddressName - gatewaySubnetId: networkDeployment.outputs.subIdForApplicationGateway - gatewaySslCertName: sslCertificateDeploymentName - gatewayTrustedRootCertName: trustedRootCertificateDeploymentName - location: location - sslCertData: sslCertData - sslCertPswData: sslCertPswData - staticPrivateFrontentIP: _appgwUsePrivateIP ? queryPrivateIPFromSubnet.outputs.privateIP : '' - trustedRootCertData: const_null - usePrivateIP: appgwUsePrivateIP - tagsByResource: tagsByResource - } - dependsOn: [ - queryPrivateIPFromSubnet - ] -} - -module appgwDeployment4 '_azure-resoruces/_appgateway.bicep' = if (_signedFrontendCertAndBackendCert) { - name: '${name_gatewayDeploymentPrefix}4' - params: { - dnsNameforApplicationGateway: dnsNameforApplicationGateway - enableCustomSSL: enableCustomSSL - gatewayName: appgwName - gatewayPublicIPAddressName: appgwPublicIPAddressName - gatewaySubnetId: networkDeployment.outputs.subIdForApplicationGateway - gatewaySslCertName: sslCertificateDeploymentName - gatewayTrustedRootCertName: trustedRootCertificateDeploymentName - location: location - sslCertData: sslCertData - sslCertPswData: sslCertPswData - staticPrivateFrontentIP: _appgwUsePrivateIP ? queryPrivateIPFromSubnet.outputs.privateIP : '' - trustedRootCertData: appgwSSLBackendRootCertData - usePrivateIP: appgwUsePrivateIP - tagsByResource: tagsByResource - } - dependsOn: [ - queryPrivateIPFromSubnet - ] -} - -module pidAppgwEnd './_pids/_pid.bicep' = { - name: 'pid-app-gateway-end-deployment' - params: { - name: _pidAppgwEnd - } - dependsOn: [ - appgwDeployment1 - appgwDeployment2 - appgwDeployment3 - appgwDeployment4 - ] -} - -output appGatewayAlias string = ref_gatewayDeployment.outputs.appGatewayAlias -output appGatewayId string = ref_gatewayDeployment.outputs.appGatewayId -output appGatewayName string = ref_gatewayDeployment.outputs.appGatewayName -output appGatewayURL string = uri(ref_gatewayDeployment.outputs.appGatewayURL, '') -output appGatewaySecuredURL string = uri(ref_gatewayDeployment.outputs.appGatewaySecuredURL, '') -// To mitigate ARM-TTK error: Control Named vnetForApplicationGateway must output the resourceGroup property when hideExisting is false -output vnetResourceGroupName string = vnetRGNameForApplicationGateway -// To mitigate ARM-TTK error: Control Named vnetForApplicationGateway must output the newOrExisting property when hideExisting is false -output newOrExisting string = newOrExistingVnetForApplicationGateway diff --git a/weblogic-azure-aks/src/main/bicep/modules/_azure-resoruces/_acr.bicep b/weblogic-azure-aks/src/main/bicep/modules/_azure-resoruces/_acr.bicep deleted file mode 100644 index 297f81567..000000000 --- a/weblogic-azure-aks/src/main/bicep/modules/_azure-resoruces/_acr.bicep +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) 2021, Oracle Corporation and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -param acrName string -param location string -@description('${label.tagsLabel}') -param tagsByResource object - -resource registries 'Microsoft.ContainerRegistry/registries@${azure.apiVersionForContainerRegistries}' = { - name: acrName - location: location - sku: { - name: 'Standard' - tier: 'Standard' - } - properties: { - adminUserEnabled: true - policies: { - quarantinePolicy: { - status: 'disabled' - } - trustPolicy: { - type: 'Notary' - status: 'disabled' - } - retentionPolicy: { - days: 7 - status: 'disabled' - } - } - encryption: { - status: 'disabled' - } - dataEndpointEnabled: false - publicNetworkAccess: 'Enabled' - networkRuleBypassOptions: 'AzureServices' - zoneRedundancy: 'Disabled' - anonymousPullEnabled: false - } - tags: tagsByResource['${identifier.registries}'] -} - -output acrName string = acrName diff --git a/weblogic-azure-aks/src/main/bicep/modules/_azure-resoruces/_aks.bicep b/weblogic-azure-aks/src/main/bicep/modules/_azure-resoruces/_aks.bicep deleted file mode 100644 index a1e52608e..000000000 --- a/weblogic-azure-aks/src/main/bicep/modules/_azure-resoruces/_aks.bicep +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) 2021, 2024, Oracle Corporation and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -@description('true to use resource or workspace permissions. false to require workspace permissions.') -param aciResourcePermissions bool = true -@description('Number of days to retain data in Azure Monitor workspace.') -param aciRetentionInDays int = 120 -@description('Pricing tier: PerGB2018 or legacy tiers (Free, Standalone, PerNode, Standard or Premium) which are not available to all customers.') -param aciWorkspaceSku string = 'pergb2018' -param agentAvailabilityZones array = [] -@maxLength(12) -@minLength(1) -@description('The name for this node pool. Node pool must contain only lowercase letters and numbers. For Linux node pools the name cannot be longer than 12 characters.') -param aksAgentPoolName string = 'agentpool' -@maxValue(10000) -@minValue(1) -@description('The number of nodes that should be created along with the cluster. You will be able to resize the cluster later.') -param aksAgentPoolNodeCount int = 3 -param aksAgentPoolNodeMaxCount int = 5 -@description('The size of the virtual machines that will form the nodes in the cluster. This cannot be changed after creating the cluster') -param aksAgentPoolVMSize string = 'Standard_DS2_v2' -@description('Prefix for cluster name. Only The name can contain only letters, numbers, underscores and hyphens. The name must start with letter or number.') -param aksClusterName string -param aksVersion string = 'default' -@description('In addition to the CPU and memory metrics included in AKS by default, you can enable Container Insights for more comprehensive data on the overall performance and health of your cluster. Billing is based on data ingestion and retention settings.') -param enableAzureMonitoring bool = false -param location string -@description('${label.tagsLabel}') -param tagsByResource object -param utcValue string = utcNow() - -var const_aksAgentPoolOSDiskSizeGB = 128 -var name_aciWorkspace = 'Workspace-${guid(utcValue)}-${location}' -// Generate a unique AKS name scoped to subscription. -var obj_aciDisableOmsAgent = { - enabled: false -} -var obj_aciEnableOmsAgent = { - enabled: true - config: { - logAnalyticsWorkspaceResourceID: azureMonitoringWorkspace.id - } -} - -resource azureMonitoringWorkspace 'Microsoft.OperationalInsights/workspaces@${azure.apiVersionForInsightsWorkspaces}' = if (enableAzureMonitoring) { - name: name_aciWorkspace - location: location - tags: tagsByResource['${identifier.workspaces}'] - properties: { - sku: { - name: aciWorkspaceSku - } - retentionInDays: aciRetentionInDays - features: { - searchVersion: 1 - legacy: 0 - enableLogAccessUsingOnlyResourcePermissions: aciResourcePermissions - } - } -} - -resource aksCluster 'Microsoft.ContainerService/managedClusters@${azure.apiVersionForManagedClusters}' = { - name: aksClusterName - location: location - tags: tagsByResource['${identifier.managedClusters}'] - properties: { - kubernetesVersion: aksVersion - dnsPrefix: '${aksClusterName}-dns' - agentPoolProfiles: [ - { - name: aksAgentPoolName - enableAutoScaling: true - minCount: aksAgentPoolNodeCount - maxCount: aksAgentPoolNodeMaxCount - count: aksAgentPoolNodeCount - vmSize: aksAgentPoolVMSize - osDiskSizeGB: const_aksAgentPoolOSDiskSizeGB - osDiskType: 'Managed' - kubeletDiskType: 'OS' - type: 'VirtualMachineScaleSets' - availabilityZones: agentAvailabilityZones - mode: 'System' - osType: 'Linux' - tags: tagsByResource['${identifier.managedClusters}'] - } - ] - addonProfiles: { - KubeDashboard: { - enabled: false - } - azurepolicy: { - enabled: false - } - httpApplicationRouting: { - enabled: false - } - omsAgent: enableAzureMonitoring ? obj_aciEnableOmsAgent : obj_aciDisableOmsAgent - } - enableRBAC: true - networkProfile: { - networkPlugin: 'azure' - loadBalancerSku: 'standard' - } - } - identity: { - // enable system identity. - type: 'SystemAssigned' - } -} - -output aksNodeRgName string = aksCluster.properties.nodeResourceGroup diff --git a/weblogic-azure-aks/src/main/bicep/modules/_azure-resoruces/_aksPodIdentity.bicep b/weblogic-azure-aks/src/main/bicep/modules/_azure-resoruces/_aksPodIdentity.bicep deleted file mode 100644 index 9b440d89f..000000000 --- a/weblogic-azure-aks/src/main/bicep/modules/_azure-resoruces/_aksPodIdentity.bicep +++ /dev/null @@ -1,36 +0,0 @@ -/* - Copyright (c) 2021, Oracle and/or its affiliates. -Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -*/ - -param aksClusterName string = '' -param dbIdentity object = {} -param namespace string = 'sample-domain1-ns' -param podIdentityName string ='' -param podIdentitySelector string = '' -param location string - -var const_APIVersion = '2022-01-31-PREVIEW' - -resource configAKSPodIdentity 'Microsoft.ContainerService/managedClusters@${azure.apiVersionForManagedClusters}' = { - name: aksClusterName - location: location - properties: { - podIdentityProfile:{ - allowNetworkPluginKubenet: false - enabled: true - userAssignedIdentities: [ - { - bindingSelector: podIdentitySelector - identity: { - clientId: reference(items(dbIdentity.userAssignedIdentities)[0].key, const_APIVersion, 'full').properties.clientId - objectId: reference(items(dbIdentity.userAssignedIdentities)[0].key, const_APIVersion, 'full').properties.principalId - resourceId: items(dbIdentity.userAssignedIdentities)[0].key - } - name: podIdentityName - namespace: namespace - } - ] - } - } -} diff --git a/weblogic-azure-aks/src/main/bicep/modules/_azure-resoruces/_appgateway.bicep b/weblogic-azure-aks/src/main/bicep/modules/_azure-resoruces/_appgateway.bicep deleted file mode 100644 index beaa9cad8..000000000 --- a/weblogic-azure-aks/src/main/bicep/modules/_azure-resoruces/_appgateway.bicep +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright (c) 2021, Oracle Corporation and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -@description('DNS for ApplicationGateway') -param dnsNameforApplicationGateway string = take('wlsgw${uniqueString(utcValue)}', 63) -param enableCustomSSL bool = false -param gatewayName string -@description('Public IP Name for the Application Gateway') -param gatewayPublicIPAddressName string -param gatewaySubnetId string = '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/subnetname' -param gatewaySslCertName string = 'appGatewaySslCert' -param gatewayTrustedRootCertName string = 'appGatewayTrustedRootCert' -param location string -param noSslCertPsw bool = false -@secure() -param sslCertData string = newGuid() -@secure() -param sslCertPswData string = newGuid() -param staticPrivateFrontentIP string = '10.0.0.1' -@secure() -param trustedRootCertData string = newGuid() -param usePrivateIP bool = false -@description('${label.tagsLabel}') -param tagsByResource object -param utcValue string = utcNow() - -var const_sslCertPsw = (noSslCertPsw) ? '' : sslCertPswData -var name_backendAddressPool = 'myGatewayBackendPool' -var name_frontEndIPConfig = 'appGwPublicFrontendIp' -var name_frontEndPrivateIPConfig = 'appGwPrivateFrontendIp' -var name_httpListener = 'HTTPListener' -var name_httpPort = 'httpport' -var name_httpSetting = 'myHTTPSetting' -var ref_backendAddressPool = resourceId('Microsoft.Network/applicationGateways/backendAddressPools', gatewayName, name_backendAddressPool) -var ref_backendHttpSettings = resourceId('Microsoft.Network/applicationGateways/backendHttpSettingsCollection', gatewayName, name_httpSetting) -var ref_frontendHTTPPort = resourceId('Microsoft.Network/applicationGateways/frontendPorts', gatewayName, name_httpPort) -var ref_frontendIPConfiguration = resourceId('Microsoft.Network/applicationGateways/frontendIPConfigurations', gatewayName, name_frontEndIPConfig) -var ref_httpListener = resourceId('Microsoft.Network/applicationGateways/httpListeners', gatewayName, name_httpListener) -var ref_publicIPAddress = resourceId('Microsoft.Network/publicIPAddresses', gatewayPublicIPAddressName) -var obj_backendTrustedRootCerts = [ - { - name: gatewayTrustedRootCertName - properties: { - data: trustedRootCertData - } - } -] -var obj_frontendIPConfigurations1 = [ - { - name: name_frontEndIPConfig - properties: { - publicIPAddress: { - id: ref_publicIPAddress - } - } - } -] -var obj_frontendIPConfigurations2 = [ - { - name: name_frontEndIPConfig - properties: { - publicIPAddress: { - id: ref_publicIPAddress - } - } - } - { - name: name_frontEndPrivateIPConfig - properties: { - privateIPAllocationMethod: 'Static' - privateIPAddress: staticPrivateFrontentIP - subnet: { - id: gatewaySubnetId - } - } - } -] - -var obj_tagIngress = { - 'managed-by-k8s-ingress': 'true' -} - -resource gatewayPublicIP 'Microsoft.Network/publicIPAddresses@${azure.apiVersionForPublicIPAddresses}' = { - name: gatewayPublicIPAddressName - sku: { - name: 'Standard' - } - location: location - tags: tagsByResource['${identifier.publicIPAddresses}'] - properties: { - publicIPAllocationMethod: 'Static' - dnsSettings: { - domainNameLabel: dnsNameforApplicationGateway - } - } -} - -resource wafv2AppGateway 'Microsoft.Network/applicationGateways@${azure.apiVersionForApplicationGateways}' = { - name: gatewayName - location: location - tags: union(tagsByResource['${identifier.applicationGateways}'], obj_tagIngress) - properties: { - sku: { - name: 'WAF_v2' - tier: 'WAF_v2' - } - sslCertificates: [ - { - name: gatewaySslCertName - properties: { - data: sslCertData - password: const_sslCertPsw - } - } - ] - trustedRootCertificates: enableCustomSSL ? obj_backendTrustedRootCerts : [] - gatewayIPConfigurations: [ - { - name: 'appGatewayIpConfig' - properties: { - subnet: { - id: gatewaySubnetId - } - } - } - ] - frontendIPConfigurations: usePrivateIP ? obj_frontendIPConfigurations2 : obj_frontendIPConfigurations1 - frontendPorts: [ - { - name: name_httpPort - properties: { - port: 80 - } - } - ] - backendAddressPools: [ - { - name: 'myGatewayBackendPool' - } - ] - httpListeners: [ - { - name: name_httpListener - properties: { - protocol: 'Http' - frontendIPConfiguration: { - id: ref_frontendIPConfiguration - } - frontendPort: { - id: ref_frontendHTTPPort - } - } - } - ] - backendHttpSettingsCollection: [ - { - name: name_httpSetting - properties: { - port: 80 - protocol: 'Http' - } - } - ] - requestRoutingRules: [ - { - name: 'HTTPRoutingRule' - properties: { - priority: 3 - httpListener: { - id: ref_httpListener - } - backendAddressPool: { - id: ref_backendAddressPool - } - backendHttpSettings: { - id: ref_backendHttpSettings - } - } - } - ] - webApplicationFirewallConfiguration: { - enabled: true - firewallMode: 'Prevention' - ruleSetType: 'OWASP' - ruleSetVersion: '3.0' - } - enableHttp2: false - autoscaleConfiguration: { - minCapacity: 2 - maxCapacity: 3 - } - } - dependsOn: [ - gatewayPublicIP - ] -} - -output appGatewayAlias string = usePrivateIP ? staticPrivateFrontentIP : reference(gatewayPublicIP.id).dnsSettings.fqdn -output appGatewayId string = wafv2AppGateway.id -output appGatewayName string = gatewayName -output appGatewayURL string = uri(format('http://{0}/', usePrivateIP ? staticPrivateFrontentIP : reference(gatewayPublicIP.id).dnsSettings.fqdn), '') -output appGatewaySecuredURL string = uri(format('https://{0}/', usePrivateIP ? staticPrivateFrontentIP : reference(gatewayPublicIP.id).dnsSettings.fqdn), '') diff --git a/weblogic-azure-aks/src/main/bicep/modules/_azure-resoruces/_autoGeneratedPfxCertInKeyVault.bicep b/weblogic-azure-aks/src/main/bicep/modules/_azure-resoruces/_autoGeneratedPfxCertInKeyVault.bicep deleted file mode 100644 index c7f4022f2..000000000 --- a/weblogic-azure-aks/src/main/bicep/modules/_azure-resoruces/_autoGeneratedPfxCertInKeyVault.bicep +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) 2021, Oracle Corporation and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -param _globalResourceNameSuffix string -@description('Managed identity to be used for the deployment script. Currently, only user-assigned MSI is supported.') -param identity object = {} - -@description('Used to name the new Azure Key Vault resoure.') -param keyVaultName string = 'wlskv${uniqueString(utcValue)}' - -param location string - -@description('Access permission of the key vault, will applied to all access policies.') -param permission object = { - certificates: [ - 'get' - 'list' - 'update' - 'create' - ] -} - -@description('Used to name the new certificate resource.') -param secretName string = 'mySelfSignedCertificate' - -@description('Price tier for Key Vault.') -param sku string = 'Standard' - -@description('Subject name to create a new certificate, example: \'CN=contoso.com\'.') -param subjectName string = 'contoso.xyz' -@description('${label.tagsLabel}') -param tagsByResource object -param utcValue string = utcNow() - -var obj_extraTag= { - 'created-by-azure-weblogic': utcValue -} -var const_identityId = '${substring(string(identity.userAssignedIdentities), indexOf(string(identity.userAssignedIdentities), '"') + 1, lastIndexOf(string(identity.userAssignedIdentities), '"') - (indexOf(string(identity.userAssignedIdentities), '"') + 1))}' - -resource keyvault 'Microsoft.KeyVault/vaults@${azure.apiVersionForKeyVault}' = { - name: keyVaultName - location: location - tags: union(tagsByResource['${identifier.vaults}'], obj_extraTag) - properties: { - sku: { - family: 'A' - name: sku - } - tenantId: subscription().tenantId - accessPolicies: [ - { - // Must specify API version of identity. - objectId: reference(const_identityId, '2018-11-30').principalId - tenantId: subscription().tenantId - permissions: permission - } - ] - enabledForDeployment: false - enabledForDiskEncryption: false - enabledForTemplateDeployment: true - enableSoftDelete: true - enableRbacAuthorization: false - } -} - -resource createAddCertificate 'Microsoft.Resources/deploymentScripts@${azure.apiVersionForDeploymentScript}' = { - name: 'ds-create-add-appgw-certificate-${_globalResourceNameSuffix}' - location: location - identity: identity - kind: 'AzurePowerShell' - tags: tagsByResource['${identifier.deploymentScripts}'] - properties: { - forceUpdateTag: utcValue - azPowerShellVersion: '${azure.powershell.version}' - timeout: 'PT30M' - arguments: ' -vaultName ${keyVaultName} -certificateName ${secretName} -subjectName ${subjectName}' - scriptContent: '\n param(\n [string] [Parameter(Mandatory=$true)] $vaultName,\n [string] [Parameter(Mandatory=$true)] $certificateName,\n [string] [Parameter(Mandatory=$true)] $subjectName\n )\n\n $ErrorActionPreference = \'Stop\'\n $DeploymentScriptOutputs = @{}\n\n $existingCert = Get-AzKeyVaultCertificate -VaultName $vaultName -Name $certificateName\n\n if ($existingCert -and $existingCert.Certificate.Subject -eq $subjectName) {\n\n Write-Host \'Certificate $certificateName in vault $vaultName is already present.\'\n\n $DeploymentScriptOutputs[\'certThumbprint\'] = $existingCert.Thumbprint\n $existingCert | Out-String\n }\n else {\n $policy = New-AzKeyVaultCertificatePolicy -SubjectName $subjectName -IssuerName Self -ValidityInMonths 12 -Verbose\n\n # private key is added as a secret that can be retrieved in the ARM template\n Add-AzKeyVaultCertificate -VaultName $vaultName -Name $certificateName -CertificatePolicy $policy -Verbose\n\n $newCert = Get-AzKeyVaultCertificate -VaultName $vaultName -Name $certificateName\n\n # it takes a few seconds for KeyVault to finish\n $tries = 0\n do {\n Write-Host \'Waiting for certificate creation completion...\'\n Start-Sleep -Seconds 10\n $operation = Get-AzKeyVaultCertificateOperation -VaultName $vaultName -Name $certificateName\n $tries++\n\n if ($operation.Status -eq \'failed\')\n {\n throw \'Creating certificate $certificateName in vault $vaultName failed with error $($operation.ErrorMessage)\'\n }\n\n if ($tries -gt 120)\n {\n throw \'Timed out waiting for creation of certificate $certificateName in vault $vaultName\'\n }\n } while ($operation.Status -ne \'completed\')\n\n $DeploymentScriptOutputs[\'certThumbprint\'] = $newCert.Thumbprint\n $newCert | Out-String\n }\n ' - cleanupPreference: 'OnSuccess' - retentionInterval: 'P1D' - } - dependsOn: [ - keyvault - ] -} - -output keyVaultName string = keyVaultName -output secretName string = secretName -output identityId string = const_identityId diff --git a/weblogic-azure-aks/src/main/bicep/modules/_azure-resoruces/_dnsZones.bicep b/weblogic-azure-aks/src/main/bicep/modules/_azure-resoruces/_dnsZones.bicep deleted file mode 100644 index 18f740809..000000000 --- a/weblogic-azure-aks/src/main/bicep/modules/_azure-resoruces/_dnsZones.bicep +++ /dev/null @@ -1,13 +0,0 @@ -@description('Azure DNS Zone name.') -param dnszoneName string -@description('${label.tagsLabel}') -param tagsByResource object - -resource dnszoneName_resource 'Microsoft.Network/dnszones@${azure.apiVersionForDNSZone}' = { - name: dnszoneName - location: 'global' - tags: tagsByResource['${identifier.dnszones}'] - properties: { - zoneType: 'Public' - } -} diff --git a/weblogic-azure-aks/src/main/bicep/modules/_azure-resoruces/_storage.bicep b/weblogic-azure-aks/src/main/bicep/modules/_azure-resoruces/_storage.bicep deleted file mode 100644 index 009b1a669..000000000 --- a/weblogic-azure-aks/src/main/bicep/modules/_azure-resoruces/_storage.bicep +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) 2021, Oracle Corporation and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -param fileShareName string -param location string -param storageAccountName string = 'stg-contoso' -@description('${label.tagsLabel}') -param tagsByResource object -param utcValue string = utcNow() - -var const_shareQuota = 5120 -var const_sku = 'Standard_LRS' -var obj_extraTag = { - 'created-by-azure-weblogic': utcValue -} - -resource storageAccount 'Microsoft.Storage/storageAccounts@${azure.apiVersionForStorage}' = { - name: storageAccountName - location: location - kind: 'StorageV2' - tags: union(tagsByResource['${identifier.storageAccounts}'], obj_extraTag) - sku: { - name: const_sku - tier: 'Standard' - } - properties: { - networkAcls: { - bypass: 'AzureServices' - defaultAction: 'Allow' - } - supportsHttpsTrafficOnly: true - encryption: { - services: { - file: { - keyType: 'Account' - enabled: true - } - } - keySource: 'Microsoft.Storage' - } - accessTier: 'Hot' - } -} - -resource fileService 'Microsoft.Storage/storageAccounts/fileServices/shares@${azure.apiVersionForStorageFileService}' = { - name: '${storageAccount.name}/default/${fileShareName}' - properties: { - accessTier: 'TransactionOptimized' - shareQuota: const_shareQuota - enabledProtocols: 'SMB' - } - dependsOn: [ - storageAccount - ] -} diff --git a/weblogic-azure-aks/src/main/bicep/modules/_azure-resoruces/_vnetAppGateway.bicep b/weblogic-azure-aks/src/main/bicep/modules/_azure-resoruces/_vnetAppGateway.bicep deleted file mode 100644 index 2a5badc4e..000000000 --- a/weblogic-azure-aks/src/main/bicep/modules/_azure-resoruces/_vnetAppGateway.bicep +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) 2021, Oracle Corporation and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -param location string -param nsgName string -param vnetForApplicationGateway object = { - name: 'wlsaks-app-gateway-vnet' - resourceGroup: resourceGroup().name - addressPrefixes: [ - '172.16.0.0/24' - ] - addressPrefix: '172.16.0.0/24' - newOrExisting: 'new' - subnets: { - gatewaySubnet: { - name: 'wlsaks-gateway-subnet' - addressPrefix: '172.16.0.0/24' - startAddress: '172.16.0.4' - } - } -} -@description('${label.tagsLabel}') -param tagsByResource object -param utcValue string = utcNow() - -var const_subnetAddressPrefixes = vnetForApplicationGateway.subnets.gatewaySubnet.addressPrefix -var const_vnetAddressPrefixes = vnetForApplicationGateway.addressPrefixes -var const_newVnet = (vnetForApplicationGateway.newOrExisting == 'new') ? true : false -var name_subnet = vnetForApplicationGateway.subnets.gatewaySubnet.name -var name_vnet = vnetForApplicationGateway.name - -// Get existing VNET. -resource existingVnet 'Microsoft.Network/virtualNetworks@${azure.apiVersionForVirtualNetworks}' existing = if (!const_newVnet) { - name: name_vnet - scope: resourceGroup(vnetForApplicationGateway.resourceGroup) -} - -// Get existing subnet. -resource existingSubnet 'Microsoft.Network/virtualNetworks/subnets@${azure.apiVersionForVirtualNetworks}' existing = if (!const_newVnet) { - name: name_subnet - parent: existingVnet -} - -// Create new network security group. -resource nsg 'Microsoft.Network/networkSecurityGroups@${azure.apiVersionForNetworkSecurityGroups}' = if (const_newVnet) { - name: nsgName - location: location - tags: tagsByResource['${identifier.networkSecurityGroups}'] - properties: { - securityRules: [ - { - properties: { - protocol: 'Tcp' - sourcePortRange: '*' - destinationPortRange: '65200-65535' - sourceAddressPrefix: 'GatewayManager' - destinationAddressPrefix: '*' - access: 'Allow' - priority: 500 - direction: 'Inbound' - } - name: 'ALLOW_APPGW' - } - { - properties: { - protocol: 'Tcp' - sourcePortRange: '*' - sourceAddressPrefix: 'Internet' - destinationAddressPrefix: '*' - access: 'Allow' - priority: 510 - direction: 'Inbound' - destinationPortRanges: [ - '80' - '443' - ] - } - name: 'ALLOW_HTTP_ACCESS' - } - ] - } -} - -// Create new VNET and subnet. -resource newVnet 'Microsoft.Network/virtualNetworks@${azure.apiVersionForVirtualNetworks}' = if (const_newVnet) { - name: name_vnet - location: location - tags: tagsByResource['${identifier.virtualNetworks}'] - properties: { - addressSpace: { - addressPrefixes: const_vnetAddressPrefixes - } - subnets: [ - { - name: name_subnet - properties: { - addressPrefix: const_subnetAddressPrefixes - networkSecurityGroup: { - id: nsg.id - } - } - } - ] - } -} - -output subIdForApplicationGateway string = const_newVnet ? resourceId('Microsoft.Network/virtualNetworks/subnets', name_vnet, name_subnet) : existingSubnet.id -output knownIPAddress string = vnetForApplicationGateway.subnets.gatewaySubnet.startAddress diff --git a/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds-create-networking.bicep b/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds-create-networking.bicep deleted file mode 100644 index 901fe4f83..000000000 --- a/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds-create-networking.bicep +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) 2021, Oracle Corporation and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -param _artifactsLocation string = deployment().properties.templateLink.uri -@secure() -param _artifactsLocationSasToken string = '' -param _globalResourceNameSuffix string - -param appgwAlias string = 'appgw-contoso-alias' -param appgwName string = 'appgw-contoso' -@description('Three scenarios we support for deploying app gateway') -param appgwForAdminServer bool = true -param appgwForRemoteConsole bool = true -param appgwSslCert string = '' -param appgwTrustedRootCert string = '' -param appgwUsePrivateIP bool = false -param aksClusterRGName string = 'aks-contoso-rg' -param aksClusterName string = 'aks-contoso' -param azCliVersion string = '' -param createAKSCluster bool -param dnszoneAdminConsoleLabel string = 'admin' -param dnszoneAdminT3ChannelLabel string = 'admin-t3' -param dnszoneClusterLabel string = 'www' -param dnszoneClusterT3ChannelLabel string = 'cluster-t3' -param dnszoneName string = 'contoso.xyz' -param dnszoneRGName string = 'dns-contoso-rg' -param enableAppGWIngress bool = false -param enableCookieBasedAffinity bool = false -param enableCustomSSL bool = false -param enableDNSConfiguration bool = false -param identity object = {} -param lbSvcValues array = [] -param location string -param useInternalLB bool = false -param utcValue string = utcNow() -param wlsDomainName string = 'domain1' -param wlsDomainUID string = 'sample-domain1' -@description('${label.tagsLabel}') -param tagsByResource object - -var const_commonScript = 'common.sh' -var const_createDnsRecordScript = 'createDnsRecord.sh' -var const_createLbSvcScript = 'createLbSvc.sh' -var const_createGatewayIngressSvcScript = 'createAppGatewayIngress.sh' -var const_scriptLocation = uri(_artifactsLocation, 'scripts/') -var const_primaryScript = 'setupNetworking.sh' -var const_utilityScript = 'utility.sh' - -resource deploymentScript 'Microsoft.Resources/deploymentScripts@${azure.apiVersionForDeploymentScript}' = { - name: 'ds-networking-deployment-${_globalResourceNameSuffix}' - location: location - kind: 'AzureCLI' - identity: identity - tags: tagsByResource['${identifier.deploymentScripts}'] - properties: { - azCliVersion: azCliVersion - environmentVariables: [ - { - name: 'AKS_CLUSTER_RG_NAME' - value: aksClusterRGName - } - { - name: 'AKS_CLUSTER_NAME' - value: aksClusterName - } - { - name: 'APPGW_SSL_CERT_NAME' - value: appgwSslCert - } - { - name: 'APPGW_TRUSTED_ROOT_CERT_NAME' - value: appgwTrustedRootCert - } - { - name: 'APPGW_NAME' - value: appgwName - } - { - name: 'APPGW_USE_PRIVATE_IP' - value: string(appgwUsePrivateIP) - } - { - name: 'APPGW_FOR_ADMIN_SERVER' - value: string(appgwForAdminServer) - } - { - name: 'APPGW_FOR_REMOTE_CONSOLE' - value: string(appgwForRemoteConsole) - } - { - name: 'APPGW_ALIAS' - value: appgwAlias - } - { - name: 'CREATE_AKS_CLUSTER' - value: string(createAKSCluster) - } - { - name: 'CURRENT_RG_NAME' - value: resourceGroup().name - } - { - name: 'DNS_ZONE_NAME' - value: dnszoneName - } - { - name: 'DNS_ZONE_RG_NAME' - value: dnszoneRGName - } - { - name: 'DNS_ADMIN_LABEL' - value: dnszoneAdminConsoleLabel - } - { - name: 'DNS_CLUSTER_LABEL' - value: dnszoneClusterLabel - } - { - name: 'DNS_ADMIN_T3_LABEL' - value: dnszoneAdminT3ChannelLabel - } - { - name: 'DNS_CLUSTER_T3_LABEL' - value: dnszoneClusterT3ChannelLabel - } - { - name: 'ENABLE_DNS_CONFIGURATION' - value: string(enableDNSConfiguration) - } - { - name: 'ENABLE_AGIC' - value: string(enableAppGWIngress) - } - { - name: 'ENABLE_CUSTOM_SSL' - value: string(enableCustomSSL) - } - { - name: 'ENABLE_COOKIE_BASED_AFFINITY' - value: string(enableCookieBasedAffinity) - } - { - name: 'LB_SVC_VALUES' - value: string(lbSvcValues) - } - { - name: 'USE_INTERNAL_LB' - value: string(useInternalLB) - } - { - name: 'WLS_DOMAIN_NAME' - value: wlsDomainName - } - { - name: 'WLS_DOMAIN_UID' - value: wlsDomainUID - } - ] - primaryScriptUri: uri(const_scriptLocation, '${const_primaryScript}${_artifactsLocationSasToken}') - supportingScriptUris: [ - uri(const_scriptLocation, '${const_commonScript}${_artifactsLocationSasToken}') - uri(const_scriptLocation, '${const_utilityScript}${_artifactsLocationSasToken}') - uri(const_scriptLocation, '${const_createDnsRecordScript}${_artifactsLocationSasToken}') - uri(const_scriptLocation, '${const_createLbSvcScript}${_artifactsLocationSasToken}') - uri(const_scriptLocation, '${const_createGatewayIngressSvcScript}${_artifactsLocationSasToken}') - ] - cleanupPreference: 'OnSuccess' - retentionInterval: 'P1D' - forceUpdateTag: utcValue - } -} - -output adminConsoleLBEndpoint string = (!enableCustomSSL) && length(lbSvcValues) > 0 && (deploymentScript.properties.outputs.adminConsoleEndpoint != 'null') ? format('http://{0}/', deploymentScript.properties.outputs.adminConsoleEndpoint) : '' -output adminConsoleLBSecuredEndpoint string = enableCustomSSL && length(lbSvcValues) > 0 && (deploymentScript.properties.outputs.adminConsoleEndpoint != 'null') ? format('https://{0}/', deploymentScript.properties.outputs.adminConsoleEndpoint) : '' -output adminServerT3LBEndpoint string = length(lbSvcValues) > 0 && (deploymentScript.properties.outputs.adminServerT3Endpoint != 'null') ? deploymentScript.properties.outputs.adminServerT3Endpoint : '' -output adminRemoteEndpoint string = (!enableCustomSSL) && length(lbSvcValues) > 0 && (deploymentScript.properties.outputs.adminRemoteEndpoint != 'null') ? format('http://{0}', deploymentScript.properties.outputs.adminRemoteEndpoint) : '' -output adminRemoteSecuredEndpoint string = enableCustomSSL && length(lbSvcValues) > 0 && (deploymentScript.properties.outputs.adminRemoteEndpoint != 'null') ? format('https://{0}', deploymentScript.properties.outputs.adminRemoteEndpoint) : '' -output clusterLBEndpoint string = (!enableCustomSSL) && length(lbSvcValues) > 0 && (deploymentScript.properties.outputs.clusterEndpoint != 'null') ? format('http://{0}/', deploymentScript.properties.outputs.clusterEndpoint) : '' -output clusterLBSecuredEndpoint string = enableCustomSSL && length(lbSvcValues) > 0 && (deploymentScript.properties.outputs.clusterEndpoint != 'null') ? format('https://{0}/', deploymentScript.properties.outputs.clusterEndpoint) : '' -output clusterT3LBEndpoint string = length(lbSvcValues) > 0 && (deploymentScript.properties.outputs.clusterT3Endpoint != 'null') ? deploymentScript.properties.outputs.clusterT3Endpoint : '' diff --git a/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds-create-wls-cluster.bicep b/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds-create-wls-cluster.bicep deleted file mode 100644 index 2db8542ca..000000000 --- a/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds-create-wls-cluster.bicep +++ /dev/null @@ -1,289 +0,0 @@ -// Copyright (c) 2021, Oracle Corporation and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -param _artifactsLocation string = deployment().properties.templateLink.uri -@secure() -param _artifactsLocationSasToken string = '' -param _globalResourceNameSuffix string - -param aksClusterRGName string = '' -param aksClusterName string = '' -param acrName string = '' -param acrResourceGroupName string = '' -param appPackageUrls array = [] -param appReplicas int = 2 -param azCliVersion string = '' -param cpuPlatform string = '' -param databaseType string = 'oracle' -param dbDriverLibrariesUrls array = [] -param enableCustomSSL bool = false -param enableAdminT3Tunneling bool = false -param enableClusterT3Tunneling bool = false -param enablePswlessConnection bool = false -param enablePV bool = false -param fileShareName string -param identity object = {} -param isSSOSupportEntitled bool -param location string -param managedServerPrefix string = 'managed-server' -@secure() -param ocrSSOPSW string -param ocrSSOUser string -param storageAccountName string = 'null' -@description('${label.tagsLabel}') -param tagsByResource object -param t3ChannelAdminPort int = 7005 -param t3ChannelClusterPort int = 8011 -param utcValue string = utcNow() -param userProvidedImagePath string = 'null' -param useOracleImage bool = true -@secure() -param wdtRuntimePassword string -param wlsClusterSize int = 5 -param wlsCPU string = '200m' -param wlsDomainName string = 'domain1' -param wlsDomainUID string = 'sample-domain1' -@secure() -param wlsIdentityKeyStoreData string =newGuid() -@secure() -param wlsIdentityKeyStorePassphrase string = newGuid() -@allowed([ - 'JKS' - 'PKCS12' -]) -param wlsIdentityKeyStoreType string = 'PKCS12' -param wlsImageTag string = '12.2.1.4' -param wlsJavaOption string = 'null' -param wlsMemory string = '1.5Gi' -@secure() -param wlsPassword string -@secure() -param wlsPrivateKeyAlias string =newGuid() -@secure() -param wlsPrivateKeyPassPhrase string = newGuid() -@secure() -param wlsTrustKeyStoreData string = newGuid() -@secure() -param wlsTrustKeyStorePassPhrase string = newGuid() -@allowed([ - 'JKS' - 'PKCS12' -]) -param wlsTrustKeyStoreType string = 'PKCS12' -param wlsUserName string = 'weblogic' - -var const_buildDockerImageScript='createVMAndBuildImage.sh' -var const_commonScript = 'common.sh' -var const_pvTempalte = 'pv.yaml.template' -var const_pvcTempalte = 'pvc.yaml.template' -var const_scriptLocation = uri(_artifactsLocation, 'scripts/') -var const_genDomainConfigScript= 'genDomainConfig.sh' -var const_setUpDomainScript = 'setupWLSDomain.sh' -var const_updateDomainConfigScript= 'updateDomainConfig.sh' -var const_utilityScript= 'utility.sh' - -resource deploymentScript 'Microsoft.Resources/deploymentScripts@${azure.apiVersionForDeploymentScript}' = { - name: 'ds-wls-cluster-creation-${_globalResourceNameSuffix}' - location: location - kind: 'AzureCLI' - identity: identity - tags: tagsByResource['${identifier.deploymentScripts}'] - properties: { - azCliVersion: azCliVersion - environmentVariables: [ - { - name: 'ACR_NAME' - value: acrName - } - { - name: 'ACR_RESOURCEGROUP_NAME' - value: acrResourceGroupName - } - { - name: 'AKS_CLUSTER_NAME' - value: aksClusterName - } - { - name: 'AKS_CLUSTER_RESOURCEGROUP_NAME' - value: aksClusterRGName - } - { - name: 'CPU_PLATFORM' - value: cpuPlatform - } - { - name: 'CURRENT_RESOURCEGROUP_NAME' - value: resourceGroup().name - } - { - name: 'DB_TYPE' - value: databaseType - } - { - name: 'ENABLE_ADMIN_CUSTOM_T3' - value: string(enableAdminT3Tunneling) - } - { - name: 'ENABLE_CLUSTER_CUSTOM_T3' - value: string(enableClusterT3Tunneling) - } - { - name: 'ENABLE_CUSTOM_SSL' - value: string(enableCustomSSL) - } - { - name: 'ENABLE_PASSWORDLESS_DB_CONNECTION' - value: string(enablePswlessConnection) - } - { - name: 'ENABLE_PV' - value: string(enablePV) - } - { - name: 'FILE_SHARE_NAME' - value: fileShareName - } - { - name: 'ORACLE_ACCOUNT_NAME' - value: ocrSSOUser - } - { - name: 'ORACLE_ACCOUNT_PASSWORD' - secureValue: ocrSSOPSW - } - { - name: 'ORACLE_ACCOUNT_ENTITLED' - value: string(isSSOSupportEntitled) - } - { - name: 'SCRIPT_LOCATION' - value: const_scriptLocation - } - { - name: 'STORAGE_ACCOUNT_NAME' - value: storageAccountName - } - { - name: 'TAG_VM' - value: string(tagsByResource['${identifier.virtualMachines}']) - } - { - name: 'URL_3RD_DATASOURCE' - value: string(dbDriverLibrariesUrls) - } - { - name: 'USE_ORACLE_IMAGE' - value: string(useOracleImage) - } - { - name: 'USER_PROVIDED_IMAGE_PATH' - value: userProvidedImagePath - } - { - name: 'WLS_ADMIN_PASSWORD' - secureValue: wlsPassword - } - { - name: 'WLS_ADMIN_USER_NAME' - secureValue: wlsUserName - } - { - name: 'WLS_APP_PACKAGE_URLS' - value: base64(string(appPackageUrls)) - } - { - name: 'WLS_APP_REPLICAS' - value: string(appReplicas) - } - { - name: 'WLS_CLUSTER_SIZE' - value: string(wlsClusterSize) - } - { - name: 'WLS_DOMAIN_NAME' - value: wlsDomainName - } - { - name: 'WLS_DOMAIN_UID' - value: wlsDomainUID - } - { - name: 'WLS_IMAGE_TAG' - value: wlsImageTag - } - { - name: 'WLS_JAVA_OPTIONS' - value: wlsJavaOption - } - { - name: 'WLS_MANAGED_SERVER_PREFIX' - value: managedServerPrefix - } - { - name: 'WLS_RESOURCE_REQUEST_CPU' - value: wlsCPU - } - { - name: 'WLS_RESOURCE_REQUEST_MEMORY' - value: wlsMemory - } - { - name: 'WLS_SSL_IDENTITY_DATA' - secureValue: wlsIdentityKeyStoreData - } - { - name: 'WLS_SSL_IDENTITY_PASSWORD' - secureValue: wlsIdentityKeyStorePassphrase - } - { - name: 'WLS_SSL_IDENTITY_TYPE' - value: wlsIdentityKeyStoreType - } - { - name: 'WLS_SSL_TRUST_DATA' - secureValue: wlsTrustKeyStoreData - } - { - name: 'WLS_SSL_TRUST_PASSWORD' - secureValue: wlsTrustKeyStorePassPhrase - } - { - name: 'WLS_SSL_TRUST_TYPE' - value: wlsTrustKeyStoreType - } - { - name: 'WLS_SSL_PRIVATE_KEY_ALIAS' - secureValue: wlsPrivateKeyAlias - } - { - name: 'WLS_SSL_PRIVATE_KEY_PASSWORD' - secureValue: wlsPrivateKeyPassPhrase - } - { - name: 'WLS_T3_ADMIN_PORT' - value: string(t3ChannelAdminPort) - } - { - name: 'WLS_T3_CLUSTER_PORT' - value: string(t3ChannelClusterPort) - } - { - name: 'WLS_WDT_RUNTIME_PSW' - secureValue: wdtRuntimePassword - } - ] - primaryScriptUri: uri(const_scriptLocation, '${const_setUpDomainScript}${_artifactsLocationSasToken}') - supportingScriptUris: [ - uri(const_scriptLocation, '${const_genDomainConfigScript}${_artifactsLocationSasToken}') - uri(const_scriptLocation, '${const_utilityScript}${_artifactsLocationSasToken}') - uri(const_scriptLocation, '${const_pvTempalte}${_artifactsLocationSasToken}') - uri(const_scriptLocation, '${const_pvcTempalte}${_artifactsLocationSasToken}') - uri(const_scriptLocation, '${const_commonScript}${_artifactsLocationSasToken}') - uri(const_scriptLocation, '${const_buildDockerImageScript}${_artifactsLocationSasToken}') - uri(const_scriptLocation, '${const_updateDomainConfigScript}${_artifactsLocationSasToken}') - ] - cleanupPreference: 'OnSuccess' - retentionInterval: 'P1D' - forceUpdateTag: utcValue - } -} diff --git a/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds-datasource-connection.bicep b/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds-datasource-connection.bicep deleted file mode 100644 index 19d5678d3..000000000 --- a/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds-datasource-connection.bicep +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) 2021, Oracle Corporation and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -param _artifactsLocation string = deployment().properties.templateLink.uri -@secure() -param _artifactsLocationSasToken string = '' -param _globalResourceNameSuffix string - -param aksClusterName string -param aksClusterRGName string -param databaseType string = 'oracle' -param azCliVersion string = '' -param dbConfigurationType string = 'createOrUpdate' -param dbDriverName string = 'org.contoso.Driver' -param dbGlobalTranPro string = 'EmulateTwoPhaseCommit' -@secure() -param dbPassword string = newGuid() -param dbTestTableName string = 'Null' -param dbUser string -param dsConnectionURL string -param enablePswlessConnection bool = false -param identity object = {} -param jdbcDataSourceName string -param location string -@description('${label.tagsLabel}') -param tagsByResource object -param utcValue string = utcNow() -param wlsDomainUID string = 'sample-domain1' -@secure() -param wlsPassword string -@description('User name for WebLogic Administrator.') -param wlsUserName string = 'weblogic' - -var const_commonScript = 'common.sh' -var const_datasourceScript='setupDBConnections.sh' -var const_datasourceModelScript='genDatasourceModel.sh' -var const_dbUtilityScript='dbUtility.sh' -var const_scriptLocation = uri(_artifactsLocation, 'scripts/') -var const_utilityScript= 'utility.sh' - -resource deploymentScript 'Microsoft.Resources/deploymentScripts@${azure.apiVersionForDeploymentScript}' = { - name: 'ds-wls-db-connection-${_globalResourceNameSuffix}' - location: location - kind: 'AzureCLI' - identity: identity - tags: tagsByResource['${identifier.deploymentScripts}'] - properties: { - azCliVersion: azCliVersion - environmentVariables: [ - { - name: 'AKS_RESOURCE_GROUP_NAME' - value: aksClusterRGName - } - { - name: 'AKS_NAME' - value: aksClusterName - } - { - name: 'DATABASE_TYPE' - value: databaseType - } - { - name: 'DB_CONFIGURATION_TYPE' - value: dbConfigurationType - } - { - name: 'DB_PASSWORD' - secureValue: dbPassword - } - { - name: 'DB_USER' - value: dbUser - } - { - name: 'DB_CONNECTION_STRING' - value: dsConnectionURL - } - { - name: 'DB_DRIVER_NAME' - value: dbDriverName - } - { - name: 'ENABLE_PASSWORDLESS_CONNECTION' - value: string(enablePswlessConnection) - } - { - name: 'GLOBAL_TRANSATION_PROTOCOL' - value: dbGlobalTranPro - } - { - name: 'JDBC_DATASOURCE_NAME' - value: jdbcDataSourceName - } - { - name: 'TEST_TABLE_NAME' - value: dbTestTableName - } - { - name: 'WLS_DOMAIN_UID' - value: wlsDomainUID - } - { - name: 'WLS_DOMAIN_USER' - value: wlsUserName - } - { - name: 'WLS_DOMAIN_PASSWORD' - secureValue: wlsPassword - } - ] - primaryScriptUri: uri(const_scriptLocation, '${const_datasourceScript}${_artifactsLocationSasToken}') - supportingScriptUris: [ - uri(const_scriptLocation, '${const_commonScript}${_artifactsLocationSasToken}') - uri(const_scriptLocation, '${const_utilityScript}${_artifactsLocationSasToken}') - uri(const_scriptLocation, '${const_dbUtilityScript}${_artifactsLocationSasToken}') - uri(const_scriptLocation, '${const_datasourceModelScript}${_artifactsLocationSasToken}') - ] - cleanupPreference: 'OnSuccess' - retentionInterval: 'P1D' - forceUpdateTag: utcValue - } -} diff --git a/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds-output-domain-configurations.bicep b/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds-output-domain-configurations.bicep deleted file mode 100644 index d86fc1353..000000000 --- a/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds-output-domain-configurations.bicep +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) 2021, 2024 Oracle Corporation and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -param _globalResourceNameSuffix string -param aksClusterRGName string = '' -param aksClusterName string = '' -param azCliVersion string = '' -param identity object = {} -param location string -@description('${label.tagsLabel}') -param tagsByResource object -param utcValue string = utcNow() -param wlsClusterName string = 'cluster-1' -param wlsDomainUID string = 'sample-domain1' - -// To mitigate arm-ttk error: Unreferenced variable: $fxv#0 -var base64_common = loadFileAsBase64('../../../arm/scripts/common.sh') -var base64_queryDomainConfigurations = loadFileAsBase64('../../../arm/scripts/inline-scripts/queryDomainConfigurations.sh') -var base64_utility = loadFileAsBase64('../../../arm/scripts/utility.sh') - -resource deploymentScript 'Microsoft.Resources/deploymentScripts@${azure.apiVersionForDeploymentScript}' = { - name: 'ds-query-wls-configurations-${_globalResourceNameSuffix}' - location: location - kind: 'AzureCLI' - identity: identity - tags: tagsByResource['${identifier.deploymentScripts}'] - properties: { - azCliVersion: azCliVersion - environmentVariables: [ - { - name: 'AKS_CLUSTER_RESOURCEGROUP_NAME' - value: aksClusterRGName - } - { - name: 'AKS_CLUSTER_NAME' - value: aksClusterName - } - { - name: 'WLS_CLUSTER_NAME' - value: wlsClusterName - } - { - name: 'WLS_DOMAIN_UID' - value: wlsDomainUID - } - ] - scriptContent: format('{0}\r\n\r\n{1}\r\n\r\n{2}',base64ToString(base64_common), base64ToString(base64_utility), base64ToString(base64_queryDomainConfigurations)) - cleanupPreference: 'OnSuccess' - retentionInterval: 'P1D' - forceUpdateTag: utcValue - } -} - -output shellCmdtoOutputWlsDomainYaml string = format('echo -e {0} | base64 -d > domain.yaml', deploymentScript.properties.outputs.domainDeploymentYaml) -output shellCmdtoOutputWlsImageModelYaml string = format('echo -e {0} | base64 -d > model.yaml', deploymentScript.properties.outputs.wlsImageModelYaml) -output shellCmdtoOutputWlsImageProperties string = format('echo -e {0} | base64 -d > model.properties', deploymentScript.properties.outputs.wlsImageProperties) -output shellCmdtoOutputWlsVersions string = format('echo -e {0} | base64 -d > version.info', deploymentScript.properties.outputs.wlsVersionDetails) diff --git a/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds-validate-applications.bicep b/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds-validate-applications.bicep deleted file mode 100644 index ff4568f73..000000000 --- a/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds-validate-applications.bicep +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) 2021, Oracle Corporation and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -param _artifactsLocation string = deployment().properties.templateLink.uri -@secure() -param _artifactsLocationSasToken string = '' -param _globalResourceNameSuffix string - -param aksClusterRGName string = '' -param aksClusterName string = '' -param azCliVersion string = '' -param identity object = {} -param location string -@description('${label.tagsLabel}') -param tagsByResource object -param utcValue string = utcNow() -param wlsDomainUID string = 'sample-domain1' -@secure() -param wlsPassword string -@description('User name for WebLogic Administrator.') -param wlsUserName string = 'weblogic' - -var const_pyCheckAppStatusScript = 'checkApplicationStatus.py' -var const_scriptLocation = uri(_artifactsLocation, 'scripts/') -var const_validateAppScript= 'validateApplications.sh' -var const_utilityScript= 'utility.sh' - - -resource deploymentScript 'Microsoft.Resources/deploymentScripts@${azure.apiVersionForDeploymentScript}' = { - name: 'ds-wls-validate-applications-${_globalResourceNameSuffix}' - location: location - kind: 'AzureCLI' - identity: identity - tags: tagsByResource['${identifier.deploymentScripts}'] - properties: { - azCliVersion: azCliVersion - environmentVariables: [ - { - name: 'AKS_RESOURCE_GROUP_NAME' - value: aksClusterRGName - } - { - name: 'AKS_NAME' - value: aksClusterName - } - { - name: 'WLS_DOMAIN_UID' - value: wlsDomainUID - } - { - name: 'WLS_DOMAIN_USER' - value: wlsUserName - } - { - name: 'WLS_DOMAIN_PASSWORD' - secureValue: wlsPassword - } - ] - primaryScriptUri: uri(const_scriptLocation, '${const_validateAppScript}${_artifactsLocationSasToken}') - supportingScriptUris: [ - uri(const_scriptLocation, '${const_utilityScript}${_artifactsLocationSasToken}') - uri(const_scriptLocation, '${const_pyCheckAppStatusScript}${_artifactsLocationSasToken}') - ] - cleanupPreference: 'OnSuccess' - retentionInterval: 'P1D' - forceUpdateTag: utcValue - } -} diff --git a/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds-validate-parameters.bicep b/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds-validate-parameters.bicep deleted file mode 100644 index c865a2e6a..000000000 --- a/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds-validate-parameters.bicep +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright (c) 2021, Oracle Corporation and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -param _globalResourceNameSuffix string -param acrName string -param acrResourceGroupName string -param aksAgentPoolNodeCount int -param aksAgentPoolVMSize string = '' -param aksClusterRGName string -param aksClusterName string -param aksVersion string = 'default' -param appGatewayCertificateOption string -param appGatewaySSLCertData string -@secure() -param appGatewaySSLCertPassword string -param appReplicas int -param azCliVersion string = '' -param createAKSCluster bool -param createDNSZone bool -param dnszoneName string -param dnszoneRGName string -param enableAppGWIngress bool -param enableCustomSSL bool -param enableDNSConfiguration bool -param identity object = {} -param isSSOSupportEntitled bool -param location string -@secure() -param ocrSSOPSW string -param ocrSSOUser string -@secure() -param sslUploadedCustomIdentityKeyStoreData string -@secure() -param sslUploadedCustomIdentityKeyStorePassphrase string -param sslUploadedCustomIdentityKeyStoreType string -@secure() -param sslUploadedCustomTrustKeyStoreData string -@secure() -param sslUploadedCustomTrustKeyStorePassPhrase string -param sslUploadedCustomTrustKeyStoreType string -@secure() -param sslUploadedPrivateKeyAlias string -@secure() -param sslUploadedPrivateKeyPassPhrase string -@description('${label.tagsLabel}') -param tagsByResource object -param useAksWellTestedVersion bool = true -param userProvidedAcr string -param userProvidedAcrRgName string -param userProvidedImagePath string -param useOracleImage bool -param vnetForApplicationGateway object -param utcValue string = utcNow() -param wlsImageTag string - -// To mitigate arm-ttk error: Unreferenced variable: $fxv#0 -var base64_common = loadFileAsBase64('../../../arm/scripts/common.sh') -var base64_utility = loadFileAsBase64('../../../arm/scripts/utility.sh') -var base64_validateParameters = loadFileAsBase64('../../../arm/scripts/inline-scripts/validateParameters.sh') -var const_arguments = '${location} ${createAKSCluster} ${aksAgentPoolVMSize} ${aksAgentPoolNodeCount} ${useOracleImage} ${wlsImageTag} ${userProvidedImagePath} ${enableCustomSSL} ${appGatewayCertificateOption} ${enableAppGWIngress} ${const_checkDNSZone}' -var const_checkDNSZone = enableDNSConfiguration && !createDNSZone -var const_deploymentName = 'ds-validate-parameters-and-fail-fast-${_globalResourceNameSuffix}' - -resource deploymentScript 'Microsoft.Resources/deploymentScripts@${azure.apiVersionForDeploymentScript}' = { - name: const_deploymentName - location: location - kind: 'AzureCLI' - identity: identity - tags: tagsByResource['${identifier.deploymentScripts}'] - properties: { - azCliVersion: azCliVersion - arguments: const_arguments - environmentVariables: [ - { - name: 'ORACLE_ACCOUNT_NAME' - value: ocrSSOUser - } - { - name: 'ORACLE_ACCOUNT_PASSWORD' - secureValue: ocrSSOPSW - } - { - name: 'ORACLE_ACCOUNT_ENTITLED' - value: string(isSSOSupportEntitled) - } - { - name: 'ACR_NAME' - value: acrName - } - { - name: 'ACR_RESOURCE_GROUP' - value: acrResourceGroupName - } - { - name: 'ACR_NAME_FOR_USER_PROVIDED_IMAGE' - value: userProvidedAcr - } - { - name: 'ACR_RG_NAME_FOR_USER_PROVIDED_IMAGE' - value: userProvidedAcrRgName - } - { - name: 'AKS_CLUSTER_NAME' - value: aksClusterName - } - { - name: 'AKS_CLUSTER_RESOURCEGROUP_NAME' - value: aksClusterRGName - } - { - name: 'AKS_VERSION' - value: aksVersion - } - { - name: 'APP_REPLICAS' - value: appReplicas - } - { - name: 'WLS_SSL_IDENTITY_DATA' - secureValue: sslUploadedCustomIdentityKeyStoreData - } - { - name: 'WLS_SSL_IDENTITY_PASSWORD' - secureValue: sslUploadedCustomIdentityKeyStorePassphrase - } - { - name: 'WLS_SSL_IDENTITY_TYPE' - value: sslUploadedCustomIdentityKeyStoreType - } - { - name: 'WLS_SSL_TRUST_DATA' - secureValue: sslUploadedCustomTrustKeyStoreData - } - { - name: 'WLS_SSL_TRUST_PASSWORD' - secureValue: sslUploadedCustomTrustKeyStorePassPhrase - } - { - name: 'WLS_SSL_TRUST_TYPE' - value: sslUploadedCustomTrustKeyStoreType - } - { - name: 'WLS_SSL_PRIVATE_KEY_ALIAS' - secureValue: sslUploadedPrivateKeyAlias - } - { - name: 'WLS_SSL_PRIVATE_KEY_PASSWORD' - secureValue: sslUploadedPrivateKeyPassPhrase - } - { - name: 'APPLICATION_GATEWAY_SSL_FRONTEND_CERT_DATA' - value: appGatewaySSLCertData - } - { - name: 'APPLICATION_GATEWAY_SSL_FRONTEND_CERT_PASSWORD' - value: appGatewaySSLCertPassword - } - { - name: 'DNS_ZONE_NAME' - value: dnszoneName - } - { - name: 'DNS_ZONE_RESOURCEGROUP_NAME' - value: dnszoneRGName - } - { - name: 'USE_AKS_WELL_TESTED_VERSION' - value: string(useAksWellTestedVersion) - } - { - name: 'VNET_FOR_APPLICATIONGATEWAY' - value: string(vnetForApplicationGateway) - } - ] - scriptContent: format('{0}\r\n\r\n{1}\r\n\r\n{2}', base64ToString(base64_common), base64ToString(base64_utility), base64ToString(base64_validateParameters)) - cleanupPreference: 'OnSuccess' - retentionInterval: 'P1D' - forceUpdateTag: utcValue - } -} - -output aksVersion string = deploymentScript.properties.outputs.aksVersion -output aksAgentAvailabilityZones array = json(deploymentScript.properties.outputs.agentAvailabilityZones) diff --git a/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds_enable_hpa.bicep b/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds_enable_hpa.bicep deleted file mode 100644 index ec3571b0f..000000000 --- a/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds_enable_hpa.bicep +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) 2024, Oracle Corporation and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -param _globalResourceNameSuffix string -param aksClusterName string -param aksClusterRGName string -param azCliVersion string -@allowed([ - 'cpu' - 'memory' -]) -param hpaScaleType string = 'cpu' -param identity object = {} -param location string -@description('${label.tagsLabel}') -param tagsByResource object -param utcValue string = utcNow() -param utilizationPercentage int -param wlsClusterSize int -param wlsNamespace string - -// To mitigate arm-ttk error: Unreferenced variable: $fxv#0 -var base64_common = loadFileAsBase64('../../../arm/scripts/common.sh') -var base64_enableHpa = loadFileAsBase64('../../../arm/scripts/inline-scripts/enableHpa.sh') -var base64_utility = loadFileAsBase64('../../../arm/scripts/utility.sh') -var const_deploymentName='ds-enable-hpa-${_globalResourceNameSuffix}' - -resource deploymentScript 'Microsoft.Resources/deploymentScripts@${azure.apiVersionForDeploymentScript}' = { - name: const_deploymentName - location: location - kind: 'AzureCLI' - identity: identity - tags: tagsByResource['${identifier.deploymentScripts}'] - properties: { - azCliVersion: azCliVersion - scriptContent: format('{0}\r\n\r\n{1}\r\n\r\n{2}',base64ToString(base64_common), base64ToString(base64_utility), base64ToString(base64_enableHpa)) - environmentVariables: [ - { - name: 'AKS_CLUSTER_RG_NAME' - value: aksClusterRGName - } - { - name: 'AKS_CLUSTER_NAME' - value: aksClusterName - } - { - name: 'CURRENT_RG_NAME' - value: resourceGroup().name - } - { - name: 'HPA_SCALE_TYPE' - value: hpaScaleType - } - { - name: 'UTILIZATION_PERCENTAGE' - value: string(utilizationPercentage) - } - { - name: 'WLS_CLUSTER_SIZE' - value: string(wlsClusterSize) - } - { - name: 'WLS_NAMESPACE' - value: wlsNamespace - } - ] - cleanupPreference: 'OnSuccess' - retentionInterval: 'P1D' - forceUpdateTag: utcValue - } -} diff --git a/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds_enable_prometheus_metrics.bicep b/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds_enable_prometheus_metrics.bicep deleted file mode 100644 index 3be6c611a..000000000 --- a/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds_enable_prometheus_metrics.bicep +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) 2024, Oracle Corporation and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -param _globalResourceNameSuffix string -param aksClusterName string -param aksClusterRGName string -param amaName string -param azCliVersion string -param identity object = {} -param kedaUamiName string -param location string -@description('${label.tagsLabel}') -param tagsByResource object -param utcValue string = utcNow() -param wlsClusterSize int -param wlsDomainUID string -param wlsNamespace string -@secure() -param wlsPassword string -param wlsUserName string -param workspaceId string - -// To mitigate arm-ttk error: Unreferenced variable: $fxv#0 -var base64_common = loadFileAsBase64('../../../arm/scripts/common.sh') -var base64_enableHpa = loadFileAsBase64('../../../arm/scripts/inline-scripts/enablePrometheusMetrics.sh') -var base64_utility = loadFileAsBase64('../../../arm/scripts/utility.sh') -var const_deploymentName = 'ds-enable-promethues-metrics-${_globalResourceNameSuffix}' -var const_kedaNamespace= 'keda' -var const_kedaSa= 'keda-operator' - -resource deploymentScript 'Microsoft.Resources/deploymentScripts@${azure.apiVersionForDeploymentScript}' = { - name: const_deploymentName - location: location - kind: 'AzureCLI' - identity: identity - tags: tagsByResource['${identifier.deploymentScripts}'] - properties: { - azCliVersion: azCliVersion - scriptContent: format('{0}\r\n\r\n{1}\r\n\r\n{2}', base64ToString(base64_common), base64ToString(base64_utility), base64ToString(base64_enableHpa)) - environmentVariables: [ - { - name: 'AKS_CLUSTER_RG_NAME' - value: aksClusterRGName - } - { - name: 'AKS_CLUSTER_NAME' - value: aksClusterName - } - { - name: 'AMA_NAME' - value: amaName - } - { - name: 'AMA_WORKSPACE_ID' - value: workspaceId - } - { - name: 'CURRENT_RG_NAME' - value: resourceGroup().name - } - { - name: 'KEDA_NAMESPACE' - value: const_kedaNamespace - } - { - name: 'KEDA_UAMI_NAME' - value: kedaUamiName - } - { - name: 'KEDA_SERVICE_ACCOUNT_NAME' - value: const_kedaSa - } - { - name: 'WLS_CLUSTER_SIZE' - value: string(wlsClusterSize) - } - { - name: 'WLS_ADMIN_PASSWORD' - value: wlsPassword - } - { - name: 'WLS_ADMIN_USERNAME' - value: wlsUserName - } - { - name: 'WLS_DOMAIN_UID' - value: wlsDomainUID - } - { - name: 'WLS_NAMESPACE' - value: wlsNamespace - } - { - name: 'LOCATION' - value: location - } - { - name: 'SUBSCRIPTION' - value: split(subscription().id, '/')[2] - } - ] - cleanupPreference: 'OnSuccess' - retentionInterval: 'P1D' - forceUpdateTag: utcValue - } -} - -output kedaScalerServerAddress string = deploymentScript.properties.outputs.kedaScalerServerAddress -output base64ofKedaScalerSample string = deploymentScript.properties.outputs.base64ofKedaScalerSample diff --git a/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds_ensure_available_agic.bicep b/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds_ensure_available_agic.bicep deleted file mode 100644 index e42042a66..000000000 --- a/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds_ensure_available_agic.bicep +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) 2022, Oracle Corporation and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -param aksClusterName string -param aksClusterRGName string -param appgwName string = 'appgw-contoso' -param azCliVersion string = '' -param identity object = {} -param location string -param utcValue string = utcNow() - -// To mitigate arm-ttk error: Unreferenced variable: $fxv#0 -var base64_common = loadFileAsBase64('../../../arm/scripts/common.sh') -var base64_enableAgic = loadFileAsBase64('../../../arm/scripts/inline-scripts/enableAgic.sh') -var base64_utility = loadFileAsBase64('../../../arm/scripts/utility.sh') -var const_deploymentName='ds-validate-agic-${uniqueString(utcValue)}' - -resource deploymentScript 'Microsoft.Resources/deploymentScripts@${azure.apiVersionForDeploymentScript}' = { - name: const_deploymentName - location: location - kind: 'AzureCLI' - identity: identity - properties: { - azCliVersion: azCliVersion - scriptContent: format('{0}\r\n\r\n{1}\r\n\r\n{2}',base64ToString(base64_common), base64ToString(base64_utility), base64ToString(base64_enableAgic)) - environmentVariables: [ - { - name: 'AKS_CLUSTER_RG_NAME' - value: aksClusterRGName - } - { - name: 'AKS_CLUSTER_NAME' - value: aksClusterName - } - { - name: 'APPGW_NAME' - value: appgwName - } - { - name: 'CURRENT_RG_NAME' - value: resourceGroup().name - } - ] - cleanupPreference: 'OnSuccess' - retentionInterval: 'P1D' - forceUpdateTag: utcValue - } -} diff --git a/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds_install_agic.bicep b/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds_install_agic.bicep deleted file mode 100644 index fc355f699..000000000 --- a/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds_install_agic.bicep +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) 2024, Oracle Corporation and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -param _globalResourceNameSuffix string -param aksClusterName string -param aksClusterRGName string -param appgwName string = 'appgw-contoso' -param azCliVersion string = '' -param identity object = {} -param location string -@description('${label.tagsLabel}') -param tagsByResource object -param utcValue string = utcNow() - -// To mitigate arm-ttk error: Unreferenced variable: $fxv#0 -var base64_common = loadFileAsBase64('../../../arm/scripts/common.sh') -var base64_enableAgic = loadFileAsBase64('../../../arm/scripts/inline-scripts/enableAgic.sh') -var base64_utility = loadFileAsBase64('../../../arm/scripts/utility.sh') -var const_deploymentName='ds-install-agic-${_globalResourceNameSuffix}' - -resource deploymentScript 'Microsoft.Resources/deploymentScripts@${azure.apiVersionForDeploymentScript}' = { - name: const_deploymentName - location: location - kind: 'AzureCLI' - identity: identity - tags: tagsByResource['${identifier.deploymentScripts}'] - properties: { - azCliVersion: azCliVersion - scriptContent: format('{0}\r\n\r\n{1}\r\n\r\n{2}',base64ToString(base64_common), base64ToString(base64_utility), base64ToString(base64_enableAgic)) - environmentVariables: [ - { - name: 'AKS_CLUSTER_RG_NAME' - value: aksClusterRGName - } - { - name: 'AKS_CLUSTER_NAME' - value: aksClusterName - } - { - name: 'APPGW_NAME' - value: appgwName - } - { - name: 'CURRENT_RG_NAME' - value: resourceGroup().name - } - ] - cleanupPreference: 'OnSuccess' - retentionInterval: 'P1D' - forceUpdateTag: utcValue - } -} diff --git a/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds_query_available_private_ip_from_subnet.bicep b/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds_query_available_private_ip_from_subnet.bicep deleted file mode 100644 index ea3ad9025..000000000 --- a/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds_query_available_private_ip_from_subnet.bicep +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) 2022, Oracle Corporation and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -param azCliVersion string = '' -param subnetId string = '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/subnetname' -param knownIP string = '10.0.0.1' - -param identity object = {} -param location string -@description('${label.tagsLabel}') -param tagsByResource object -param utcValue string = utcNow() - -// To mitigate arm-ttk error: Unreferenced variable: $fxv#0 -var base64_common = loadFileAsBase64('../../../arm/scripts/common.sh') -var base64_queryPrivateIPForAppGateway = loadFileAsBase64('../../../arm/scripts/inline-scripts/queryPrivateIPForAppGateway.sh') -var const_deploymentName = 'ds-query-private-ip-${uniqueString(utcValue)}' - -resource deploymentScript 'Microsoft.Resources/deploymentScripts@${azure.apiVersionForDeploymentScript}' = { - name: const_deploymentName - location: location - kind: 'AzureCLI' - identity: identity - tags: tagsByResource['${identifier.deploymentScripts}'] - properties: { - azCliVersion: azCliVersion - scriptContent: format('{0}\r\n\r\n{1}', base64ToString(base64_common), base64ToString(base64_queryPrivateIPForAppGateway)) - environmentVariables: [ - { - name: 'SUBNET_ID' - value: subnetId - } - { - name: 'KNOWN_IP' - value: knownIP - } - ] - cleanupPreference: 'OnSuccess' - retentionInterval: 'P1D' - forceUpdateTag: utcValue - } -} - -output privateIP string = string(deploymentScript.properties.outputs.privateIP) diff --git a/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds_update-applications.bicep b/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds_update-applications.bicep deleted file mode 100644 index 8f0623b14..000000000 --- a/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds_update-applications.bicep +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) 2021, Oracle Corporation and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -param _artifactsLocation string = deployment().properties.templateLink.uri -@secure() -param _artifactsLocationSasToken string = '' - -param aksClusterRGName string = '' -param aksClusterName string = '' -param acrName string = '' -param appPackageUrls array = [] -param appPackageFromStorageBlob object = { - storageAccountName: 'stg-contoso' - containerName: 'container-contoso' -} -param azCliVersion string = '' -param identity object = {} -param isSSOSupportEntitled bool -param location string - -@secure() -param ocrSSOPSW string -param ocrSSOUser string - -param utcValue string = utcNow() -param wlsDomainName string = 'domain1' -param wlsDomainUID string = 'sample-domain1' -param wlsImageTag string = '12.2.1.4' -param userProvidedImagePath string = 'null' -param useOracleImage bool = true - -var const_buildDockerImageScript='createVMAndBuildImage.sh' -var const_commonScript = 'common.sh' -var const_scriptLocation = uri(_artifactsLocation, 'scripts/') -var const_updateAppScript= 'updateApplications.sh' -var const_utilityScript= 'utility.sh' - -resource deploymentScript 'Microsoft.Resources/deploymentScripts@${azure.apiVersionForDeploymentScript}' = { - name: 'ds-wls-update-applications-${uniqueString(utcValue)}' - location: location - kind: 'AzureCLI' - identity: identity - properties: { - azCliVersion: azCliVersion - environmentVariables: [ - { - name: 'ACR_NAME' - value: acrName - } - { - name: 'AKS_CLUSTER_NAME' - value: aksClusterName - } - { - name: 'AKS_CLUSTER_RESOURCEGROUP_NAME' - value: aksClusterRGName - } - { - name: 'CURRENT_RESOURCEGROUP_NAME' - value: resourceGroup().name - } - { - name: 'ORACLE_ACCOUNT_ENTITLED' - value: string(isSSOSupportEntitled) - } - { - name: 'ORACLE_ACCOUNT_NAME' - value: ocrSSOUser - } - { - name: 'ORACLE_ACCOUNT_PASSWORD' - secureValue: ocrSSOPSW - } - { - name: 'STORAGE_ACCOUNT_NAME' - value: appPackageFromStorageBlob.storageAccountName - } - { - name: 'STORAGE_ACCOUNT_CONTAINER_NAME' - value: appPackageFromStorageBlob.containerName - } - { - name: 'SCRIPT_LOCATION' - value: const_scriptLocation - } - { - name: 'USE_ORACLE_IMAGE' - value: string(useOracleImage) - } - { - name: 'USER_PROVIDED_IMAGE_PATH' - value: userProvidedImagePath - } - { - name: 'WLS_APP_PACKAGE_URLS' - value: string(appPackageUrls) - } - { - name: 'WLS_DOMAIN_NAME' - value: wlsDomainName - } - { - name: 'WLS_DOMAIN_UID' - value: wlsDomainUID - } - { - name: 'WLS_IMAGE_TAG' - value: wlsImageTag - } - - ] - primaryScriptUri: uri(const_scriptLocation, '${const_updateAppScript}${_artifactsLocationSasToken}') - supportingScriptUris: [ - uri(const_scriptLocation, '${const_commonScript}${_artifactsLocationSasToken}') - uri(const_scriptLocation, '${const_utilityScript}${_artifactsLocationSasToken}') - uri(const_scriptLocation, '${const_buildDockerImageScript}${_artifactsLocationSasToken}') - ] - cleanupPreference: 'OnSuccess' - retentionInterval: 'P1D' - forceUpdateTag: utcValue - } -} - -output image string = deploymentScript.properties.outputs.image diff --git a/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds_validate_agic.bicep b/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds_validate_agic.bicep deleted file mode 100644 index 437ac0128..000000000 --- a/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds_validate_agic.bicep +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) 2024, Oracle Corporation and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -param _globalResourceNameSuffix string -param aksClusterName string -param aksClusterRGName string -param azCliVersion string = '' -param identity object = {} -param location string -@description('${label.tagsLabel}') -param tagsByResource object -param utcValue string = utcNow() - -// To mitigate arm-ttk error: Unreferenced variable: $fxv#0 -var base64_common = loadFileAsBase64('../../../arm/scripts/common.sh') -var base64_enableAgic = loadFileAsBase64('../../../arm/scripts/inline-scripts/validateAgic.sh') -var base64_utility = loadFileAsBase64('../../../arm/scripts/utility.sh') -var const_deploymentName='ds-validate-agic-${_globalResourceNameSuffix}' - -resource deploymentScript 'Microsoft.Resources/deploymentScripts@${azure.apiVersionForDeploymentScript}' = { - name: const_deploymentName - location: location - kind: 'AzureCLI' - identity: identity - tags: tagsByResource['${identifier.deploymentScripts}'] - properties: { - azCliVersion: azCliVersion - scriptContent: format('{0}\r\n\r\n{1}\r\n\r\n{2}',base64ToString(base64_common), base64ToString(base64_utility), base64ToString(base64_enableAgic)) - environmentVariables: [ - { - name: 'AKS_CLUSTER_RG_NAME' - value: aksClusterRGName - } - { - name: 'AKS_CLUSTER_NAME' - value: aksClusterName - } - { - name: 'CURRENT_RG_NAME' - value: resourceGroup().name - } - ] - cleanupPreference: 'OnSuccess' - retentionInterval: 'P1D' - forceUpdateTag: utcValue - } -} diff --git a/weblogic-azure-aks/src/main/bicep/modules/_enableAutoScaling.bicep b/weblogic-azure-aks/src/main/bicep/modules/_enableAutoScaling.bicep deleted file mode 100644 index 59d78778a..000000000 --- a/weblogic-azure-aks/src/main/bicep/modules/_enableAutoScaling.bicep +++ /dev/null @@ -1,127 +0,0 @@ -/* - Copyright (c) 2024, Oracle and/or its affiliates. -Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -*/ - -param _globalResourceNameSuffix string -param _pidCPUUtilization string = '' -param _pidEnd string = '' -param _pidMemoryUtilization string = '' -param _pidStart string = '' -param _pidWme string = '' - -param aksClusterName string -param aksClusterRGName string -param azCliVersion string - -@allowed([ - 'cpu' - 'memory' -]) -param hpaScaleType string = 'cpu' -param identity object = {} -param location string -@description('${label.tagsLabel}') -param tagsByResource object -param useHpa bool -param utilizationPercentage int -param wlsClusterSize int -param wlsDomainUID string -@secure() -param wlsPassword string -param wlsUserName string - -var const_namespace = '${wlsDomainUID}-ns' - -module pidAutoScalingStart './_pids/_pid.bicep' = { - name: 'pid-auto-scaling-start' - params: { - name: _pidStart - } -} - -module pidCpuUtilization './_pids/_pid.bicep' = if(useHpa && hpaScaleType == 'cpu') { - name: 'pid-auto-scaling-based-on-cpu-utilization' - params: { - name: _pidCPUUtilization - } - dependsOn: [ - pidAutoScalingStart - ] -} - -module pidMemoryUtilization './_pids/_pid.bicep' = if(useHpa && hpaScaleType == 'memory') { - name: 'pid-auto-scaling-based-on-memory-utilization' - params: { - name: _pidMemoryUtilization - } - dependsOn: [ - pidAutoScalingStart - ] -} - -module pidWme './_pids/_pid.bicep' = if(!useHpa) { - name: 'pid-auto-scaling-based-on-java-metrics' - params: { - name: _pidWme - } - dependsOn: [ - pidAutoScalingStart - ] -} - -module hapDeployment '_deployment-scripts/_ds_enable_hpa.bicep' = if(useHpa) { - name: 'hpa-deployment' - params: { - _globalResourceNameSuffix: _globalResourceNameSuffix - aksClusterName: aksClusterName - aksClusterRGName: aksClusterRGName - azCliVersion: azCliVersion - hpaScaleType: hpaScaleType - identity: identity - location: location - tagsByResource: tagsByResource - utilizationPercentage: utilizationPercentage - wlsClusterSize: wlsClusterSize - wlsNamespace: const_namespace - } - dependsOn: [ - pidAutoScalingStart - ] -} - -module promethuesKedaDeployment '_enablePromethuesKeda.bicep' = if (!useHpa) { - name: 'promethues-keda-weblogic-monitoring-exporter-deployment' - params: { - _globalResourceNameSuffix: _globalResourceNameSuffix - aksClusterName: aksClusterName - aksClusterRGName: aksClusterRGName - azCliVersion: azCliVersion - identity: identity - location: location - tagsByResource: tagsByResource - wlsClusterSize: wlsClusterSize - wlsDomainUID: wlsDomainUID - wlsPassword: wlsPassword - wlsUserName: wlsUserName - } - dependsOn: [ - pidAutoScalingStart - ] -} - - - -module pidAutoScalingEnd './_pids/_pid.bicep' = { - name: 'pid-auto-scaling-end' - params: { - name: _pidEnd - } - dependsOn: [ - hapDeployment - promethuesKedaDeployment - ] -} - -output kedaScalerServerAddress string = useHpa ? '' : promethuesKedaDeployment.outputs.kedaScalerServerAddress -output base64ofKedaScalerSample string = useHpa ? '' : promethuesKedaDeployment.outputs.base64ofKedaScalerSample diff --git a/weblogic-azure-aks/src/main/bicep/modules/_enablePromethuesKeda.bicep b/weblogic-azure-aks/src/main/bicep/modules/_enablePromethuesKeda.bicep deleted file mode 100644 index fc5aa1a2e..000000000 --- a/weblogic-azure-aks/src/main/bicep/modules/_enablePromethuesKeda.bicep +++ /dev/null @@ -1,87 +0,0 @@ -/* - Copyright (c) 2024, Oracle and/or its affiliates. -Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -*/ -param _globalResourceNameSuffix string -param aksClusterName string -param aksClusterRGName string -param azCliVersion string -param identity object = {} -param location string -@description('${label.tagsLabel}') -param tagsByResource object -param utcValue string = utcNow() -param wlsClusterSize int -param wlsDomainUID string -@secure() -param wlsPassword string -param wlsUserName string - -var const_namespace = '${wlsDomainUID}-ns' -// https://docs.microsoft.com/en-us/azure/role-based-access-control/built-in-roles -var const_roleDefinitionIdOfMonitorDataReader = 'b24988ac-6180-42a0-ab88-20f7382dd24c' -var name_azureMonitorAccountName = 'ama${_globalResourceNameSuffix}' -var name_kedaUserDefinedManagedIdentity = 'kedauami${_globalResourceNameSuffix}' -var name_kedaMonitorDataReaderRoleAssignmentName = guid('${resourceGroup().id}${name_kedaUserDefinedManagedIdentity}${_globalResourceNameSuffix}') - -resource monitorAccount 'Microsoft.Monitor/accounts@${azure.apiVersionForMonitorAccount}' = { - name: name_azureMonitorAccountName - location: location - properties: {} - tags: tagsByResource['${identifier.accounts}'] -} - -// UAMI for KEDA -resource uamiForKeda 'Microsoft.ManagedIdentity/userAssignedIdentities@${azure.apiVersionForIdentity}' = { - name: name_kedaUserDefinedManagedIdentity - location: location - tags: tagsByResource['${identifier.userAssignedIdentities}'] -} - -// Get role resource id -resource monitorDataReaderResourceDefinition 'Microsoft.Authorization/roleDefinitions@${azure.apiVersionForRoleDefinitions}' existing = { - name: const_roleDefinitionIdOfMonitorDataReader -} - -// Assign Monitor Data Reader role we need the permission to read data. -resource kedaUamiRoleAssignment 'Microsoft.Authorization/roleAssignments@${azure.apiVersionForRoleAssignment}' = { - name: name_kedaMonitorDataReaderRoleAssignmentName - scope: monitorAccount - properties: { - description: 'Assign Monitor Data Reader role role to KEDA Identity ' - principalId: reference(uamiForKeda.id, '${azure.apiVersionForIdentity}', 'full').properties.principalId - principalType: 'ServicePrincipal' - roleDefinitionId: monitorDataReaderResourceDefinition.id - } - dependsOn: [ - monitorAccount - uamiForKeda - ] -} - -module azureMonitorIntegrationDeployment '_deployment-scripts/_ds_enable_prometheus_metrics.bicep' = { - name: 'azure-monitor-promethues-keda-deployment' - params: { - _globalResourceNameSuffix: _globalResourceNameSuffix - aksClusterName: aksClusterName - aksClusterRGName: aksClusterRGName - amaName: name_azureMonitorAccountName - azCliVersion: azCliVersion - identity: identity - kedaUamiName: name_kedaUserDefinedManagedIdentity - location: location - tagsByResource: tagsByResource - wlsClusterSize: wlsClusterSize - wlsDomainUID: wlsDomainUID - wlsNamespace: const_namespace - wlsPassword: wlsPassword - wlsUserName: wlsUserName - workspaceId: monitorAccount.id - } - dependsOn: [ - kedaUamiRoleAssignment - ] -} - -output kedaScalerServerAddress string = azureMonitorIntegrationDeployment.outputs.kedaScalerServerAddress -output base64ofKedaScalerSample string = format('echo -e {0} | base64 -d > scaler.yaml', azureMonitorIntegrationDeployment.outputs.base64ofKedaScalerSample) diff --git a/weblogic-azure-aks/src/main/bicep/modules/_globalUamiAndRoles.bicep b/weblogic-azure-aks/src/main/bicep/modules/_globalUamiAndRoles.bicep deleted file mode 100644 index e5acfe269..000000000 --- a/weblogic-azure-aks/src/main/bicep/modules/_globalUamiAndRoles.bicep +++ /dev/null @@ -1,33 +0,0 @@ -/* - Copyright (c) 2021, Oracle and/or its affiliates. -Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -*/ - -param _globalResourceNameSuffix string -param location string -@description('${label.tagsLabel}') -param tagsByResource object -param name_deploymentScriptContributorRoleAssignmentName string = newGuid() - -// https://docs.microsoft.com/en-us/azure/role-based-access-control/built-in-roles -var const_roleDefinitionIdOfContributor = 'b24988ac-6180-42a0-ab88-20f7382dd24c' -var name_deploymentScriptUserDefinedManagedIdentity = 'wls-aks-deployment-script-user-defined-managed-itentity-${_globalResourceNameSuffix}' - -// UAMI for deployment script -resource uamiForDeploymentScript 'Microsoft.ManagedIdentity/userAssignedIdentities@${azure.apiVersionForIdentity}' = { - name: name_deploymentScriptUserDefinedManagedIdentity - location: location - tags: tagsByResource['${identifier.userAssignedIdentities}'] -} - -// Assign Contributor role in subscription scope, we need the permission to get/update resource cross resource group. -module deploymentScriptUAMICotibutorRoleAssignment '_rolesAssignment/_roleAssignmentinSubscription.bicep' = { - name: name_deploymentScriptContributorRoleAssignmentName - scope: subscription() - params: { - roleDefinitionId: const_roleDefinitionIdOfContributor - principalId: reference(resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', name_deploymentScriptUserDefinedManagedIdentity)).principalId - } -} - -output uamiIdForDeploymentScript string = uamiForDeploymentScript.id diff --git a/weblogic-azure-aks/src/main/bicep/modules/_pids/_empty.bicep b/weblogic-azure-aks/src/main/bicep/modules/_pids/_empty.bicep deleted file mode 100644 index 98e4de354..000000000 --- a/weblogic-azure-aks/src/main/bicep/modules/_pids/_empty.bicep +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) 2021, Oracle Corporation and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -/* -* Used to create an empty deployment -* Example: -* module emptyDeployment './empty.bicep' = { -* name: name -* } -*/ - -// Workaround to arm-ttk complain: Parameters property must exist in the template -param name string = 'This is an empty deployment' - -output name string = name diff --git a/weblogic-azure-aks/src/main/bicep/modules/_pids/_pid-dev.bicep b/weblogic-azure-aks/src/main/bicep/modules/_pids/_pid-dev.bicep deleted file mode 100644 index 98c1e07f4..000000000 --- a/weblogic-azure-aks/src/main/bicep/modules/_pids/_pid-dev.bicep +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) 2021, 2024, Oracle Corporation and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -// Deployment for pids. - -param name string = 'pid' - -// create a pid deployment if there is a specified name -module pidStart './_empty.bicep' = if (name != 'pid'){ - name: name -} - -output appgwEnd string = '38647ff6-ea8d-59e5-832d-b036a4d29c73' -output appgwStart string = '8ba7beaa-96fd-576a-acd8-28f7a6efa83a' -output autoScalingEnd string = '074fd64c-184f-4bb9-b878-448cae164601' -output autoScalingStart string = 'f4e5974d-6531-4a34-a733-e7416258fe03' -output customCertForAppgw string = 'b16ba29f-fc8e-5059-8988-f17bef4a9c5c' -output cpuUtilization string = '22a34519-24ea-4864-b304-7e47aee4071b' -output dbEnd string = 'ffab0a3f-90cb-585a-a7f9-ec0a62faeec1' -output dbStart string = 'e64361eb-fea0-5f15-a313-c76daadbc648' -output dnsEnd string = '189306c7-39e2-5844-817d-01e883a4cf1e' -output dnsStart string = '8ae63711-9fa7-56b4-a4a0-236f3ccef542' -output enableWlsMonitoringExporter string = '960632d4-918a-47c4-a32e-61ab0d4c470a' -output lbEnd string = 'f76e2847-d5a1-52e7-9e52-fc8560f5d3e4' -output lbStart string = 'e2a8c8b2-9b58-52c6-9636-1834ff3976dc' -output networkingEnd string = '39d32fcd-1d02-50b6-9455-4b767a8e769e' -output networkingStart string = 'ed47756f-2475-56dd-b13a-26027749b6e1' -output memoryUtilization string = 'b9b57564-3603-4d27-8e0c-a853ef0d60b9' -output otherDb string = '551122ff-2fea-53a8-b7f4-6d6dae85af6a' -output pswlessDbEnd string = '7e7aaa5b-2251-55b5-8b3d-43d514738cf2' -output pswlessDbStart string = '089e9783-6707-54d0-ac8c-9b8d517914c5' -output sslEnd string = 'fd285d8c-8d24-5d4e-b9f9-81f252ebfc6d' -output sslStart string = 'eb67405c-3276-53bb-b1bc-db6dad811d71' -output wlsAKSEnd string = '17328b4d-841f-57b5-a9c5-861ad48f9d0d' -output wlsAKSStart string = 'c46a11b1-e8d2-5053-9741-45294b2e15c9' -output wlsClusterAppEnd string = '18121d1c-4227-51ff-a9fa-ceb890d683e3' -output wlsClusterAppStart string = '4218fc54-4b9b-5e5c-b6a9-bc8736c25b68' diff --git a/weblogic-azure-aks/src/main/bicep/modules/_pids/_pid.bicep b/weblogic-azure-aks/src/main/bicep/modules/_pids/_pid.bicep deleted file mode 100644 index b86bae86f..000000000 --- a/weblogic-azure-aks/src/main/bicep/modules/_pids/_pid.bicep +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) 2021, 2024, Oracle Corporation and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -// Deployment for pids. - -param name string = 'pid' - -// create a pid deployment if there is a specified name -module pidStart './_empty.bicep' = if (name != 'pid'){ - name: name -} - -output appgwEnd string = '47ea43a0-95cf-52c7-aee8-7ee6106fc1bf' -output appgwStart string = '01288010-2672-5831-a66b-7b8b45cace1b' -output autoScalingEnd string = 'fff261b8-f09f-4c46-b7b7-923c239f1da5' -output autoScalingStart string = '94fd65ac-bb13-475d-aba7-3352288777c2' -output customCertForAppgw string = 'b80f52c3-dddd-5286-915e-e4cc64be3093' -output cpuUtilization string = 'deb6b656-aa63-4014-a686-6a01e8f87fec' -output dbEnd string = 'd7a9c78e-39d9-5a47-928d-8645ed86dafd' -output dbStart string = '0cc86800-37f4-5191-9368-2953394309ec' -output dnsEnd string = '754e16bc-4d81-5343-b99b-7532abd6587d' -output dnsStart string = '64ae895c-feb3-529e-8435-5d2e49f94e09' -output enableWlsMonitoringExporter string = '5e607302-2e52-42c4-8f02-29db35e3ddf1' -output lbEnd string = 'ce664543-77bd-515a-832e-107e32f99da9' -output lbStart string = '44732bbc-04c4-5df7-a0c6-b9be9ec00ee6' -output networkingEnd string = '2798165c-49fa-5701-b608-b80ed3986176' -output networkingStart string = '0793308f-de9d-5f0d-92f9-d9fc4b413b8b' -output memoryUtilization string = 'd1c2d027-f030-4a18-8e74-d608dd10c6f3' -output otherDb string = 'fceccc86-531c-5e44-99fd-9f1250f8e409' -output pswlessDbEnd string = '972084b9-2b2d-5eb9-aa37-80448a77fbe1' -output pswlessDbStart string = '7190b263-7825-5ae3-bc56-7294df936d4a' -output sslEnd string = '6738fb2b-4383-520e-bf8a-b4e00162b692' -output sslStart string = '29953382-5f6a-5bcf-9453-0bb82475951c' -output wlsAKSEnd string = '2571f846-2f66-5c22-9fe6-38ecea7889ac' -output wlsAKSStart string = '3e6acde5-9a62-5488-9fd4-87c46f4105f4' -output wlsClusterAppEnd string = 'e6e33240-e5db-52fc-9154-7fc7b3b8b508' -output wlsClusterAppStart string = '4570a81a-3f3a-53d5-b178-7f985d9c5ecf' diff --git a/weblogic-azure-aks/src/main/bicep/modules/_preDeployedAzureResources.bicep b/weblogic-azure-aks/src/main/bicep/modules/_preDeployedAzureResources.bicep deleted file mode 100644 index 0790d55a1..000000000 --- a/weblogic-azure-aks/src/main/bicep/modules/_preDeployedAzureResources.bicep +++ /dev/null @@ -1,24 +0,0 @@ -/* - Copyright (c) 2021, Oracle and/or its affiliates. -Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -*/ - -param acrName string = 'acr-contoso' -param acrResourceGroupName string = 'acr-contoso-rg' -param createNewAcr bool = false -@description('${label.tagsLabel}') -param tagsByResource object - -param location string - -module acrDeployment './_azure-resoruces/_acr.bicep' = if (createNewAcr) { - name: 'acr-deployment' - params: { - acrName: acrName - location: location - tagsByResource: tagsByResource - } -} - -output acrName string = createNewAcr ? acrDeployment.outputs.acrName : acrName -output acrResourceGroupName string = createNewAcr ? resourceGroup().name : acrResourceGroupName diff --git a/weblogic-azure-aks/src/main/bicep/modules/_rolesAssignment/_agicRoleAssignment.bicep b/weblogic-azure-aks/src/main/bicep/modules/_rolesAssignment/_agicRoleAssignment.bicep deleted file mode 100644 index 85f56df12..000000000 --- a/weblogic-azure-aks/src/main/bicep/modules/_rolesAssignment/_agicRoleAssignment.bicep +++ /dev/null @@ -1,31 +0,0 @@ -/* - Copyright (c) 2021, Oracle and/or its affiliates. -Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -*/ - -param aksClusterName string -param aksClusterRGName string -param utcValue string = utcNow() - -var const_APIVersion = '2020-12-01' -var name_appGwContributorRoleAssignmentName = guid('${resourceGroup().id}${uniqueString(utcValue)}ForApplicationGateway') -// https://docs.microsoft.com/en-us/azure/role-based-access-control/built-in-roles -var const_roleDefinitionIdOfContributor = 'b24988ac-6180-42a0-ab88-20f7382dd24c' - -resource aksCluster 'Microsoft.ContainerService/managedClusters@${azure.apiVersionForManagedClusters}' existing = { - name: aksClusterName - scope: resourceGroup(aksClusterRGName) -} - -resource agicUamiRoleAssignment 'Microsoft.Authorization/roleAssignments@${azure.apiVersionForRoleAssignment}' = { - name: name_appGwContributorRoleAssignmentName - properties: { - description: 'Assign Resource Group Contributor role to User Assigned Managed Identity ' - principalId: reference(aksCluster.id, const_APIVersion , 'Full').properties.addonProfiles.ingressApplicationGateway.identity.objectId - principalType: 'ServicePrincipal' - roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', const_roleDefinitionIdOfContributor) - } - dependsOn: [ - aksCluster - ] -} diff --git a/weblogic-azure-aks/src/main/bicep/modules/_rolesAssignment/_aksClusterMioRoleOverDbIdentity.bicep b/weblogic-azure-aks/src/main/bicep/modules/_rolesAssignment/_aksClusterMioRoleOverDbIdentity.bicep deleted file mode 100644 index 514d47094..000000000 --- a/weblogic-azure-aks/src/main/bicep/modules/_rolesAssignment/_aksClusterMioRoleOverDbIdentity.bicep +++ /dev/null @@ -1,34 +0,0 @@ -/* - Copyright (c) 2021, Oracle and/or its affiliates. -Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -*/ - -param clusterIdentityPrincipalId string = '' -param dbIdentityName string = '' - -// https://docs.microsoft.com/en-us/azure/role-based-access-control/built-in-roles -var const_roleDefinitionIdOfManagedIdentityOperator = 'f1a07417-d97a-45cb-824c-7a7467783830' -var name_roleAssignmentName = guid('${subscription().id}${clusterIdentityPrincipalId}Role assignment in resource scope') - -resource dbIdentityResource 'Microsoft.ManagedIdentity/userAssignedIdentities@${azure.apiVersionForIdentity}' existing = { - name: dbIdentityName -} - -// Get role resource id -resource roleResourceDefinition 'Microsoft.Authorization/roleDefinitions@${azure.apiVersionForRoleDefinitions}' existing = { - name: const_roleDefinitionIdOfManagedIdentityOperator -} - -// Assign role -resource roleAssignment 'Microsoft.Authorization/roleAssignments@${azure.apiVersionForRoleAssignment}' = { - name: name_roleAssignmentName - scope: dbIdentityResource - properties: { - description: 'Assign Managed Identity Operator role to AKS Cluster over DB Identity ' - principalId: clusterIdentityPrincipalId - principalType: 'ServicePrincipal' - roleDefinitionId: roleResourceDefinition.id - } -} - -output roleId string = roleResourceDefinition.id diff --git a/weblogic-azure-aks/src/main/bicep/modules/_rolesAssignment/_roleAssignmentinRgScope.bicep b/weblogic-azure-aks/src/main/bicep/modules/_rolesAssignment/_roleAssignmentinRgScope.bicep deleted file mode 100644 index f5b50c20d..000000000 --- a/weblogic-azure-aks/src/main/bicep/modules/_rolesAssignment/_roleAssignmentinRgScope.bicep +++ /dev/null @@ -1,43 +0,0 @@ -/* - Copyright (c) 2021, Oracle and/or its affiliates. -Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -*/ - -/* -Description: assign roles cross resource group. -Usage: - module roleAssignment '_roleAssignmentinRgScope.bicep' = { - name: 'assign-role' - scope: resourceGroup( 0 -var ref_networkDeployment = _enableAppGWIngress ? networkingDeploymentYesAppGW : networkingDeploymentNoAppGW - -module pidNetworkingStart './_pids/_pid.bicep' = { - name: 'pid-networking-start-deployment' - params: { - name: _pidNetworkingStart - } -} - -module pidLbStart './_pids/_pid.bicep' = if (const_enableLbService) { - name: 'pid-loadbalancer-service-start-deployment' - params: { - name: _pidLbStart - } -} - -module pidDnsStart './_pids/_pid.bicep' = if (enableDNSConfiguration) { - name: 'pid-dns-start-deployment' - params: { - name: _pidDnsStart - } -} - -module dnsZoneDeployment '_azure-resoruces/_dnsZones.bicep' = if (enableDNSConfiguration && createDNSZone) { - name: 'dnszone-deployment' - params: { - dnszoneName: dnszoneName - tagsByResource: tagsByResource - } - dependsOn: [ - pidNetworkingStart - pidDnsStart - ] -} - -module installAgic '_deployment-scripts/_ds_install_agic.bicep' = if (enableAppGWIngress) { - name: 'install-agic' - params: { - _globalResourceNameSuffix: _globalResourceNameSuffix - location: location - identity: identity - aksClusterRGName: aksClusterRGName - appgwName: appGatewayName - aksClusterName: aksClusterName - azCliVersion: azCliVersion - tagsByResource: tagsByResource - } - dependsOn: [ - pidNetworkingStart - ] -} - -module agicRoleAssignment '_rolesAssignment/_agicRoleAssignment.bicep' = if (enableAppGWIngress) { - name: 'allow-agic-access-current-resource-group' - params: { - aksClusterName: aksClusterName - aksClusterRGName: aksClusterRGName - } - dependsOn: [ - installAgic - ] -} - -module validateAgic '_deployment-scripts/_ds_validate_agic.bicep' = if (enableAppGWIngress) { - name: 'validate-agic' - params: { - _globalResourceNameSuffix: _globalResourceNameSuffix - location: location - identity: identity - aksClusterRGName: aksClusterRGName - aksClusterName: aksClusterName - azCliVersion: azCliVersion - tagsByResource: tagsByResource - } - dependsOn: [ - agicRoleAssignment - ] -} - -module networkingDeploymentYesAppGW '_deployment-scripts/_ds-create-networking.bicep' = if (enableAppGWIngress) { - name: 'ds-networking-deployment-yes-appgw' - params: { - _artifactsLocation: _artifactsLocation - _artifactsLocationSasToken: _artifactsLocationSasToken - _globalResourceNameSuffix: _globalResourceNameSuffix - appgwName: appGatewayName - appgwAlias: appGatewayAlias - appgwForAdminServer: appgwForAdminServer - appgwForRemoteConsole: appgwForRemoteConsole - appgwSslCert: appGatewaySslCert - appgwTrustedRootCert: appGatewayTrustedRootCert - appgwUsePrivateIP: appgwUsePrivateIP - aksClusterRGName: aksClusterRGName - aksClusterName: aksClusterName - azCliVersion: azCliVersion - createAKSCluster: createAKSCluster - dnszoneAdminConsoleLabel: dnszoneAdminConsoleLabel - dnszoneAdminT3ChannelLabel: dnszoneAdminT3ChannelLabel - dnszoneClusterLabel: dnszoneClusterLabel - dnszoneClusterT3ChannelLabel: dnszoneClusterT3ChannelLabel - dnszoneName: dnszoneName - dnszoneRGName: createDNSZone ? resourceGroup().name : dnszoneRGName - enableAppGWIngress: enableAppGWIngress - enableCookieBasedAffinity: enableCookieBasedAffinity - enableCustomSSL: enableCustomSSL - enableDNSConfiguration: enableDNSConfiguration - identity: identity - lbSvcValues: lbSvcValues - location: location - tagsByResource: tagsByResource - useInternalLB: useInternalLB - wlsDomainName: wlsDomainName - wlsDomainUID: wlsDomainUID - } - dependsOn: [ - dnsZoneDeployment - validateAgic - ] -} - -module networkingDeploymentNoAppGW '_deployment-scripts/_ds-create-networking.bicep' = if (!enableAppGWIngress) { - name: 'ds-networking-deployment-no-appgw' - params: { - _artifactsLocation: _artifactsLocation - _artifactsLocationSasToken: _artifactsLocationSasToken - _globalResourceNameSuffix: _globalResourceNameSuffix - appgwName: 'null' - appgwAlias: 'null' - appgwForAdminServer: appgwForAdminServer - appgwForRemoteConsole: appgwForRemoteConsole - appgwSslCert: appGatewaySslCert - appgwTrustedRootCert: appGatewayTrustedRootCert - appgwUsePrivateIP: appgwUsePrivateIP - aksClusterRGName: aksClusterRGName - aksClusterName: aksClusterName - azCliVersion: azCliVersion - createAKSCluster: createAKSCluster - dnszoneAdminConsoleLabel: dnszoneAdminConsoleLabel - dnszoneAdminT3ChannelLabel: dnszoneAdminT3ChannelLabel - dnszoneClusterLabel: dnszoneClusterLabel - dnszoneClusterT3ChannelLabel: dnszoneClusterT3ChannelLabel - dnszoneName: dnszoneName - dnszoneRGName: createDNSZone ? resourceGroup().name : dnszoneRGName - enableAppGWIngress: enableAppGWIngress - enableCookieBasedAffinity: enableCookieBasedAffinity - enableCustomSSL: enableCustomSSL - enableDNSConfiguration: enableDNSConfiguration - identity: identity - lbSvcValues: lbSvcValues - location: location - tagsByResource: tagsByResource - useInternalLB: useInternalLB - wlsDomainName: wlsDomainName - wlsDomainUID: wlsDomainUID - } - dependsOn: [ - dnsZoneDeployment - validateAgic - ] -} - -module pidLbEnd './_pids/_pid.bicep' = if (const_enableLbService) { - name: 'pid-loadbalancer-service-end-deployment' - params: { - name: _pidLbEnd - } - dependsOn: [ - networkingDeploymentYesAppGW - networkingDeploymentNoAppGW - ] -} - -module pidDnsEnd './_pids/_pid.bicep' = if (enableDNSConfiguration) { - name: 'pid-dns-end-deployment' - params: { - name: _pidDnsEnd - } - dependsOn: [ - networkingDeploymentYesAppGW - networkingDeploymentNoAppGW - ] -} - -module pidNetworkingEnd './_pids/_pid.bicep' = { - name: 'pid-networking-end-deployment' - params: { - name: _pidNetworkingEnd - } - dependsOn: [ - pidLbEnd - pidDnsEnd - ] -} - -output adminConsoleExternalEndpoint string = enableAppGWIngress ? (enableDNSConfiguration ? format('http://{0}console', const_appgwAdminCustomDNSAlias) : format('http://{0}/console', appGatewayAlias)) : ref_networkDeployment.outputs.adminConsoleLBEndpoint -output adminConsoleExternalSecuredEndpoint string = enableAppGWIngress && enableCustomSSL && enableDNSConfiguration ? format('https://{0}console', const_appgwAdminCustomDNSAlias) : ref_networkDeployment.outputs.adminConsoleLBSecuredEndpoint -output adminRemoteConsoleEndpoint string = enableAppGWIngress ? (enableDNSConfiguration ? format('http://{0}remoteconsole', const_appgwAdminCustomDNSAlias) : format('http://{0}/remoteconsole', appGatewayAlias)) : ref_networkDeployment.outputs.adminRemoteEndpoint -output adminRemoteConsoleSecuredEndpoint string = enableAppGWIngress && enableCustomSSL && enableDNSConfiguration ? format('https://{0}remoteconsole', const_appgwAdminCustomDNSAlias) : ref_networkDeployment.outputs.adminRemoteSecuredEndpoint -output adminServerT3ChannelEndpoint string = format('{0}://{1}', enableCustomSSL ? 't3s' : 't3', ref_networkDeployment.outputs.adminServerT3LBEndpoint) -output clusterExternalEndpoint string = enableAppGWIngress ? (enableDNSConfiguration ? format('http://{0}', const_appgwCustomDNSAlias) : appGatewayURL) : ref_networkDeployment.outputs.clusterLBEndpoint -output clusterExternalSecuredEndpoint string = enableAppGWIngress ? (enableDNSConfiguration ? format('https://{0}', const_appgwCustomDNSAlias) : appGatewaySecuredURL) : ref_networkDeployment.outputs.clusterLBSecuredEndpoint -output clusterT3ChannelEndpoint string = format('{0}://{1}', enableCustomSSL ? 't3s' : 't3', ref_networkDeployment.outputs.clusterT3LBEndpoint) diff --git a/weblogic-azure-aks/src/main/bicep/modules/setupDBConnection.bicep b/weblogic-azure-aks/src/main/bicep/modules/setupDBConnection.bicep deleted file mode 100644 index d2857cc74..000000000 --- a/weblogic-azure-aks/src/main/bicep/modules/setupDBConnection.bicep +++ /dev/null @@ -1,132 +0,0 @@ -/* - Copyright (c) 2021, Oracle and/or its affiliates. -Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -Description - - This script is to confige DB connection in an existing WebLogic Cluster. - -Pre-requisites - - There is at least one WebLogic cluster running on Azure Kubernetes Service (AKS), the cluster must be deployed using Azure WebLoigc on AKS marketplace offer. - - Azure CLI with bicep installed. - -Parameters - - _artifactsLocation: Script location. - - aksClusterName: Name of the AKS instance that runs the WebLogic cluster. - - databaseType: One of the supported database types. - - dbConfigurationType: 'createOrUpdate' or 'delete' - - createOrUpdate: create a new data source connection, or update an existing data source connection. - - delete: delete an existing data source connection - - dbPassword: Password for Database - - dbGlobalTranPro: Determines the transaction protocol (global transaction processing behavior) for the data source.. - - dbUser: User id of Database - - dsConnectionURL: JDBC Connection String - - identity: Azure user managed identity used, make sure the identity has permission to create/update/delete Azure resources. It's recommended to assign "Contributor" role. - - jdbcDataSourceName: JNDI Name for JDBC Datasource. - - wlsDomainUID: UID of the domain that you are going to update. Make sure it's the same with the initial cluster deployment. - -Build and run - - Run command `bicep build setupDBConnection.bicep`, you will get built ARM template setupDBConnection.json. - - Prepare parameters file parameters.json - - Run command `az deployment group create -f setupDBConnection.json -p parameters.json -g ` -*/ - -param _artifactsLocation string = 'https://raw.githubusercontent.com/oracle/weblogic-azure/main/weblogic-azure-aks/src/main/arm/' -@secure() -param _artifactsLocationSasToken string = '' - -@description('Name of an existing AKS cluster.') -param aksClusterName string = '' -@allowed([ - 'oracle' - 'postgresql' - 'sqlserver' - 'mysql' - 'otherdb' -]) -@description('One of the supported database types') -param databaseType string = 'oracle' -@allowed([ - 'createOrUpdate' - 'delete' -]) -@description('createOrUpdate: create a new data source connection, or update an existing data source connection. delete: delete an existing data source connection') -param dbConfigurationType string = 'createOrUpdate' -@description('Determines the transaction protocol (global transaction processing behavior) for the data source.') -param dbGlobalTranPro string = 'EmulateTwoPhaseCommit' -@secure() -@description('Password for Database') -param dbPassword string = newGuid() -@description('User id of Database') -param dbUser string = 'contosoDbUser' -@description('JDBC Connection String') -param dsConnectionURL string = 'jdbc:postgresql://contoso.postgres.database.azure.com:5432/postgres' - -param identity object = {} - -@description('JNDI Name for JDBC Datasource') -param jdbcDataSourceName string = 'jdbc/contoso' -@description('tags for the resources') -param tagsByResource object = {} -param utcValue string = utcNow() -@description('UID of WebLogic domain, used in WebLogic Operator.') -param wlsDomainUID string = 'sample-domain1' -@secure() -param wlsPassword string -@description('User name for WebLogic Administrator.') -param wlsUserName string = 'weblogic' - -// This template is used for post deployment, hard code the CLI version with a variable. -var const_azCliVersion = '2.33.1' -var _objTagsByResource = { - 'Microsoft.Monitor/accounts': contains(tagsByResource, 'Microsoft.Monitor/accounts') ? tagsByResource['Microsoft.Monitor/accounts'] : json('{}') - 'Microsoft.ContainerService/managedClusters': contains(tagsByResource, 'Microsoft.ContainerService/managedClusters') ? tagsByResource['Microsoft.ContainerService/managedClusters'] : json('{}') - 'Microsoft.Network/applicationGateways': contains(tagsByResource, 'Microsoft.Network/applicationGateways') ? tagsByResource['Microsoft.Network/applicationGateways'] : json('{}') - 'Microsoft.ContainerRegistry/registries': contains(tagsByResource, 'Microsoft.ContainerRegistry/registries') ? tagsByResource['Microsoft.ContainerRegistry/registries'] : json('{}') - 'Microsoft.Compute/virtualMachines': contains(tagsByResource, 'Microsoft.Compute/virtualMachines') ? tagsByResource['Microsoft.Compute/virtualMachines'] : json('{}') - 'Virtual machine extension': contains(tagsByResource, 'Virtual machine extension') ? tagsByResource['Virtual machine extension'] : json('{}') - 'Microsoft.Network/virtualNetworks': contains(tagsByResource, 'Microsoft.Network/virtualNetworks') ? tagsByResource['Microsoft.Network/virtualNetworks'] : json('{}') - 'Microsoft.Network/networkInterfaces': contains(tagsByResource, 'Microsoft.Network/networkInterfaces') ? tagsByResource['Microsoft.Network/networkInterfaces'] : json('{}') - 'Microsoft.Network/networkSecurityGroups': contains(tagsByResource, 'Microsoft.Network/networkSecurityGroups') ? tagsByResource['Microsoft.Network/networkSecurityGroups'] : json('{}') - 'Microsoft.Network/publicIPAddresses': contains(tagsByResource, 'Microsoft.Network/publicIPAddresses') ? tagsByResource['Microsoft.Network/publicIPAddresses'] : json('{}') - 'Microsoft.Storage/storageAccounts': contains(tagsByResource, 'Microsoft.Storage/storageAccounts') ? tagsByResource['Microsoft.Storage/storageAccounts'] : json('{}') - 'Microsoft.KeyVault/vaults': contains(tagsByResource, 'Microsoft.KeyVault/vaults') ? tagsByResource['Microsoft.KeyVault/vaults'] : json('{}') - 'Microsoft.ManagedIdentity/userAssignedIdentities': contains(tagsByResource, 'Microsoft.ManagedIdentity/userAssignedIdentities') ? tagsByResource['Microsoft.ManagedIdentity/userAssignedIdentities'] : json('{}') - 'Microsoft.Network/dnszones': contains(tagsByResource, 'Microsoft.Network/dnszones') ? tagsByResource['Microsoft.Network/dnszones'] : json('{}') - 'Microsoft.OperationalInsights/workspaces': contains(tagsByResource, 'Microsoft.OperationalInsights/workspaces') ? tagsByResource['Microsoft.OperationalInsights/workspaces'] : json('{}') - 'Microsoft.Resources/deploymentScripts': contains(tagsByResource, 'Microsoft.Resources/deploymentScripts') ? tagsByResource['Microsoft.Resources/deploymentScripts'] : json('{}') -} - -module pids './_pids/_pid.bicep' = { - name: 'initialization' -} - -module configDataSource './_setupDBConnection.bicep' = { - name: 'create-update-delete-datasource' - params:{ - _pidEnd: pids.outputs.dbEnd - _pidOtherDb: pids.outputs.otherDb - _pidStart: pids.outputs.dbStart - _artifactsLocation: _artifactsLocation - _artifactsLocationSasToken: _artifactsLocationSasToken - _globalResourceNameSuffix: uniqueString(utcValue) - aksClusterName: aksClusterName - aksClusterRGName: resourceGroup().name - azCliVersion: const_azCliVersion - databaseType: databaseType - dbConfigurationType: dbConfigurationType - dbGlobalTranPro: dbGlobalTranPro - dbPassword: dbPassword - dbUser: dbUser - dsConnectionURL: dsConnectionURL - identity: identity - jdbcDataSourceName: jdbcDataSourceName - location: resourceGroup().location - tagsByResource: _objTagsByResource - wlsDomainUID: wlsDomainUID - wlsPassword: wlsPassword - wlsUserName: wlsUserName - } - dependsOn:[ - pids - ] -} diff --git a/weblogic-azure-aks/src/main/bicep/modules/setupWebLogicCluster.bicep b/weblogic-azure-aks/src/main/bicep/modules/setupWebLogicCluster.bicep deleted file mode 100644 index ec0325055..000000000 --- a/weblogic-azure-aks/src/main/bicep/modules/setupWebLogicCluster.bicep +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright (c) 2021, 2024, Oracle Corporation and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -/* -* The script is to create a simple WLS cluster, including: -* Create Azure resources: -* - Azure Kubenetes Cluster Service instance -* - Azure Container Registry instance -* - Azure Storage Account and file share -* - Azure Container Insight -* Initialize WebLogic cluster: -* - Build WebLogic domain image and push to ACR. -* - Install WebLogic Operator -* - Create WebLogic cluster and make sure the servers are running -*/ - -param _artifactsLocation string = deployment().properties.templateLink.uri -@secure() -param _artifactsLocationSasToken string = '' -param _pidEnd string = 'pid-wls-end' -param _pidStart string = 'pid-wls-start' -param _pidSSLEnd string = 'pid-ssl-end' -param _pidSSLStart string = 'pid-ssl-start' -param _globalResourceNameSuffix string -@description('true to use resource or workspace permissions. false to require workspace permissions.') -param aciResourcePermissions bool = true -@description('Number of days to retain data in Azure Monitor workspace.') -param aciRetentionInDays int = 120 -@description('Pricing tier: PerGB2018 or legacy tiers (Free, Standalone, PerNode, Standard or Premium) which are not available to all customers.') -param aciWorkspaceSku string = 'pergb2018' -param acrName string = '' -param acrResourceGroupName string = '' -param aksAgentAvailabilityZones array = [] -@maxLength(12) -@minLength(1) -@description('The name for this node pool. Node pool must contain only lowercase letters and numbers. For Linux node pools the name cannot be longer than 12 characters.') -param aksAgentPoolName string = 'agentpool' -@maxValue(10000) -@minValue(1) -@description('Set the minimum node count for the cluster..') -param aksAgentPoolNodeCount int = 3 -@maxValue(1000) -@minValue(3) -@description('Set the maximum node count for the cluster.') -param aksAgentPoolNodeMaxCount int = 5 -@description('The size of the virtual machines that will form the nodes in the cluster. This cannot be changed after creating the cluster') -param vmSize string = 'Standard_DS2_v2' -@description('Resource group name of an existing AKS cluster.') -param aksClusterRGName string = '' -@description('Name of an existing AKS cluster.') -param aksClusterName string = '' -@description('The AKS version.') -param aksVersion string = 'default' -@description('Urls of Java EE application packages.') -param appPackageUrls array = [] -@description('The number of managed server to start.') -param appReplicas int = 2 -param azCliVersion string = '' -param cpuPlatform string = 'linux/amd64' -@description('true to create a new AKS cluster.') -param createAKSCluster bool = true -param databaseType string = 'oracle' -param dbDriverLibrariesUrls array = [] -@description('In addition to the CPU and memory metrics included in AKS by default, you can enable Container Insights for more comprehensive data on the overall performance and health of your cluster. Billing is based on data ingestion and retention settings.') -param enableAzureMonitoring bool = false -@description('true to create persistent volume using file share.') -param enableCustomSSL bool = false -param enableAdminT3Tunneling bool = false -param enableClusterT3Tunneling bool = false -param enablePswlessConnection bool = false -param enablePV bool = false -param fileShareName string = '' -@description('An user assigned managed identity. Make sure the identity has permission to create/update/delete/list Azure resources.') -param identity object = {} -param isSSOSupportEntitled bool -param location string -@description('Name prefix of managed server.') -param managedServerPrefix string = 'managed-server' -@secure() -@description('Password of Oracle SSO account.') -param ocrSSOPSW string -@description('User name of Oracle SSO account.') -param ocrSSOUser string -param storageAccountName string = 'stg-contoso' -param t3ChannelAdminPort int = 7005 -param t3ChannelClusterPort int = 8011 -@description('${label.tagsLabel}') -param tagsByResource object -param userProvidedAcr string = 'null' -param userProvidedAcrRgName string = 'null' -param userProvidedImagePath string = 'null' -param useOracleImage bool = true -@secure() -@description('Password for model WebLogic Deploy Tooling runtime encrytion.') -param wdtRuntimePassword string -@description('Maximum cluster size.') -param wlsClusterSize int = 5 -@description('Requests for CPU resources for admin server and managed server.') -param wlsCPU string = '200m' -@description('Name of WebLogic domain to create.') -param wlsDomainName string = 'domain1' -@description('UID of WebLogic domain, used in WebLogic Operator.') -param wlsDomainUID string = 'sample-domain1' -@secure() -param wlsIdentityKeyStoreData string = newGuid() -@secure() -param wlsIdentityKeyStorePassphrase string = newGuid() -@allowed([ - 'JKS' - 'PKCS12' -]) -param wlsIdentityKeyStoreType string = 'PKCS12' -@description('Docker tag that comes after "container-registry.oracle.com/middleware/weblogic:"') -param wlsImageTag string = '12.2.1.4' -param wlsJavaOption string = 'null' -@description('Memory requests for admin server and managed server.') -param wlsMemory string = '1.5Gi' -@secure() -param wlsPassword string -@secure() -param wlsPrivateKeyAlias string = newGuid() -@secure() -param wlsPrivateKeyPassPhrase string = newGuid() -@secure() -param wlsTrustKeyStoreData string = newGuid() -@secure() -param wlsTrustKeyStorePassPhrase string = newGuid() -@allowed([ - 'JKS' - 'PKCS12' -]) -param wlsTrustKeyStoreType string = 'PKCS12' -@description('User name for WebLogic Administrator.') -param wlsUserName string = 'weblogic' -/* -* Deploy a pid to tract an offer deployment starts -*/ -module pidStart './_pids/_pid.bicep' = { - name: 'wls-aks-start-pid-deployment' - params: { - name: _pidStart - } -} - -module pidSSLStart './_pids/_pid.bicep' = if (enableCustomSSL) { - name: 'wls-ssl-start-pid-deployment' - params: { - name: _pidSSLStart - } -} - -resource existingAKSCluster 'Microsoft.ContainerService/managedClusters@${azure.apiVersionForManagedClusters}' existing = if (!createAKSCluster) { - name: aksClusterName - scope: resourceGroup(aksClusterRGName) -} - -/* -* Deploy AKS cluster -*/ -module aksClusterDeployment './_azure-resoruces/_aks.bicep' = if (createAKSCluster) { - name: 'aks-cluster-deployment' - params: { - aciResourcePermissions: aciResourcePermissions - aciRetentionInDays: aciRetentionInDays - aciWorkspaceSku: aciWorkspaceSku - agentAvailabilityZones: aksAgentAvailabilityZones - aksAgentPoolName: aksAgentPoolName - aksAgentPoolNodeCount: aksAgentPoolNodeCount - aksAgentPoolNodeMaxCount: aksAgentPoolNodeMaxCount - aksAgentPoolVMSize: vmSize - aksClusterName: aksClusterName - aksVersion: aksVersion - enableAzureMonitoring: enableAzureMonitoring - location: location - tagsByResource: tagsByResource - } - dependsOn: [ - pidStart - ] -} - -// enableAppGWIngress: if true, will create storage for certificates. -module storageDeployment './_azure-resoruces/_storage.bicep' = { - name: 'storage-deployment' - params: { - fileShareName: fileShareName - location: location - storageAccountName: storageAccountName - tagsByResource: tagsByResource - } - dependsOn: [ - pidStart - ] -} - -/* -* Deploy WLS domain -*/ -module wlsDomainDeployment './_deployment-scripts/_ds-create-wls-cluster.bicep' = { - name: 'wls-domain-deployment' - params: { - _artifactsLocation: _artifactsLocation - _artifactsLocationSasToken: _artifactsLocationSasToken - _globalResourceNameSuffix: _globalResourceNameSuffix - aksClusterRGName: createAKSCluster ? resourceGroup().name : aksClusterRGName - aksClusterName: aksClusterName - acrName: useOracleImage ? acrName : userProvidedAcr - acrResourceGroupName: useOracleImage ? acrResourceGroupName : userProvidedAcrRgName - appPackageUrls: appPackageUrls - appReplicas: appReplicas - azCliVersion: azCliVersion - cpuPlatform: cpuPlatform - databaseType: databaseType - dbDriverLibrariesUrls: dbDriverLibrariesUrls - enableCustomSSL: enableCustomSSL - enableAdminT3Tunneling: enableAdminT3Tunneling - enableClusterT3Tunneling: enableClusterT3Tunneling - enablePswlessConnection: enablePswlessConnection - enablePV: enablePV - fileShareName: fileShareName - identity: identity - isSSOSupportEntitled: isSSOSupportEntitled - location: location - managedServerPrefix: managedServerPrefix - ocrSSOUser: ocrSSOUser - ocrSSOPSW: ocrSSOPSW - storageAccountName: storageAccountName - t3ChannelAdminPort: t3ChannelAdminPort - t3ChannelClusterPort: t3ChannelClusterPort - tagsByResource: tagsByResource - userProvidedImagePath: userProvidedImagePath - useOracleImage: useOracleImage - wdtRuntimePassword: wdtRuntimePassword - wlsClusterSize: wlsClusterSize - wlsCPU: wlsCPU - wlsDomainName: wlsDomainName - wlsDomainUID: wlsDomainUID - wlsIdentityKeyStoreData: wlsIdentityKeyStoreData - wlsIdentityKeyStorePassphrase: wlsIdentityKeyStorePassphrase - wlsIdentityKeyStoreType: wlsIdentityKeyStoreType - wlsImageTag: wlsImageTag - wlsJavaOption: wlsJavaOption - wlsMemory: wlsMemory - wlsPassword: wlsPassword - wlsPrivateKeyAlias: wlsPrivateKeyAlias - wlsPrivateKeyPassPhrase: wlsPrivateKeyPassPhrase - wlsTrustKeyStoreData: wlsTrustKeyStoreData - wlsTrustKeyStorePassPhrase: wlsTrustKeyStorePassPhrase - wlsTrustKeyStoreType: wlsTrustKeyStoreType - wlsUserName: wlsUserName - } - dependsOn: [ - aksClusterDeployment - storageDeployment - ] -} - -module pidSSLEnd './_pids/_pid.bicep' = if (enableCustomSSL) { - name: 'wls-ssl-end-pid-deployment' - params: { - name: _pidSSLEnd - } - dependsOn: [ - wlsDomainDeployment - ] -} - -/* -* Deploy a pid to tract an offer deployment ends -* Make sure all the dependencies added to dependsOn array -*/ -module pidEnd './_pids/_pid.bicep' = { - name: 'wls-aks-end-pid-deployment' - params: { - name: _pidEnd - } - dependsOn: [ - wlsDomainDeployment - ] -} - -output aksClusterName string = aksClusterName -output aksClusterRGName string = createAKSCluster ? resourceGroup().name : aksClusterRGName -output aksNodeRgName string = createAKSCluster? aksClusterDeployment.outputs.aksNodeRgName : existingAKSCluster.properties.nodeResourceGroup -output adminServerEndPoint string = format('http://{0}-admin-server.{0}-ns.svc.cluster.local:7001/console', wlsDomainUID) -output adminServerT3InternalEndPoint string = enableAdminT3Tunneling ? format('{0}://{1}-admin-server.{1}-ns.svc.cluster.local:{2}', enableCustomSSL ? 't3s' : 't3', wlsDomainUID, t3ChannelAdminPort): '' -output clusterEndPoint string = format('http://{0}-cluster-cluster-1.{0}-ns.svc.cluster.local:8001/', wlsDomainUID) -output clusterT3InternalEndPoint string = enableClusterT3Tunneling ? format('{0}://{1}-cluster-cluster-1.{1}-ns.svc.cluster.local:{2}', enableCustomSSL ? 't3s' : 't3', wlsDomainUID, t3ChannelClusterPort): '' diff --git a/weblogic-azure-aks/src/main/bicep/modules/updateWebLogicApplications.bicep b/weblogic-azure-aks/src/main/bicep/modules/updateWebLogicApplications.bicep deleted file mode 100644 index c190e76d4..000000000 --- a/weblogic-azure-aks/src/main/bicep/modules/updateWebLogicApplications.bicep +++ /dev/null @@ -1,131 +0,0 @@ -/* - Copyright (c) 2021, Oracle and/or its affiliates. -Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -Description - - This script is to update applications running in an existing WebLogic Cluster. - - Application input can be customized using parameters appPackageUrls and appPackageFromStorageBlob. - -Pre-requisites - - There is at least one WebLogic cluster running on Azure Kubernetes Service (AKS), the cluster must be deployed using Azure WebLoigc on AKS marketplace offer. - - Azure CLI with bicep installed. - -Parameters - - _artifactsLocation: Script location. - - acrName: Name of Azure Container Registry that is used to managed the WebLogic domain images. - - aksClusterRGName: Name of resource group that contains the (AKS) instance, probably the resource group you are working on. It's recommended to run this sript with the same resource group that runs AKS. - - aksClusterName: Name of the AKS instance that runs the WebLogic cluster. - - appPackageUrls: String array of Java EE applciation location, which can be downloaded using "curl". Currently, only support urls of Azure Storage Account blob. - - appPackageFromStorageBlob: Storage blob that contains Java EE applciations, the script will download all the .war, .jar and .ear file from that blob. Do not include white space in the file name. - - storageAccountName: Storage account name. - - containerName: container name. - - identity: Azure user managed identity used, make sure the identity has permission to create/update/delete Azure resources. It's recommended to assign "Contributor" role. - - isSSOSupportEntitled: Is the specified SSO account associated with an active Oracle support contract? - - ocrSSOPSW: Password of Oracle SSO account. The script will pull image from Oracle Container Registry (OCR), Oracle account is required. Make sure the account has checkout WebLogic images. - - ocrSSOUser: User name of Oracle SSO account. - - wlsDomainName: Name of the domain that you are going to update. Make sure it's the same with the initial cluster deployment. - - wlsDomainUID: UID of the domain that you are going to update. Make sure it's the same with the initial cluster deployment. - - wlsImageTag: The available WebLogic docker image tags that OCR provides. - -Build and run - - Run command `bicep build updateWebLogicApplications.bicep`, you will get built ARM template updateWebLogicApplications.json. - - Prepare parameters file parameters.json - - Run command `az deployment group create -f updateWebLogicApplications.json -p parameters.json -g ` -*/ - -param _artifactsLocation string = 'https://raw.githubusercontent.com/oracle/weblogic-azure/main/weblogic-azure-aks/src/main/arm/' -@secure() -param _artifactsLocationSasToken string = '' - -param acrName string = '' -@description('Resource group name of an existing AKS cluster.') -param aksClusterRGName string = '' -@description('Name of an existing AKS cluster.') -param aksClusterName string = '' - -@description('Download all the .war .jar and .ear packages from the specified storage blob. You can specify the applciation using "appPackageUrls" and "appPackageFromStorageBlob", please do not specify the same applciation in both parameters.') -param appPackageFromStorageBlob object = { - storageAccountName: 'stg-contoso' - containerName: 'container-contoso' -} -@description('Url array of Java EE application locations.') -param appPackageUrls array = [] - -param identity object = {} - -@description('Is the specified SSO account associated with an active Oracle support contract?') -param isSSOSupportEntitled bool = false -@secure() -@description('Password of Oracle SSO account.') -param ocrSSOPSW string = 'null' -@description('User name of Oracle SSO account.') -param ocrSSOUser string = 'null' - -@description('Name of WebLogic domain to create.') -param wlsDomainName string = 'domain1' -@description('UID of WebLogic domain, used in WebLogic Operator.') -param wlsDomainUID string = 'sample-domain1' -@description('Docker tag that comes after "container-registry.oracle.com/middleware/weblogic:"') -param wlsImageTag string = '12.2.1.4' -@description('User provided ACR for base image') -param userProvidedAcr string = 'null' -@description('User provided base image path') -param userProvidedImagePath string = 'null' -@description('Use Oracle images or user provided patched images') -param useOracleImage bool = true - -var const_azCLIVersion = '2.33.1' - -module pids './_pids/_pid.bicep' = { - name: 'initialization' -} - -module pidStart './_pids/_pid.bicep' = { - name: 'wls-aks-update-app-start-pid-deployment' - params: { - name: pids.outputs.wlsClusterAppStart - } - dependsOn:[ - pids - ] -} - -module updateWLSApplications '_deployment-scripts/_ds_update-applications.bicep' = { - name: 'update-wls-applications' - params:{ - _artifactsLocation: _artifactsLocation - _artifactsLocationSasToken: _artifactsLocationSasToken - aksClusterRGName: aksClusterRGName - aksClusterName: aksClusterName - acrName: useOracleImage ? acrName : userProvidedAcr - appPackageUrls: appPackageUrls - appPackageFromStorageBlob: appPackageFromStorageBlob - azCliVersion: const_azCLIVersion - identity: identity - isSSOSupportEntitled: isSSOSupportEntitled - location: resourceGroup().location - ocrSSOPSW: ocrSSOPSW - ocrSSOUser: ocrSSOUser - wlsDomainName: wlsDomainName - wlsDomainUID: wlsDomainUID - wlsImageTag: wlsImageTag - userProvidedImagePath: userProvidedImagePath - useOracleImage: useOracleImage - } - dependsOn:[ - pidStart - ] -} - - -module pidEnd './_pids/_pid.bicep' = { - name: 'wls-aks-update-app-end-pid-deployment' - params: { - name: pids.outputs.wlsClusterAppEnd - } - dependsOn:[ - updateWLSApplications - ] -} - -output image string = updateWLSApplications.outputs.image diff --git a/weblogic-azure-aks/src/main/resources/aks_tooling_well_tested_versions.json b/weblogic-azure-aks/src/main/resources/aks_tooling_well_tested_versions.json deleted file mode 100644 index bb6f1efe6..000000000 --- a/weblogic-azure-aks/src/main/resources/aks_tooling_well_tested_versions.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "AKS toolings used in WebLogic on AKS offer", - "description": "The versions are known to work for all the features of Azure WebLogic on AKS offer.", - "items": [ - { - "key": "keda", - "description": "KEDA for autoscaling", - "version": "2.14.2", - "testedDate": "2024-05-07" - } - ] -} diff --git a/weblogic-azure-aks/src/main/resources/aks_well_tested_version.json b/weblogic-azure-aks/src/main/resources/aks_well_tested_version.json deleted file mode 100644 index 3b8c596c6..000000000 --- a/weblogic-azure-aks/src/main/resources/aks_well_tested_version.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "Known-good version of Azure Kubernetes Service", - "description": "This version is known to work for all the features of Azure WebLogic on AKS offer.", - "value": "1.30.7", - "testedDate": "2025-02-10" -} diff --git a/weblogic-azure-aks/src/main/resources/azure-identity-extensions.xml b/weblogic-azure-aks/src/main/resources/azure-identity-extensions.xml deleted file mode 100644 index e786947da..000000000 --- a/weblogic-azure-aks/src/main/resources/azure-identity-extensions.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - 4.0.0 - com.oracle.weblogic.azure - passwordless-db - 1.0-SNAPSHOT - jar - - 11 - 11 - - - - com.azure - azure-identity-extensions - 1.2.0 - - - \ No newline at end of file diff --git a/weblogic-azure-aks/src/main/resources/diagrams/wls-aks-diagram-autoscaling.vsdx b/weblogic-azure-aks/src/main/resources/diagrams/wls-aks-diagram-autoscaling.vsdx deleted file mode 100644 index 39ab6c68e..000000000 Binary files a/weblogic-azure-aks/src/main/resources/diagrams/wls-aks-diagram-autoscaling.vsdx and /dev/null differ diff --git a/weblogic-azure-aks/src/main/resources/marketing-artifacts/README.md b/weblogic-azure-aks/src/main/resources/marketing-artifacts/README.md deleted file mode 100644 index 10d2ba5fe..000000000 --- a/weblogic-azure-aks/src/main/resources/marketing-artifacts/README.md +++ /dev/null @@ -1,53 +0,0 @@ -

    Offer listing

    - -

    Name

    - -Oracle WebLogic Server on the Azure Kubernetes Service - -

    Oracle WebLogic Server is a scalable, enterprise-ready Java application server.

    - -

    Description

    - -

    The Oracle WebLogic Server (WLS) on Azure Kubernetes Service (AKS) offer lets you embrace cloud computing by providing greater choice and flexibility for WLS migration. The offer enables you to move WLS workloads to AKS as quickly and easily as possible by automating the provisioning of a number of Java and Azure resources. The automatically provisioned resources include an AKS cluster, the WebLogic Kubernetes Operator, WLS Docker images and the Azure Container Registry (ACR). It is possible to use an existing AKS cluster or ACR instance with the offer if desired. The offer also supports configuring load balancing with Azure App Gateway or the Azure Load Balancer, DNS configuration, SSL/TLS configuration, easing database connectivity, publishing metrics to Azure Monitor as well as mounting Azure Files as Kubernetes Persistent Volumes. After the offer performs most boilerplate resource provisioning and configuration, you can focus on deploying your WLS application to AKS, typically through a DevOps tool such as GitHub Actions and tools from the WebLogic Kubernetes ToolKit such as the WebLogic Image Tool and WebLogic Deploy Tooling. You are also completely free to customize the deployment further.

    - -

    This offer is Bring-Your-Own-License. It assumes you have already procured the appropriate licenses with Oracle and are properly licensed to run offers in Microsoft Azure.

    - -

    If you want to provide feedback on this offer, stay updated on the roadmap, or work closely on your migration scenarios with the engineering team developing this offer, select the CONTACT ME button on the marketplace WebLogic on Azure offer overview page linked below. The opportunity to collaborate on a migration scenario is free while the offers are under active development.

    - -

    Search keywords

    - -Java -Java EE -WebLogic - -

    Privacy policy link

    - -https://www.oracle.com/legal/privacy/privacy-policy.html - -

    Useful links

    - -[Overview](https://www.oracle.com/middleware/weblogic/) - -[WebLogic on Azure](https://azuremarketplace.microsoft.com/en-us/marketplace/apps/oracle.oraclelinux-wls-cluster) - -[Learn More](https://www.oracle.com/middleware/technologies/weblogic.html) - -

    Videos

    - -

    Name

    - -WebLogic on AKS - -

    Link

    - -https://www.youtube.com/watch?v=gFS-64XQorA - -

    Thumbnail

    - - - -LICENSE - -Copyright (c) 2021 Oracle and/or its affiliates. - -Released under the Universal Permissive License v1.0 as shown at https://oss.oracle.com/licenses/upl/. diff --git a/weblogic-azure-aks/src/main/resources/marketing-artifacts/partner-center.html b/weblogic-azure-aks/src/main/resources/marketing-artifacts/partner-center.html deleted file mode 100644 index 1b9ff9af2..000000000 --- a/weblogic-azure-aks/src/main/resources/marketing-artifacts/partner-center.html +++ /dev/null @@ -1,68 +0,0 @@ -

    CONTACT ME offer

    -

    Name

    -

    Oracle WebLogic Server on Azure

    -

    Search results summary

    -

    Oracle WebLogic Server is a scalable, enterprise-ready Java application server.

    -

    Description (5000 characters, including basic HTML markup)

    -

    Oracle WebLogic Server (WLS) is an industry-leading Java runtime powering some of the most mission-critical enterprise applications - across the globe. Oracle and Microsoft collaborate to fully enable WLS on both Azure Virtual Machines and the Azure Kubernetes - Service (AKS). Joint solutions make it easier to migrate your application to the cloud by automating most boilerplate Azure and - Java resource provisioning and configuration tasks. Once initial provisioning is complete, you are completely free to customize - deployments further.

    -

    The currently available offers are linked in the learn more section at the bottom of this page.

    -

    You can reach out to the engineering team developing these offers by clicking the CONTACT ME button. Program managers, - architects and engineers will get in touch and can assist you for free with your Azure migration.

    -

    Links

    - - -

    Azure Application Offer

    -

    Name

    -

    Oracle WebLogic Server on Azure Kubernetes Service

    -

    Search results summary

    -

    Provisions an Oracle WebLogic Server dynamic cluster on Azure Kubernetes Service

    -

    Short description

    -

    Provisions an Oracle WebLogic Server dynamic cluster on the Azure Kubernetes Service. Integration options include Azure App Gateway, -Azure Container Registry, Azure Files, Azure Application Insights and various databases.

    -

    Description

    -

    Oracle WebLogic Server (WLS) is an industry-leading Java runtime powering some of the most mission-critical enterprise applications - across the globe. This solution automates most boilerplate steps to provision WLS on an Azure Kubernetes Service (AKS) - cluster. Once initial provisioning is complete, you are completely free to customize deployments further. The solution is jointly - developed by Oracle and Microsoft.

    -

    The solution supports WLS Enterprise Edition 12.2.1.4, and 14.1.1.0.

    -

    The following resources are automatically provisioned by the offer.

    -
      -
    • AKS cluster (alternatively, you can deploy to an existing AKS cluster)
    • -
    • Azure Container Registry (ACR) instance (alternatively, you can use an existing ACR instance)
    • -
    • WebLogic dynamic cluster with specified number of Managed Servers
    • -
    • Admin Server
    • -
    • WebLogic Domain
    • -
    • WebLogic Kubernetes Operator
    • -
    • Choice of Azure Application Gateway or AKS standard load balancer
    • -
    • Custom application deployment using domain home in image - optional
    • -
    • Configured data source connection (Oracle DB, Azure SQL, Azure MySQL, Azure PostgreSQL) - optional
    • -
    • Azure Container Insights and workspace monitoring WLS on AKS - optional
    • -
    • Azure File share named weblogic mounted to /shared as Persistent Volume - optional
    • -
    • Virtual network and subnet
    • -
    • Azure Storage Account
    • -
    -

    This offer is Bring-Your-Own-License. It assumes you have already procured the appropriate licenses with Oracle and are properly -licensed to run offers in Microsoft Azure.

    -

    Oracle and Microsoft also provide basic step-by-step instructions on getting started with WLS and AKS without automated -provisioning.

    -

    Oracle and Microsoft provide similar solutions targeting WLS on Azure VMs (single instance or cluster). These options are linked in -the Learn more section below.

    -

    You can reach out to the engineering team developing these offers by clicking the CONTACT ME button on -the marketplace WebLogic on Azure overview page. Program managers, architects and engineers will get in touch and can -assist you for free with your Azure migration.

    -

    Links

    - diff --git a/weblogic-azure-aks/src/main/resources/marketing-artifacts/video-thumbnail.png b/weblogic-azure-aks/src/main/resources/marketing-artifacts/video-thumbnail.png deleted file mode 100644 index c10e69547..000000000 Binary files a/weblogic-azure-aks/src/main/resources/marketing-artifacts/video-thumbnail.png and /dev/null differ diff --git a/weblogic-azure-aks/src/main/resources/mysql-connector-java.xml b/weblogic-azure-aks/src/main/resources/mysql-connector-java.xml deleted file mode 100644 index 4dd31b2af..000000000 --- a/weblogic-azure-aks/src/main/resources/mysql-connector-java.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - 4.0.0 - com.oracle.weblogic.azure - mysql-driver - 1.0-SNAPSHOT - jar - - 11 - 11 - - - - - com.mysql - mysql-connector-j - 9.2.0 - - - - \ No newline at end of file diff --git a/weblogic-azure-aks/src/main/resources/weblogic_cpu_images.json b/weblogic-azure-aks/src/main/resources/weblogic_cpu_images.json deleted file mode 100644 index a616bd1a9..000000000 --- a/weblogic-azure-aks/src/main/resources/weblogic_cpu_images.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "Oracle WebLogic Server docker image tags mapping for Azure Marketplace offer", - "description": "List image tag mapping from Oracle Container Registry middleware/weblogic and middleware/weblogic_cpu repository.", - "items": [ - { - "gaTag": "14.1.1.0-11", - "cpuTag": "14.1.1.0-generic-jdk11-ol7" - }, - { - "gaTag": "14.1.1.0-11-ol8", - "cpuTag": "14.1.1.0-generic-jdk11-ol8" - }, - { - "gaTag": "14.1.1.0-8", - "cpuTag": "14.1.1.0-generic-jdk8-ol7" - }, - { - "gaTag": "14.1.1.0-8-ol8", - "cpuTag": "14.1.1.0-generic-jdk8-ol8" - }, - { - "gaTag": "12.2.1.4", - "cpuTag": "12.2.1.4-generic-jdk8-ol7" - }, - { - "gaTag": "12.2.1.4-ol8", - "cpuTag": "12.2.1.4-generic-jdk8-ol8" - } - ] -} diff --git a/weblogic-azure-aks/src/main/resources/weblogic_tooling_family.json b/weblogic-azure-aks/src/main/resources/weblogic_tooling_family.json deleted file mode 100644 index e73e37d7d..000000000 --- a/weblogic-azure-aks/src/main/resources/weblogic_tooling_family.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "Oracle WebLogic Server Tooling Family used in WebLogic on AKS offer", - "description": "The versions are known to work for all the features of Azure WebLogic on AKS offer.", - "items": [ - { - "key": "WKO", - "description": "Oracle WebLogic Kubernetes Operator", - "version": "4.1.8", - "testedDate": "2024-03-13" - }, - { - "key": "WDT", - "description": "Oracle WebLogic Deploy Tooling", - "version": "3.5.2", - "downloadURL": "https://github.com/oracle/weblogic-deploy-tooling/releases/download/release-3.5.2/weblogic-deploy.zip", - "testedDate": "2024-03-13" - }, - { - "key": "WIT", - "description": "Oracle WebLogic Image Tool", - "version": "1.13.2", - "downloadURL": "https://github.com/oracle/weblogic-image-tool/releases/download/release-1.13.2/imagetool.zip", - "testedDate": "2024-07-15" - }, - { - "key": "WME", - "description": "Oracle Weblogic Monitoring Exporter. IMPORTANT note to maintener: This value is hard coded in enablePrometheusMetrics.sh. Please update it there also.", - "version": "2.1.9", - "imageURL": "ghcr.io/oracle/weblogic-monitoring-exporter:2.1.9", - "testedDate": "2024-02-29" - } - ] -} diff --git a/weblogic-azure-aks/src/test/genWlsAksParameters.sh b/weblogic-azure-aks/src/test/genWlsAksParameters.sh deleted file mode 100644 index da5bac7e2..000000000 --- a/weblogic-azure-aks/src/test/genWlsAksParameters.sh +++ /dev/null @@ -1,130 +0,0 @@ -#!/bin/bash -# Copyright (c) 2023, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -gitUserName=$1 -testbranchName=$2 -appPackageUrls=$3 -dbPassword=$4 -dbUser=$5 -dsConnectionURL=$6 -location=$7 -ocrSSOPSW=$8 -ocrSSOUser=$9 -wdtRuntimePassword=${10} -wlsPassword=${11} -wlsUserName=${12} -vmSize=${13} -parametersPath=${14} - - -cat < ${parametersPath} -{ - "\$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - // This file is used by CI/CD workflows. It allows the workflows to provide parameters when invoking the offer from the command line. - "parameters": { - "_artifactsLocation": { - "value": "https://raw.githubusercontent.com/${gitUserName}/weblogic-azure/${testbranchName}/weblogic-azure-aks/src/main/arm/" - }, - "aksAgentPoolNodeCount": { - "value": 3 - }, - "vmSize": { - "value": "${vmSize}" - }, - "appGatewayCertificateOption": { - "value": "generateCert" - }, - "appgwForAdminServer": { - "value": true - }, - "appgwForRemoteConsole": { - "value": true - }, - "appPackageUrls": { - "value": [ - "${appPackageUrls}" - ] - }, - "appReplicas": { - "value": 2 - }, - "createACR": { - "value": true - }, - "createAKSCluster": { - "value": true - }, - "createDNSZone": { - "value": true - }, - "dbGlobalTranPro": { - "value": "EmulateTwoPhaseCommit" - }, - "dbPassword": { - "value": "${dbPassword}" - }, - "dbUser": { - "value": "${dbUser}" - }, - "databaseType": { - "value": "postgresql" - }, - "dsConnectionURL": { - "value": "${dsConnectionURL}" - }, - "enableAppGWIngress": { - "value": true - }, - "enableAzureMonitoring": { - "value": false - }, - "enableAzureFileShare": { - "value": true - }, - "enableCookieBasedAffinity": { - "value": true - }, - "enableCustomSSL": { - "value": false - }, - "enableDB": { - "value": true - }, - "enableDNSConfiguration": { - "value": false - }, - "jdbcDataSourceName": { - "value": "jdbc/CargoTrackerDB" - }, - "location": { - "value": "${location}" - }, - "ocrSSOPSW": { - "value": "${ocrSSOPSW}" - }, - "ocrSSOUser": { - "value": "${ocrSSOUser}" - }, - "useInternalLB": { - "value": false - }, - "useOracleImage": { - "value": true - }, - "wdtRuntimePassword": { - "value": "${wdtRuntimePassword}" - }, - "wlsImageTag": { - "value": "14.1.1.0-11" - }, - "wlsPassword": { - "value": "${wlsPassword}" - }, - "wlsUserName": { - "value": "${wlsUserName}" - } - } -} -EOF diff --git a/weblogic-azure-vm/README.md b/weblogic-azure-vm/README.md deleted file mode 100644 index 7628a55ac..000000000 --- a/weblogic-azure-vm/README.md +++ /dev/null @@ -1,75 +0,0 @@ -# About WebLogic on Microsoft Azure Virtual Machine - -As part of a broad-ranging partnership between Oracle and Microsoft, this project offers support for running Oracle WebLogic Server in Azure Virtual Machine. The partnership includes joint support for a range of Oracle software running on Azure, including Oracle WebLogic, Oracle Linux, and Oracle DB, as well as interoperability between Oracle Cloud Infrastructure (OCI) and Azure. - -This is the main/root git repository for the Azure Resource Management (ARM) templates and other scripts used for the implementation of WebLogic Server on Microsoft Azure Virtual Machine. - -## Installation - -The [Azure Marketplace WebLogic Server Offering](https://azuremarketplace.microsoft.com/en-us/marketplace/apps?search=WebLogic) offers a simplified UI and installation experience over the full power of the ARM template. - -The following are few single/multinode deployment offers that are available in the Azure Marketplace: - -- Bootstrap an Oracle Linux VM with pre-installed WebLogic Server (without Administration Server) -- Oracle WebLogic Server with Administration Server -- Oracle WebLogic Server N-Node cluster -- Oracle WebLogic Server N-Node dynamic cluster - ---- - -![WebLogic Server Azure Marketplace UI Flow](weblogic-azure-vm/arm-oraclelinux-wls/images/wls-on-azure.gif) - ---- - -In this GitHub project under weblogic-azure-vm you can find the Azure Resource Manager (ARM) templates for each of these Azure Marketplace WebLogic Server Offerings. These ARM templates can be used to deploy the offering directly from the Azure CLI or Azure Powershell. - -The following are the corresponding directories: - -- [https://github.com/oracle/weblogic-azure/weblogic-azure-vm/arm-oraclelinux-wls](https://github.com/oracle/weblogic-azure/weblogic-azure-vm/arm-oraclelinux-wls) - -- [https://github.com/oracle/weblogic-azure/weblogic-azure-vm/arm-oraclelinux-wls-admin](https://github.com/oracle/weblogic-azure/weblogic-azure-vm/arm-oraclelinux-wls-admin) - -- [https://github.com/oracle/weblogic-azure/weblogic-azure-vm/arm-oraclelinux-wls-cluster](https://github.com/oracle/weblogic-azure/weblogic-azure-vm/arm-oraclelinux-wls-cluster) - -- [https://github.com/oracle/weblogic-azure/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster](https://github.com/oracle/weblogic-azure/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster) - -## ARM Template based deployment of Weblogic Offers - -For each WebLogic offer, the sample parameters.json file is located under the "src/main/arm" directory, corresponding to that offer. - -**Note**: Oracle recommends that the parameters.json file be deleted or secured after the WebLogic offer deployment is completed, -so that sensitive information such as user name and password are not inadvertently exposed. - -## Documentation - -Please refer to the documentation [Oracle WebLogic Server Azure Applications](https://docs.oracle.com/en/middleware/standalone/weblogic-server/wlazu/get-started-oracle-weblogic-server-microsoft-azure-iaas.html#GUID-E0B24A45-F496-4509-858E-103F5EBF67A7) - -## Examples - -To get details of how to run Oracle WebLogic Server on Azure Virtual Machines refer to the blog [WebLogic on Azure Virtual Machines Major Release Now Available](https://blogs.oracle.com/weblogicserver/weblogic-on-azure-virtual-machines-major-release-now-available). - -## Issues - -Issue related to Oracle WebLogic Server on Microsoft Azure implementation are tracked ain the [Issues tab](https://github.com/oracle/weblogic-azure/issues) of the GitHub project. - -## Workflow Tracker - -This section tracks GitHub Actions configured for each offer repo, 'Build and Test' and 'New Tag' are two different workflows. -| Offer Repo | Build and Test | New Tag | -|--- |--- |--- | -| [Single Node] | [Build and Test]| [New Tag]| -| [Admin] | [Build and Test] | [New Tag] | -| [Configured Cluster] | [Build and Test]svg) | [New Tag]) | -| [Dynamic Cluster] | [Build and Test] | [New Tag] | - -## Pull Requests - -This section tracks GitHub pull requests. -https://github.com/oracle/weblogic-azure/pulls - -## License - -Copyright (c) 2021 Oracle and/or its affiliates. - -Released under the Universal Permissive License v1.0 as shown at -. diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/README.md b/weblogic-azure-vm/arm-oraclelinux-wls-admin/README.md deleted file mode 100644 index c4058234a..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/README.md +++ /dev/null @@ -1,11 +0,0 @@ - - -## WebLogic Server (with Administration Server) on Microsoft Azure - Marketplace Offerings - -This git repository is used to maintain the Azure Resource Management (ARM) templates and other scripts -used for the implementation of WebLogic Server (with Administration Server) on Microsoft Azure. - -For WebLogic Server running in the Azure Virtual Machines documentation, please refer to the [README documentation](https://github.com/oracle/weblogic-azure/weblogic-azure-vm/arm-oraclelinux-wls/README.md). diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/admin-ssl-post-deploy/pom.xml b/weblogic-azure-vm/arm-oraclelinux-wls-admin/admin-ssl-post-deploy/pom.xml deleted file mode 100644 index 5698ed0bb..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/admin-ssl-post-deploy/pom.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - 4.0.0 - - - com.oracle.weblogic.azure - weblogic-azure-vm - 1.0.0 - ../../pom.xml - - - com.oracle.weblogic.azure - arm-oraclelinux-wls-admin-ssl-config-post-deploy - 1.0.30 - - jar - ${project.artifactId} - - - -TestParameter '@{"SampleName"="admin-ssl-post-deploy/src/main";"RawRepoPath"="${artifactsLocationBase}/arm-oraclelinux-wls-admin/"}' - ${project.basedir}/../../.. - false - false - - - - - - - diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/admin-ssl-post-deploy/src/main/arm/mainTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-admin/admin-ssl-post-deploy/src/main/arm/mainTemplate.json deleted file mode 100644 index 77f835f0b..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/admin-ssl-post-deploy/src/main/arm/mainTemplate.json +++ /dev/null @@ -1,150 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - }, - "defaultValue": "${artifactsLocationBase}/arm-oraclelinux-wls-admin/admin-ssl-post-deploy/src/main/" - }, - "_artifactsLocationSasToken": { - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - }, - "defaultValue": "" - }, - "adminVMName": { - "type": "string", - "defaultValue": "adminVM", - "metadata": { - "description": "Admin Server hosting VM name." - } - }, - "aadsSettings": { - "type": "object", - "defaultValue": { - "enable": false, - "certificateBase64String": "null" - }, - "metadata": { - "description": "If enable is true, must specify the certificateBase64String, which is the based64 string of LADP client certificate that will be imported to trust store of WebLogic Server to enable SSL connection of AD provider." - } - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]", - "metadata": { - "description": "Location for all resources." - } - }, - "wlsDomainName": { - "type": "string", - "defaultValue": "wlsd", - "metadata": { - "description": "Provide existing running Weblogic domain name" - } - }, - "wlsUserName": { - "type": "string", - "metadata": { - "description": "Username for your Weblogic domain name" - } - }, - "wlsPassword": { - "type": "securestring", - "metadata": { - "description": "Password for your Weblogic domain name" - } - }, - "customSSLSettings": { - "type": "object", - "defaultValue": { - "enable": false, - "customIdentityKeyStoreBase64String": "null", - "customIdentityKeyStorePassPhrase": "null", - "customIdentityKeyStoreType": "null", - "customTrustKeyStoreBase64String": "null", - "customTrustKeyStorePassPhrase": "null", - "customTrustKeyStoreType": "null", - "privateKeyAlias":"null", - "privateKeyPassPhrase":"null" - }, - "metadata": { - "description": "If enable is true, must specify all customSSLSettings. customIdentityKeyStoreBase64String and customTrustKeyStoreBase64String are the custom identity and trust keystore data repectively, i.e., contents of identity.jks, trust.jks keystore files in base64 encoding. Similarly, all other custom ssl settings are also required to configure SSL settings" - } - }, - "deploy_timestamp": { - "type": "string", - "defaultValue": "[utcNow('yyMMddHHmm')]", - "metadata": { - "description": "Timestamp required for uniquely identifying and executing custom extension script multiple times" - } - } - }, - "variables": { - "const_wlsHome": "/u01/app/wls/install/oracle/middleware/oracle_home", - "const_wlsDomainPath": "/u01/domains", - "name_scriptFile": "configureCustomAdminSSL.sh" - }, - "resources": [ - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${post.deploy.ssl.config.start}", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [] - } - } - }, - { - "type": "Microsoft.Compute/virtualMachines/extensions", - "name": "[concat(parameters('adminVMName'),'/newuserscript')]", - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "location": "[parameters('location')]", - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.1", - "autoUpgradeMinorVersion": true, - "settings": { - "timestamp": "[int(parameters('deploy_timestamp'))]", - "fileUris": [ - "[uri(parameters('_artifactsLocation'), concat('scripts/', variables('name_scriptFile'), parameters('_artifactsLocationSasToken')))]" - ] - }, - "protectedSettings": { - "commandToExecute": "[concat('sh',' ',variables('name_scriptFile'),' <<< \"',parameters('adminVMName'),' ',parameters('wlsDomainName'),' ',parameters('wlsUserName'),' ',parameters('wlsPassword'),' ',variables('const_wlsHome'),' ',variables('const_wlsDomainPath'),' ', parameters('aadsSettings').enable,' ',if(parameters('aadsSettings').enable, parameters('aadsSettings').certificateBase64String, 'null'),' ', parameters('customSSLSettings').enable,' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').customIdentityKeyStoreBase64String, 'null'),' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').customIdentityKeyStorePassPhrase, 'null'),' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').customIdentityKeyStoreType, 'null'),' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').customTrustKeyStoreBase64String, 'null'),' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').customTrustKeyStorePassPhrase, 'null'),' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').customTrustKeyStoreType, 'null'),' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').privateKeyAlias, 'null'),' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').privateKeyPassPhrase, 'null'),'\"')]" - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${post.deploy.ssl.config.end}", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [] - } - } - } - ], - "outputs": { - "wlsDomainLocation": { - "type": "string", - "value": "[concat('/u01/domains/', parameters('wlsDomainName'))]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/admin-ssl-post-deploy/src/main/arm/post.deploy.ssl.config.parameters.json b/weblogic-azure-vm/arm-oraclelinux-wls-admin/admin-ssl-post-deploy/src/main/arm/post.deploy.ssl.config.parameters.json deleted file mode 100644 index d6cf93bf0..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/admin-ssl-post-deploy/src/main/arm/post.deploy.ssl.config.parameters.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "value":"GEN-UNIQUE" - }, - "aadsSettings": { - "value": { - "enable": false, - "certificateBase64String": "GEN-UNIQUE" - } - }, - "location": { - "value": "GEN-UNIQUE" - }, - "wlsDomainName": { - "value": "GEN-UNIQUE" - }, - "wlsUserName": { - "value": "GEN-UNIQUE" - }, - "wlsPassword": { - "value": "GEN-UNIQUE" - }, - "customSSLSettings": { - "value": { - "enable": false, - "customIdentityKeyStoreBase64String": "GEN-UNIQUE", - "customIdentityKeyStorePassPhrase": "GEN-UNIQUE", - "customIdentityKeyStoreType": "GEN-UNIQUE", - "customTrustKeyStoreBase64String": "GEN-UNIQUE", - "customTrustKeyStorePassPhrase": "GEN-UNIQUE", - "customTrustKeyStoreType": "GEN-UNIQUE", - "privateKeyAlias": "GEN-UNIQUE", - "privateKeyPassPhrase": "GEN-UNIQUE" - } - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/admin-ssl-post-deploy/src/main/scripts/configureCustomAdminSSL.sh b/weblogic-azure-vm/arm-oraclelinux-wls-admin/admin-ssl-post-deploy/src/main/scripts/configureCustomAdminSSL.sh deleted file mode 100644 index 0ee7f3fd6..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/admin-ssl-post-deploy/src/main/scripts/configureCustomAdminSSL.sh +++ /dev/null @@ -1,325 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# -#Function to output message to StdErr -function echo_stderr () -{ - echo "$@" >&2 -} - -#Function to display usage message -function usage() -{ - echo_stderr "./configureCustomAdminSSL.sh <<< \"\"" -} - -function installUtilities() -{ - echo "Installing zip unzip wget vnc-server rng-tools cifs-utils" - sudo yum install -y zip unzip wget vnc-server rng-tools cifs-utils - - #Setting up rngd utils - attempt=1 - while [[ $attempt -lt 4 ]] - do - echo "Starting rngd service attempt $attempt" - sudo systemctl start rngd - attempt=`expr $attempt + 1` - sudo systemctl status rngd | grep running - if [[ $? == 0 ]]; - then - echo "rngd utility service started successfully" - break - fi - sleep 1m - done -} - -function validateInput() -{ - if [ -z "$adminVMName" ]; - then - echo_stderr "adminVMName is required. " - fi - - if [ -z "$wlsDomainName" ]; - then - echo_stderr "wlsDomainName is required. " - fi - - if [[ -z "$wlsUserName" || -z "$wlsPassword" ]] - then - echo_stderr "wlsUserName or wlsPassword is required. " - exit 1 - fi - - if [ -z "$oracleHome" ]; - then - echo_stderr "oracleHome is required. " - fi - - if [ -z "$wlsDomainPath" ]; - then - echo_stderr "wlsDomainPath is required. " - fi - - if [[ "$enableAAD" == "true" ]]; - then - if [[ -z "$wlsADSSLCer" ]] - then - echo_stderr "wlsADSSLCer is required required. " - exit 1 - fi - fi - - if [ "$isCustomSSLEnabled" == "true" ]; - then - if [[ -z "$customIdentityKeyStoreBase64String" || -z "$customIdentityKeyStorePassPhrase" || -z "$customIdentityKeyStoreType" || - -z "$customTrustKeyStoreBase64String" || -z "$customTrustKeyStorePassPhrase" || -z "$customTrustKeyStoreType" || - -z "$privateKeyAlias" || -z "$privateKeyPassPhrase" ]] - then - echo_stderr "customIdentityKeyStoreBase64String, customIdentityKeyStorePassPhrase, customIdentityKeyStoreType, customTrustKeyStoreBase64String, customTrustKeyStorePassPhrase, customTrustKeyStoreType, privateKeyAlias and privateKeyPassPhrase are required. " - exit 1 - fi - else - echo "SSL configuration not enabled as iscustomSSLEnabled was set to false. Please set the flag to true and retry." - exit 1 - fi -} - -#Function to cleanup all temporary files -function cleanup() -{ - echo "Cleaning up temporary files..." - rm -rf $wlsDomainPath/managed-domain.yaml - rm -rf $wlsDomainPath/weblogic-deploy.zip - rm -rf $wlsDomainPath/weblogic-deploy - rm -rf $wlsDomainPath/*.py - echo "Cleanup completed." -} - -#This function to add machine for a given managed server -function configureSSL() -{ - echo "Configuring SSL on Admin Server: $wlsServerName" - cat <$wlsDomainPath/configureSSL.py - -isCustomSSLEnabled='${isCustomSSLEnabled}' - -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -edit("$wlsServerName") -startEdit() -cd('/Servers/$wlsServerName') - -if isCustomSSLEnabled == 'true' : - cmo.setKeyStores('CustomIdentityAndCustomTrust') - cmo.setCustomIdentityKeyStoreFileName('$customSSLIdentityKeyStoreFile') - cmo.setCustomIdentityKeyStoreType('$customIdentityKeyStoreType') - set('CustomIdentityKeyStorePassPhrase', '$customIdentityKeyStorePassPhrase') - cmo.setCustomTrustKeyStoreFileName('$customSSLTrustKeyStoreFile') - cmo.setCustomTrustKeyStoreType('$customTrustKeyStoreType') - set('CustomTrustKeyStorePassPhrase', '$customTrustKeyStorePassPhrase') - - cd('/Servers/$wlsServerName/SSL/$wlsServerName') - cmo.setServerPrivateKeyAlias('$privateKeyAlias') - set('ServerPrivateKeyPassPhrase', '$privateKeyPassPhrase') - cmo.setHostnameVerificationIgnored(true) - -cd('/Servers/$wlsServerName/ServerStart/$wlsServerName') -arguments = '${SERVER_STARTUP_ARGS} -Dweblogic.Name=$wlsServerName -Dweblogic.security.SSL.ignoreHostnameVerification=true' -oldArgs = cmo.getArguments() -if oldArgs != None: - newArgs = oldArgs + ' ' + arguments -else: - newArgs = arguments -cmo.setArguments(newArgs) -save() -resolve() -activate() -destroyEditSession("$wlsServerName") -disconnect() -EOF - -sudo chown -R $username:$groupname $wlsDomainPath/configureSSL.py - -echo "Running wlst script to configure SSL on $wlsServerName" -runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST $wlsDomainPath/configureSSL.py" -if [[ $? != 0 ]]; then - echo "Error : SSL Configuration for server $wlsServerName failed" - exit 1 -fi - -} - - -#This function to wait for admin server -function wait_for_admin() -{ - #wait for admin to start -count=1 -CHECK_URL="http://$wlsAdminURL/weblogic/ready" -status=`curl --insecure -ILs $CHECK_URL | tac | grep -m1 HTTP/1.1 | awk {'print $2'}` -echo "Waiting for admin server to start" -while [[ "$status" != "200" ]] -do - echo "." - count=$((count+1)) - if [ $count -le 30 ]; - then - sleep 1m - else - echo "Error : Maximum attempts exceeded while starting admin server" - exit 1 - fi - status=`curl --insecure -ILs $CHECK_URL | tac | grep -m1 HTTP/1.1 | awk {'print $2'}` - if [ "$status" == "200" ]; - then - echo "Server $wlsServerName started succesfully..." - break - fi -done -} - -function parseLDAPCertificate() -{ - echo "create key store" - cer_begin=0 - cer_size=${#wlsADSSLCer} - cer_line_len=64 - mkdir ${SCRIPT_PWD}/security - touch ${SCRIPT_PWD}/security/AzureADLDAPCerBase64String.txt - while [ ${cer_begin} -lt ${cer_size} ] - do - cer_sub=${wlsADSSLCer:$cer_begin:$cer_line_len} - echo ${cer_sub} >> ${SCRIPT_PWD}/security/AzureADLDAPCerBase64String.txt - cer_begin=$((cer_begin+$cer_line_len)) - done - - openssl base64 -d -in ${SCRIPT_PWD}/security/AzureADLDAPCerBase64String.txt -out ${SCRIPT_PWD}/security/AzureADTrust.cer - addsCertificate=${SCRIPT_PWD}/security/AzureADTrust.cer -} - -function importAADCertificateIntoWLSCustomTrustKeyStore() -{ - if [ "${isCustomSSLEnabled,,}" == "true" ]; - then - # set java home - . $oracleHome/oracle_common/common/bin/setWlstEnv.sh - - #validate Trust keystore - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; keytool -list -v -keystore $customSSLTrustKeyStoreFile -storepass $customTrustKeyStorePassPhrase -storetype $customTrustKeyStoreType | grep 'Entry type:' | grep 'trustedCertEntry'" - - if [[ $? != 0 ]]; then - echo "Error : Trust Keystore Validation Failed !!" - exit 1 - fi - - # For SSL enabled causes Entra ID failure #225 - # ISSUE: https://github.com/wls-eng/arm-oraclelinux-wls/issues/225 - - echo "Importing Entra ID Certificate into WLS Custom Trust Key Store: " - - sudo ${JAVA_HOME}/bin/keytool -noprompt -import -trustcacerts -keystore $customSSLTrustKeyStoreFile -storepass $customTrustKeyStorePassPhrase -alias aadtrust -file ${addsCertificate} -storetype $customTrustKeyStoreType - else - echo "customSSL not enabled. Not required to configure Entra ID for WebLogic Custom SSL" - fi -} - -function validateSSLKeyStores() -{ - sudo chown -R $username:$groupname $KEYSTORE_PATH - - #validate identity keystore - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; keytool -list -v -keystore $customSSLIdentityKeyStoreFile -storepass $customIdentityKeyStorePassPhrase -storetype $customIdentityKeyStoreType | grep 'Entry type:' | grep 'PrivateKeyEntry'" - - if [[ $? != 0 ]]; then - echo "Error : Identity Keystore Validation Failed !!" - exit 1 - fi - - #validate Trust keystore - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; keytool -list -v -keystore $customSSLTrustKeyStoreFile -storepass $customTrustKeyStorePassPhrase -storetype $customTrustKeyStoreType | grep 'Entry type:' | grep 'trustedCertEntry'" - - if [[ $? != 0 ]]; then - echo "Error : Trust Keystore Validation Failed !!" - exit 1 - fi - - echo "ValidateSSLKeyStores Successfull !!" -} - -function parseAndSaveCustomSSLKeyStoreData() -{ - echo "create key stores for custom ssl settings" - - mkdir -p ${KEYSTORE_PATH} - touch ${KEYSTORE_PATH}/identityKeyStoreCerBase64String.txt - - echo "$customIdentityKeyStoreBase64String" > ${KEYSTORE_PATH}/identityKeyStoreCerBase64String.txt - cat ${KEYSTORE_PATH}/identityKeyStoreCerBase64String.txt | base64 -d > ${KEYSTORE_PATH}/identity.keystore - customSSLIdentityKeyStoreFile=${KEYSTORE_PATH}/identity.keystore - - rm -rf ${KEYSTORE_PATH}/identityKeyStoreCerBase64String.txt - - mkdir -p ${KEYSTORE_PATH} - touch ${KEYSTORE_PATH}/trustKeyStoreCerBase64String.txt - - echo "$customTrustKeyStoreBase64String" > ${KEYSTORE_PATH}/trustKeyStoreCerBase64String.txt - cat ${KEYSTORE_PATH}/trustKeyStoreCerBase64String.txt | base64 -d > ${KEYSTORE_PATH}/trust.keystore - customSSLTrustKeyStoreFile=${KEYSTORE_PATH}/trust.keystore - - rm -rf ${KEYSTORE_PATH}/trustKeyStoreCerBase64String.txt - - validateSSLKeyStores -} - -function restartAdminServerService() -{ - echo "Restart weblogic admin server service" - sudo systemctl stop wls_admin - sudo systemctl start wls_admin -} - -#main script starts here - -SCRIPT_PWD=`pwd` - -# store arguments in a special array -args=("$@") -# get number of elements -ELEMENTS=${#args[@]} - -#read arguments from stdin -read adminVMName wlsDomainName wlsUserName wlsPassword oracleHome wlsDomainPath enableAAD wlsADSSLCer isCustomSSLEnabled customIdentityKeyStoreBase64String customIdentityKeyStorePassPhrase customIdentityKeyStoreType customTrustKeyStoreBase64String customTrustKeyStorePassPhrase customTrustKeyStoreType privateKeyAlias privateKeyPassPhrase - - -enableAAD="${enableAAD,,}" -isCustomSSLEnabled="${isCustomSSLEnabled,,}" - -wlsAdminPort=7001 -wlsAdminChannelPort=7005 -wlsAdminURL="$adminVMName:$wlsAdminChannelPort" -wlsServerName="admin" -username="oracle" -groupname="oracle" - -KEYSTORE_PATH="$wlsDomainPath/$wlsDomainName/keystores" -SERVER_STARTUP_ARGS="-Dlog4j2.formatMsgNoLookups=true" - -validateInput -cleanup - -parseAndSaveCustomSSLKeyStoreData - -if [ "$enableAAD" == "true" ];then - parseLDAPCertificate - importAADCertificateIntoWLSCustomTrustKeyStore -fi - -wait_for_admin -configureSSL -restartAdminServerService -wait_for_admin - -cleanup diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/cli-scripts/custom-dns-alias-cli.sh b/weblogic-azure-vm/arm-oraclelinux-wls-admin/cli-scripts/custom-dns-alias-cli.sh deleted file mode 100644 index a94b8f0ff..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/cli-scripts/custom-dns-alias-cli.sh +++ /dev/null @@ -1,270 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# -# -# Description -# This script is to configure custom DNS alias for Weblogic Server Administration Console. -# It supports two scenarios: -# * If you have an Azure DNS Zone, create DNS alias for admin console on the existing DNS Zone. -# * If you don’t have an Azure DNS Zone, create the DNS Zone in the same resource group of WebLogic server, and create DNS alias for admin console. - -# Initialize -script="${BASH_SOURCE[0]}" -scriptDir="$(cd "$(dirname "${script}")" && pwd)" - -function usage() { - cat < \\ - --admin-vm-name adminVM \\ - --admin-console-label admin \\ - --artifact-location \\ - --location eastus \\ - --zone-name contoso.com \\ - --zone-resource-group haiche-dns-test1 - - 2. Configure DNS alias on a new DNS Zone - ./custom-dns-alias-cli.sh \\ - --resource-group \\ - --admin-vm-name adminVM \\ - --admin-console-label admin \\ - --artifact-location \\ - --location eastus \\ - --zone-name contoso.com - -EOF -} - -function validateInput() { - if [ -z "${resourceGroup}" ]; then - echo "Option --resource-group is required." - exit 1 - fi - if [ -z "${artifactLocation}" ]; then - echo "Option --artifact-location is required." - exit 1 - fi - - templateURL="${artifactLocation}nestedtemplates/dnszonesTemplate.json" - if [ -z "${templateURL}" ]; then - echo "Option --artifact-location is required." - exit 1 - else - if curl --output /dev/null --silent --head --fail "${templateURL}"; then - echo "ARM Tempalte exists: $templateURL" - else - echo "ARM Tempalte does not exist: $templateURL" - exit 1 - fi - fi - if [ -z "${zoneName}" ]; then - echo "Option --zone-name is required." - exit 1 - fi - if [ -z "${adminVMName}" ]; then - echo "Option --admin-vm-name is required." - exit 1 - fi - if [ -z "${adminLabel}" ]; then - echo "Option --admin-console-label is required." - exit 1 - fi - - if [ -n "${zoneResourceGroup}" ]; then - hasDNSZone=true - fi -} - -function queryAdminIPId() { - az extension add --name resource-graph; - - nicId=$(az graph query -q "Resources - | where type =~ 'microsoft.compute/virtualmachines' - | where name=~ '${adminVMName}' - | where resourceGroup =~ '${resourceGroup}' - | extend nics=array_length(properties.networkProfile.networkInterfaces) - | mv-expand nic=properties.networkProfile.networkInterfaces - | where nics == 1 or nic.properties.primary =~ 'true' or isempty(nic) - | project nicId = tostring(nic.id)" -o tsv) - - if [ -z "${nicId}" ]; then - echo "Please make sure admin VM '${adminVMName}' exists in resource group '${resourceGroup}'. " - exit 1 - fi - - adminIPId=$(az graph query -q "Resources - | where type =~ 'microsoft.network/networkinterfaces' - | where id=~ '${nicId}' - | extend ipConfigsCount=array_length(properties.ipConfigurations) - | mv-expand ipconfig=properties.ipConfigurations - | where ipConfigsCount == 1 or ipconfig.properties.primary =~ 'true' - | project publicIpId = tostring(ipconfig.properties.publicIPAddress.id)" -o tsv) - - if [ -z "${adminIPId}" ]; then - echo "Can not query public IP of admin VM. Please make sure admin VM '${adminVMName}' exists in resource group '${resourceGroup}'. " - exit 1 - fi -} - -function generateParameterFile() { - parametersPath=parameters.json - cat <${scriptDir}/${parametersPath} -{ - "\$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "value": "${artifactLocation}" - }, - "_artifactsLocationSasToken": { - "value": "" - }, - "dnszonesARecordSetNames": { - "value": [ - "$adminLabel" - ] - }, - "dnszonesCNAMEAlias": { - "value": [ - ] - }, - "dnszonesCNAMERecordSetNames": { - "value": [ - ] - }, - "dnszoneName": { - "value": "${zoneName}" - }, - "hasDNSZones": { - "value": ${hasDNSZone} - }, - "location": { - "value": "${location}" - }, - "resourceGroup": { - "value": "${zoneResourceGroup}" - }, - "targetResources": { - "value": [ - "${adminIPId}" - ] - } - } -} -EOF -} - -function invoke() { - # validate the template - az deployment group validate --verbose \ - --resource-group ${resourceGroup} \ - --parameters @${scriptDir}/${parametersPath} \ - --template-uri ${templateURL} - - # invoke the template - az deployment group create --verbose \ - --resource-group ${resourceGroup} \ - --parameters @${scriptDir}/${parametersPath} \ - --template-uri ${templateURL} \ - --name "configure-custom-dns-alias-$(date +"%s")" - - # exit if error happens - if [ $? -eq 1 ]; then - exit 1 - fi -} - -function cleanup() { - if test -f "${scriptDir}/${parametersPath}"; then - rm -f ${scriptDir}/${parametersPath} - fi -} - -function printSummary() { - echo "" - echo "" - echo " -DONE! - " - if [ "${hasDNSZone}" == "false" ]; then - nameServers=$(az network dns zone show -g ${resourceGroup} --name ${zoneName} --query nameServers) - echo " -Action required: - Complete Azure DNS delegation to make the alias accessible. - Reference: https://aka.ms/dns-domain-delegation - Name servers: - ${nameServers} - " - fi - - echo " -Custom DNS alias: - Resource group: ${resourceGroup} - WebLogic Server Administration Console URL: http://${adminLabel}.${zoneName}:7001/console - WebLogic Server Administration Console secured URL: https://${adminLabel}.${zoneName}:7002/console - " -} - -# main script start from here -# default value -hasDNSZone=false - -# Transform long options to short ones -for arg in "$@"; do - shift - case "$arg" in - "--help") set -- "$@" "-h" ;; - "--resource-group") set -- "$@" "-g" ;; - "--artifact-location") set -- "$@" "-f" ;; - "--zone-name") set -- "$@" "-z" ;; - "--admin-vm-name") set -- "$@" "-m" ;; - "--admin-console-label") set -- "$@" "-c" ;; - "--zone-resource-group") set -- "$@" "-r" ;; - "--location") set -- "$@" "-l" ;; - "--"*) - set -- usage - exit 2 - ;; - *) set -- "$@" "$arg" ;; - esac -done - -# Parse short options -OPTIND=1 -while getopts "hg:f:z:m:c:w:r:i:l:" opt; do - case "$opt" in - "g") resourceGroup="$OPTARG" ;; - "f") artifactLocation="$OPTARG" ;; - "h") - usage - exit 0 - ;; - "z") zoneName="$OPTARG" ;; - "m") adminVMName="$OPTARG" ;; - "c") adminLabel="$OPTARG" ;; - "r") zoneResourceGroup="$OPTARG" ;; - "l") location="$OPTARG" ;; - esac -done -shift $(expr $OPTIND - 1) - -validateInput -cleanup -queryAdminIPId -generateParameterFile -invoke -cleanup -printSummary diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/pom.xml b/weblogic-azure-vm/arm-oraclelinux-wls-admin/pom.xml deleted file mode 100644 index b792c3082..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - 4.0.0 - - - com.oracle.weblogic.azure - weblogic-azure-vm - 1.0.0 - ../pom.xml - - - com.oracle.weblogic.azure - arm-oraclelinux-wls-admin - ${version.arm-oraclelinux-wls-admin} - - pom - ${project.artifactId} - - - ${project.basedir}/../.. - false - false - - - - admin-ssl-post-deploy - - diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/admindeploy.parameters.json b/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/admindeploy.parameters.json deleted file mode 100644 index 76353379d..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/admindeploy.parameters.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "adminPasswordOrKey": { - "value": "GEN-SSH-PUB-KEY" - }, - "adminUsername": { - "value": "GEN-UNIQUE" - }, - "adminVMName": { - "value": "GEN-UNIQUE" - }, - "authenticationType": { - "value": "GEN-UNIQUE" - }, - "databaseType": { - "value": "GEN-UNIQUE" - }, - "dnsLabelPrefix": { - "value": "GEN-UNIQUE" - }, - "dsConnectionURL": { - "value": "GEN-UNIQUE" - }, - "dsPassword": { - "value": "GEN-PASSWORD" - }, - "dsUser": { - "value": "GEN-UNIQUE" - }, - "enableDB": { - "value": "GEN-UNIQUE" - }, - "jdbcDataSourceName": { - "value": "GEN-UNIQUE" - }, - "vmSize": { - "value": "GEN-UNIQUE" - }, - "wlsDomainName": { - "value": "GEN-UNIQUE" - }, - "wlsPassword": { - "value": "GEN-PASSWORD" - }, - "wlsUserName": { - "value": "GEN-UNIQUE" - } - } -} \ No newline at end of file diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/createUiDefinition.json b/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/createUiDefinition.json deleted file mode 100644 index 762dd1212..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/createUiDefinition.json +++ /dev/null @@ -1,1074 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/0.1.2-preview/CreateUIDefinition.MultiVm.json#", - "handler": "Microsoft.Azure.CreateUIDef", - "version": "0.1.2-preview", - "parameters": { - "config": { - "basics": { - "resourceGroup": { - "allowExisting": true - } - } - }, - "basics": [ - { - "name": "skuUrnVersion", - "type": "Microsoft.Common.DropDown", - "label": "Oracle WebLogic Image", - "defaultValue": "WebLogic Server 14.1.1.0.0 and JDK 11 on Oracle Linux 9.1", - "toolTip": "Choose Oracle WebLogic image, which is provided by Oracle, with Java and WebLogic preinstalled.", - "constraints": { - "allowedValues": [ - { - "label": "WebLogic Server 14.1.1.0.0 and JDK 11 on Oracle Linux 9.1", - "value": "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest" - }, - { - "label": "WebLogic Server 14.1.1.0.0 and JDK 11 on Oracle Linux 8.7", - "value": "owls-141100-jdk11-ol87;Oracle:weblogic-141100-jdk11-ol87:owls-141100-jdk11-ol87;latest" - }, - { - "label": "WebLogic Server 14.1.1.0.0 and JDK 8 on Oracle Linux 9.1", - "value": "owls-141100-jdk8-ol91;Oracle:weblogic-141100-jdk8-ol91:owls-141100-jdk8-ol91;latest" - }, - { - "label": "WebLogic Server 14.1.1.0.0 and JDK 8 on Oracle Linux 8.7", - "value": "owls-141100-jdk8-ol87;Oracle:weblogic-141100-jdk8-ol87:owls-141100-jdk8-ol87;latest" - }, - { - "label": "WebLogic Server 12.2.1.4.0 and JDK 8 on Oracle Linux 9.1", - "value": "owls-122140-jdk8-ol91;Oracle:weblogic-122140-jdk8-ol91:owls-122140-jdk8-ol91;latest" - }, - { - "label": "WebLogic Server 12.2.1.4.0 and JDK 8 on Oracle Linux 8.7", - "value": "owls-122140-jdk8-ol87;Oracle:weblogic-122140-jdk8-ol87:owls-122140-jdk8-ol87;latest" - }, - { - "label": "WebLogic Server 12.2.1.4.0 and JDK8 on Oracle Linux 7.6", - "value": "owls-122140-jdk8-ol76;Oracle:weblogic-122140-jdk8-ol76:owls-122140-jdk8-ol7;latest" - }, - { - "label": "WebLogic Server 14.1.1.0.0 and JDK8 on Oracle Linux 7.6", - "value": "owls-141100-jdk8-ol76;Oracle:weblogic-141100-jdk8-ol76:owls-141100-jdk8-ol7;latest" - }, - { - "label": "WebLogic Server 14.1.1.0.0 and JDK11 on Oracle Linux 7.6", - "value": "owls-141100-jdk11-ol76;Oracle:weblogic-141100-jdk11-ol76:owls-141100-jdk11-ol7;latest" - }, - { - "label": "WebLogic Server 14.1.1.0.0 and JDK11 on Red Hat Enterprise Linux 8.7", - "value": "owls-141100-jdk11-rhel87;Oracle:weblogic-141100-jdk11-rhel87:owls-141100-jdk11-rhel87;latest" - }, - { - "label": "WebLogic Server 14.1.1.0.0 and JDK8 on Red Hat Enterprise Linux 8.7", - "value": "owls-141100-jdk8-rhel87;Oracle:weblogic-141100-jdk8-rhel87:owls-141100-jdk8-rhel87;latest" - }, - { - "label": "WebLogic Server 12.2.1.4.0 and JDK8 on Red Hat Enterprise Linux 8.7", - "value": "owls-122140-jdk8-rhel87;Oracle:weblogic-122140-jdk8-rhel87:owls-122140-jdk8-rhel87;latest" - } - ], - "required": true - }, - "visible": true - }, - { - "name": "vmSizeSelect", - "type": "Microsoft.Compute.SizeSelector", - "label": "Virtual machine size", - "toolTip": "The size of virtual machine to provision.", - "recommendedSizes": [ - "Standard_A1", - "Standard_A2", - "Standard_A3", - "Standard_A4", - "Standard_B1ms" - ], - "constraints": { - "excludedSizes": [ - "Standard_B1ls", - "Standard_A0", - "Basic_A0", - "Standard_B1s", - ${azure.armBased.vmSize.list} - ] - }, - "osPlatform": "Linux", - "count": "1", - "visible": true - }, - { - "name": "invalidVMSizeInfo", - "type": "Microsoft.Common.InfoBox", - "visible": "[contains(basics('vmSizeSelect'),'p')]", - "options": { - "icon": "Error", - "text": "The VM size you selected includes the feature letter 'p', indicating it uses ARM CPUs. ARM platform is not supported. Please select a different VM size. For more information, refer to the Azure virtual machine sizes naming conventions." - } - }, - { - "name": "basicsRequired", - "type": "Microsoft.Common.Section", - "label": "Credentials for Virtual Machines and WebLogic", - "elements": [ - { - "name": "adminUsername", - "type": "Microsoft.Common.TextBox", - "label": "Username for admin account of VMs", - "defaultValue": "weblogic", - "toolTip": "Use only letters and numbers", - "constraints": { - "required": true, - "validations": [ - { - "regex": "^[a-z0-9A-Z]{1,30}$", - "message": "The value must be 1-30 characters long and must only contain letters and numbers." - }, - { - "isValid": "[not(contains(basics('vmSizeSelect'),'p'))]", - "message": "ARM platform is not supported. Please select a different VM size." - } - ] - }, - "visible": true - }, - { - "name": "adminPasswordOrKey", - "type": "Microsoft.Compute.CredentialsCombo", - "label": { - "authenticationType": "Authentication type", - "password": "Password", - "confirmPassword": "Confirm password", - "sshPublicKey": "SSH public key" - }, - "toolTip": { - "authenticationType": "Use username and password or SSH public key for authentication to the VM", - "password": "Password for admin account of VMs", - "sshPublicKey": "SSH key for admin account of VMs" - }, - "constraints": { - "required": true, - "customPasswordRegex": "^((?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])|(?=.*[0-9])(?=.*[a-z])(?=.*[!@#$%^&*])|(?=.*[0-9])(?=.*[A-Z])(?=.*[!@#$%^&*])|(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*])).{12,72}$", - "customValidationMessage": "Password must be at least 12 characters long and have 3 out of the following: one number, one lower case, one upper case, or one special character" - }, - "options": { - "hideConfirmation": false, - "hidePassword": false - }, - "osPlatform": "Linux", - "visible": true - }, - { - "name": "wlsUserName", - "type": "Microsoft.Common.TextBox", - "label": "Username for WebLogic Administrator", - "defaultValue": "weblogic", - "toolTip": "Use only letters and numbers", - "constraints": { - "required": true, - "regex": "^[a-z0-9A-Z]{1,30}$", - "validationMessage": "The value must be 1-30 characters long and must only contain letters and numbers." - }, - "visible": true - }, - { - "name": "wlsPassword", - "type": "Microsoft.Common.PasswordBox", - "label": { - "password": "Password for WebLogic Administrator", - "confirmPassword": "Confirm password" - }, - "toolTip": "Password for WebLogic Administrator", - "constraints": { - "required": true, - "regex": "^(?=.*[A-Z])(?=.*[a-z])(?=.*\\d)[A-Za-z\\d]{12,}$", - "validationMessage": "The password must contain at least 12 characters, with at least 1 uppercase letter, 1 lowercase letter and 1 number, and special characters are not allowed." - }, - "options": { - "hideConfirmation": false - }, - "visible": true - } - ], - "visible": true - }, - { - "name": "basicsOptional", - "type": "Microsoft.Common.Section", - "label": "Optional Basic Configuration", - "elements": [ - { - "name": "basicsOptionalAcceptDefaults", - "type": "Microsoft.Common.OptionsGroup", - "label": "Accept defaults for optional configuration?", - "defaultValue": "Yes", - "toolTip": "Select 'No' to edit optional basic configuration.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": "false" - }, - { - "label": "No", - "value": "true" - } - ], - "required": true - } - }, - { - "name": "wlsDomainName", - "type": "Microsoft.Common.TextBox", - "label": "WebLogic Domain Name", - "toolTip": "The name of the WebLogic Domain to create.", - "defaultValue": "adminDomain", - "constraints": { - "required": true, - "regex": "^[a-z0-9A-Z]{3,20}$", - "validationMessage": "The Domain Name must be between 3 and 20 characters long and contain letters, numbers only." - }, - "visible": "[bool(basics('basicsOptional').basicsOptionalAcceptDefaults)]" - }, - { - "name": "enableAdminHTTPListenPort", - "type": "Microsoft.Common.OptionsGroup", - "label": "Enable HTTP listen port on WebLogic Administration Server?", - "defaultValue": "Yes", - "toolTip": "Select 'No' to disable HTTP listen port on WebLogic Administration Server.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": true - }, - { - "label": "No", - "value": false - } - ], - "required": true - }, - "visible": "[bool(basics('basicsOptional').basicsOptionalAcceptDefaults)]" - }, - { - "name": "useSystemAssignedManagedIdentity", - "label": "Create a system assigned managed identity to be created for the VM(s).", - "type": "Microsoft.Common.OptionsGroup", - "toolTip": "System assigned managed identities enable credential-free secure access to many Azure resources from this VM.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": true - }, - { - "label": "No", - "value": false - } - ], - "required": true - }, - "defaultValue": "Yes", - "visible": "[bool(basics('basicsOptional').basicsOptionalAcceptDefaults)]" - } - ], - "visible": true - }, - { - "name": "howToReportIssues", - "type": "Microsoft.Common.Section", - "label": "Report issues, get help, and share feedback", - "elements": [ - { - "name": "help", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "See the documentation for this offer.", - "link": { - "label": "Offer documentation", - "uri": "https://aka.ms/wls-vm-docs" - } - } - }, - { - "name": "howToReportIssueText", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "If you encounter problems during the deployment of Oracle WebLogic Server, report them here.", - "link": { - "label": "Issue tracker", - "uri": "https://aka.ms/arm-oraclelinux-wls-issues?version=${project.version}" - } - } - }, - { - "name": "howToJoinSlack", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "If you want to interact directly with the Oracle WebLogic community, join the public Slack channel named 'oracle-weblogic'.", - "link": { - "label": "Join Slack", - "uri": "https://aka.ms/arm-oraclelinux-wls-slack" - } - } - }, - { - "name": "survey", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "To get free help with Azure migration from the development team, fill out this survey.", - "link": { - "label": "Take survey", - "uri": "https://aka.ms/wls-on-azure-survey" - } - } - } - ], - "visible": true - } - ], - "steps": [ - { - "name": "section_sslConfiguration", - "type": "Microsoft.Common.Section", - "label": "TLS/SSL Configuration", - "elements": [ - { - "name": "sslConfigurationText", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "Selecting 'Yes' here will cause the template to provision WebLogic Administration Console on HTTPS (Secure) port, with your own TLS/SSL certificate.", - "link": { - "label": "Learn more", - "uri": "https://aka.ms/arm-oraclelinux-wls-ssl-config" - } - } - }, - { - "name": "enableCustomSSL", - "type": "Microsoft.Common.OptionsGroup", - "label": "Configure WebLogic Administration Console on HTTPS (Secure) port, with your own TLS/SSL certificate?", - "defaultValue": "No", - "toolTip": "Select 'Yes' to configure WebLogic Administration Console on HTTPS (Secure) port with your own TLS/SSL certificate.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": true - }, - { - "label": "No", - "value": false - } - ], - "required": false - } - }, - { - "name": "uploadedCustomSSLSettings", - "type": "Microsoft.Common.Section", - "visible": "[steps('section_sslConfiguration').enableCustomSSL]", - "label": "TLS/SSL Configuration Settings", - "elements": [ - { - "name": "sslKeystoreInfo0", - "type": "Microsoft.Common.InfoBox", - "visible": "true", - "options": { - "icon": "Info", - "text": "You must provide different files for identity and trust KeyStores. Select here for more details.", - "uri": "https://aka.ms/arm-oraclelinux-wls-ssl-configuration" - } - }, - { - "name": "uploadedCustomIdentityKeyStoreData", - "type": "Microsoft.Common.FileUpload", - "label": "Identity KeyStore Data file(.jks,.p12)", - "toolTip": "Identity KeyStore for TLS/SSL configuration", - "constraints": { - "required": true, - "accept": ".jks,.p12" - }, - "options": { - "multiple": false, - "uploadMode": "file", - "openMode": "binary" - }, - "visible": true - }, - { - "name": "uploadedCustomIdentityKeyStorePassphrase", - "type": "Microsoft.Common.PasswordBox", - "label": { - "password": "Password", - "confirmPassword": "Confirm password" - }, - "toolTip": " The passphrase for the Identity KeyStore", - "constraints": { - "required": true, - "regex": "^.{6,}$", - "validationMessage": "Keypass must be at least 6 characters long." - }, - "options": { - "hideConfirmation": false - }, - "visible": true - }, - { - "name": "uploadedCustomIdentityKeyStoreType", - "type": "Microsoft.Common.DropDown", - "visible": "true", - "label": "The Identity KeyStore type (JKS,PKCS12)", - "defaultValue": "JKS", - "toolTip": "One of the supported KeyStore types", - "constraints": { - "allowedValues": [ - { - "label": "JKS", - "value": "JKS" - }, - { - "label": "PKCS12", - "value": "PKCS12" - } - ], - "required": true - } - }, - { - "name": "uploadedPrivateKeyAlias", - "type": "Microsoft.Common.TextBox", - "visible": "true", - "label": "The alias of the server's private key within the Identity KeyStore", - "defaultValue": "", - "toolTip": "Use only letters and numbers", - "constraints": { - "required": true, - "regex": "^[a-z0-9A-Z]{1,30}$", - "validationMessage": "The value must be 1-30 characters long and must only contain letters and numbers." - } - }, - { - "name": "uploadedPrivateKeyPassPhrase", - "type": "Microsoft.Common.PasswordBox", - "visible": "true", - "label": { - "password": "The passphrase for the server's private key within the Identity KeyStore", - "confirmPassword": "Confirm passphrase" - }, - "toolTip": "Use only letters and numbers", - "constraints": { - "required": true, - "regex": "^.{6,}$", - "validationMessage": "Keypass must be at least 6 characters long." - }, - "options": { - "hideConfirmation": false - } - }, - { - "name": "uploadedCustomTrustKeyStoreData", - "type": "Microsoft.Common.FileUpload", - "label": "Trust KeyStore Data file(.jks,.p12)", - "toolTip": "Trust KeyStore for TLS/SSL configuration.", - "constraints": { - "required": true, - "accept": ".jks,.p12" - }, - "options": { - "multiple": false, - "uploadMode": "file", - "openMode": "binary" - }, - "visible": true - }, - { - "name": "uploadedCustomTrustKeyStorePassPhrase", - "type": "Microsoft.Common.PasswordBox", - "label": { - "password": "Password", - "confirmPassword": "Confirm password" - }, - "toolTip": " The passphrase for the Trust KeyStore", - "constraints": { - "required": true, - "regex": "^.{6,}$", - "validationMessage": "Keypass must be at least 6 characters long." - }, - "options": { - "hideConfirmation": false - }, - "visible": true - }, - { - "name": "uploadedCustomTrustKeyStoreType", - "type": "Microsoft.Common.DropDown", - "visible": "true", - "label": "The Trust KeyStore type (JKS,PKCS12)", - "defaultValue": "JKS", - "toolTip": "One of the supported KeyStore types", - "constraints": { - "allowedValues": [ - { - "label": "JKS", - "value": "JKS" - }, - { - "label": "PKCS12", - "value": "PKCS12" - } - ], - "required": true - } - } - ] - } - ] - }, - { - "name": "section_networkingConfiguration", - "type": "Microsoft.Common.Section", - "label": "Networking", - "elements": [ - { - "name": "vnetInfo", - "type": "Microsoft.Common.InfoBox", - "options": { - "icon": "Info", - "text": "When creating a new virtual network, the subnet's address prefix is calculated automatically based on the virtual
    network's address prefix. When using an existing virtual network, a minimum virtual network size of /28 and a
    minimum subnet size of /29 are required. Additionally, the subnet must have adequate available addresses for
    the server setup." - } - }, - { - "name": "virtualNetwork", - "type": "Microsoft.Network.VirtualNetworkCombo", - "label": { - "virtualNetwork": "Virtual network", - "subnets": "Subnets" - }, - "toolTip": { - "virtualNetwork": "Name of the virtual network", - "subnets": "Subnets for the virtual network" - }, - "defaultValue": { - "name": "[concat('wlsadmin-vnet',take(guid(), 8))]", - "addressPrefixSize": "/28" - }, - "constraints": { - "minAddressPrefixSize": "/28" - }, - "subnets": { - "subnet1": { - "label": "Subnet", - "defaultValue": { - "name": "Subnet-1", - "addressPrefixSize": "/29" - }, - "constraints": { - "minAddressPrefixSize": "/29", - "minAddressCount": 2, - "requireContiguousAddresses": false - } - } - } - }, - { - "name": "denyPublicTrafficForAdminServer", - "type": "Microsoft.Common.OptionsGroup", - "visible": "[equals(steps('section_networkingConfiguration').virtualNetwork.newOrExisting, 'new')]", - "label": "Deny public traffic for admin server?", - "defaultValue": "No", - "toolTip": "Select 'Yes' to deny public traffic for admin server. Configuration here for port 7001 and 7002 has a higher priority than above.", - "constraints": { - "allowedValues": [ - { - "label": "No", - "value": false - }, - { - "label": "Yes", - "value": true - } - ], - "required": true - } - }, - { - "name": "dnsConfigurationText", - "type": "Microsoft.Common.TextBlock", - "visible": "[equals(steps('section_networkingConfiguration').virtualNetwork.newOrExisting, 'new')]", - "options": { - "text": "Selecting 'Yes' here will cause the template to provision Oracle WebLogic Server Administration Console using custom DNS Name (example: admin.contoso.com)", - "link": { - "label": "Learn more", - "uri": "https://aka.ms/arm-oraclelinux-wls-dns" - } - } - }, - { - "name": "enableCustomDNS", - "type": "Microsoft.Common.OptionsGroup", - "visible": "[equals(steps('section_networkingConfiguration').virtualNetwork.newOrExisting, 'new')]", - "label": "Configure Custom DNS Alias?", - "defaultValue": "No", - "toolTip": "Select 'Yes' to configure Custom DNS Alias.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": true - }, - { - "label": "No", - "value": false - } - ], - "required": false - } - }, - { - "name": "dnsLabelPrefix", - "type": "Microsoft.Common.TextBox", - "label": "DNS Label Prefix", - "toolTip": "The string to prepend to the DNS label.", - "defaultValue": "wls", - "constraints": { - "required": true, - "regex": "^[a-z0-9A-Z]{3,10}$", - "validationMessage": "The prefix must be between 3 and 10 characters long and contain letters, numbers only." - }, - "visible": "[bool(steps('section_networkingConfiguration').enableCustomDNS)]" - }, - { - "name": "portsToExpose", - "label": "Ports and port ranges to expose (N or N-N, comma separated)", - "type": "Microsoft.Common.TextBox", - "toolTip": "Ports and port ranges to expose (N or N-N, comma separated)", - "defaultValue": "80,443,7001-9000", - "constraints": { - "required": true, - "regex": "^((([0-9]+-[0-9]+)|([0-9]+))[,]?)+[^,]$", - "validationMessage": "Only numbers, hyphen separated ranges of numbers, separated by commas" - }, - "visible": "[bool(steps('section_networkingConfiguration').enableCustomDNS)]" - }, - { - "name": "customDNSSettings", - "type": "Microsoft.Common.Section", - "label": "DNS Configuration Settings", - "visible": "[bool(steps('section_networkingConfiguration').enableCustomDNS)]", - "elements": [ - { - "name": "bringDNSZone", - "type": "Microsoft.Common.OptionsGroup", - "label": "Use an existing Azure DNS Zone", - "defaultValue": "No", - "toolTip": "Select 'Yes' to configure Custom DNS Alias based on an existing Azure DNS Zone. Select 'No' to create an Azure DNS Zone and Custom DNS Alias.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": true - }, - { - "label": "No", - "value": false - } - ] - } - }, - { - "name": "createDNSZoneText", - "type": "Microsoft.Common.InfoBox", - "visible": "[not(bool(steps('section_networkingConfiguration').customDNSSettings.bringDNSZone))]", - "options": { - "icon": "Info", - "text": "You must perform DNS Domain Delegation at your DNS Registry after deployment.", - "uri": "https://aka.ms/dns-domain-delegation" - } - }, - { - "name": "infoDNSIndentity", - "type": "Microsoft.Common.InfoBox", - "visible": "[steps('section_networkingConfiguration').customDNSSettings.bringDNSZone]", - "options": { - "icon": "Info", - "text": "This option will add/update records in your Azure DNS Zone.The Azure identity deploying this feature must have one of the following two sets of Azure role-based access control roles:
  • Contributor and User Access Administrator of the current subscription.
  • Owner of the current subscription.
  • " - } - }, - { - "name": "dnszoneName", - "type": "Microsoft.Common.TextBox", - "label": "DNS Zone Name", - "defaultValue": "", - "toolTip": "Use only letters and numbers and periods to separate Domains", - "constraints": { - "required": true, - "regex": "^([0-9a-zA-Z_-]{1,63}\\.){1,33}[0-9a-zA-Z_-]{1,63}$", - "validationMessage": "There must be between 2 and 34 labels. For example, \"contoso.com\" has 2 labels. Each label must contain between 1 and 63 characters. Each label must only contain letters, numbers, underscores, and dashes." - } - }, - { - "name": "dnsZoneResourceGroup", - "type": "Microsoft.Common.TextBox", - "label": "Name of the resource group which contains the DNS Zone in current subscription", - "defaultValue": "", - "toolTip": "Name of the resource group which contains the DNS Zone in current subscription", - "constraints": { - "required": true, - "regex": "^[a-z0-9A-Z.\\-_()]{0,89}([a-z0-9A-Z\\-_()]{1})$", - "validationMessage": "[if(greater(length(steps('section_networkingConfiguration').existingDNSZonesSettings.dnsZoneResourceGroup), 90),'Resource group names only allow up to 90 characters.', 'Resource group names only allow alphanumeric characters, periods, underscores, hyphens and parenthesis and cannot end in a period.')]" - }, - "visible": "[steps('section_networkingConfiguration').customDNSSettings.bringDNSZone]" - }, - { - "name": "dnszoneAdminConsoleLabel", - "type": "Microsoft.Common.TextBox", - "label": "Label for Oracle WebLogic Administration Console", - "defaultValue": "admin", - "toolTip": "Specify a label to generate subdomain of Oracle WebLogic Administration Console", - "constraints": { - "required": true, - "validations": [ - { - "regex": "^([0-9a-zA-Z_-]{1,63}\\.){0,33}[0-9a-zA-Z_-]{1,63}$", - "message": "Each label must contain between 1 and 63 characters. Each label must only contain letters, numbers, underscores, and dashes." - }, - { - "isValid": "[less(sub(length(concat(steps('section_networkingConfiguration').customDNSSettings.dnszoneAdminConsoleLabel,'.',steps('section_networkingConfiguration').customDNSSettings.dnszoneName)),length(replace(concat(steps('section_networkingConfiguration').customDNSSettings.dnszoneAdminConsoleLabel,'.',steps('section_networkingConfiguration').customDNSSettings.dnszoneName), '.', ''))),34)]", - "message": "Subdomain must be between 2 and 34 labels. For example, \"admin.contoso.com\" has 3 labels." - } - ] - } - } - ] - } - ] - }, - { - "name": "section_database", - "type": "Microsoft.Common.Section", - "label": "Database", - "subLabel": { - "preValidation": "Configure integrations to database", - "postValidation": "Done" - }, - "bladeTitle": "Database", - "elements": [ - { - "name": "aboutDatabase", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "Selecting 'Yes' here and providing the configuration will cause the template to configure the WebLogic Server to connect to the desired pre-existing database. The database must be network accessible to the VNET and subnets created by the template." - } - }, - { - "name": "enableDB", - "type": "Microsoft.Common.OptionsGroup", - "label": "Connect to database?", - "defaultValue": "No", - "toolTip": "Select 'Yes' and provide required info to configure the connection to a database.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": "true" - }, - { - "label": "No", - "value": "false" - } - ], - "required": true - } - }, - { - "name": "databaseConnectionInfo", - "type": "Microsoft.Common.Section", - "label": "Connection settings", - "elements": [ - { - "name": "databaseType", - "type": "Microsoft.Common.DropDown", - "label": "Choose database type", - "toolTip": "Choose database type", - "defaultValue": "Oracle database", - "constraints": { - "allowedValues": [ - { - "label": "PostgreSQL (Supports passwordless connection)", - "value": "postgresql" - }, - { - "label": "Oracle database", - "value": "oracle" - }, - { - "label": "Microsoft SQL Server (Supports passwordless connection)", - "value": "sqlserver" - }, - { - "label": "MySQL (Supports passwordless connection)", - "value": "mysql" - } - ], - "required": true - }, - "visible": true - }, - { - "name": "mysqlJDBCDriverInfo", - "type": "Microsoft.Common.InfoBox", - "visible": "[and(bool(steps('section_database').enableDB),equals(steps('section_database').databaseConnectionInfo.databaseType, 'mysql'))]", - "options": { - "icon": "Info", - "text": "To support passwordless connection and various functionalities, the offer will upgrade the
    Oracle WebLogic Server MySQL driver with recent MySQL Connector Java driver." - } - }, - { - "name": "jdbcDataSourceName", - "type": "Microsoft.Common.TextBox", - "label": "JNDI Name", - "toolTip": "The JNDI name for the database JDBC connection", - "defaultValue": "", - "constraints": { - "required": true, - "validations": [ - { - "regex": "^[a-z0-9A-Z/]{1,30}$", - "message": "The value must be 1-30 characters long and must only contain letters, numbers, and slashes (/)." - } - ] - }, - "visible": true - }, - { - "name": "dsConnectionURL", - "type": "Microsoft.Common.TextBox", - "label": "DataSource Connection String", - "toolTip": "The JDBC connection string for the database", - "defaultValue": "", - "constraints": { - "required": true, - "validations": [ - { - "regex": "^jdbc:.*$", - "message": "A valid JDBC URL must start with 'jdbc:'." - }, - { - "isValid": "[startsWith(steps('section_database').databaseConnectionInfo.dsConnectionURL, concat('jdbc:', steps('section_database').databaseConnectionInfo.databaseType))]", - "message": "A valid JDBC URL for the chosen database type must be provided." - }, - { - "isValid": "[if(and(bool(steps('section_database').databaseConnectionInfo.enablePswlessConnection), equals(steps('section_database').databaseConnectionInfo.databaseType, 'mysql')), and(not(contains(steps('section_database').databaseConnectionInfo.dsConnectionURL, 'defaultAuthenticationPlugin')),not(contains(steps('section_database').databaseConnectionInfo.dsConnectionURL, 'authenticationPlugins')), not(contains(steps('section_database').databaseConnectionInfo.dsConnectionURL, 'azure.clientId'))), 'true')]", - "message": "The offer will append defaultAuthenticationPlugin, authenticationPlugins with Azure provided plugins, and append azure.clientId with your managed identity client ID automatically, please do not specify them in your connection string." - }, - { - "isValid": "[if(and(bool(steps('section_database').databaseConnectionInfo.enablePswlessConnection), equals(steps('section_database').databaseConnectionInfo.databaseType, 'postgresql')), and(not(contains(steps('section_database').databaseConnectionInfo.dsConnectionURL, 'authenticationPluginClassName')),not(contains(steps('section_database').databaseConnectionInfo.dsConnectionURL, 'azure.clientId'))), 'true')]", - "message": "The offer will append authenticationPluginClassName with Azure provided plugins, and append azure.clientId with your managed identity client ID automatically, please do not specify them in your connection string." - }, - { - "isValid": "[if(and(bool(steps('section_database').databaseConnectionInfo.enablePswlessConnection), equals(steps('section_database').databaseConnectionInfo.databaseType, 'sqlserver')), and(not(contains(steps('section_database').databaseConnectionInfo.dsConnectionURL, 'authentication=ActiveDirectoryMSI')),not(contains(steps('section_database').databaseConnectionInfo.dsConnectionURL, 'msiClientId'))), 'true')]", - "message": "The offer will append authentication with ActiveDirectoryMSI, and append msiClientId with your managed identity client ID automatically, please do not specify them in your connection string." - }, - { - "isValid": "[if(and(bool(steps('section_database').databaseConnectionInfo.enablePswlessConnection0),equals(steps('section_database').databaseConnectionInfo.databaseType, 'sqlserver')), greater(length(steps('section_database').databaseConnectionInfo.dbIdentity.userAssignedIdentities),0), bool('true'))]", - "message": "You must select at least one managed identity that has access to your database." - } - ] - }, - "visible": true - }, - { - "name": "dbGlobalTranPro", - "type": "Microsoft.Common.DropDown", - "label": "Global transactions protocol", - "defaultValue": "OnePhaseCommit", - "multiLine": true, - "toolTip": "Determines the transaction protocol (global transaction processing behavior) for the data source.", - "constraints": { - "allowedValues": [ - { - "label": "TwoPhaseCommit", - "description": "Standard XA transaction processing. Requires an XA driver.", - "value": "TwoPhaseCommit" - }, - { - "label": "LoggingLastResource", - "description": "A performance enhancement for one non-XA resource.", - "value": "LoggingLastResource" - }, - { - "label": "EmulateTwoPhaseCommit", - "description": "Enables one non-XA resource to participate in a global transaction, but has some risk to data.", - "value": "EmulateTwoPhaseCommit" - }, - { - "label": "OnePhaseCommit", - "description": "One-phase XA transaction processing using a non-XA driver. This is the default setting.", - "value": "OnePhaseCommit" - }, - { - "label": "None", - "description": "Support for local transactions only.", - "value": "None" - } - ], - "required": true - }, - "visible": true - }, - { - "name": "enablePswlessConnection0", - "type": "Microsoft.Common.CheckBox", - "label": "Use passwordless datasource connection", - "toolTip": "Use passwordless datasource connection.", - "visible": "[and(bool(steps('section_database').enableDB),equals(steps('section_database').databaseConnectionInfo.databaseType, 'sqlserver'))]" - }, - { - "name": "dbUser", - "type": "Microsoft.Common.TextBox", - "label": "Database username", - "toolTip": "Use only letters and numbers", - "defaultValue": "", - "constraints": { - "required": true, - "validations": [ - { - "regex": "^(?!\\-)([a-z0-9A-Z@\\-]{1,128})([^\\-])$", - "message": "The value must be 1-128 characters long and must only contain letters, numbers, hyphen(-) and the at sign, no hyphen allowed at the beginning and the end of database username." - }, - { - "isValid": "[if(bool(steps('section_database').databaseConnectionInfo.enablePswlessConnection), greater(length(steps('section_database').databaseConnectionInfo.dbIdentity.userAssignedIdentities),0), bool('true'))]", - "message": "You must select at least one managed identity that has access to your database." - } - ] - }, - "visible": "[and(bool(steps('section_database').enableDB), not(and(steps('section_database').databaseConnectionInfo.enablePswlessConnection0, equals(steps('section_database').databaseConnectionInfo.databaseType, 'sqlserver'))))]" - }, - { - "name": "enablePswlessConnection", - "type": "Microsoft.Common.CheckBox", - "label": "Use passwordless datasource connection", - "toolTip": "Use passwordless datasource connection.", - "visible": "[and(bool(steps('section_database').enableDB),or(equals(steps('section_database').databaseConnectionInfo.databaseType, 'mysql'),equals(steps('section_database').databaseConnectionInfo.databaseType, 'postgresql')))]" - }, - { - "name": "dbPassword", - "type": "Microsoft.Common.PasswordBox", - "label": { - "password": "Database Password", - "confirmPassword": "Confirm password" - }, - "toolTip": "Database Password", - "constraints": { - "required": true, - "regex": "^((?=.*[0-9])(?=.*[a-zA-Z!@#$%^&*])).{5,128}$", - "validationMessage": "The password must be between 5 and 128 characters long and have at least one number." - }, - "options": { - "hideConfirmation": false - }, - "visible": "[and(bool(steps('section_database').enableDB), not(or(steps('section_database').databaseConnectionInfo.enablePswlessConnection, steps('section_database').databaseConnectionInfo.enablePswlessConnection0)))]" - }, - { - "name": "dbIdentity", - "type": "Microsoft.ManagedIdentity.IdentitySelector", - "label": "Connect database with Managed Identity", - "toolTip": { - "userAssignedIdentity": "Select a user assigned identity that has access to your database. For how to create a database user for your managed identity, see https://aka.ms/javaee-db-identity." - }, - "defaultValue": { - "systemAssignedIdentity": "Off" - }, - "options": { - "hideSystemAssignedIdentity": true, - "hideUserAssignedIdentity": false - }, - "visible": "[and(bool(steps('section_database').enableDB), or(steps('section_database').databaseConnectionInfo.enablePswlessConnection, steps('section_database').databaseConnectionInfo.enablePswlessConnection0))]" - } - ], - "visible": "[bool(steps('section_database').enableDB)]" - } - ] - }, - { - "name": "section_tags", - "label": "Tags", - "elements": [ - { - "name": "tagsByResource", - "type": "Microsoft.Common.TagsByResource", - "resources": [ - "${identifier.dnszones}", - "${identifier.networkInterfaces}", - "${identifier.networkSecurityGroups}", - "${identifier.publicIPAddresses}", - "${identifier.privateEndpoints}", - "${identifier.storageAccounts}", - "${identifier.virtualNetworks}", - "${identifier.virtualMachines}", - "${identifier.virtualMachinesExtensions}", - "${identifier.deploymentScripts}", - "${identifier.userAssignedIdentities}", - "${identifier.resourcesDeployment}" - ], - "toolTip": "Tags help you organize your resources and categorize them for billing or management purposes. You can apply tags to resources deployed by the offer." - } - ] - } - ], - "outputs": { - "Location": "[location()]", - "adminPasswordOrKey": "[if(equals(basics('basicsRequired').adminPasswordOrKey.authenticationType, 'password'), basics('basicsRequired').adminPasswordOrKey.password, basics('basicsRequired').adminPasswordOrKey.sshPublicKey)]", - "adminUsername": "[basics('basicsRequired').adminUsername]", - "authenticationType": "[basics('basicsRequired').adminPasswordOrKey.authenticationType]", - "addressPrefixes": "[steps('section_networkingConfiguration').virtualNetwork.addressPrefixes]", - "databaseType": "[steps('section_database').databaseConnectionInfo.databaseType]", - "denyPublicTrafficForAdminServer": "[steps('section_networkingConfiguration').denyPublicTrafficForAdminServer]", - "dbIdentity": "[steps('section_database').databaseConnectionInfo.dbIdentity]", - "dbPassword": "[steps('section_database').databaseConnectionInfo.dbPassword]", - "dbUser": "[steps('section_database').databaseConnectionInfo.dbUser]", - "dbGlobalTranPro": "[steps('section_database').databaseConnectionInfo.dbGlobalTranPro]", - "dnsLabelPrefix": "[steps('section_networkingConfiguration').dnsLabelPrefix]", - "dnszoneName": "[steps('section_networkingConfiguration').customDNSSettings.dnszoneName]", - "dnszoneResourceGroup": "[steps('section_networkingConfiguration').customDNSSettings.dnsZoneResourceGroup]", - "dnszoneAdminConsoleLabel": "[steps('section_networkingConfiguration').customDNSSettings.dnszoneAdminConsoleLabel]", - "dsConnectionURL": "[steps('section_database').databaseConnectionInfo.dsConnectionURL]", - "enableDB": "[bool(steps('section_database').enableDB)]", - "enableCustomDNS": "[bool(steps('section_networkingConfiguration').enableCustomDNS)]", - "enablePswlessConnection": "[or(bool(steps('section_database').databaseConnectionInfo.enablePswlessConnection), bool(steps('section_database').databaseConnectionInfo.enablePswlessConnection0))]", - "hasDNSZones": "[bool(if(bool(steps('section_networkingConfiguration').enableCustomDNS), steps('section_networkingConfiguration').customDNSSettings.bringDNSZone, 'false'))]", - "jdbcDataSourceName": "[steps('section_database').databaseConnectionInfo.jdbcDataSourceName]", - "portsToExpose": "[steps('section_networkingConfiguration').portsToExpose]", - "skuUrnVersion": "[basics('skuUrnVersion')]", - "useSystemAssignedManagedIdentity": "[basics('basicsOptional').useSystemAssignedManagedIdentity]", - "vmSize": "[basics('vmSizeSelect')]", - "wlsDomainName": "[basics('basicsOptional').wlsDomainName]", - "wlsPassword": "[basics('basicsRequired').wlsPassword]", - "wlsUserName": "[basics('basicsRequired').wlsUserName]", - "enableHTTPAdminListenPort": "[basics('basicsOptional').enableAdminHTTPListenPort]", - "enableCustomSSL": "[steps('section_sslConfiguration').enableCustomSSL]", - "subnetName": "[steps('section_networkingConfiguration').virtualNetwork.subnets.subnet1.name]", - "subnetPrefix": "[steps('section_networkingConfiguration').virtualNetwork.subnets.subnet1.addressPrefix]", - "tagsByResource": "[steps('section_tags').tagsByResource]", - "uploadedCustomIdentityKeyStoreData": "[steps('section_sslConfiguration').uploadedCustomSSLSettings.uploadedCustomIdentityKeyStoreData]", - "uploadedCustomIdentityKeyStorePassphrase": "[steps('section_sslConfiguration').uploadedCustomSSLSettings.uploadedCustomIdentityKeyStorePassphrase]", - "uploadedCustomIdentityKeyStoreType": "[steps('section_sslConfiguration').uploadedCustomSSLSettings.uploadedCustomIdentityKeyStoreType]", - "uploadedCustomTrustKeyStoreData": "[steps('section_sslConfiguration').uploadedCustomSSLSettings.uploadedCustomTrustKeyStoreData]", - "uploadedCustomTrustKeyStorePassPhrase": "[steps('section_sslConfiguration').uploadedCustomSSLSettings.uploadedCustomTrustKeyStorePassPhrase]", - "uploadedCustomTrustKeyStoreType": "[steps('section_sslConfiguration').uploadedCustomSSLSettings.uploadedCustomTrustKeyStoreType]", - "uploadedPrivateKeyAlias": "[steps('section_sslConfiguration').uploadedCustomSSLSettings.uploadedPrivateKeyAlias]", - "uploadedPrivateKeyPassPhrase": "[steps('section_sslConfiguration').uploadedCustomSSLSettings.uploadedPrivateKeyPassPhrase]", - "virtualNetworkName": "[steps('section_networkingConfiguration').virtualNetwork.name]", - "virtualNetworkResourceGroupName": "[steps('section_networkingConfiguration').virtualNetwork.resourceGroup]", - "virtualNetworkNewOrExisting": "[steps('section_networkingConfiguration').virtualNetwork.newOrExisting]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/mainTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/mainTemplate.json deleted file mode 100644 index c5bee0ed6..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/mainTemplate.json +++ /dev/null @@ -1,866 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - }, - "defaultValue": "[deployment().properties.templateLink.uri]" - }, - "_artifactsLocationSasToken": { - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - }, - "defaultValue": "" - }, - "adminPasswordOrKey": { - "type": "securestring", - "metadata": { - "description": "SSH Key or password for the Virtual Machine. SSH key is recommended." - } - }, - "adminUsername": { - "defaultValue": "weblogic", - "type": "string", - "metadata": { - "description": "User name for the Virtual Machine." - } - }, - "adminVMName": { - "type": "string", - "defaultValue": "adminVM", - "metadata": { - "description": "Admin Server hosting VM name." - } - }, - "authenticationType": { - "type": "string", - "defaultValue": "password", - "allowedValues": [ - "sshPublicKey", - "password" - ], - "metadata": { - "description": "Type of authentication to use on the Virtual Machine. SSH key is recommended." - } - }, - "databaseType": { - "defaultValue": "oracle", - "type": "string", - "metadata": { - "description": "One of the supported database types" - } - }, - "dbGlobalTranPro": { - "defaultValue": "OnePhaseCommit", - "type": "string", - "metadata": { - "description": "Determines the transaction protocol (global transaction processing behavior) for the data source." - } - }, - "dbIdentity": { - "defaultValue": {}, - "type": "object", - "metadata": { - "description": "Managed identity that has access to the data source." - } - }, - "dbPassword": { - "defaultValue": "", - "type": "securestring", - "metadata": { - "description": "Password for Database" - } - }, - "dbUser": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "Userid of Database" - } - }, - "denyPublicTrafficForAdminServer": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "Set 'true' to deny public inbound traffic for the admin server." - } - }, - "dnsLabelPrefix": { - "defaultValue": "wls", - "type": "string", - "metadata": { - "description": "Unique DNS Name for the Public IP used to access the Virtual Machine." - } - }, - "dnszoneName": { - "defaultValue": "contoso.xyz", - "type": "string", - "metadata": { - "description": "Azure DNS Zone name." - } - }, - "dnszoneResourceGroup": { - "type": "string", - "defaultValue": "[resourceGroup().name]", - "metadata": { - "description": "Name of the resource group containing the Azure DNS Zone." - } - }, - "dnszoneAdminConsoleLabel": { - "type": "string", - "defaultValue": "console", - "metadata": { - "description": "Specify a label used to generate subdomain of Oracle WebLogic Administration Console. The final subdomain name will be label.dnszoneName, e.g. console.contoso.xyz" - } - }, - "dsConnectionURL": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "JDBC Connection String" - } - }, - "enableDB": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "If true, use the supplied parameters to connect the cluster to a pre-provisioned database." - } - }, - "enableCustomDNS": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "Boolean value indicating, if custom DNS Name is available or not" - } - }, - "enableCustomSSL": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "Boolean value indicating, if custom SSL is enabled or not" - } - }, - "enablePswlessConnection": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "True to enable passwordless JDBC connection." - } - }, - "enableHTTPAdminListenPort": { - "defaultValue": true, - "type": "bool", - "metadata": { - "description": "Boolean value indicating, if WebLogic Admin Server HTTP Listen Port is enabled or not" - } - }, - "hasDNSZones": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "If true, the template will update records to the existing DNS Zone. If false, the template will create a new DNS Zone." - } - }, - "jdbcDataSourceName": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "JNDI Name for JDBC Datasource" - } - }, - "guidValue": { - "type": "string", - "defaultValue": "[newGuid()]" - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]", - "metadata": { - "description": "Location for all resources." - } - }, - "uploadedCustomIdentityKeyStoreData": { - "type": "securestring", - "metadata": { - "description": "Custom Identity KeyStore Data" - }, - "defaultValue": "" - }, - "uploadedCustomIdentityKeyStorePassphrase": { - "type": "securestring", - "metadata": { - "description": "Custom Identity KeyStore Passphrase" - }, - "defaultValue": "" - }, - "uploadedCustomIdentityKeyStoreType": { - "type": "string", - "metadata": { - "description": "Weblogic Custom Identity Keystore Type" - }, - "defaultValue": "JKS" - }, - "uploadedCustomTrustKeyStoreData": { - "type": "securestring", - "metadata": { - "description": "Custom Trust KeyStore Data" - }, - "defaultValue": "" - }, - "uploadedCustomTrustKeyStorePassPhrase": { - "type": "securestring", - "metadata": { - "description": "Custom Trust KeyStore PassPhrase" - }, - "defaultValue": "" - }, - "uploadedCustomTrustKeyStoreType": { - "type": "string", - "metadata": { - "description": "Weblogic Custom Trust Keystore Type" - }, - "defaultValue": "JKS" - }, - "uploadedPrivateKeyAlias": { - "type": "string", - "metadata": { - "description": "Alias of the private key" - }, - "defaultValue": "privateKeyAlias" - }, - "uploadedPrivateKeyPassPhrase": { - "type": "securestring", - "metadata": { - "description": "Password of the private key" - }, - "defaultValue": "" - }, - "portsToExpose": { - "type": "string", - "defaultValue": "80,443,7001-9000", - "metadata": { - "description": "Ports and port ranges to expose" - } - }, - "skuUrnVersion": { - "type": "string", - "defaultValue": "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest", - "allowedValues": [ - "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest", - "owls-141100-jdk11-ol87;Oracle:weblogic-141100-jdk11-ol87:owls-141100-jdk11-ol87;latest", - "owls-141100-jdk8-ol91;Oracle:weblogic-141100-jdk8-ol91:owls-141100-jdk8-ol91;latest", - "owls-141100-jdk8-ol87;Oracle:weblogic-141100-jdk8-ol87:owls-141100-jdk8-ol87;latest", - "owls-122140-jdk8-ol91;Oracle:weblogic-122140-jdk8-ol91:owls-122140-jdk8-ol91;latest", - "owls-122140-jdk8-ol87;Oracle:weblogic-122140-jdk8-ol87:owls-122140-jdk8-ol87;latest", - "owls-122140-jdk8-ol76;Oracle:weblogic-122140-jdk8-ol76:owls-122140-jdk8-ol7;latest", - "owls-141100-jdk8-ol76;Oracle:weblogic-141100-jdk8-ol76:owls-141100-jdk8-ol7;latest", - "owls-141100-jdk11-ol76;Oracle:weblogic-141100-jdk11-ol76:owls-141100-jdk11-ol7;latest", - "owls-141100-jdk11-rhel87;Oracle:weblogic-141100-jdk11-rhel87:owls-141100-jdk11-rhel87;latest", - "owls-141100-jdk8-rhel87;Oracle:weblogic-141100-jdk8-rhel87:owls-141100-jdk8-rhel87;latest", - "owls-122140-jdk8-rhel87;Oracle:weblogic-122140-jdk8-rhel87:owls-122140-jdk8-rhel87;latest", - "owls-122140-jdk8-rhel76;Oracle:weblogic-122140-jdk8-rhel76:owls-122140-jdk8-rhel76;latest", - "owls-141100-jdk8-rhel76;Oracle:weblogic-141100-jdk8-rhel76:owls-141100-jdk8-rhel76;latest", - "owls-141100-jdk11-rhel76;Oracle:weblogic-141100-jdk11-rhel76:owls-141100-jdk11-rhel76;latest" - ], - "metadata": { - "description": "The Oracle Linux image with Weblogic and Java preinstalled. Semicolon separated string of Sku, URN, and Version" - } - }, - "usePreviewImage": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "Bool value, if it's set to true, will deploy with preview weblogic image." - } - }, - "useSystemAssignedManagedIdentity": { - "type": "bool", - "defaultValue": true, - "metadata": { - "description": "Bool value, if it's set to true, a system assigned managed identity will to be created for the VM(s)" - } - }, - "vmSize": { - "type": "string", - "defaultValue": "Standard_A3", - "metadata": { - "description": "Select appropriate VM Size as per requirement" - } - }, - "virtualNetworkNewOrExisting": { - "type": "string", - "defaultValue": "new", - "allowedValues": [ - "new", - "existing" - ], - "metadata": { - "description": "Specify whether to create a new or existing virtual network for the VM." - } - }, - "virtualNetworkName": { - "type": "string", - "defaultValue": "[concat('wls-vnet', uniqueString(utcNow()))]", - "metadata": { - "description": "Name of the existing or new VNET" - } - }, - "virtualNetworkResourceGroupName": { - "type": "string", - "defaultValue": "[resourceGroup().name]", - "metadata": { - "description": "Resource group of Virtual network" - } - }, - "addressPrefixes": { - "type": "array", - "defaultValue": [ - "10.0.0.0/28" - ], - "metadata": { - "description": "Address prefix of the VNET." - } - }, - "subnetName": { - "type": "string", - "defaultValue": "wls-subnet", - "metadata": { - "description": "Name of the existing or new Subnet" - } - }, - "subnetPrefix": { - "type": "string", - "defaultValue": "10.0.0.0/29", - "metadata": { - "description": "Address prefix of the subnet" - } - }, - "tagsByResource": { - "type": "object", - "defaultValue": {}, - "metadata": { - "description": "${label.tagsLabel}" - } - }, - "wlsDomainName": { - "defaultValue": "adminDomain", - "type": "string", - "metadata": { - "description": "Provide Weblogic domain name" - } - }, - "wlsPassword": { - "type": "securestring", - "metadata": { - "description": "Password for your Weblogic domain name" - } - }, - "wlsUserName": { - "defaultValue": "weblogic", - "type": "string", - "metadata": { - "description": "Username for your Weblogic domain name" - } - } - }, - "variables": { - "const_globalResourceNameSuffix": "[uniqueString(parameters('guidValue'))]", - "name_adminCustomSSLLinkedTemplateName": "adminTemplateForCustomSSL.json", - "name_adminLinkedTemplateDeployment": "[concat('admin',if(parameters('enableCustomSSL'),'CustomSSL',''),'LinkedTemplate')]", - "name_adminLinkedTemplateName": "adminTemplate.json", - "name_adminVM": "[concat(parameters('adminVMName'), variables('const_globalResourceNameSuffix'))]", - "name_dbLinkedTemplate": "dbTemplate.json", - "name_dnszonesLinkedTemplateName": "dnszonesTemplate.json", - "name_networkSecurityGroup": "[concat(parameters('dnsLabelPrefix'), '-nsg', variables('const_globalResourceNameSuffix'))]", - "name_nsgLinkedTemplateName": "nsgNestedTemplate.json", - // If adding a new resource, add the resource identifier to the array below - // Also modify createUIDefinition.json to include the new resource - "obj_tagsByResources":{ - "${identifier.dnszones}": "[funcTags.tagsFilter(parameters('tagsByResource'), '${identifier.dnszones}')]", - "${identifier.networkInterfaces}": "[funcTags.tagsFilter(parameters('tagsByResource'), '${identifier.networkInterfaces}')]", - "${identifier.networkSecurityGroups}": "[funcTags.tagsFilter(parameters('tagsByResource'), '${identifier.networkSecurityGroups}')]", - "${identifier.publicIPAddresses}": "[funcTags.tagsFilter(parameters('tagsByResource'), '${identifier.publicIPAddresses}')]", - "${identifier.privateEndpoints}": "[funcTags.tagsFilter(parameters('tagsByResource'), '${identifier.privateEndpoints}')]", - "${identifier.storageAccounts}": "[funcTags.tagsFilter(parameters('tagsByResource'), '${identifier.storageAccounts}')]", - "${identifier.virtualNetworks}": "[funcTags.tagsFilter(parameters('tagsByResource'), '${identifier.virtualNetworks}')]", - "${identifier.virtualMachines}": "[funcTags.tagsFilter(parameters('tagsByResource'), '${identifier.virtualMachines}')]", - "${identifier.virtualMachinesExtensions}": "[funcTags.tagsFilter(parameters('tagsByResource'), '${identifier.virtualMachinesExtensions}')]", - "${identifier.deploymentScripts}": "[funcTags.tagsFilter(parameters('tagsByResource'), '${identifier.deploymentScripts}')]", - "${identifier.userAssignedIdentities}": "[funcTags.tagsFilter(parameters('tagsByResource'), '${identifier.userAssignedIdentities}')]", - "${identifier.resourcesDeployment}": "[funcTags.tagsFilter(parameters('tagsByResource'), '${identifier.resourcesDeployment}')]" - } - }, - "functions": [ - { - // This same function is defined in the mainTemplate.json for every other offer. - // Please ensure any changes are applied in all the other places. - "namespace": "funcTags", - "members": { - "tagsFilter": { - "parameters": [ - { - "name": "tagsByResource", - "type": "object" - }, - { - "name": "resourceIdentifier", - "type": "string" - } - ], - "output": { - "type": "object", - "value": "[if(contains(parameters('tagsByResource'), parameters('resourceIdentifier')), parameters('tagsByResource')[parameters('resourceIdentifier')], json('{}'))]" - } - } - } - } - ], - "resources": [ - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[variables('obj_tagsByResources')['${identifier.resourcesDeployment}']]", - "name": "${admin.start}", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "name": "adminLinkedTemplate", - "type": "Microsoft.Resources/deployments", - "tags": "[variables('obj_tagsByResources')['${identifier.resourcesDeployment}']]", - "apiVersion": "${azure.apiVersionForDeployment}", - "condition": "[not(parameters('enableCustomSSL'))]", - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_adminLinkedTemplateName')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "_globalResourceNameSuffix": { - "value": "[variables('const_globalResourceNameSuffix')]" - }, - "adminPasswordOrKey": { - "value": "[parameters('adminPasswordOrKey')]" - }, - "adminUsername": { - "value": "[parameters('adminUsername')]" - }, - "adminVMName": { - "value": "[variables('name_adminVM')]" - }, - "authenticationType": { - "value": "[parameters('authenticationType')]" - }, - "addressPrefixes": { - "value": "[parameters('addressPrefixes')]" - }, - "customDNSName": { - "value": "[if(parameters('enableCustomDNS'), format('{0}.{1}', parameters('dnszoneAdminConsoleLabel'),parameters('dnszoneName')),'')]" - }, - "dnsLabelPrefix": { - "value": "[parameters('dnsLabelPrefix')]" - }, - "enableCustomDNS": { - "value": "[parameters('enableCustomDNS')]" - }, - "enableHTTPAdminListenPort": { - "value": "[parameters('enableHTTPAdminListenPort')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "nsgName": { - "value": "[variables('name_networkSecurityGroup')]" - }, - "portsToExpose": { - "value": "[parameters('portsToExpose')]" - }, - "skuUrnVersion": { - "value": "[parameters('skuUrnVersion')]" - }, - "subnetName": { - "value": "[parameters('subnetName')]" - }, - "subnetPrefix": { - "value": "[parameters('subnetPrefix')]" - }, - "tagsByResource": { - "value": "[variables('obj_tagsByResources')]" - }, - "usePreviewImage": { - "value": "[parameters('usePreviewImage')]" - }, - "useSystemAssignedManagedIdentity": { - "value": "[parameters('useSystemAssignedManagedIdentity')]" - }, - "vmSize": { - "value": "[parameters('vmSize')]" - }, - "virtualNetworkNewOrExisting": { - "value": "[parameters('virtualNetworkNewOrExisting')]" - }, - "virtualNetworkName": { - "value": "[parameters('virtualNetworkName')]" - }, - "virtualNetworkResourceGroupName": { - "value": "[parameters('virtualNetworkResourceGroupName')]" - }, - "wlsDomainName": { - "value": "[parameters('wlsDomainName')]" - }, - "wlsPassword": { - "value": "[parameters('wlsPassword')]" - }, - "wlsUserName": { - "value": "[parameters('wlsUserName')]" - } - } - } - }, - { - "name": "adminCustomSSLLinkedTemplate", - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[variables('obj_tagsByResources')['${identifier.resourcesDeployment}']]", - "condition": "[parameters('enableCustomSSL')]", - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_adminCustomSSLLinkedTemplateName')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "_globalResourceNameSuffix": { - "value": "[variables('const_globalResourceNameSuffix')]" - }, - "adminPasswordOrKey": { - "value": "[parameters('adminPasswordOrKey')]" - }, - "adminUsername": { - "value": "[parameters('adminUsername')]" - }, - "adminVMName": { - "value": "[variables('name_adminVM')]" - }, - "authenticationType": { - "value": "[parameters('authenticationType')]" - }, - "addressPrefixes": { - "value": "[parameters('addressPrefixes')]" - }, - "customDNSName": { - "value": "[if(parameters('enableCustomDNS'), format('{0}.{1}', parameters('dnszoneAdminConsoleLabel'),parameters('dnszoneName')),'')]" - }, - "dnsLabelPrefix": { - "value": "[parameters('dnsLabelPrefix')]" - }, - "enableCustomDNS": { - "value": "[parameters('enableCustomDNS')]" - }, - "enableCustomSSL": { - "value": "[parameters('enableCustomSSL')]" - }, - "enableHTTPAdminListenPort": { - "value": "[parameters('enableHTTPAdminListenPort')]" - }, - "nsgName": { - "value": "[variables('name_networkSecurityGroup')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "sslCustomIdentityKeyStoreData": { - "value": "[parameters('uploadedCustomIdentityKeyStoreData')]" - }, - "sslCustomIdentityKeyStorePassPhrase": { - "value": "[parameters('uploadedCustomIdentityKeyStorePassphrase')]" - }, - "sslCustomIdentityKeyStoreType": { - "value": "[parameters('uploadedCustomIdentityKeyStoreType')]" - }, - "sslCustomTrustKeyStoreData": { - "value": "[parameters('uploadedCustomTrustKeyStoreData')]" - }, - "sslCustomTrustKeyStorePassPhrase": { - "value": "[parameters('uploadedCustomTrustKeyStorePassPhrase')]" - }, - "sslCustomTrustKeyStoreType": { - "value": "[parameters('uploadedCustomTrustKeyStoreType')]" - }, - "sslPrivateKeyAlias": { - "value": "[parameters('uploadedPrivateKeyAlias')]" - }, - "sslPrivateKeyPassPhrase": { - "value": "[parameters('uploadedPrivateKeyPassPhrase')]" - }, - "portsToExpose": { - "value": "[parameters('portsToExpose')]" - }, - "skuUrnVersion": { - "value": "[parameters('skuUrnVersion')]" - }, - "subnetName": { - "value": "[parameters('subnetName')]" - }, - "subnetPrefix": { - "value": "[parameters('subnetPrefix')]" - }, - "tagsByResource": { - "value": "[variables('obj_tagsByResources')]" - }, - "usePreviewImage": { - "value": "[parameters('usePreviewImage')]" - }, - "useSystemAssignedManagedIdentity": { - "value": "[parameters('useSystemAssignedManagedIdentity')]" - }, - "vmSize": { - "value": "[parameters('vmSize')]" - }, - "virtualNetworkNewOrExisting": { - "value": "[parameters('virtualNetworkNewOrExisting')]" - }, - "virtualNetworkName": { - "value": "[parameters('virtualNetworkName')]" - }, - "virtualNetworkResourceGroupName": { - "value": "[parameters('virtualNetworkResourceGroupName')]" - }, - "wlsDomainName": { - "value": "[parameters('wlsDomainName')]" - }, - "wlsPassword": { - "value": "[parameters('wlsPassword')]" - }, - "wlsUserName": { - "value": "[parameters('wlsUserName')]" - } - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[variables('obj_tagsByResources')['${identifier.resourcesDeployment}']]", - "condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'new')]", - "name": "networkSecurityLinkedTemplate", - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_nsgLinkedTemplateName')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "denyPublicTrafficForAdminServer": { - "value": "[parameters('denyPublicTrafficForAdminServer')]" - }, - "networkSecurityGroupName": { - "value": "[variables('name_networkSecurityGroup')]" - } - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', 'adminLinkedTemplate')]", - "[resourceId('Microsoft.Resources/deployments', 'adminCustomSSLLinkedTemplate')]" - ] - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "dnszonesLinkedTemplate", - "tags": "[variables('obj_tagsByResources')['${identifier.resourcesDeployment}']]", - "condition": "[and(parameters('enableCustomDNS'), equals(parameters('virtualNetworkNewOrExisting'), 'new'))]", - "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', 'networkSecurityLinkedTemplate')]" - ], - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_dnszonesLinkedTemplateName')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "_globalResourceNameSuffix": { - "value": "[variables('const_globalResourceNameSuffix')]" - }, - "dnszonesARecordSetNames": { - "value": [ - "[parameters('dnszoneAdminConsoleLabel')]" - ] - }, - "dnszoneName": { - "value": "[parameters('dnszoneName')]" - }, - "hasDNSZones": { - "value": "[parameters('hasDNSZones')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "resourceGroup": { - "value": "[parameters('dnszoneResourceGroup')]" - }, - "targetResources": { - "value": [ - "[reference(variables('name_adminLinkedTemplateDeployment'), '${azure.apiVersionForDeployment}').outputs._adminPublicIPId.value]" - ] - }, - "tagsByResource": { - "value": "[variables('obj_tagsByResources')]" - } - } - } - }, - { - "name": "dbLinkedTemplate", - "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', 'dnszonesLinkedTemplate')]" - ], - "type": "Microsoft.Resources/deployments", - "tags": "[variables('obj_tagsByResources')['${identifier.resourcesDeployment}']]", - "apiVersion": "${azure.apiVersionForDeployment}", - "condition": "[parameters('enableDB')]", - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_dbLinkedTemplate')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "adminVMName": { - "value": "[variables('name_adminVM')]" - }, - "databaseType": { - "value": "[parameters('databaseType')]" - }, - "dbGlobalTranPro": { - "value": "[parameters('dbGlobalTranPro')]" - }, - "dbIdentity": { - "value": "[parameters('dbIdentity')]" - }, - "dbPassword": { - "value": "[parameters('dbPassword')]" - }, - "dbUser": { - "value": "[parameters('dbUser')]" - }, - "dsConnectionURL": { - "value": "[parameters('dsConnectionURL')]" - }, - "enablePswlessConnection": { - "value": "[parameters('enablePswlessConnection')]" - }, - "jdbcDataSourceName": { - "value": "[parameters('jdbcDataSourceName')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "tagsByResource": { - "value": "[variables('obj_tagsByResources')]" - }, - "wlsDomainName": { - "value": "[parameters('wlsDomainName')]" - }, - "wlsPassword": { - "value": "[parameters('wlsPassword')]" - }, - "wlsUserName": { - "value": "[parameters('wlsUserName')]" - } - - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[variables('obj_tagsByResources')['${identifier.resourcesDeployment}']]", - "name": "${admin.end}", - "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', variables('name_adminLinkedTemplateDeployment'))]", - "[resourceId('Microsoft.Resources/deployments', 'networkSecurityLinkedTemplate')]", - "[resourceId('Microsoft.Resources/deployments', 'dnszonesLinkedTemplate')]", - "[resourceId('Microsoft.Resources/deployments', 'dbLinkedTemplate')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - } - ], - "outputs": { - "adminVMName": { - "type": "string", - "value": "[variables('name_adminVM')]" - }, - "hostname": { - "type": "string", - "value": "[reference(variables('name_adminLinkedTemplateDeployment'),'${azure.apiVersionForDeployment}').outputs.hostname.value]" - }, - "sshCommand": { - "type": "string", - "value": "[concat('ssh ', parameters('adminUsername'), '@', reference(variables('name_adminLinkedTemplateDeployment'),'${azure.apiVersionForDeployment}').outputs.hostname.value)]" - }, - "wlsDomainLocation": { - "type": "string", - "value": "[reference(variables('name_adminLinkedTemplateDeployment'),'${azure.apiVersionForDeployment}').outputs.wlsDomainLocation.value]" - }, - "adminConsoleURL": { - "type": "string", - "value": "[if(parameters('enableCustomDNS'), uri(format('http://{0}.{1}:7001/console/',parameters('dnszoneAdminConsoleLabel'),parameters('dnszoneName')), ''),reference(variables('name_adminLinkedTemplateDeployment'),'${azure.apiVersionForDeployment}').outputs.adminConsoleURL.value)]" - }, - "adminConsoleSecureURL": { - "type": "string", - "value": "[if(parameters('enableCustomDNS'), uri(format('https://{0}.{1}:7002/console/',parameters('dnszoneAdminConsoleLabel'),parameters('dnszoneName')), ''),reference(variables('name_adminLinkedTemplateDeployment'),'${azure.apiVersionForDeployment}').outputs.adminConsoleSecureURL.value)]" - }, - "dnsZoneNameServers": { - "type": "array", - "condition": "[and(parameters('enableCustomDNS'), not(parameters('hasDNSZones')))]", - "value": "[reference('dnszonesLinkedTemplate','${azure.apiVersionForDeployment}').outputs.dnsZoneNameServers.value]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/metadata.json b/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/metadata.json deleted file mode 100644 index 263a12a3d..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/metadata.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "$schema": "https://aka.ms/azure-quickstart-templates-metadata-schema#", - "type": "QuickStart", - "itemDisplayName": "Creating Weblogic Admin Domain on Oracle Linux VM with pre-installed Weblogic Server", - "icon": "oracle-linux", - "description": "This template allows you to create Weblogic Admin Domain on Oracle Linux VM with pre-installed Weblogic Server. This will deploy a A3 size VM in the resource group location and return the FQDN of the VM.", - "summary": "This template takes a minimum amount of parameters and creates Weblogic Admin Domain, using the latest patched version.", - "githubUsername": "wls-eng", - "dateUpdated": "2019-08-01" -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/_appendUserManagedIdentity.json b/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/_appendUserManagedIdentity.json deleted file mode 100644 index ba47748a4..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/_appendUserManagedIdentity.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "vmName": { - "type": "string" - }, - "existingIdentities": { - "type": "object" - }, - "newIdentities": { - "type": "object" - }, - "location": { - "type": "string" - } - }, - "resources": [ - { - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines", - "name": "[parameters('vmName')]", - "location": "[parameters('location')]", - "identity": { - "type": "userAssigned", - "userAssignedIdentities": "[union(parameters('existingIdentities'),parameters('newIdentities'))]" - } - } - ] -} \ No newline at end of file diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/_dbTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/_dbTemplate.json deleted file mode 100644 index f88e4117d..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/_dbTemplate.json +++ /dev/null @@ -1,254 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - } - }, - "_artifactsLocationDbTemplate": { - "defaultValue": "[if(contains(parameters('_artifactsLocation'), 'githubusercontent'), parameters('_artifactsLocation'), deployment().properties.templateLink.uri)]", - "type": "string", - "metadata": { - "description": "If we are deploying from the command line, use the passed in _artifactsLocation, otherwise use the default." - } - }, - "_artifactsLocationSasToken": { - "defaultValue": "", - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - } - }, - "adminVMName": { - "type": "string", - "defaultValue": "adminVM", - "metadata": { - "description": "Admin Server hosting VM name." - } - }, - "databaseType": { - "type": "string", - "metadata": { - "description": "One of the supported database types" - } - }, - "dbGlobalTranPro": { - "defaultValue": "OnePhaseCommit", - "type": "string", - "metadata": { - "description": "Determines the transaction protocol (global transaction processing behavior) for the data source." - } - }, - "dbPassword": { - "defaultValue": "[newGuid()]", - "type": "securestring", - "metadata": { - "description": "Password for Database" - } - }, - "dbUser": { - "type": "string", - "metadata": { - "description": "Userid of Database" - } - }, - "dsConnectionURL": { - "type": "string", - "metadata": { - "description": "JDBC Connection String" - } - }, - "enablePswlessConnection": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "True to enable passwordless connection." - } - }, - "jdbcDataSourceName": { - "type": "string", - "defaultValue": "", - "metadata": { - "description": "JNDI Name for JDBC Datasource" - } - }, - "location": { - "type": "string", - "metadata": { - "description": "Location for all resources." - } - }, - "tagsByResource": { - "type": "object", - "defaultValue": {}, - "metadata": { - "description": "${label.tagsLabel}" - } - }, - "wlsPassword": { - "type": "securestring", - "metadata": { - "description": "Password for your Weblogic domain name" - } - }, - "wlsUserName": { - "type": "string", - "metadata": { - "description": "Username for your Weblogic domain name" - } - } - }, - "variables": { - "const_wlsAdminPort": "7005", - "const_wlsHome": "/u01/app/wls/install/oracle/middleware/oracle_home", - "name_scriptFilePrefix": "datasourceConfig-", - "name_scriptFileSuffix-sqlserver": "sqlserver.sh", - "name_scriptFileSuffix-oracle": "oracle.sh", - "name_scriptFileSuffix-postgresql": "postgresql.sh", - "name_scriptFileSuffix-mysql": "mysql.sh" - }, - "resources": [ - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${admin.database.start}", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines/extensions", - "name": "[concat(parameters('adminVMName'),'/newuserscript')]", - "location": "[parameters('location')]", - "tags": "[parameters('tagsByResource')['${identifier.virtualMachinesExtensions}']]", - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.0", - "autoUpgradeMinorVersion": true, - "settings": { - "fileUris": [ - "[uri(parameters('_artifactsLocationDbTemplate'), concat('../scripts/', variables('name_scriptFilePrefix'), variables('name_scriptFileSuffix-sqlserver'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationDbTemplate'), concat('../scripts/', variables('name_scriptFilePrefix'), variables('name_scriptFileSuffix-oracle'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationDbTemplate'), concat('../scripts/', variables('name_scriptFilePrefix'), variables('name_scriptFileSuffix-postgresql'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationDbTemplate'), concat('../scripts/', variables('name_scriptFilePrefix'), variables('name_scriptFileSuffix-mysql'), parameters('_artifactsLocationSasToken')))]" - ] - }, - "protectedSettings": { - "commandToExecute": "[concat('sh',' ',variables('name_scriptFilePrefix'),parameters('databaseType'),'.sh <<< \"',variables('const_wlsHome'),' ',parameters('adminVMName'),' ',variables('const_wlsAdminPort'),' ',parameters('wlsUserName'),' ',base64(parameters('wlsPassword')),' ',base64(parameters('jdbcDataSourceName')),' ',base64(parameters('dsConnectionURL')),' ',parameters('dbUser'),' ',base64(parameters('dbPassword')), ' ', parameters('dbGlobalTranPro'), ' ', parameters('enablePswlessConnection'), '\"')]" - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${admin.database.end}", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${database.oracle}", - "condition": "[if(contains(parameters('databaseType'), 'oracle'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${database.postgresql}", - "condition": "[if(contains(parameters('databaseType'), 'postgresql'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${database.sqlserver}", - "condition": "[if(contains(parameters('databaseType'), 'sqlserver'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${database.mysql}", - "condition": "[if(contains(parameters('databaseType'), 'mysql'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - } - ], - "outputs": { - "artifactsLocationPassedIn": { - "type": "string", - "value": "[parameters('_artifactsLocation')]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/_dnszones/_createDNSZonesTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/_dnszones/_createDNSZonesTemplate.json deleted file mode 100644 index 52164197b..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/_dnszones/_createDNSZonesTemplate.json +++ /dev/null @@ -1,128 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "dnszonesARecordSetNames": { - "type": "array", - "metadata": { - "description": "An array of A record names. Used to create A record set." - } - }, - "dnszonesCNAMEAlias": { - "type": "array", - "metadata": { - "description": "An array of CNAME record alias. Used to create CNAME records." - } - }, - "dnszonesCNAMERecordSetNames": { - "type": "array", - "metadata": { - "description": "An array of CNAME record names. Used to create CNAME record set." - } - }, - "dnszoneName": { - "type": "string", - "metadata": { - "description": "Azure DNS Zone name." - } - }, - "location": { - "type": "string", - "metadata": { - "description": "Location for all resources." - } - }, - "targetResources": { - "type": "array", - "metadata": { - "description": "References to Azure resources from where the DNS resource value is taken. Each item is corresponding to values of dnszonesARecordSetNames." - } - }, - "tagsByResource": { - "type": "object", - "defaultValue": {}, - "metadata": { - "description": "${label.tagsLabel}" - } - }, - "ttl": { - "type": "int", - "defaultValue": 3600, - "metadata": { - "description": "The TTL (time-to-live) of the records in the record sets." - } - } - }, - "variables": { - // Tempalte validation fails on record name expression 'parameters('arrayValue')[copyIndex]' if the array is empty, though the deployment will be skipped. - // Concat a sample array if an array is empty, and do not deploy the sample record. - "const_dnszonesARecordSetNames": "[concat(parameters('dnszonesARecordSetNames'), variables('const_sampleValuetoPassValidation'))]", - "const_dnszonesCNAMERecordSetNames": "[concat(parameters('dnszonesCNAMERecordSetNames'),variables('const_sampleValuetoPassValidation'))]", - "const_hasARecords": "[greater(length(parameters('dnszonesARecordSetNames')),0)]", - "const_hasCNAMERecords": "[greater(length(parameters('dnszonesCNAMERecordSetNames')), 0)]", - "const_sampleValuetoPassValidation": [ - "test" - ] - }, - "resources": [ - { - "type": "Microsoft.Network/dnszones", - "apiVersion": "${azure.apiVersionForDNSZone}", - "name": "[parameters('dnszoneName')]", - "tags": "[parameters('tagsByResource')['${identifier.dnszones}']]", - "location": "[parameters('location')]", - "properties": { - "zoneType": "Public" - } - }, - { - "type": "Microsoft.Network/dnszones/A", - "apiVersion": "${azure.apiVersionForDNSZone}", - "condition": "[variables('const_hasARecords')]", - "name": "[concat(parameters('dnszoneName'), '/', variables('const_dnszonesARecordSetNames')[copyIndex()])]", - "copy": { - "name": "dnszonesALoop", - "count": "[length(parameters('dnszonesARecordSetNames'))]" - }, - "dependsOn": [ - "[resourceId('Microsoft.Network/dnszones', parameters('dnszoneName'))]" - ], - "properties": { - "TTL": "[parameters('ttl')]", - "targetResource": { - "id": "[parameters('targetResources')[copyIndex()]]" - } - } - }, - { - "type": "Microsoft.Network/dnszones/CNAME", - "apiVersion": "${azure.apiVersionForDNSZone}", - "condition": "[variables('const_hasCNAMERecords')]", - "name": "[concat(parameters('dnszoneName'),'/', variables('const_dnszonesCNAMERecordSetNames')[copyIndex()])]", - "location": "[parameters('location')]", - "copy": { - "name": "dnszonesCNAMELoop", - "count": "[length(parameters('dnszonesCNAMERecordSetNames'))]" - }, - "dependsOn": [ - "dnszonesALoop" - ], - "properties": { - "TTL": "[parameters('ttl')]", - "CNAMERecord": { - "cname": "[parameters('dnszonesCNAMEAlias')[copyIndex()]]" - } - } - } - ], - "outputs": { - "dnszonesName": { - "type": "string", - "value": "[parameters('dnszoneName')]" - }, - "dnsZoneNameServers": { - "type": "array", - "value": "[reference(parameters('dnszoneName')).nameServers]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/_dnszones/_uamiAndRoleAssignment.json b/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/_dnszones/_uamiAndRoleAssignment.json deleted file mode 100644 index 766dd3089..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/_dnszones/_uamiAndRoleAssignment.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_globalResourceNameSuffix": { - "type": "string" - }, - "location": { - "type": "string" - }, - "uamiName": { - "type": "string" - }, - "tagsByResource": { - "type": "object", - "defaultValue": {}, - "metadata": { - "description": "${label.tagsLabel}" - } - } - }, - "functions": [], - "variables": { - "const_roleDefinitionIdOfContributor": "b24988ac-6180-42a0-ab88-20f7382dd24c", - "name_deploymentScriptContributorRoleAssignmentName": "[guid(format('{0}{1}Deployment Script', parameters('_globalResourceNameSuffix'), parameters('uamiName')))]" - }, - "resources": [ - { - "type": "Microsoft.ManagedIdentity/userAssignedIdentities", - "apiVersion": "${azure.apiVersionForIdentity}", - "name": "[parameters('uamiName')]", - "location": "[parameters('location')]", - "tags": "[parameters('tagsByResource')['${identifier.userAssignedIdentities}']]" - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "[variables('name_deploymentScriptContributorRoleAssignmentName')]", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "subscriptionId": "[subscription().subscriptionId]", - "location": "[parameters('location')]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "_globalResourceNameSuffix": { - "value": "[parameters('_globalResourceNameSuffix')]" - }, - "roleDefinition": { - "value": "[variables('const_roleDefinitionIdOfContributor')]" - }, - "principalId": { - "value": "[reference(resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', parameters('uamiName'))).principalId]" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_globalResourceNameSuffix": { - "type": "string", - "defaultValue": "" - }, - "roleDefinition": { - "type": "string", - "defaultValue": "" - }, - "principalId": { - "type": "string", - "defaultValue": "" - } - }, - "functions": [], - "variables": { - "name_roleAssignmentName": "[guid(format('{0}{1}Role assignment in subscription scope', parameters('_globalResourceNameSuffix'), parameters('principalId')))]" - }, - "resources": [ - { - "type": "Microsoft.Authorization/roleAssignments", - "apiVersion": "${azure.apiVersionForRoleAssignment}", - "name": "[variables('name_roleAssignmentName')]", - "properties": { - "description": "Assign subscription scope role to User Assigned Managed Identity ", - "principalId": "[parameters('principalId')]", - "principalType": "ServicePrincipal", - "roleDefinitionId": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinition'))]" - } - } - ], - "outputs": { - "roleId": { - "type": "string", - "value": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinition'))]" - } - } - } - } - } - ], - "outputs": { - "uamiIdForDeploymentScript": { - "type": "string", - "value": "[resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', parameters('uamiName'))]" - } - } - } diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/_dnszones/_updateDNSZonesTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/_dnszones/_updateDNSZonesTemplate.json deleted file mode 100644 index 4794a5891..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/_dnszones/_updateDNSZonesTemplate.json +++ /dev/null @@ -1,223 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - } - }, - "_artifactsLocationDNSZonesTemplate": { - "defaultValue": "[if(contains(parameters('_artifactsLocation'), 'githubusercontent'), concat(parameters('_artifactsLocation'),'nestedtemplates/'), deployment().properties.templateLink.uri)]", - "type": "string", - "metadata": { - "description": "If we are deploying from the command line, use the passed in _artifactsLocation, otherwise use the default." - } - }, - "_artifactsLocationSasToken": { - "defaultValue": "", - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - } - }, - "_globalResourceNameSuffix": { - "type": "string", - "metadata": { - "description": "The suffix to be added to the globally unique resource name." - } - }, - "dnszonesARecordSetNames": { - "type": "array", - "metadata": { - "description": "An array of A record names. Used to create A records." - } - }, - "dnszonesCNAMEAlias": { - "type": "array", - "metadata": { - "description": "An array of CNAME record alias. Used to create CNAME records." - } - }, - "dnszonesCNAMERecordSetNames": { - "type": "array", - "metadata": { - "description": "An array of CNAME record names. Used to create CNAME record set." - } - }, - "dnszoneName": { - "type": "string", - "metadata": { - "description": "Azure DNS Zone name." - } - }, - "location": { - "type": "string", - "metadata": { - "description": "Location for all resources." - } - }, - "resourceGroup": { - "type": "string", - "metadata": { - "description": "Name of the resource group that has an Azure DNS Zone deployed." - } - }, - "targetResources": { - "type": "array", - "metadata": { - "description": "References to Azure resources from where the DNS resource value is taken. Each item is corresponding to values of dnszonesARecordSetNames." - } - }, - "tagsByResource": { - "type": "object", - "defaultValue": {}, - "metadata": { - "description": "${label.tagsLabel}" - } - }, - "ttl": { - "type": "int", - "defaultValue": 3600, - "metadata": { - "description": "The TTL (time-to-live) of the records in the record sets." - } - }, - "utcValue": { - "type": "string", - "defaultValue": "[utcNow()]", - "metadata": { - "description": "Current deployment time. Used as a tag in deployment script." - } - } - }, - "functions": [ - { - "namespace": "array", - "members": { - "join": { - "parameters": [ - { - "name": "items", - "type": "array" - } - ], - "output": { - "type": "string", - "value": "[replace(replace(replace(string(parameters('items')), '[\"', ''), '\"]', ''), '\",\"', ',')]" - } - } - } - } - ], - "variables": { - "name_deploymentScriptUserDefinedManagedIdentity": "wls-vm-deployment-script-user-defined-managed-itentity", - "name_scriptDNSConfiguration": "updateDNSZones.sh", - "name_templateUAMIDeployment": "_uamiAndRoleAssignment.json" - }, - "resources": [ - { - "type": "Microsoft.Resources/deployments", - "name": "uamiDeployment", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/_dnszones/', variables('name_templateUAMIDeployment')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_globalResourceNameSuffix": { - "value": "[parameters('_globalResourceNameSuffix')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "uamiName": { - "value": "[variables('name_deploymentScriptUserDefinedManagedIdentity')]" - }, - "tagsByResource": { - "value": "[parameters('tagsByResource')]" - } - } - } - }, - { - "type": "Microsoft.Resources/deploymentScripts", - "apiVersion": "${azure.apiVersionForDeploymentScript}", - "tags": "[parameters('tagsByResource')['${identifier.deploymentScripts}']]", - "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', 'uamiDeployment')]" - ], - "name": "[concat('script-createDNSRecords', parameters('_globalResourceNameSuffix'))]", - "location": "[parameters('location')]", - "identity": { - "type": "UserAssigned", - "userAssignedIdentities": { - "[resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', variables('name_deploymentScriptUserDefinedManagedIdentity'))]": {} - } - }, - "kind": "AzureCLI", - "properties": { - "forceUpdateTag": "[parameters('utcValue')]", - "AzCliVersion": "${azure.cli.version}", - "timeout": "PT30M", - "environmentVariables": [ - { - "name": "DNS_CNAME_ALIAS", - "value": "[array.join(parameters('dnszonesCNAMEAlias'))]" - }, - { - "name": "DNS_CNAME_ALIAS_LENGTH", - "value": "[length(parameters('dnszonesCNAMEAlias'))]" - }, - { - "name": "DNS_CNAME_RECORDSET_LENGTH", - "value": "[length(parameters('dnszonesCNAMERecordSetNames'))]" - }, - { - "name": "DNS_CNAME_RECORDSET_NAMES", - "value": "[array.join(parameters('dnszonesCNAMERecordSetNames'))]" - }, - { - "name": "DNS_RECORDSET_NAMES", - "value": "[array.join(parameters('dnszonesARecordSetNames'))]" - }, - { - "name": "DNS_RECORD_NAMES_LENGTH", - "value": "[length(parameters('dnszonesARecordSetNames'))]" - }, - { - "name": "DNS_TARGET_RESOURCES_LENGTH", - "value": "[length(parameters('targetResources'))]" - }, - { - "name": "DNS_TARGET_RESOURCES", - "value": "[array.join(parameters('targetResources'))]" - }, - { - "name": "DNS_RECORD_TTL", - "value": "[parameters('ttl')]" - }, - { - "name": "DNS_ZONE_NAME", - "value": "[parameters('dnszoneName')]" - }, - { - "name": "MANAGED_IDENTITY_ID", - "value": "[resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', variables('name_deploymentScriptUserDefinedManagedIdentity'))]" - }, - { - "name": "RESOURCE_GROUP_NAME", - "value": "[parameters('resourceGroup')]" - } - ], - "primaryScriptUri": "[uri(parameters('_artifactsLocationDNSZonesTemplate'), concat('../../scripts/', variables('name_scriptDNSConfiguration'), parameters('_artifactsLocationSasToken')))]", - "cleanupPreference": "OnSuccess", - "retentionInterval": "P1D" - } - } - ] -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/_installJdbcLibsTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/_installJdbcLibsTemplate.json deleted file mode 100644 index 381354058..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/_installJdbcLibsTemplate.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - } - }, - "_artifactsLocationInstallJdbcLibsTemplate": { - "defaultValue": "[if(contains(parameters('_artifactsLocation'), 'githubusercontent'), parameters('_artifactsLocation'), deployment().properties.templateLink.uri)]", - "type": "string", - "metadata": { - "description": "If we are deploying from the command line, use the passed in _artifactsLocation, otherwise use the default." - } - }, - "_artifactsLocationSasToken": { - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - }, - "defaultValue": "" - }, - "adminVMName": { - "type": "string", - "defaultValue": "adminVM", - "metadata": { - "description": "Admin Server hosting VM name." - } - }, - "databaseType": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "One of the supported database types" - } - }, - "enablePswlessConnection": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "True to enable passwordless connection." - } - }, - "location": { - "type": "string", - "metadata": { - "description": "Location for all resources." - } - }, - "tagsByResource": { - "type": "object", - "defaultValue": {}, - "metadata": { - "description": "${label.tagsLabel}" - } - }, - "wlsDomainName": { - "type": "string", - "defaultValue": "wlsd", - "metadata": { - "description": "Provide Weblogic domain name" - } - }, - "wlsPassword": { - "type": "securestring", - "metadata": { - "description": "Password for your Weblogic domain name" - } - }, - "wlsUserName": { - "type": "string", - "metadata": { - "description": "Username for your Weblogic domain name" - } - } - }, - "variables": { - "const_wlsAdminPort": "7005", - "const_wlsDomainPath": "[concat('/u01/domains/', parameters('wlsDomainName'))]", - "const_wlsHome": "/u01/app/wls/install/oracle/middleware/oracle_home", - "name_scriptInstallJdbcLibs": "installJdbcDrivers.sh" - }, - "resources": [ - { - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines/extensions", - "name": "[concat(parameters('adminVMName'), '/newuserscript')]", - "tags": "[parameters('tagsByResource')['${identifier.virtualMachinesExtensions}']]", - "location": "[parameters('location')]", - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.0", - "autoUpgradeMinorVersion": true, - "settings": { - "fileUris": [ - "[uri(parameters('_artifactsLocationInstallJdbcLibsTemplate'), concat('../scripts/', variables('name_scriptInstallJdbcLibs'), parameters('_artifactsLocationSasToken')))]" - ] - }, - "protectedSettings": { - "commandToExecute": "[concat('sh',' ',variables('name_scriptInstallJdbcLibs'),' <<< \"',variables('const_wlsHome'),' ',variables('const_wlsDomainPath'),' ','admin', ' ', parameters('adminVMName'), ' ',variables('const_wlsAdminPort'),' ',parameters('wlsUserName'),' ',base64(parameters('wlsPassword')),' ',parameters('databaseType'),' ',parameters('enablePswlessConnection'), '\"')]" - } - } - } - ] -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/_pswlessDbTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/_pswlessDbTemplate.json deleted file mode 100644 index 84feb48ab..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/_pswlessDbTemplate.json +++ /dev/null @@ -1,304 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - } - }, - "_artifactsLocationSasToken": { - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - }, - "defaultValue": "" - }, - "adminVMName": { - "type": "string", - "defaultValue": "adminVM", - "metadata": { - "description": "Admin Server hosting VM name." - } - }, - "databaseType": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "One of the supported database types" - } - }, - "dbGlobalTranPro": { - "defaultValue": "OnePhaseCommit", - "type": "string", - "metadata": { - "description": "Determines the transaction protocol (global transaction processing behavior) for the data source." - } - }, - "dbIdentity": { - "defaultValue": {}, - "type": "object", - "metadata": { - "description": "Managed identity that has access to the data source." - } - }, - "dbUser": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "Userid of Database" - } - }, - "dsConnectionURL": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "JDBC Connection String" - } - }, - "jdbcDataSourceName": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "JNDI Name for JDBC Datasource" - } - }, - "location": { - "type": "string", - "metadata": { - "description": "Location for all resources." - } - }, - "tagsByResource": { - "type": "object", - "defaultValue": {}, - "metadata": { - "description": "${label.tagsLabel}" - } - }, - "wlsDomainName": { - "type": "string", - "defaultValue": "adminDomain", - "metadata": { - "description": "Provide Weblogic domain name" - } - }, - "wlsPassword": { - "type": "securestring", - "metadata": { - "description": "Password for your Weblogic domain name" - } - }, - "wlsUserName": { - "type": "string", - "metadata": { - "description": "Username for your Weblogic domain name" - } - } - }, - "variables": { - "const_connectionString": "[if(and(equals(parameters('databaseType'),'sqlserver'), equals(last(parameters('dsConnectionURL')),';')), take(parameters('dsConnectionURL'), add(length(parameters('dsConnectionURL')),-1)),parameters('dsConnectionURL'))]", - "const_identityAPIVersion": "${azure.apiVersionForIdentity}", - "const_msiDefaultUser": "msiUser", - "name_appendIdentityTemplate": "_appendUserManagedIdentity.json", - "name_installJdbcLibsTemplate": "_installJdbcLibsTemplate.json", - "name_dbTemplate": "_dbTemplate.json", - "array_msiClientId": { - "mysql": "azure.clientId", - "postgresql": "azure.clientId", - "sqlserver": "msiClientId" - }, - "array_azureJdbcPlugins": { - "mysql": "defaultAuthenticationPlugin=com.azure.identity.extensions.jdbc.mysql.AzureMysqlAuthenticationPlugin&authenticationPlugins=com.azure.identity.extensions.jdbc.mysql.AzureMysqlAuthenticationPlugin", - "postgresql": "authenticationPluginClassName=com.azure.identity.extensions.jdbc.postgresql.AzurePostgresqlAuthenticationPlugin", - "sqlserver": "authentication=ActiveDirectoryMSI" - }, - "array_urlJoiner": { - "mysql": "[if(contains(variables('const_connectionString'), '?'), '&', '?')]", - "postgresql": "[if(contains(variables('const_connectionString'), '?'), '&', '?')]", - "sqlserver": ";" - }, - "array_paramJoiner": { - "mysql": "&", - "postgresql": "&", - "sqlserver": ";" - }, - "obj_dbIdentity": { - "[items(parameters('dbIdentity').userAssignedIdentities)[0].key]": {} - }, - "obj_empty": {} - }, - "resources": [ - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${admin.pswless.database.start}", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "assignDbIdentityToAdminVM", - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_appendIdentityTemplate')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "vmName": { - "value": "[parameters('adminVMName')]" - }, - "newIdentities": { - "value": "[variables('obj_dbIdentity')]" - }, - "existingIdentities": { - "value": "[if(equals(reference(resourceId('Microsoft.Compute/virtualMachines',parameters('adminVMName')), '${azure.apiVersionForDeployment}', 'Full').identity.type,'UserAssigned'),reference(resourceId('Microsoft.Compute/virtualMachines',parameters('adminVMName')), '${azure.apiVersionForDeployment}', 'Full').identity.userAssignedIdentities, variables('obj_empty'))]" - }, - "location": { - "value": "[parameters('location')]" - } - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "installJdbcLibsTemplate", - "condition": "[or(equals(parameters('databaseType'),'mysql'), equals(parameters('databaseType'),'postgresql'))]", - "dependsOn": [ - "assignDbIdentityToAdminVM" - ], - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_installJdbcLibsTemplate')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "adminVMName": { - "value": "[parameters('adminVMName')]" - }, - "databaseType": { - "value": "[parameters('databaseType')]" - }, - "enablePswlessConnection": { - "value": true - }, - "location": { - "value": "[parameters('location')]" - }, - "tagsByResource": { - "value": "[parameters('tagsByResource')]" - }, - "wlsDomainName": { - "value": "[parameters('wlsDomainName')]" - }, - "wlsPassword": { - "value": "[parameters('wlsPassword')]" - }, - "wlsUserName": { - "value": "[parameters('wlsUserName')]" - } - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "passwordlessDatasourceDeployment", - "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', 'installJdbcLibsTemplate')]" - ], - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_dbTemplate')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "adminVMName": { - "value": "[parameters('adminVMName')]" - }, - "databaseType": { - "value": "[parameters('databaseType')]" - }, - "dbGlobalTranPro": { - "value": "[parameters('dbGlobalTranPro')]" - }, - "dsConnectionURL": { - "value": "[uri(format('{0}{4}{1}{5}{2}={3}', variables('const_connectionString'), variables('array_azureJdbcPlugins')[parameters('databaseType')], variables('array_msiClientId')[parameters('databaseType')], reference(items(parameters('dbIdentity').userAssignedIdentities)[0].key,variables('const_identityAPIVersion'), 'full').properties.clientId, variables('array_urlJoiner')[parameters('databaseType')], variables('array_paramJoiner')[parameters('databaseType')]), '')]" - }, - "dbUser": { - "value": "[if(equals(parameters('databaseType'), 'sqlserver'), variables('const_msiDefaultUser'), parameters('dbUser'))]" - }, - "enablePswlessConnection": { - "value": true - }, - "jdbcDataSourceName": { - "value": "[parameters('jdbcDataSourceName')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "tagsByResource": { - "value": "[parameters('tagsByResource')]" - }, - "wlsPassword": { - "value": "[parameters('wlsPassword')]" - }, - "wlsUserName": { - "value": "[parameters('wlsUserName')]" - } - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${admin.pswless.database.end}", - "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', 'passwordlessDatasourceDeployment')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [] - } - } - } - ], - "outputs": { - "artifactsLocationPassedIn": { - "type": "string", - "value": "[parameters('_artifactsLocation')]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/adminTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/adminTemplate.json deleted file mode 100644 index a219cdc66..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/adminTemplate.json +++ /dev/null @@ -1,917 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - } - }, - "_artifactsLocationAdminTemplate": { - "defaultValue": "[if(contains(parameters('_artifactsLocation'), 'githubusercontent'), parameters('_artifactsLocation'), deployment().properties.templateLink.uri)]", - "type": "string", - "metadata": { - "description": "If we are deploying from the command line, use the passed in _artifactsLocation, otherwise use the default." - } - }, - "_artifactsLocationSasToken": { - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - } - }, - "_globalResourceNameSuffix": { - "type": "string", - "metadata": { - "description": "A unique suffix that was specified during the deployment of the solution template." - } - }, - "adminPasswordOrKey": { - "type": "securestring", - "metadata": { - "description": "SSH Key or password for the Virtual Machine. SSH key is recommended." - } - }, - "adminUsername": { - "type": "string", - "metadata": { - "description": "User name for the Virtual Machine." - } - }, - "adminVMName": { - "type": "string", - "defaultValue": "adminVM", - "metadata": { - "description": "Admin Server hosting VM name." - } - }, - "authenticationType": { - "type": "string", - "defaultValue": "password", - "allowedValues": [ - "sshPublicKey", - "password" - ], - "metadata": { - "description": "Type of authentication to use on the Virtual Machine. SSH key is recommended." - } - }, - "customDNSName": { - "defaultValue": "console.contoso.xyz", - "type": "string", - "metadata": { - "description": "Custom DNS Zone domain name for Oracle WebLogic Administration Console" - } - }, - "dnsLabelPrefix": { - "type": "string", - "metadata": { - "description": "Unique DNS Name for the Public IP used to access the Virtual Machine." - } - }, - "enableCustomDNS": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "Boolean value indicating, if custom DNS Name is available or not" - } - }, - "enableHTTPAdminListenPort": { - "type": "bool", - "defaultValue": true, - "metadata": { - "description": "Boolean value indicating, if WebLogic Admin Server HTTP Listen Port is enabled or not" - } - }, - "guidValue": { - "type": "string", - "defaultValue": "[newGuid()]" - }, - "location": { - "type": "string", - "metadata": { - "description": "Location for all resources." - } - }, - "nsgName": { - "type": "string", - "metadata": { - "description": "Network Security Group name" - } - }, - "portsToExpose": { - "type": "string", - "defaultValue": "80,443,7001-9000", - "metadata": { - "description": "Ports and port ranges to expose" - } - }, - "skuUrnVersion": { - "type": "string", - "defaultValue": "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest", - "allowedValues": [ - "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest", - "owls-141100-jdk11-ol87;Oracle:weblogic-141100-jdk11-ol87:owls-141100-jdk11-ol87;latest", - "owls-141100-jdk8-ol91;Oracle:weblogic-141100-jdk8-ol91:owls-141100-jdk8-ol91;latest", - "owls-141100-jdk8-ol87;Oracle:weblogic-141100-jdk8-ol87:owls-141100-jdk8-ol87;latest", - "owls-122140-jdk8-ol91;Oracle:weblogic-122140-jdk8-ol91:owls-122140-jdk8-ol91;latest", - "owls-122140-jdk8-ol87;Oracle:weblogic-122140-jdk8-ol87:owls-122140-jdk8-ol87;latest", - "owls-122140-jdk8-ol76;Oracle:weblogic-122140-jdk8-ol76:owls-122140-jdk8-ol7;latest", - "owls-141100-jdk8-ol76;Oracle:weblogic-141100-jdk8-ol76:owls-141100-jdk8-ol7;latest", - "owls-141100-jdk11-ol76;Oracle:weblogic-141100-jdk11-ol76:owls-141100-jdk11-ol7;latest", - "owls-141100-jdk11-rhel87;Oracle:weblogic-141100-jdk11-rhel87:owls-141100-jdk11-rhel87;latest", - "owls-141100-jdk8-rhel87;Oracle:weblogic-141100-jdk8-rhel87:owls-141100-jdk8-rhel87;latest", - "owls-122140-jdk8-rhel87;Oracle:weblogic-122140-jdk8-rhel87:owls-122140-jdk8-rhel87;latest", - "owls-122140-jdk8-rhel76;Oracle:weblogic-122140-jdk8-rhel76:owls-122140-jdk8-rhel76;latest", - "owls-141100-jdk8-rhel76;Oracle:weblogic-141100-jdk8-rhel76:owls-141100-jdk8-rhel76;latest", - "owls-141100-jdk11-rhel76;Oracle:weblogic-141100-jdk11-rhel76:owls-141100-jdk11-rhel76;latest" - ], - "metadata": { - "description": "The Oracle Linux image with Weblogic and Java preinstalled. Semicolon separated string of Sku, URN, and Version" - } - }, - "usePreviewImage": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "Bool value, if it's set to true, will deploy with preview weblogic image." - } - }, - "useSystemAssignedManagedIdentity": { - "type": "bool", - "defaultValue": true, - "metadata": { - "description": "Bool value, if it's set to true, a system assigned managed identity will to be created for the VM(s)" - } - }, - "vmSize": { - "type": "string", - "defaultValue": "Standard_A3", - "metadata": { - "description": "Select appropriate VM Size as per requirement" - } - }, - "virtualNetworkNewOrExisting": { - "type": "string", - "defaultValue": "new", - "allowedValues": [ - "new", - "existing" - ], - "metadata": { - "description": "Specify whether to create a new or existing virtual network for the VM." - } - }, - "virtualNetworkName": { - "type": "string", - "defaultValue": "wls-vnet", - "metadata": { - "description": "Name of the existing or new VNET" - } - }, - "virtualNetworkResourceGroupName": { - "type": "string", - "defaultValue": "[resourceGroup().name]", - "metadata": { - "description": "Resource group of Virtual network" - } - }, - "addressPrefixes": { - "type": "array", - "defaultValue": [ - "10.0.0.0/28" - ], - "metadata": { - "description": "Address prefix of the VNET." - } - }, - "subnetName": { - "type": "string", - "defaultValue": "wls-subnet", - "metadata": { - "description": "Name of the existing or new Subnet" - } - }, - "subnetPrefix": { - "type": "string", - "defaultValue": "10.0.0.0/29", - "metadata": { - "description": "Address prefix of the subnet" - } - }, - "wlsDomainName": { - "type": "string", - "metadata": { - "description": "Provide Weblogic domain name" - } - }, - "wlsPassword": { - "type": "securestring", - "metadata": { - "description": "Password for your Weblogic domain name" - } - }, - "wlsUserName": { - "type": "string", - "metadata": { - "description": "Username for your Weblogic domain name" - } - }, - "tagsByResource": { - "type": "object", - "defaultValue": {}, - "metadata": { - "description": "${label.tagsLabel}" - } - } - }, - "variables": { - "const_addressPrefix": "[parameters('addressPrefixes')]", - "const_hyphen": "-", - "const_imageOffer": "[concat('weblogic',variables('const_hyphen'), split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[1],variables('const_hyphen'),split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[2],variables('const_hyphen'),split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[3],if(parameters('usePreviewImage'),'-preview',''))]", - "const_imagePublisher": "oracle", - "const_linuxConfiguration": { - "disablePasswordAuthentication": true, - "ssh": { - "publicKeys": [ - { - "path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]", - "keyData": "[parameters('adminPasswordOrKey')]" - } - ] - } - }, - "const_publicIPAddressType": "Dynamic", - "const_requiredPortrange": ",65200-65535,5556", - "const_storageAccountType": "Standard_LRS", - "const_subnetPrefix": "[parameters('subnetPrefix')]", - "const_vmSize": "[parameters('vmSize')]", - "const_wlsHome": "/u01/app/wls/install/oracle/middleware/oracle_home", - "const_mountPointPath": "[concat('/mnt/', variables('name_share'))]", - "name_linuxImageOfferSKU": "[first(split(parameters('skuUrnVersion'), ';'))]", - "name_linuxImageVersion": "[last(split(parameters('skuUrnVersion'),';'))]", - "name_nic": "[concat('adminServerVM_NIC_', parameters('_globalResourceNameSuffix'))]", - "name_nic_with_pub_ip": "[concat(variables('name_nic'), '_with_pub_ip')]", - "name_nic_without_pub_ip": "[concat(variables('name_nic'), '_without_pub_ip')]", - "name_publicIPAddress": "[concat('adminServerVM_PublicIP_', parameters('_globalResourceNameSuffix'))]", - "name_privateSaEndpoint": "[concat('saep', parameters('_globalResourceNameSuffix'))]", - "name_scriptFile": "setupAdminDomain.sh", - "name_storageAccount": "[concat('olvmstg', parameters('_globalResourceNameSuffix'))]", - "name_share": "[concat('wlsshare', parameters('_globalResourceNameSuffix'))]", - "name_subnet": "[parameters('subnetName')]", - "name_virtualNetwork": "[parameters('virtualNetworkName')]", - "ref_networkSecurityGroup": "[resourceId('Microsoft.Network/networkSecurityGroups', parameters('nsgName'))]", - "ref_subnet": "[resourceId(parameters('virtualNetworkResourceGroupName'), 'Microsoft.Network/virtualNetworks/subnets', variables('name_virtualNetwork'), variables('name_subnet'))]", - "ref_storage": "[resourceId('Microsoft.Storage/storageAccounts', variables('name_storageAccount'))]", - "ref_fileService": "[resourceId('Microsoft.Storage/storageAccounts/fileServices', variables('name_storageAccount'), 'default')]", - "ref_fileShare": "[resourceId('Microsoft.Storage/storageAccounts/fileServices/shares', variables('name_storageAccount'), 'default',variables('name_share'))]", - "name_customHostnameGeneratorscriptFile": "generateCustomHostNameVerifier.sh", - "name_customHostnameVerifierJavaFile": "src/main/java/WebLogicCustomHostNameVerifier.java", - "name_customHostnameValuesTemplate": "src/main/java/HostNameValuesTemplate.txt", - "name_customHostnameVerifierTest" : "src/test/java/WebLogicCustomHostNameVerifierTest.java" - }, - "resources": [ - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${admin.admin.start}", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Network/networkSecurityGroups", - "apiVersion": "${azure.apiVersionForNetworkSecurityGroups}", - "tags": "[parameters('tagsByResource')['${identifier.networkSecurityGroups}']]", - "condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'new')]", - "name": "[parameters('nsgName')]", - "location": "[parameters('location')]", - "properties": { - "securityRules": [ - { - "name": "WebLogicPorts", - "properties": { - "protocol": "TCP", - "sourcePortRange": "*", - "sourceAddressPrefix": "*", - "destinationAddressPrefix": "*", - "access": "Allow", - "priority": 320, - "direction": "Inbound", - "destinationPortRanges": "[split(concat(parameters('portsToExpose'),variables('const_requiredPortrange')), ',')]" - } - }, - { - "name": "WebLogicNMPort", - "properties": { - "protocol": "TCP", - "sourcePortRange": "*", - "sourceAddressPrefix": "Internet", - "destinationAddressPrefix": "*", - "access": "Deny", - "priority": 201, - "direction": "Inbound", - "destinationPortRanges": [ "5556" ] - } - }, - { - "name": "WebLogicAdminChannelPort", - "properties": { - "protocol": "TCP", - "sourcePortRange": "*", - "sourceAddressPrefix": "Internet", - "destinationAddressPrefix": "*", - "access": "Deny", - "priority": 202, - "direction": "Inbound", - "destinationPortRanges": [ "7005" ] - } - } - ] - } - }, - { - "type": "Microsoft.Storage/storageAccounts", - "apiVersion": "${azure.apiVersionForStorage}", - "tags": "[parameters('tagsByResource')['${identifier.storageAccounts}']]", - "name": "[variables('name_storageAccount')]", - "location": "[parameters('location')]", - "sku": { - "name": "[variables('const_storageAccountType')]" - }, - "kind": "StorageV2", - "properties": { - "supportsHttpsTrafficOnly": false - }, - "dependsOn": [ - "[parameters('nsgName')]" - ] - }, - { - "apiVersion": "${azure.apiVersionForPrivateEndpoint}", - "name": "[variables('name_privateSaEndpoint')]", - "type": "Microsoft.Network/privateEndpoints", - "tags": "[parameters('tagsByResource')['${identifier.privateEndpoints}']]", - "location": "[parameters('location')]", - "properties": { - "privateLinkServiceConnections": [ - { - "name": "[variables('name_privateSaEndpoint')]", - "properties": { - "privateLinkServiceId": "[resourceId('Microsoft.Storage/storageAccounts/', variables('name_storageAccount'))]", - "groupIds": [ - "file" - ] - } - } - ], - "subnet": { - "id": "[variables('ref_subnet')]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('name_storageAccount'))]" - ] - }, - { - "type": "Microsoft.Storage/storageAccounts/fileServices", - "apiVersion": "${azure.apiVersionForStorageFileService}", - "name": "[concat(variables('name_storageAccount'), '/default')]", - "dependsOn": [ - "[variables('ref_storage')]" - ], - "sku": { - "name": "Standard_LRS", - "tier": "Standard" - } - }, - { - "type": "Microsoft.Storage/storageAccounts/fileServices/shares", - "apiVersion": "${azure.apiVersionForStorageFileService}", - "name": "[concat(variables('name_storageAccount'), '/default/', variables('name_share'))]", - "dependsOn": [ - "[variables('ref_fileService')]", - "[variables('ref_storage')]" - ], - "properties": { - "shareQuota": 10 - } - }, - { - "apiVersion": "${azure.apiVersionForPublicIPAddresses}", - "type": "Microsoft.Network/publicIPAddresses", - "tags": "[parameters('tagsByResource')['${identifier.publicIPAddresses}']]", - "condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'new')]", - "name": "[variables('name_publicIPAddress')]", - "location": "[parameters('location')]", - "properties": { - "publicIPAllocationMethod": "[variables('const_publicIPAddressType')]", - "dnsSettings": { - "domainNameLabel": "[concat(toLower(parameters('dnsLabelPrefix')),'-',take(replace(parameters('guidValue'), '-', ''), 10),'-',toLower(parameters('wlsDomainName')))]" - } - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualNetworks}", - "type": "Microsoft.Network/virtualNetworks", - "tags": "[parameters('tagsByResource')['${identifier.virtualNetworks}']]", - "condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'new')]", - "name": "[variables('name_virtualNetwork')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[variables('ref_networkSecurityGroup')]" - ], - "properties": { - "addressSpace": { - "addressPrefixes": "[variables('const_addressPrefix')]" - }, - "subnets": [ - { - "name": "[variables('name_subnet')]", - "properties": { - "addressPrefix": "[variables('const_subnetPrefix')]", - "networkSecurityGroup": { - "id": "[variables('ref_networkSecurityGroup')]" - } - } - } - ] - } - }, - { - "apiVersion": "${azure.apiVersionForNetworkInterfaces}", - "type": "Microsoft.Network/networkInterfaces", - "tags": "[parameters('tagsByResource')['${identifier.networkInterfaces}']]", - "condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'new')]", - "name": "[variables('name_nic_with_pub_ip')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/publicIPAddresses/', variables('name_publicIPAddress'))]", - "[resourceId('Microsoft.Network/virtualNetworks/', variables('name_virtualNetwork'))]" - ], - "properties": { - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('name_publicIPAddress'))]" - }, - "subnet": { - "id": "[variables('ref_subnet')]" - } - } - } - ], - "dnsSettings": { - "internalDnsNameLabel": "[parameters('adminVMName')]" - } - } - }, - { - "apiVersion": "${azure.apiVersionForNetworkInterfaces}", - "type": "Microsoft.Network/networkInterfaces", - "tags": "[parameters('tagsByResource')['${identifier.networkInterfaces}']]", - "condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'existing')]", - "name": "[variables('name_nic_without_pub_ip')]", - "location": "[parameters('location')]", - "properties": { - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "subnet": { - "id": "[variables('ref_subnet')]" - } - } - } - ] - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines", - "tags": "[parameters('tagsByResource')['${identifier.virtualMachines}']]", - "name": "[parameters('adminVMName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts/', variables('name_storageAccount'))]", - "[resourceId('Microsoft.Network/networkInterfaces/', variables('name_nic_with_pub_ip'))]", - "[resourceId('Microsoft.Network/networkInterfaces/', variables('name_nic_without_pub_ip'))]" - ], - "identity": "[if(parameters('useSystemAssignedManagedIdentity'), json('{\"type\":\"SystemAssigned\"}'), null())]", - "properties": { - "hardwareProfile": { - "vmSize": "[variables('const_vmSize')]" - }, - "osProfile": { - "computerName": "[parameters('adminVMName')]", - "adminUsername": "[parameters('adminUsername')]", - "adminPassword": "[parameters('adminPasswordOrKey')]", - "linuxConfiguration": "[if(equals(parameters('authenticationType'), 'password'), json('null'), variables('const_linuxConfiguration'))]" - }, - "storageProfile": { - "imageReference": { - "publisher": "[variables('const_imagePublisher')]", - "offer": "[variables('const_imageOffer')]", - "sku": "[variables('name_linuxImageOfferSKU')]", - "version": "[variables('name_linuxImageVersion')]" - }, - "osDisk": { - "createOption": "FromImage", - "managedDisk": { - "storageAccountType": "Standard_LRS" - } - } - }, - "networkProfile": { - "networkInterfaces": [ - { - "id": "[if(equals(parameters('virtualNetworkNewOrExisting'), 'new'), resourceId('Microsoft.Network/networkInterfaces', variables('name_nic_with_pub_ip')), resourceId('Microsoft.Network/networkInterfaces', variables('name_nic_without_pub_ip')))]" - } - ] - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": true, - "storageUri": "[reference(resourceId('Microsoft.Storage/storageAccounts/', variables('name_storageAccount')), '${azure.apiVersionForStorage}').primaryEndpoints.blob]" - } - } - }, - "plan": { - "name": "[variables('name_linuxImageOfferSKU')]", - "publisher": "[variables('const_imagePublisher')]", - "product": "[variables('const_imageOffer')]" - } - }, - { - "name": "[concat(parameters('adminVMName'),'/newuserscript')]", - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines/extensions", - "tags": "[parameters('tagsByResource')['${identifier.virtualMachinesExtensions}']]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/', parameters('adminVMName'))]", - "[variables('ref_fileShare')]", - "[variables('name_privateSaEndpoint')]" - ], - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.0", - "autoUpgradeMinorVersion": true, - "settings": { - "fileUris": [ - "[uri(parameters('_artifactsLocationAdminTemplate'), concat('../scripts/', variables('name_scriptFile'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationAdminTemplate'), concat('../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameGeneratorscriptFile'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationAdminTemplate'), concat('../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameVerifierJavaFile'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationAdminTemplate'), concat('../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameValuesTemplate'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationAdminTemplate'), concat('../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameVerifierTest'), parameters('_artifactsLocationSasToken')))]" - ] - }, - "protectedSettings": { - "commandToExecute": "[concat('sh',' ',variables('name_scriptFile'),' <<< \"',parameters('wlsDomainName'),' ',parameters('wlsUserName'),' ',parameters('wlsPassword'),' ',parameters('adminVMName'),' ', variables('const_wlsHome'),' ',variables('name_storageAccount'),' ',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('name_storageAccount')), '${azure.apiVersionForStorage}').keys[0].value,' ',variables('const_mountPointPath'),' ',string(parameters('enableHTTPAdminListenPort')),' ', if(equals(parameters('virtualNetworkNewOrExisting'), 'new'), if(parameters('enableCustomDNS'), parameters('customDNSName'), reference(variables('name_publicIPAddress')).dnsSettings.fqdn), reference(variables('name_nic_without_pub_ip')).ipConfigurations[0].properties.privateIPAddress),' ',parameters('dnsLabelPrefix'),' ',parameters('location'),' ',parameters('virtualNetworkNewOrExisting'),' ',reference(resourceId('Microsoft.Network/privateEndpoints/', variables('name_privateSaEndpoint')), '${azure.apiVersionForPrivateEndpoint}').customDnsConfigs[0].ipAddresses[0],' ',variables('name_share'), '\"')]" - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${admin.admin.end}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk11-ol91}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk11-ol91'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk11-ol87}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk11-ol87'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk8-ol91}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk8-ol91'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk8-ol87}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk8-ol87'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-122140-jdk8-ol91}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-122140-jdk8-ol91'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-122140-jdk8-ol87}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-122140-jdk8-ol87'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-122140-jdk8-ol76}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'from.owls-122140-jdk8-ol76'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk8-ol76}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk8-ol76'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk11-ol76}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk11-ol76'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk11-rhel87}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk11-rhel87'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-122140-jdk8-rhel87}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-122140-jdk8-rhel87'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-122140-jdk8-rhel76}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-122140-jdk8-rhel76'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk8-rhel87}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk8-rhel87'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk8-rhel76}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk8-rhel76'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk11-rhel76}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk11-rhel76'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - } - ], - "outputs": { - "_adminPublicIPId": { - "type": "string", - "value": "[if(equals(parameters('virtualNetworkNewOrExisting'), 'new'), resourceId('Microsoft.Network/publicIPAddresses',variables('name_publicIPAddress')), reference(variables('name_nic_without_pub_ip')).ipConfigurations[0].properties.privateIPAddress)]" - }, - "hostname": { - "type": "string", - "value": "[if(equals(parameters('virtualNetworkNewOrExisting'), 'new'), reference(variables('name_publicIPAddress')).dnsSettings.fqdn, reference(variables('name_nic_without_pub_ip')).ipConfigurations[0].properties.privateIPAddress)]" - }, - "sshCommand": { - "type": "string", - "value": "[concat('ssh ', parameters('adminUsername'), '@', if(equals(parameters('virtualNetworkNewOrExisting'), 'new'), reference(variables('name_publicIPAddress')).dnsSettings.fqdn, reference(variables('name_nic_without_pub_ip')).ipConfigurations[0].properties.privateIPAddress))]" - }, - "wlsDomainLocation": { - "type": "string", - "value": "[concat('/u01/domains/', parameters('wlsDomainName'))]" - }, - "adminConsoleURL": { - "type": "string", - "value": "[uri(concat('http://', if(equals(parameters('virtualNetworkNewOrExisting'), 'new'), reference(variables('name_publicIPAddress')).dnsSettings.fqdn, reference(variables('name_nic_without_pub_ip')).ipConfigurations[0].properties.privateIPAddress),':7001/console/'), '')]" - }, - "adminConsoleSecureURL": { - "type": "string", - "value": "[uri(concat('https://',if(equals(parameters('virtualNetworkNewOrExisting'), 'new'), reference(variables('name_publicIPAddress')).dnsSettings.fqdn, reference(variables('name_nic_without_pub_ip')).ipConfigurations[0].properties.privateIPAddress),':7002/console/'), '')]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/adminTemplateForCustomSSL.json b/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/adminTemplateForCustomSSL.json deleted file mode 100644 index a8800c2b2..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/adminTemplateForCustomSSL.json +++ /dev/null @@ -1,1005 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - } - }, - "_artifactsLocationAdminTemplate": { - "defaultValue": "[if(contains(parameters('_artifactsLocation'), 'githubusercontent'), parameters('_artifactsLocation'), deployment().properties.templateLink.uri)]", - "type": "string", - "metadata": { - "description": "If we are deploying from the command line, use the passed in _artifactsLocation, otherwise use the default." - } - }, - "_artifactsLocationSasToken": { - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - } - }, - "_globalResourceNameSuffix": { - "type": "string", - "metadata": { - "description": "A unique suffix that was specified during the deployment of the solution template." - } - }, - "adminPasswordOrKey": { - "type": "securestring", - "metadata": { - "description": "SSH Key or password for the Virtual Machine. SSH key is recommended." - } - }, - "adminUsername": { - "type": "string", - "metadata": { - "description": "User name for the Virtual Machine." - } - }, - "adminVMName": { - "type": "string", - "defaultValue": "adminVM", - "metadata": { - "description": "Admin Server hosting VM name." - } - }, - "authenticationType": { - "type": "string", - "defaultValue": "password", - "allowedValues": [ - "sshPublicKey", - "password" - ], - "metadata": { - "description": "Type of authentication to use on the Virtual Machine. SSH key is recommended." - } - }, - "customDNSName": { - "defaultValue": "console.contoso.xyz", - "type": "string", - "metadata": { - "description": "Custom DNS Zone domain name for Oracle WebLogic Administration Console" - } - }, - "dnsLabelPrefix": { - "type": "string", - "metadata": { - "description": "Unique DNS Name for the Public IP used to access the Virtual Machine." - } - }, - "enableCustomDNS": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "Boolean value indicating, if custom DNS Name is available or not" - } - }, - "enableCustomSSL": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "Boolean value indicating, if custom SSL is enabled or not" - } - }, - "enableHTTPAdminListenPort": { - "type": "bool", - "defaultValue": true, - "metadata": { - "description": "Boolean value indicating, if WebLogic Admin Server HTTP Listen Port is enabled or not" - } - }, - "guidValue": { - "type": "string", - "defaultValue": "[newGuid()]" - }, - "nsgName": { - "type": "string", - "metadata": { - "description": "Network Security Group name" - } - }, - "sslCustomIdentityKeyStoreData": { - "type": "securestring", - "metadata": { - "description": "Weblogic Custom Identity Keystore Data" - } - }, - "sslCustomIdentityKeyStorePassPhrase": { - "type": "securestring", - "metadata": { - "description": "Weblogic Custom Identity Keystore Passphrase" - } - }, - "sslCustomIdentityKeyStoreType": { - "type": "string", - "metadata": { - "description": "Weblogic Custom Identity Keystore Type" - }, - "defaultValue": "JKS" - }, - "sslCustomTrustKeyStoreData": { - "type": "securestring", - "metadata": { - "description": "Weblogic Custom Trust Store Data" - } - }, - "sslCustomTrustKeyStorePassPhrase": { - "type": "securestring", - "metadata": { - "description": "Weblogic Custom Trust Store Passphrase" - } - }, - "sslCustomTrustKeyStoreType": { - "type": "string", - "metadata": { - "description": "Weblogic Custom Trust Store Type" - }, - "defaultValue": "JKS" - }, - "sslPrivateKeyAlias": { - "type": "string", - "metadata": { - "description": "Weblogic Server Private Key Alias" - } - }, - "sslPrivateKeyPassPhrase": { - "type": "securestring", - "metadata": { - "description": "Weblogic Server Private Key Pass Phrase" - } - }, - "location": { - "type": "string", - "metadata": { - "description": "Location for all resources." - } - }, - "portsToExpose": { - "type": "string", - "defaultValue": "80,443,7001-9000", - "metadata": { - "description": "Ports and port ranges to expose" - } - }, - "skuUrnVersion": { - "type": "string", - "defaultValue": "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest", - "allowedValues": [ - "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest", - "owls-141100-jdk11-ol87;Oracle:weblogic-141100-jdk11-ol87:owls-141100-jdk11-ol87;latest", - "owls-141100-jdk8-ol91;Oracle:weblogic-141100-jdk8-ol91:owls-141100-jdk8-ol91;latest", - "owls-141100-jdk8-ol87;Oracle:weblogic-141100-jdk8-ol87:owls-141100-jdk8-ol87;latest", - "owls-122140-jdk8-ol91;Oracle:weblogic-122140-jdk8-ol91:owls-122140-jdk8-ol91;latest", - "owls-122140-jdk8-ol87;Oracle:weblogic-122140-jdk8-ol87:owls-122140-jdk8-ol87;latest", - "owls-122140-jdk8-ol76;Oracle:weblogic-122140-jdk8-ol76:owls-122140-jdk8-ol7;latest", - "owls-141100-jdk8-ol76;Oracle:weblogic-141100-jdk8-ol76:owls-141100-jdk8-ol7;latest", - "owls-141100-jdk11-ol76;Oracle:weblogic-141100-jdk11-ol76:owls-141100-jdk11-ol7;latest", - "owls-141100-jdk11-rhel87;Oracle:weblogic-141100-jdk11-rhel87:owls-141100-jdk11-rhel87;latest", - "owls-141100-jdk8-rhel87;Oracle:weblogic-141100-jdk8-rhel87:owls-141100-jdk8-rhel87;latest", - "owls-122140-jdk8-rhel87;Oracle:weblogic-122140-jdk8-rhel87:owls-122140-jdk8-rhel87;latest", - "owls-122140-jdk8-rhel76;Oracle:weblogic-122140-jdk8-rhel76:owls-122140-jdk8-rhel76;latest", - "owls-141100-jdk8-rhel76;Oracle:weblogic-141100-jdk8-rhel76:owls-141100-jdk8-rhel76;latest", - "owls-141100-jdk11-rhel76;Oracle:weblogic-141100-jdk11-rhel76:owls-141100-jdk11-rhel76;latest" - ], - "metadata": { - "description": "The Oracle Linux image with Weblogic and Java preinstalled. Semicolon separated string of Sku, URN, and Version" - } - }, - "usePreviewImage": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "Bool value, if it's set to true, will deploy with preview weblogic image." - } - }, - "useSystemAssignedManagedIdentity": { - "type": "bool", - "defaultValue": true, - "metadata": { - "description": "Bool value, if it's set to true, a system assigned managed identity will to be created for the VM(s)" - } - }, - "virtualNetworkNewOrExisting": { - "type": "string", - "defaultValue": "new", - "allowedValues": [ - "new", - "existing" - ], - "metadata": { - "description": "Specify whether to create a new or existing virtual network for the VM." - } - }, - "virtualNetworkName": { - "type": "string", - "defaultValue": "wls-vnet", - "metadata": { - "description": "Name of the existing or new VNET" - } - }, - "virtualNetworkResourceGroupName": { - "type": "string", - "defaultValue": "[resourceGroup().name]", - "metadata": { - "description": "Resource group of Virtual network" - } - }, - "addressPrefixes": { - "type": "array", - "defaultValue": [ - "10.0.0.0/28" - ], - "metadata": { - "description": "Address prefix of the VNET." - } - }, - "subnetName": { - "type": "string", - "defaultValue": "wls-subnet", - "metadata": { - "description": "Name of the existing or new Subnet" - } - }, - "subnetPrefix": { - "type": "string", - "defaultValue": "10.0.0.0/29", - "metadata": { - "description": "Address prefix of the subnet" - } - }, - "tagsByResource": { - "type": "object", - "defaultValue": {}, - "metadata": { - "description": "${label.tagsLabel}" - } - }, - "vmSize": { - "type": "string", - "defaultValue": "Standard_A3", - "metadata": { - "description": "Select appropriate VM Size as per requirement" - } - }, - "wlsDomainName": { - "type": "string", - "metadata": { - "description": "Provide Weblogic domain name" - } - }, - "wlsPassword": { - "type": "securestring", - "metadata": { - "description": "Password for your Weblogic domain name" - } - }, - "wlsUserName": { - "type": "string", - "metadata": { - "description": "Username for your Weblogic domain name" - } - } - }, - "variables": { - "const_addressPrefix": "[parameters('addressPrefixes')]", - "const_hyphen": "-", - "const_imageOffer": "[concat('weblogic',variables('const_hyphen'), split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[1],variables('const_hyphen'),split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[2],variables('const_hyphen'),split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[3],if(parameters('usePreviewImage'),'-preview',''))]", - "const_imagePublisher": "oracle", - "const_linuxConfiguration": { - "disablePasswordAuthentication": true, - "ssh": { - "publicKeys": [ - { - "path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]", - "keyData": "[parameters('adminPasswordOrKey')]" - } - ] - } - }, - "const_mountPointPath": "[concat('/mnt/', variables('name_share'))]", - "const_publicIPAddressType": "Dynamic", - "const_requiredPortrange": ",65200-65535,5556", - "const_storageAccountType": "Standard_LRS", - "const_subnetPrefix": "[parameters('subnetPrefix')]", - "const_vmSize": "[parameters('vmSize')]", - "const_wlsHome": "/u01/app/wls/install/oracle/middleware/oracle_home", - "name_linuxImageOfferSKU": "[first(split(parameters('skuUrnVersion'), ';'))]", - "name_linuxImageVersion": "[last(split(parameters('skuUrnVersion'),';'))]", - "name_nic": "[concat('adminServerVM_NIC_', parameters('_globalResourceNameSuffix'))]", - "name_nic_with_pub_ip": "[concat(variables('name_nic'), '_with_pub_ip')]", - "name_nic_without_pub_ip": "[concat(variables('name_nic'), '_without_pub_ip')]", - "name_publicIPAddress": "[concat('adminServerVM_PublicIP_', parameters('_globalResourceNameSuffix'))]", - "name_privateSaEndpoint": "[concat(take(replace(parameters('guidValue'),'-',''),6),'saep')]", - "name_scriptFile": "setupAdminDomain.sh", - "name_storageAccount": "[concat('olvmstg', parameters('_globalResourceNameSuffix'))]", - "name_subnet": "[parameters('subnetName')]", - "name_share": "[concat('wlsshare', parameters('_globalResourceNameSuffix'))]", - "name_virtualNetwork": "[parameters('virtualNetworkName')]", - "ref_networkSecurityGroup": "[resourceId('Microsoft.Network/networkSecurityGroups', parameters('nsgName'))]", - "ref_subnet": "[resourceId(parameters('virtualNetworkResourceGroupName'), 'Microsoft.Network/virtualNetworks/subnets', variables('name_virtualNetwork'), variables('name_subnet'))]", - "ref_storage": "[resourceId('Microsoft.Storage/storageAccounts', variables('name_storageAccount'))]", - "ref_fileService": "[resourceId('Microsoft.Storage/storageAccounts/fileServices', variables('name_storageAccount'), 'default')]", - "ref_fileShare": "[resourceId('Microsoft.Storage/storageAccounts/fileServices/shares', variables('name_storageAccount'), 'default',variables('name_share'))]", - "name_customHostnameGeneratorscriptFile": "generateCustomHostNameVerifier.sh", - "name_customHostnameVerifierJavaFile": "src/main/java/WebLogicCustomHostNameVerifier.java", - "name_customHostnameValuesTemplate": "src/main/java/HostNameValuesTemplate.txt", - "name_customHostnameVerifierTest" : "src/test/java/WebLogicCustomHostNameVerifierTest.java" - }, - "resources": [ - { - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${admin.admin.start}", - "type": "Microsoft.Resources/deployments", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${admin.ssl.start}", - "type": "Microsoft.Resources/deployments", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "apiVersion": "${azure.apiVersionForNetworkSecurityGroups}", - "type": "Microsoft.Network/networkSecurityGroups", - "tags": "[parameters('tagsByResource')['${identifier.networkSecurityGroups}']]", - "condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'new')]", - "name": "[parameters('nsgName')]", - "location": "[parameters('location')]", - "properties": { - "securityRules": [ - { - "name": "WebLogicPorts", - "properties": { - "protocol": "TCP", - "sourcePortRange": "*", - "sourceAddressPrefix": "*", - "destinationAddressPrefix": "*", - "access": "Allow", - "priority": 320, - "direction": "Inbound", - "destinationPortRanges": "[split(concat(parameters('portsToExpose'),variables('const_requiredPortrange')), ',')]" - } - }, - { - "name": "WebLogicNMPort", - "properties": { - "protocol": "TCP", - "sourcePortRange": "*", - "sourceAddressPrefix": "Internet", - "destinationAddressPrefix": "*", - "access": "Deny", - "priority": 201, - "direction": "Inbound", - "destinationPortRanges": [ "5556" ] - } - }, - { - "name": "WebLogicAdminChannelPort", - "properties": { - "protocol": "TCP", - "sourcePortRange": "*", - "sourceAddressPrefix": "Internet", - "destinationAddressPrefix": "*", - "access": "Deny", - "priority": 202, - "direction": "Inbound", - "destinationPortRanges": [ "7005" ] - } - } - ] - } - }, - { - "type": "Microsoft.Storage/storageAccounts", - "apiVersion": "${azure.apiVersionForStorage}", - "name": "[variables('name_storageAccount')]", - "tags": "[parameters('tagsByResource')['${identifier.storageAccounts}']]", - "location": "[parameters('location')]", - "sku": { - "name": "[variables('const_storageAccountType')]" - }, - "kind": "StorageV2", - "properties": { - "supportsHttpsTrafficOnly": false - }, - "dependsOn": [ - "[parameters('nsgName')]" - ] - }, - { - "apiVersion": "${azure.apiVersionForPrivateEndpoint}", - "name": "[variables('name_privateSaEndpoint')]", - "type": "Microsoft.Network/privateEndpoints", - "tags": "[parameters('tagsByResource')['${identifier.privateEndpoints}']]", - "location": "[parameters('location')]", - "properties": { - "privateLinkServiceConnections": [ - { - "name": "[variables('name_privateSaEndpoint')]", - "properties": { - "privateLinkServiceId": "[resourceId('Microsoft.Storage/storageAccounts/', variables('name_storageAccount'))]", - "groupIds": [ - "file" - ] - } - } - ], - "subnet": { - "id": "[variables('ref_subnet')]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('name_storageAccount'))]" - ] - }, - { - "type": "Microsoft.Storage/storageAccounts/fileServices", - "apiVersion": "${azure.apiVersionForStorageFileService}", - "name": "[concat(variables('name_storageAccount'), '/default')]", - "dependsOn": [ - "[variables('ref_storage')]" - ], - "sku": { - "name": "Standard_LRS", - "tier": "Standard" - } - }, - { - "type": "Microsoft.Storage/storageAccounts/fileServices/shares", - "apiVersion": "${azure.apiVersionForStorageFileService}", - "name": "[concat(variables('name_storageAccount'), '/default/', variables('name_share'))]", - "dependsOn": [ - "[variables('ref_fileService')]", - "[variables('ref_storage')]" - ], - "properties": { - "shareQuota": 10 - } - }, - { - "apiVersion": "${azure.apiVersionForPublicIPAddresses}", - "type": "Microsoft.Network/publicIPAddresses", - "tags": "[parameters('tagsByResource')['${identifier.publicIPAddresses}']]", - "condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'new')]", - "name": "[variables('name_publicIPAddress')]", - "location": "[parameters('location')]", - "properties": { - "publicIPAllocationMethod": "[variables('const_publicIPAddressType')]", - "dnsSettings": { - "domainNameLabel": "[concat(toLower(parameters('dnsLabelPrefix')),'-',take(replace(parameters('guidValue'), '-', ''), 10),'-',toLower(parameters('wlsDomainName')))]" - } - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualNetworks}", - "type": "Microsoft.Network/virtualNetworks", - "tags": "[parameters('tagsByResource')['${identifier.virtualNetworks}']]", - "condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'new')]", - "name": "[variables('name_virtualNetwork')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[variables('ref_networkSecurityGroup')]" - ], - "properties": { - "addressSpace": { - "addressPrefixes": "[variables('const_addressPrefix')]" - }, - "subnets": [ - { - "name": "[variables('name_subnet')]", - "properties": { - "addressPrefix": "[variables('const_subnetPrefix')]", - "networkSecurityGroup": { - "id": "[variables('ref_networkSecurityGroup')]" - } - } - } - ] - } - }, - { - "apiVersion": "${azure.apiVersionForNetworkInterfaces}", - "type": "Microsoft.Network/networkInterfaces", - "tags": "[parameters('tagsByResource')['${identifier.networkInterfaces}']]", - "condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'new')]", - "name": "[variables('name_nic_with_pub_ip')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/publicIPAddresses/', variables('name_publicIPAddress'))]", - "[resourceId('Microsoft.Network/virtualNetworks/', variables('name_virtualNetwork'))]" - ], - "properties": { - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('name_publicIPAddress'))]" - }, - "subnet": { - "id": "[variables('ref_subnet')]" - } - } - } - ], - "dnsSettings": { - "internalDnsNameLabel": "[parameters('adminVMName')]" - } - } - }, - { - "apiVersion": "${azure.apiVersionForNetworkInterfaces}", - "type": "Microsoft.Network/networkInterfaces", - "tags": "[parameters('tagsByResource')['${identifier.networkInterfaces}']]", - "condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'existing')]", - "name": "[variables('name_nic_without_pub_ip')]", - "location": "[parameters('location')]", - "properties": { - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "subnet": { - "id": "[variables('ref_subnet')]" - } - } - } - ] - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines", - "tags": "[parameters('tagsByResource')['${identifier.virtualMachines}']]", - "name": "[parameters('adminVMName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts/', variables('name_storageAccount'))]", - "[resourceId('Microsoft.Network/networkInterfaces/', variables('name_nic_with_pub_ip'))]", - "[resourceId('Microsoft.Network/networkInterfaces/', variables('name_nic_without_pub_ip'))]" ], - "identity": "[if(parameters('useSystemAssignedManagedIdentity'), json('{\"type\":\"SystemAssigned\"}'), null())]", - "properties": { - "hardwareProfile": { - "vmSize": "[variables('const_vmSize')]" - }, - "osProfile": { - "computerName": "[parameters('adminVMName')]", - "adminUsername": "[parameters('adminUsername')]", - "adminPassword": "[parameters('adminPasswordOrKey')]", - "linuxConfiguration": "[if(equals(parameters('authenticationType'), 'password'), json('null'), variables('const_linuxConfiguration'))]" - }, - "storageProfile": { - "imageReference": { - "publisher": "[variables('const_imagePublisher')]", - "offer": "[variables('const_imageOffer')]", - "sku": "[variables('name_linuxImageOfferSKU')]", - "version": "[variables('name_linuxImageVersion')]" - }, - "osDisk": { - "createOption": "FromImage", - "managedDisk": { - "storageAccountType": "Standard_LRS" - } - } - }, - "networkProfile": { - "networkInterfaces": [ - { - "id": "[if(equals(parameters('virtualNetworkNewOrExisting'), 'new'), resourceId('Microsoft.Network/networkInterfaces', variables('name_nic_with_pub_ip')), resourceId('Microsoft.Network/networkInterfaces', variables('name_nic_without_pub_ip')))]" - } - ] - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": true, - "storageUri": "[reference(resourceId('Microsoft.Storage/storageAccounts/', variables('name_storageAccount')), '${azure.apiVersionForStorage}').primaryEndpoints.blob]" - } - } - }, - "plan": { - "name": "[variables('name_linuxImageOfferSKU')]", - "publisher": "[variables('const_imagePublisher')]", - "product": "[variables('const_imageOffer')]" - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines/extensions", - "tags": "[parameters('tagsByResource')['${identifier.virtualMachinesExtensions}']]", - "name": "[concat(parameters('adminVMName'),'/newuserscript')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/', parameters('adminVMName'))]", - "[variables('ref_fileShare')]", - "[variables('name_privateSaEndpoint')]" - ], - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.0", - "autoUpgradeMinorVersion": true, - "settings": { - "fileUris": [ - "[uri(parameters('_artifactsLocationAdminTemplate'), concat('../scripts/', variables('name_scriptFile'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationAdminTemplate'), concat('../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameGeneratorscriptFile'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationAdminTemplate'), concat('../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameVerifierJavaFile'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationAdminTemplate'), concat('../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameValuesTemplate'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationAdminTemplate'), concat('../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameVerifierTest'), parameters('_artifactsLocationSasToken')))]" - ] - }, - "protectedSettings": { - "commandToExecute": "[concat('sh',' ',variables('name_scriptFile'),' <<< \"',parameters('wlsDomainName'),' ',parameters('wlsUserName'),' ',parameters('wlsPassword'),' ',parameters('adminVMName'),' ', variables('const_wlsHome'),' ',variables('name_storageAccount'),' ',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('name_storageAccount')), '${azure.apiVersionForStorage}').keys[0].value,' ',variables('const_mountPointPath'),' ',string(parameters('enableHTTPAdminListenPort')),' ',if(equals(parameters('virtualNetworkNewOrExisting'), 'new'), if(parameters('enableCustomDNS'), parameters('customDNSName'), reference(variables('name_publicIPAddress')).dnsSettings.fqdn), reference(variables('name_nic_without_pub_ip')).ipConfigurations[0].properties.privateIPAddress),' ',parameters('dnsLabelPrefix'),' ',parameters('location'),' ',parameters('virtualNetworkNewOrExisting'),' ',reference(resourceId('Microsoft.Network/privateEndpoints/', variables('name_privateSaEndpoint')), '${azure.apiVersionForPrivateEndpoint}').customDnsConfigs[0].ipAddresses[0],' ',variables('name_share'),' ',string(parameters('enableCustomSSL')),' ',if(parameters('enableCustomSSL'),base64(parameters('sslCustomIdentityKeyStoreData')),''),' ',if(parameters('enableCustomSSL'),base64(parameters('sslCustomIdentityKeyStorePassPhrase')),''),' ',if(parameters('enableCustomSSL'),base64(parameters('sslCustomIdentityKeyStoreType')),''),' ',if(parameters('enableCustomSSL'),base64(parameters('sslCustomTrustKeyStoreData')),''),' ',if(parameters('enableCustomSSL'),base64(parameters('sslCustomTrustKeyStorePassPhrase')),''),' ',if(parameters('enableCustomSSL'),base64(parameters('sslCustomTrustKeyStoreType')),''),' ',if(parameters('enableCustomSSL'),base64(parameters('sslPrivateKeyAlias')),''),' ',if(parameters('enableCustomSSL'),base64(parameters('sslPrivateKeyPassPhrase')),''), '\"')]" } - } - }, - { - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${admin.ssl.end}", - "type": "Microsoft.Resources/deployments", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${admin.admin.end}", - "type": "Microsoft.Resources/deployments", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk11-ol91}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk11-ol91'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk11-ol87}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk11-ol87'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk8-ol91}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk8-ol91'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk8-ol87}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk8-ol87'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-122140-jdk8-ol91}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-122140-jdk8-ol91'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-122140-jdk8-ol87}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-122140-jdk8-ol87'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-122140-jdk8-ol76}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'from.owls-122140-jdk8-ol76'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk8-ol76}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk8-ol76'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk11-ol76}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk11-ol76'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk11-rhel87}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk11-rhel87'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk8-rhel87}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk8-rhel87'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-122140-jdk8-rhel87}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-122140-jdk8-rhel87'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-122140-jdk8-rhel76}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-122140-jdk8-rhel76'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk8-rhel76}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk8-rhel76'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk11-rhel76}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk11-rhel76'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - } - ], - "outputs": { - "_adminPublicIPId": { - "type": "string", - "value": "[if(equals(parameters('virtualNetworkNewOrExisting'), 'new'), resourceId('Microsoft.Network/publicIPAddresses',variables('name_publicIPAddress')), reference(variables('name_nic_without_pub_ip')).ipConfigurations[0].properties.privateIPAddress)]" - }, - "hostname": { - "type": "string", - "value": "[if(equals(parameters('virtualNetworkNewOrExisting'), 'new'), reference(variables('name_publicIPAddress')).dnsSettings.fqdn, reference(variables('name_nic_without_pub_ip')).ipConfigurations[0].properties.privateIPAddress)]" - }, - "sshCommand": { - "type": "string", - "value": "[concat('ssh ', parameters('adminUsername'), '@', if(equals(parameters('virtualNetworkNewOrExisting'), 'new'), reference(variables('name_publicIPAddress')).dnsSettings.fqdn, reference(variables('name_nic_without_pub_ip')).ipConfigurations[0].properties.privateIPAddress))]" - }, - "wlsDomainLocation": { - "type": "string", - "value": "[concat('/u01/domains/', parameters('wlsDomainName'))]" - }, - "adminConsoleURL": { - "type": "string", - "value": "[uri(concat('http://', if(equals(parameters('virtualNetworkNewOrExisting'), 'new'), reference(variables('name_publicIPAddress')).dnsSettings.fqdn, reference(variables('name_nic_without_pub_ip')).ipConfigurations[0].properties.privateIPAddress),':7001/console/'), '')]" - }, - "adminConsoleSecureURL": { - "type": "string", - "value": "[uri(concat('https://',if(equals(parameters('virtualNetworkNewOrExisting'), 'new'), reference(variables('name_publicIPAddress')).dnsSettings.fqdn, reference(variables('name_nic_without_pub_ip')).ipConfigurations[0].properties.privateIPAddress),':7002/console/'), '')]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/dbTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/dbTemplate.json deleted file mode 100644 index 10d56c67c..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/dbTemplate.json +++ /dev/null @@ -1,292 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - } - }, - "_artifactsLocationSasToken": { - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - }, - "defaultValue": "" - }, - "adminVMName": { - "type": "string", - "defaultValue": "adminVM", - "metadata": { - "description": "Admin Server hosting VM name." - } - }, - "databaseType": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "One of the supported database types" - } - }, - "dbGlobalTranPro": { - "defaultValue": "OnePhaseCommit", - "type": "string", - "metadata": { - "description": "Determines the transaction protocol (global transaction processing behavior) for the data source." - } - }, - "dbIdentity": { - "defaultValue": {}, - "type": "object", - "metadata": { - "description": "Managed identity that has access to the data source." - } - }, - "dbPassword": { - "defaultValue": "[newGuid()]", - "type": "securestring", - "metadata": { - "description": "Password for Database" - } - }, - "dbUser": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "Userid of Database" - } - }, - "dsConnectionURL": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "JDBC Connection String" - } - }, - "enablePswlessConnection": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "True to enable passwordless connection." - } - }, - "jdbcDataSourceName": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "JNDI Name for JDBC Datasource" - } - }, - "location": { - "type": "string", - "metadata": { - "description": "Location for all resources." - } - }, - "tagsByResource": { - "type": "object", - "defaultValue": {}, - "metadata": { - "description": "${label.tagsLabel}" - } - }, - "wlsDomainName": { - "type": "string", - "defaultValue": "adminDomain", - "metadata": { - "description": "Provide Weblogic domain name" - } - }, - "wlsPassword": { - "type": "securestring", - "metadata": { - "description": "Password for your Weblogic domain name" - } - }, - "wlsUserName": { - "type": "string", - "metadata": { - "description": "Username for your Weblogic domain name" - } - } - }, - "variables": { - "name_dbLinkedTemplateName": "_dbTemplate.json", - "name_dbPswlessTemplateName": "_pswlessDbTemplate.json", - "name_dbUpgradeMySQLDriver": "_installJdbcLibsTemplate.json" - }, - "resources": [ - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "pswlessDbTemplate", - "condition": "[parameters('enablePswlessConnection')]", - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_dbPswlessTemplateName')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "adminVMName": { - "value": "[parameters('adminVMName')]" - }, - "databaseType": { - "value": "[parameters('databaseType')]" - }, - "dbGlobalTranPro": { - "value": "[parameters('dbGlobalTranPro')]" - }, - "dbIdentity": { - "value": "[parameters('dbIdentity')]" - }, - "dbUser": { - "value": "[parameters('dbUser')]" - }, - "dsConnectionURL": { - "value": "[parameters('dsConnectionURL')]" - }, - "jdbcDataSourceName": { - "value": "[parameters('jdbcDataSourceName')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "tagsByResource": { - "value": "[parameters('tagsByResource')]" - }, - "wlsDomainName": { - "value": "[parameters('wlsDomainName')]" - }, - "wlsPassword": { - "value": "[parameters('wlsPassword')]" - }, - "wlsUserName": { - "value": "[parameters('wlsUserName')]" - } - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "upgradeMySQLJdbcDriverTemplate", - "condition": "[and(not(parameters('enablePswlessConnection')), equals(parameters('databaseType'),'mysql'))]", - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_dbUpgradeMySQLDriver')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "adminVMName": { - "value": "[parameters('adminVMName')]" - }, - "databaseType": { - "value": "[parameters('databaseType')]" - }, - "enablePswlessConnection": { - "value": "[parameters('enablePswlessConnection')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "tagsByResource": { - "value": "[parameters('tagsByResource')]" - }, - "wlsDomainName": { - "value": "[parameters('wlsDomainName')]" - }, - "wlsPassword": { - "value": "[parameters('wlsPassword')]" - }, - "wlsUserName": { - "value": "[parameters('wlsUserName')]" - } - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "passwordDatasourceDeployment", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "condition": "[not(parameters('enablePswlessConnection'))]", - "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', 'upgradeMySQLJdbcDriverTemplate')]" - ], - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_dbLinkedTemplateName')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "adminVMName": { - "value": "[parameters('adminVMName')]" - }, - "databaseType": { - "value": "[parameters('databaseType')]" - }, - "dbGlobalTranPro": { - "value": "[parameters('dbGlobalTranPro')]" - }, - "dbPassword": { - "value": "[parameters('dbPassword')]" - }, - "dbUser": { - "value": "[parameters('dbUser')]" - }, - "dsConnectionURL": { - "value": "[parameters('dsConnectionURL')]" - }, - "enablePswlessConnection": { - "value": "[parameters('enablePswlessConnection')]" - }, - "jdbcDataSourceName": { - "value": "[parameters('jdbcDataSourceName')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "tagsByResource": { - "value": "[parameters('tagsByResource')]" - }, - "wlsPassword": { - "value": "[parameters('wlsPassword')]" - }, - "wlsUserName": { - "value": "[parameters('wlsUserName')]" - } - } - } - } - ], - "outputs": { - "artifactsLocationPassedIn": { - "type": "string", - "value": "[parameters('_artifactsLocation')]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/dnszonesTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/dnszonesTemplate.json deleted file mode 100644 index a850bc0a0..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/dnszonesTemplate.json +++ /dev/null @@ -1,245 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - } - }, - "_artifactsLocationSasToken": { - "defaultValue": "", - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - } - }, - "_globalResourceNameSuffix": { - "type": "string", - "metadata": { - "description": "The suffix to be added to the globally unique resource name." - } - }, - "dnszonesARecordSetNames": { - "type": "array", - "defaultValue": [], - "metadata": { - "description": "An array of A record names. Used to create A records." - } - }, - "dnszonesCNAMEAlias": { - "type": "array", - "metadata": { - "description": "An array of CNAME record alias. Used to create CNAME records." - }, - "defaultValue": [] - }, - "dnszonesCNAMERecordSetNames": { - "type": "array", - "metadata": { - "description": "An array of CNAME record names. Used to create CNAME record set." - }, - "defaultValue": [] - }, - "dnszoneName": { - "defaultValue": "contoso.xyz", - "type": "string", - "metadata": { - "description": "Azure DNS Zone name." - } - }, - "dnszoneLocation": { - "defaultValue": "global", - "type": "string", - "metadata": { - "description": "Location used to create Azure DNS Zone." - } - }, - "hasDNSZones": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "If true, update A records in the existing DNS Zone, otherwise, create a new DNS Zone and ." - } - }, - "location": { - "type": "string", - "metadata": { - "description": "Location for all resources." - } - }, - "resourceGroup": { - "type": "string", - "defaultValue": "[resourceGroup()]", - "metadata": { - "description": "Name of the resource group that has an Azure DNS Zone deployed." - } - }, - "targetResources": { - "type": "array", - "defaultValue": [], - "metadata": { - "description": "References to Azure resources from where the DNS resource value is taken. Each item is corresponding to values of dnszonesARecordSetNames." - } - }, - "tagsByResource": { - "type": "object", - "defaultValue": {}, - "metadata": { - "description": "${label.tagsLabel}" - } - }, - "ttl": { - "type": "int", - "defaultValue": 3600, - "metadata": { - "description": "The TTL (time-to-live) of the records in the record sets." - } - }, - "utcValue": { - "type": "string", - "defaultValue": "[utcNow()]", - "metadata": { - "description": "Current deployment time. Used as a tag in deployment script." - } - } - }, - "variables": { - "name_createDNSZoneLinkedTemplateName": "_createDNSZonesTemplate.json", - "name_dnszoneTempaltesFolder": "_dnszones", - "name_updateDNSZoneLinkedTemplateName": "_updateDNSZonesTemplate.json" - }, - "resources": [ - { - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${cluster.dns.start}", - "type": "Microsoft.Resources/deployments", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [] - } - } - }, - { - "apiVersion": "${azure.apiVersionForDeployment}", - "type": "Microsoft.Resources/deployments", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "createDNSZone", - "condition": "[not(parameters('hasDNSZones'))]", - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/',variables('name_dnszoneTempaltesFolder'),'/', variables('name_createDNSZoneLinkedTemplateName')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "dnszonesARecordSetNames": { - "value": "[parameters('dnszonesARecordSetNames')]" - }, - "dnszonesCNAMEAlias": { - "value": "[parameters('dnszonesCNAMEAlias')]" - }, - "dnszonesCNAMERecordSetNames": { - "value": "[parameters('dnszonesCNAMERecordSetNames')]" - }, - "dnszoneName": { - "value": "[parameters('dnszoneName')]" - }, - "location": { - "value": "[parameters('dnszoneLocation')]" - }, - "targetResources": { - "value": "[parameters('targetResources')]" - }, - "tagsByResource": { - "value": "[parameters('tagsByResource')]" - }, - "ttl": { - "value": "[parameters('ttl')]" - } - } - } - }, - { - "apiVersion": "${azure.apiVersionForDeployment}", - "type": "Microsoft.Resources/deployments", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "updateDNSZone", - "condition": "[parameters('hasDNSZones')]", - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/',variables('name_dnszoneTempaltesFolder'),'/', variables('name_updateDNSZoneLinkedTemplateName')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "_globalResourceNameSuffix": { - "value": "[parameters('_globalResourceNameSuffix')]" - }, - "dnszonesARecordSetNames": { - "value": "[parameters('dnszonesARecordSetNames')]" - }, - "dnszonesCNAMEAlias": { - "value": "[parameters('dnszonesCNAMEAlias')]" - }, - "dnszonesCNAMERecordSetNames": { - "value": "[parameters('dnszonesCNAMERecordSetNames')]" - }, - "dnszoneName": { - "value": "[parameters('dnszoneName')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "resourceGroup": { - "value": "[parameters('resourceGroup')]" - }, - "targetResources": { - "value": "[parameters('targetResources')]" - }, - "tagsByResource": { - "value": "[parameters('tagsByResource')]" - }, - "ttl": { - "value": "[parameters('ttl')]" - }, - "utcValue": { - "value": "[parameters('utcValue')]" - } - } - } - }, - { - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${cluster.dns.end}", - "type": "Microsoft.Resources/deployments", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [] - } - } - } - ], - "outputs": { - "dnsZoneNameServers": { - "type": "array", - "condition": "[not(parameters('hasDNSZones'))]", - "value": "[reference('createDNSZone', '${azure.apiVersionForDeployment}').outputs.dnsZoneNameServers.value]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/nsgNestedTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/nsgNestedTemplate.json deleted file mode 100644 index a2ec4c154..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/nsgNestedTemplate.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "denyPublicTrafficForAdminServer": { - "type": "bool", - "defaultValue": false - }, - "networkSecurityGroupName": { - "type": "string", - "metadata": { - "description": "Network Security Group name" - } - } - }, - "variables": { - "const_subnetPrefix": "10.0.0.0/24" - }, - "resources": [ - { - "apiVersion": "${azure.apiVersionForNetworkSecurityGroups}", - "type": "Microsoft.Network/networkSecurityGroups/securityRules", - "name": "[concat(parameters('networkSecurityGroupName'),'/','WebLogicAdminPortsAllowed')]", - "condition": "[not(parameters('denyPublicTrafficForAdminServer'))]", - "properties": { - "protocol": "TCP", - "sourcePortRange": "*", - "destinationAddressPrefix": "*", - "access": "Allow", - "priority": 210, - "direction": "Inbound", - "destinationPortRanges": [ - "7001", - "7002" - ], - "sourceAddressPrefix": "[variables('const_subnetPrefix')]" - } - }, - { - "apiVersion": "${azure.apiVersionForNetworkSecurityGroups}", - "type": "Microsoft.Network/networkSecurityGroups/securityRules", - "name": "[concat(parameters('networkSecurityGroupName'),'/','WebLogicAdminPortsDenied')]", - "condition": "[parameters('denyPublicTrafficForAdminServer')]", - "properties": { - "protocol": "*", - "sourcePortRange": "*", - "destinationAddressPrefix": "*", - "access": "Deny", - "priority": 211, - "direction": "Inbound", - "destinationPortRanges": [ - "7001", - "7002" - ], - "sourceAddressPrefix": "Internet" - } - } - ] -} \ No newline at end of file diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/resources/marketing-artifacts/partner-center.html b/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/resources/marketing-artifacts/partner-center.html deleted file mode 100644 index c27730901..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/resources/marketing-artifacts/partner-center.html +++ /dev/null @@ -1,44 +0,0 @@ -

    Name

    -

    Oracle WebLogic Server with Admin Server on Azure VM

    -

    Search results summary

    -

    Provisions WebLogic Server with an Admin only domain on an Azure VM.

    -

    Short description

    -

    Provisions WebLogic Server Enterprise Edition with an Admin only domain, and starts the Administration Server.

    -

    Description

    -

    Oracle WebLogic Server (WLS) is an industry-leading Java runtime powering some of the most mission-critical enterprise applications - across the globe. This solution automates most boilerplate steps to provision a single WLS Admin Server on an Azure VM. Once initial - provisioning is complete, you are completely free to customize deployments further. The solution is jointly developed by Oracle and - Microsoft.

    -

    WLS Enterprise Edition versions supported include 12.2.1.4, and 14.1.1.0.

    -

    The following resources are automatically provisioned by the offer.

    -
      -
    • Oracle Linux or Red Hat Enterprise Linux (RHEL) VM with public IP address
    • -
    • Single WLS Enterprise Edition Admin Server instance (ORACLE_HOME is -/u01/app/wls/install/oracle/middleware/oracle_home)
    • -
    • Oracle JDK (JAVA_HOME is /u01/app/jdk/jdk-${version})
    • -
    • In addition to drivers that come standard with WLS, most recent supported PostgreSQL and Microsoft SQL JDBC drivers (drivers stored in -/u01/app/wls/install/oracle/middleware/oracle_home/wlserver/server/lib/)
    • -
    • WebLogic Domain with default name adminDomain (domain path is /u01/domains/adminDomain/)
    • -
    • Configured data source connection (Oracle DB, Azure SQL, Azure MySQL, Azure PostgreSQL) - optional
    • -
    • Virtual network and subnet (alternatively, you can deploy to an existing virtual network)
    • -
    • Network security group
    • -
    • OS disk attached to VM
    • -
    • Azure Storage Account to store VM diagnostics
    • -
    -

    This offer is Bring-Your-Own-License. It assumes you have already procured the appropriate licenses with Oracle and are properly -licensed to run offers in Microsoft Azure.

    -

    Oracle and Microsoft also provide basic step-by-step instructions on getting started with WLS and Azure VMs without automated -provisioning.

    -

    Oracle and Microsoft provide similar solutions targeting WLS on the Azure Kubernetes Service (AKS) in addition to a WLS cluster on -Azure VMs. These options are linked in the Learn more section below.

    -

    You can reach out to the engineering team developing these offers by clicking the CONTACT ME button on -the marketplace WebLogic on Azure overview page. Program managers, architects and engineers will get in touch and can -assist you for free with your Azure migration.

    -

    Links

    - diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/scripts/datasourceConfig-mysql.sh b/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/scripts/datasourceConfig-mysql.sh deleted file mode 100644 index 7c5369c0f..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/scripts/datasourceConfig-mysql.sh +++ /dev/null @@ -1,186 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# -#read arguments from stdin -read oracleHome wlsAdminHost wlsAdminPort wlsUserName wlsPassword jdbcDataSourceName dsConnectionURL dsUser dsPassword dbGlobalTranPro enablePswlessConnection wlsClusterName - -if [ -z "$wlsClusterName" ]; then - wlsClusterName="cluster1" -fi - -wlsAdminURL=$wlsAdminHost:$wlsAdminPort -hostName=`hostname` - -#Function to output message to StdErr -function echo_stderr () -{ - echo "$@" >&2 -} - -#Function to display usage message -function usage() -{ - echo_stderr "./configDatasource.sh <<< \"\"" -} - -function validateInput() -{ - # parse base64 string - wlsPassword=$(echo "${wlsPassword}" | base64 -d) - jdbcDataSourceName=$(echo "${jdbcDataSourceName}" | base64 -d) - dsConnectionURL=$(echo "${dsConnectionURL}" | base64 -d) - dsPassword=$(echo "${dsPassword}" | base64 -d) - - if [ -z "$oracleHome" ]; - then - echo _stderr "Please provide oracleHome" - exit 1 - fi - - if [ -z "$wlsAdminHost" ]; - then - echo _stderr "Please provide WeblogicServer hostname" - exit 1 - fi - - if [ -z "$wlsAdminPort" ]; - then - echo _stderr "Please provide Weblogic admin port" - exit 1 - fi - - if [ -z "$wlsUserName" ]; - then - echo _stderr "Please provide Weblogic username" - exit 1 - fi - - if [ -z "$wlsPassword" ]; - then - echo _stderr "Please provide Weblogic password" - exit 1 - fi - - if [ -z "$jdbcDataSourceName" ]; - then - echo _stderr "Please provide JDBC datasource name to be configured" - exit 1 - fi - - if [ -z "$dsConnectionURL" ]; - then - echo _stderr "Please provide Azure database of MySQL URL in the format 'jdbc:oracle:thin:@:/'" - exit 1 - fi - - if [ -z "$dsUser" ]; - then - echo _stderr "Please provide Azure database of MySQL user name" - exit 1 - fi - - if [ -z "$dsPassword" ]; - then - echo _stderr "Please provide Azure database of MySQL password" - exit 1 - fi - - if [ -z "$dbGlobalTranPro" ]; - then - echo _stderr "Please provide Global transactions protocol" - exit 1 - fi - - if [ -z "${enablePswlessConnection}" ]; - then - echo _stderr "Please provide enablePswlessConnection to identity if enabling passwordless connection." - exit 1 - fi - - if [ -z "$wlsClusterName" ]; - then - echo _stderr "Please provide Weblogic target cluster name" - exit 1 - fi - - # reset password - if [[ "${enablePswlessConnection,,}" == "true" ]]; then - dsPassword="" - fi -} - -function createJDBCSource_model() -{ - local driverName="com.mysql.jdbc.Driver" - if [[ "${enablePswlessConnection,,}" == "true" ]]; then - driverName="com.mysql.cj.jdbc.Driver" - fi - - echo "Creating JDBC data source with name $jdbcDataSourceName" - cat <${scriptPath}/create_datasource.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -edit("$hostName") -startEdit() -cd('/') -try: - cmo.createJDBCSystemResource('$jdbcDataSourceName') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName') - cmo.setName('$jdbcDataSourceName') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDataSourceParams/$jdbcDataSourceName') - set('JNDINames',jarray.array([String('$jdbcDataSourceName')], String)) - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName') - cmo.setDatasourceType('GENERIC') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDriverParams/$jdbcDataSourceName') - cmo.setUrl('$dsConnectionURL') - cmo.setDriverName('$driverName') - cmo.setPassword('$dsPassword') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCConnectionPoolParams/$jdbcDataSourceName') - cmo.setTestTableName('SQL ISVALID\r\n\r\n\r\n\r\n') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDriverParams/$jdbcDataSourceName/Properties/$jdbcDataSourceName') - cmo.createProperty('user') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDriverParams/$jdbcDataSourceName/Properties/$jdbcDataSourceName/Properties/user') - cmo.setValue('$dsUser') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDataSourceParams/$jdbcDataSourceName') - cmo.setGlobalTransactionsProtocol('${dbGlobalTranPro}') - cd('/JDBCSystemResources/$jdbcDataSourceName') - set('Targets',jarray.array([ObjectName('com.bea:Name=admin,Type=Server')], ObjectName)) - save() - resolve() - activate() -except Exception, e: - e.printStackTrace() - dumpStack() - undo('true',defaultAnswer='y') - cancelEdit('y') - destroyEditSession("$hostName",force = true) - raise("$jdbcDataSourceName configuration failed") -destroyEditSession("$hostName",force = true) -disconnect() -EOF -} - -function createTempFolder() -{ - scriptPath="/u01/tmp" - sudo rm -f -r ${scriptPath} - sudo mkdir ${scriptPath} - sudo rm -rf $scriptPath/* -} - -createTempFolder -validateInput -createJDBCSource_model - -sudo chown -R oracle:oracle ${scriptPath} -runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST ${scriptPath}/create_datasource.py" - -errorCode=$? -if [ $errorCode -eq 1 ] -then - echo "Exception occurs during DB configuration, please check." - exit 1 -fi - -echo "Cleaning up temporary files..." -rm -f -r ${scriptPath} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/scripts/datasourceConfig-oracle.sh b/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/scripts/datasourceConfig-oracle.sh deleted file mode 100644 index 4549073bb..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/scripts/datasourceConfig-oracle.sh +++ /dev/null @@ -1,189 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Description -# This script configures datasource on WebLogic Server Domain for Oracle database. - -#Function to output message to StdErr -function echo_stderr () -{ - echo "$@" >&2 -} - -#Function to display usage message -function usage() -{ - echo_stderr "./configDatasource.sh <<< \"\"" -} - -function validateInput() -{ - # parse base64 string - wlsPassword=$(echo "${wlsPassword}" | base64 -d) - jdbcDataSourceName=$(echo "${jdbcDataSourceName}" | base64 -d) - dsConnectionURL=$(echo "${dsConnectionURL}" | base64 -d) - dsPassword=$(echo "${dsPassword}" | base64 -d) - - if [ -z "$oracleHome" ]; - then - echo _stderr "Please provide oracleHome" - exit 1 - fi - - if [ -z "$wlsAdminHost" ]; - then - echo _stderr "Please provide WeblogicServer hostname" - exit 1 - fi - - if [ -z "$wlsAdminPort" ]; - then - echo _stderr "Please provide Weblogic admin port" - exit 1 - fi - - if [ -z "$wlsUserName" ]; - then - echo _stderr "Please provide Weblogic username" - exit 1 - fi - - if [ -z "$wlsPassword" ]; - then - echo _stderr "Please provide Weblogic password" - exit 1 - fi - - if [ -z "$jdbcDataSourceName" ]; - then - echo _stderr "Please provide JDBC datasource name to be configured" - exit 1 - fi - - if [ -z "$dsConnectionURL" ]; - then - echo _stderr "Please provide Oracle Database URL in the format 'jdbc:oracle:thin:@:/'" - exit 1 - fi - - if [ -z "$dsUser" ]; - then - echo _stderr "Please provide Oracle Database user name" - exit 1 - fi - - if [ -z "$dsPassword" ]; - then - echo _stderr "Please provide Oracle Database password" - exit 1 - fi - - if [ -z "$dbGlobalTranPro" ]; - then - echo _stderr "Please provide Global transactions protocol" - exit 1 - fi - - if [ -z "$wlsClusterName" ]; - then - echo _stderr "Please provide Weblogic target cluster name" - exit 1 - fi - - if [ -z "${enablePswlessConnection}" ]; - then - echo _stderr "Please provide enablePswlessConnection to identity if enabling passwordless connection." - exit 1 - fi - - # reset password - if [[ "${enablePswlessConnection,,}" == "true" ]]; then - dsPassword="" - fi -} - -function createJDBCSource_model() -{ -echo "Creating JDBC data source with name $jdbcDataSourceName" -cat <${scriptPath}/create_datasource.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -edit("$hostName") -startEdit() -cd('/') -try: - cmo.createJDBCSystemResource('$jdbcDataSourceName') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName') - cmo.setName('$jdbcDataSourceName') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDataSourceParams/$jdbcDataSourceName') - set('JNDINames',jarray.array([String('$jdbcDataSourceName')], String)) - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName') - cmo.setDatasourceType('GENERIC') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDriverParams/$jdbcDataSourceName') - cmo.setUrl('$dsConnectionURL') - cmo.setDriverName('oracle.jdbc.OracleDriver') - cmo.setPassword('$dsPassword') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCConnectionPoolParams/$jdbcDataSourceName') - cmo.setTestTableName('SQL ISVALID\r\n\r\n\r\n\r\n') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDriverParams/$jdbcDataSourceName/Properties/$jdbcDataSourceName') - cmo.createProperty('user') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDriverParams/$jdbcDataSourceName/Properties/$jdbcDataSourceName/Properties/user') - cmo.setValue('$dsUser') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDataSourceParams/$jdbcDataSourceName') - cmo.setGlobalTransactionsProtocol('${dbGlobalTranPro}') - cd('/JDBCSystemResources/$jdbcDataSourceName') - set('Targets',jarray.array([ObjectName('com.bea:Name=admin,Type=Server')], ObjectName)) - save() - resolve() - activate() -except Exception, e: - e.printStackTrace() - dumpStack() - undo('true',defaultAnswer='y') - cancelEdit('y') - destroyEditSession("$hostName",force = true) - raise("$jdbcDataSourceName configuration failed") -destroyEditSession("$hostName",force = true) -disconnect() -EOF -} - -function createTempFolder() -{ - scriptPath="/u01/tmp" - sudo rm -f -r ${scriptPath} - sudo mkdir ${scriptPath} - sudo rm -rf $scriptPath/* -} - -#main - -#read arguments from stdin -read oracleHome wlsAdminHost wlsAdminPort wlsUserName wlsPassword jdbcDataSourceName dsConnectionURL dsUser dsPassword dbGlobalTranPro enablePswlessConnection wlsClusterName - -wlsAdminURL=$wlsAdminHost:$wlsAdminPort -hostName=`hostname` - -if [ -z "$wlsClusterName" ]; -then - wlsClusterName="cluster1" -fi - -createTempFolder -validateInput -createJDBCSource_model - -sudo chown -R oracle:oracle ${scriptPath} -runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST ${scriptPath}/create_datasource.py" - -errorCode=$? -if [ $errorCode -eq 1 ] -then - echo "Exception occurs during DB configuration, please check." - exit 1 -fi - -echo "Cleaning up temporary files..." -rm -f -r ${scriptPath} - - diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/scripts/datasourceConfig-postgresql.sh b/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/scripts/datasourceConfig-postgresql.sh deleted file mode 100644 index 056534e64..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/scripts/datasourceConfig-postgresql.sh +++ /dev/null @@ -1,193 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Description -# This script configures datasource on WebLogic Server Domain for PostgreSQL database. - -#Function to output message to StdErr -function echo_stderr () -{ - echo "$@" >&2 -} - -#Function to display usage message -function usage() -{ - echo_stderr "./configDatasource.sh <<< \"\"" -} - -function validateInput() -{ - # parse base64 string - wlsPassword=$(echo "${wlsPassword}" | base64 -d) - jdbcDataSourceName=$(echo "${jdbcDataSourceName}" | base64 -d) - dsConnectionURL=$(echo "${dsConnectionURL}" | base64 -d) - dsPassword=$(echo "${dsPassword}" | base64 -d) - - if [ -z "$oracleHome" ]; - then - echo _stderr "Please provide oracleHome" - exit 1 - fi - - if [ -z "$wlsAdminHost" ]; - then - echo _stderr "Please provide WeblogicServer hostname" - exit 1 - fi - - if [ -z "$wlsAdminPort" ]; - then - echo _stderr "Please provide Weblogic admin port" - exit 1 - fi - - if [ -z "$wlsUserName" ]; - then - echo _stderr "Please provide Weblogic username" - exit 1 - fi - - if [ -z "$wlsPassword" ]; - then - echo _stderr "Please provide Weblogic password" - exit 1 - fi - - if [ -z "$jdbcDataSourceName" ]; - then - echo _stderr "Please provide JDBC datasource name to be configured" - exit 1 - fi - - if [ -z "$dsConnectionURL" ]; - then - echo _stderr "Please provide PostgreSQL Database URL in the format 'jdbc:oracle:thin:@:/'" - exit 1 - fi - - if [ -z "$dsUser" ]; - then - echo _stderr "Please provide PostgreSQL Database user name" - exit 1 - fi - - if [ -z "$dsPassword" ]; - then - echo _stderr "Please provide PostgreSQL Database password" - exit 1 - fi - - if [ -z "$dbGlobalTranPro" ]; - then - echo _stderr "Please provide Global transactions protocol" - exit 1 - fi - - if [ -z "$wlsClusterName" ]; - then - echo _stderr "Please provide Weblogic target cluster name" - exit 1 - fi - - if [ -z "${enablePswlessConnection}" ]; - then - echo _stderr "Please provide enablePswlessConnection to identity if enabling passwordless connection." - exit 1 - fi - - # reset password - if [[ "${enablePswlessConnection,,}" == "true" ]]; then - dsPassword="" - fi -} - -function createJDBCSource_model() -{ -echo "Creating JDBC data source with name $jdbcDataSourceName" -cat <${scriptPath}/create_datasource.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -edit("$hostName") -startEdit() -cd('/') -try: - cmo.createJDBCSystemResource('$jdbcDataSourceName') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName') - cmo.setName('$jdbcDataSourceName') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDataSourceParams/$jdbcDataSourceName') - set('JNDINames',jarray.array([String('$jdbcDataSourceName')], String)) - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName') - cmo.setDatasourceType('GENERIC') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDriverParams/$jdbcDataSourceName') - cmo.setUrl('$dsConnectionURL') - cmo.setDriverName('org.postgresql.Driver') - cmo.setPassword('$dsPassword') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCConnectionPoolParams/$jdbcDataSourceName') - cmo.setTestTableName('SQL ISVALID\r\n\r\n\r\n\r\n') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDriverParams/$jdbcDataSourceName/Properties/$jdbcDataSourceName') - cmo.createProperty('user') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDriverParams/$jdbcDataSourceName/Properties/$jdbcDataSourceName/Properties/user') - cmo.setValue('$dsUser') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDataSourceParams/$jdbcDataSourceName') - cmo.setGlobalTransactionsProtocol('${dbGlobalTranPro}') - cd('/JDBCSystemResources/$jdbcDataSourceName') - set('Targets',jarray.array([ObjectName('com.bea:Name=admin,Type=Server')], ObjectName)) - save() - resolve() - activate() -except Exception, e: - e.printStackTrace() - dumpStack() - undo('true',defaultAnswer='y') - cancelEdit('y') - destroyEditSession("$hostName",force = true) - raise("$jdbcDataSourceName configuration failed") -destroyEditSession("$hostName",force = true) -disconnect() -EOF -} - -function createTempFolder() -{ - scriptPath="/u01/tmp" - sudo rm -f -r ${scriptPath} - sudo mkdir ${scriptPath} - sudo rm -rf $scriptPath/* -} - -# store arguments in a special array -args=("$@") -# get number of elements -ELEMENTS=${#args[@]} - -#main - -#read arguments from stdin -read oracleHome wlsAdminHost wlsAdminPort wlsUserName wlsPassword jdbcDataSourceName dsConnectionURL dsUser dsPassword dbGlobalTranPro enablePswlessConnection wlsClusterName - -wlsAdminURL=$wlsAdminHost:$wlsAdminPort -hostName=`hostname` - -if [ -z "$wlsClusterName" ]; -then - wlsClusterName="cluster1" -fi - -createTempFolder -validateInput -createJDBCSource_model - -sudo chown -R oracle:oracle ${scriptPath} -runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST ${scriptPath}/create_datasource.py" - -errorCode=$? -if [ $errorCode -eq 1 ] -then - echo "Exception occurs during DB configuration, please check." - exit 1 -fi - -echo "Cleaning up temporary files..." -rm -f -r ${scriptPath} - diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/scripts/datasourceConfig-sqlserver.sh b/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/scripts/datasourceConfig-sqlserver.sh deleted file mode 100644 index 0a606f1f5..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/scripts/datasourceConfig-sqlserver.sh +++ /dev/null @@ -1,189 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Description -# This script configures datasource on WebLogic Server Domain for SQL Server database. - -#Function to output message to StdErr -function echo_stderr () -{ - echo "$@" >&2 -} - -#Function to display usage message -function usage() -{ - echo_stderr "./configDatasource.sh <<< \"\"" -} - -function validateInput() -{ - # parse base64 string - wlsPassword=$(echo "${wlsPassword}" | base64 -d) - jdbcDataSourceName=$(echo "${jdbcDataSourceName}" | base64 -d) - dsConnectionURL=$(echo "${dsConnectionURL}" | base64 -d) - dsPassword=$(echo "${dsPassword}" | base64 -d) - - if [ -z "$oracleHome" ]; - then - echo _stderr "Please provide oracleHome" - exit 1 - fi - - if [ -z "$wlsAdminHost" ]; - then - echo _stderr "Please provide WeblogicServer hostname" - exit 1 - fi - - if [ -z "$wlsAdminPort" ]; - then - echo _stderr "Please provide Weblogic admin port" - exit 1 - fi - - if [ -z "$wlsUserName" ]; - then - echo _stderr "Please provide Weblogic username" - exit 1 - fi - - if [ -z "$wlsPassword" ]; - then - echo _stderr "Please provide Weblogic password" - exit 1 - fi - - if [ -z "$jdbcDataSourceName" ]; - then - echo _stderr "Please provide JDBC datasource name to be configured" - exit 1 - fi - - if [ -z "$dsConnectionURL" ]; - then - echo _stderr "Please provide Azure SQL Database URL in the format 'jdbc:oracle:thin:@:/'" - exit 1 - fi - - if [ -z "$dsUser" ]; - then - echo _stderr "Please provide Azure SQL Database user name" - exit 1 - fi - - if [ -z "$dsPassword" ]; - then - echo _stderr "Please provide Azure SQL Database password" - exit 1 - fi - - if [ -z "$dbGlobalTranPro" ]; - then - echo _stderr "Please provide Global transactions protocol" - exit 1 - fi - - if [ -z "$wlsClusterName" ]; - then - echo _stderr "Please provide Weblogic target cluster name" - exit 1 - fi - - if [ -z "${enablePswlessConnection}" ]; - then - echo _stderr "Please provide enablePswlessConnection to identity if enabling passwordless connection." - exit 1 - fi - - # reset password and user - if [[ "${enablePswlessConnection,,}" == "true" ]]; then - dsPassword="" - dsUser="" - fi -} - -function createJDBCSource_model() -{ -echo "Creating JDBC data source with name $jdbcDataSourceName" -cat <${scriptPath}/create_datasource.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -edit("$hostName") -startEdit() -cd('/') -try: - cmo.createJDBCSystemResource('$jdbcDataSourceName') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName') - cmo.setName('$jdbcDataSourceName') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDataSourceParams/$jdbcDataSourceName') - set('JNDINames',jarray.array([String('$jdbcDataSourceName')], String)) - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName') - cmo.setDatasourceType('GENERIC') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDriverParams/$jdbcDataSourceName') - cmo.setUrl('$dsConnectionURL') - cmo.setDriverName('com.microsoft.sqlserver.jdbc.SQLServerDriver') - cmo.setPassword('$dsPassword') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCConnectionPoolParams/$jdbcDataSourceName') - cmo.setTestTableName('SQL ISVALID\r\n\r\n\r\n\r\n') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDriverParams/$jdbcDataSourceName/Properties/$jdbcDataSourceName') - cmo.createProperty('user') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDriverParams/$jdbcDataSourceName/Properties/$jdbcDataSourceName/Properties/user') - cmo.setValue('$dsUser') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDataSourceParams/$jdbcDataSourceName') - cmo.setGlobalTransactionsProtocol('${dbGlobalTranPro}') - cd('/JDBCSystemResources/$jdbcDataSourceName') - set('Targets',jarray.array([ObjectName('com.bea:Name=admin,Type=Server')], ObjectName)) - save() - resolve() - activate() -except Exception, e: - e.printStackTrace() - dumpStack() - undo('true',defaultAnswer='y') - cancelEdit('y') - destroyEditSession("$hostName",force = true) - raise("$jdbcDataSourceName configuration failed") -destroyEditSession("$hostName",force = true) -disconnect() -EOF -} - -function createTempFolder() -{ - scriptPath="/u01/tmp" - sudo rm -f -r ${scriptPath} - sudo mkdir ${scriptPath} - sudo rm -rf $scriptPath/* -} - -#main - -#read arguments from stdin -read oracleHome wlsAdminHost wlsAdminPort wlsUserName wlsPassword jdbcDataSourceName dsConnectionURL dsUser dsPassword dbGlobalTranPro enablePswlessConnection wlsClusterName - -wlsAdminURL=$wlsAdminHost:$wlsAdminPort -hostName=`hostname` - -if [ -z "$wlsClusterName" ]; -then - wlsClusterName="cluster1" -fi - -createTempFolder -validateInput -createJDBCSource_model - -sudo chown -R oracle:oracle ${scriptPath} -runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST ${scriptPath}/create_datasource.py" - -errorCode=$? -if [ $errorCode -eq 1 ] -then - echo "Exception occurs during DB configuration, please check." - exit 1 -fi - -echo "Cleaning up temporary files..." -rm -f -r ${scriptPath} - diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/scripts/installJdbcDrivers.sh b/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/scripts/installJdbcDrivers.sh deleted file mode 100644 index 0ee0155a8..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/scripts/installJdbcDrivers.sh +++ /dev/null @@ -1,278 +0,0 @@ -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# Description -# This script is to install jdbc libraries at WebLogic cluster domain. - -# /bin/bash - -#Function to output message to StdErr -function echo_stderr() { - echo "$@" >&2 -} - -#Function to display usage message -function usage() { - echo_stderr "./installJdbcDrivers.sh <<< \"\"" -} - -function validate_input() { - - # parse base64 string - wlsPassword=$(echo "${wlsPassword}" | base64 -d) - - if [ -z "$oracleHome" ]; then - echo _stderr "Please provide oracleHome" - exit 1 - fi - - if [ -z "$domainPath" ]; then - echo _stderr "Please provide domainPath" - exit 1 - fi - - if [ -z "$wlsServerName" ]; then - echo _stderr "Please provide wlsServerName" - exit 1 - fi - - if [ -z "$wlsAdminHost" ]; then - echo _stderr "Please provide wlsAdminHost" - exit 1 - fi - - if [ -z "$wlsAdminPort" ]; then - echo _stderr "Please provide wlsAdminPort" - exit 1 - fi - - if [ -z "$wlsUserName" ]; then - echo _stderr "Please provide wlsUserName" - exit 1 - fi - - if [ -z "$wlsPassword" ]; then - echo _stderr "Please provide wlsPassword" - exit 1 - fi - - if [ -z "$databaseType" ]; then - echo _stderr "Please provide databaseType" - exit 1 - fi - - if [ -z "$enablePswlessConnection" ]; then - echo _stderr "Please provide enablePswlessConnection" - exit 1 - fi -} - -function install_maven() { - local mavenUrl=$(curl -Ls -o /dev/null -w %{url_effective} ${url4MavenInstaller}) - if [ $? != 0 ]; then - echo_stderr "Failed to get maven download url." - fi - curl -m ${curlMaxTime} --retry ${retryMaxAttempt} -fksL "${mavenUrl}" -o ${mvnInstaller} - if [ $? != 0 ]; then - echo_stderr "Failed to download ${mavenUrl}." - fi - - tar xzvf ${mvnInstaller} -C /u01/app - export MAVEN_HOME=$(find /u01/app -maxdepth 1 -type d -name "apache-maven*") - . $oracleHome/oracle_common/common/bin/setWlstEnv.sh # set JAVA_HOME - export PATH=${MAVEN_HOME}/bin:$PATH - - rm ${mvnInstaller} -f - mvn --version - if [ $? != 0 ]; then - echo_stderr "Failed to install maven." - fi -} - -function uninstall_maven() { - sudo rm -f ${MAVEN_HOME} -R -} - -function install_azure_identity_extension() { - local myPomFile=pom.xml - curl -m ${curlMaxTime} --retry ${retryMaxAttempt} -fksL "${gitUrl4AzureIdentityExtensionPomFile}" -o ${myPomFile} - if [ $? != 0 ]; then - echo_stderr "Failed to download ${gitUrl4AzureIdentityExtensionPomFile}." - fi - - echo "download dependencies" - mvn dependency:copy-dependencies -f ${myPomFile} - if [ $? -eq 0 ]; then - ls -l target/dependency/ - - domainBase=$(dirname $domainPath) - - # check if azure identity extension has been installed, if so, remove old version - if [ -d "${domainBase}/azure-libraries/identity" ]; then - sudo rm ${domainBase}/azure-libraries/identity -f -r - sudo rm ${domainBase}/azure-libraries/jackson -f -r - fi - - sudo mkdir -p ${domainBase}/azure-libraries/identity - sudo mkdir -p ${domainBase}/azure-libraries/jackson - # fix JARs conflict issue, put jackson libraries to PRE_CLASSPATH to upgrade the existing libs. - sudo mv target/dependency/jackson-annotations-*.jar ${domainBase}/azure-libraries/jackson - sudo mv target/dependency/jackson-core-*.jar ${domainBase}/azure-libraries/jackson - sudo mv target/dependency/jackson-databind-*.jar ${domainBase}/azure-libraries/jackson - sudo mv target/dependency/jackson-datatype-*.jar ${domainBase}/azure-libraries/jackson - # Those jars will be appended to CLASSPATH - sudo mv target/dependency/*.jar ${domainBase}/azure-libraries/identity - sudo chown -R oracle:oracle ${domainBase}/azure-libraries - else - echo "Failed to download dependencies for azure-identity-extension" - exit 1 - fi - - rm ${myPomFile} -f - rm target -f -r - if ! grep -q "${domainBase}/azure-libraries/identity/" "${domainPath}/bin/setDomainEnv.sh"; then - sed -i 's;^export DOMAIN_HOME;&\nCLASSPATH="'${domainBase}'/azure-libraries/identity/*:${CLASSPATH}";' ${domainPath}/bin/setDomainEnv.sh - fi - - if ! grep -q "${domainBase}/azure-libraries/jackson/" "${domainPath}/bin/setDomainEnv.sh"; then - sed -i 's;^export DOMAIN_HOME;&\nPRE_CLASSPATH="'${domainBase}'/azure-libraries/jackson/*:${PRE_CLASSPATH}";' ${domainPath}/bin/setDomainEnv.sh - fi -} - -function upgrade_mysql_driver() { - local mysqlPomFile=mysql-pom.xml - curl -m ${curlMaxTime} --retry ${retryMaxAttempt} -fksL "${gitUrl4MySQLDriverPomFile}" -o ${mysqlPomFile} - if [ $? != 0 ]; then - echo_stderr "Failed to download ${gitUrl4MySQLDriverPomFile}." - fi - - echo "download dependencies" - mvn dependency:copy-dependencies -f ${mysqlPomFile} - if [ $? -eq 0 ]; then - ls -l target/dependency/ - - local domainBase=$(dirname $domainPath) - local preClassLibsFolderName=preclasspath-libraries - - # check if the driver has been upgraded, if so, remove old driver - if [ -e ${domainBase}/${preClassLibsFolderName}/mysql-connector-*.jar ]; then - sudo rm ${domainBase}/${preClassLibsFolderName} -f -r - fi - - sudo mkdir ${domainBase}/${preClassLibsFolderName} - sudo mv target/dependency/mysql-connector-*.jar ${domainBase}/${preClassLibsFolderName}/ - sudo chown -R oracle:oracle ${domainBase}/${preClassLibsFolderName} - else - echo "Failed to download mysql driver." - exit 1 - fi - - rm ${mysqlPomFile} -f - rm target -f -r - - if ! grep -q "${domainBase}/preclasspath-libraries/" "${domainPath}/bin/setDomainEnv.sh"; then - sed -i 's;^export DOMAIN_HOME;&\nPRE_CLASSPATH="'${domainBase}'/preclasspath-libraries/*:${PRE_CLASSPATH}";' ${domainPath}/bin/setDomainEnv.sh - fi -} - -#This function to wait for admin server -function wait_for_admin() { - #wait for admin to start - count=1 - CHECK_URL="http://$wlsAdminURL/weblogic/ready" - status=$(curl --insecure -ILs $CHECK_URL | tac | grep -m1 HTTP/1.1 | awk {'print $2'}) - echo "Waiting for admin server to start" - while [[ "$status" != "200" ]]; do - echo "." - count=$((count + 1)) - if [ $count -le 30 ]; then - sleep 1m - else - echo "Error : Maximum attempts exceeded while starting admin server" - exit 1 - fi - status=$(curl --insecure -ILs $CHECK_URL | tac | grep -m1 HTTP/1.1 | awk {'print $2'}) - if [ "$status" == "200" ]; then - echo "Admin Server started succesfully..." - break - fi - done -} - -function restart_admin_service() { - echo "Restart weblogic admin server service" - sudo systemctl stop wls_admin - sudo systemctl start wls_admin - wait_for_admin -} - -function restart_managed_servers() { - echo "Restart managed servers" - cat <${SCRIPT_PWD}/restart-managedServer.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -servers=cmo.getServers() -domainRuntime() -print "Restart the servers which are in RUNNING status" -for server in servers: - bean="/ServerLifeCycleRuntimes/"+server.getName() - serverbean=getMBean(bean) - if (serverbean.getState() in ("RUNNING")) and (server.getName() == '${wlsServerName}'): - try: - print "Stop the Server ",server.getName() - shutdown(server.getName(),server.getType(),ignoreSessions='true',force='true') - print "Start the Server ",server.getName() - start(server.getName(),server.getType()) - break - except: - print "Failed restarting managed server ", server.getName() - dumpStack() -serverConfig() -disconnect() -EOF - . $oracleHome/oracle_common/common/bin/setWlstEnv.sh - java $WLST_ARGS weblogic.WLST ${SCRIPT_PWD}/restart-managedServer.py - - if [[ $? != 0 ]]; then - echo "Error : Fail to restart managed server to configuration external libraries." - exit 1 - fi -} - -#read arguments from stdin -read oracleHome domainPath wlsServerName wlsAdminHost wlsAdminPort wlsUserName wlsPassword databaseType enablePswlessConnection - -export curlMaxTime=120 # seconds -export gitUrl4AzureIdentityExtensionPomFile="https://raw.githubusercontent.com/oracle/weblogic-azure/main/weblogic-azure-aks/src/main/resources/azure-identity-extensions.xml" -export gitUrl4MySQLDriverPomFile="https://raw.githubusercontent.com/oracle/weblogic-azure/main/weblogic-azure-aks/src/main/resources/mysql-connector-java.xml" -export retryMaxAttempt=5 # retry attempt for curl command -export mvnInstaller="apache-maven-bin.tar.gz" - -# 2024-09-11 https://github.com/oracle/weblogic-azure/pull/325 -# Increase maintainability by putting URL behind redirector. As of today -# target is https://dlcdn.apache.org/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.tar.gz -# A better solution would be if Oracle had an employee accessible URL redirector -# service similar to Microsoft's aka.ms. - -export url4MavenInstaller="https://aka.ms/wls-offer-maven-download-url" -export wlsAdminURL=$wlsAdminHost:$wlsAdminPort - -validate_input - -install_maven - -if [ $databaseType == "mysql" ]; then - upgrade_mysql_driver -fi - -if [ "${enablePswlessConnection,,}" == "true" ]; then - if [[ $databaseType == "mysql" || $databaseType == "postgresql" ]]; then - install_azure_identity_extension - fi -fi - -uninstall_maven - -if [ $wlsServerName == "admin" ]; then - restart_admin_service -else - restart_managed_servers -fi diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/scripts/setupAdminDomain.sh b/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/scripts/setupAdminDomain.sh deleted file mode 100644 index 70d2a7c37..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/scripts/setupAdminDomain.sh +++ /dev/null @@ -1,694 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -#Function to output message to StdErr -function echo_stderr () -{ - echo "$@" >&2 -} - -#Function to display usage message -function usage() -{ - echo_stderr "./setupAdminDomain.sh <<< \"\"" -} - -function setupKeyStoreDir() -{ - sudo mkdir -p $KEYSTORE_PATH - sudo rm -rf $KEYSTORE_PATH/* -} - -function installUtilities() -{ - echo "Installing zip unzip wget vnc-server rng-tools bind-utils" - sudo yum install -y zip unzip wget vnc-server rng-tools bind-utils - - #Setting up rngd utils - attempt=1 - while [[ $attempt -lt 4 ]] - do - echo "Starting rngd service attempt $attempt" - sudo systemctl start rngd - attempt=`expr $attempt + 1` - sudo systemctl status rngd | grep running - if [[ $? == 0 ]]; - then - echo "rngd utility service started successfully" - break - fi - sleep 1m - done -} - -function downloadUsingWget() -{ - downloadURL=$1 - filename=${downloadURL##*/} - for in in {1..5} - do - wget $downloadURL - if [ $? != 0 ]; - then - echo "$filename Driver Download failed on $downloadURL. Trying again..." - rm -f $filename - else - echo "$filename Driver Downloaded successfully" - break - fi - done -} - -#Function to cleanup all temporary files -function cleanup() -{ - echo "Cleaning up temporary files..." - - rm -rf $DOMAIN_PATH/admin-domain.yaml - rm -rf $DOMAIN_PATH/*.py - rm -rf ${CUSTOM_HOSTNAME_VERIFIER_HOME} - - echo "Cleanup completed." -} - -# This function verifies whether certificate is valid and not expired -function verifyCertValidity() -{ - KEYSTORE=$1 - PASSWORD=$2 - CURRENT_DATE=$3 - MIN_CERT_VALIDITY=$4 - KEY_STORE_TYPE=$5 - VALIDITY=$(($CURRENT_DATE + ($MIN_CERT_VALIDITY*24*60*60))) - - echo "Verifying $KEYSTORE is valid at least $MIN_CERT_VALIDITY day from the deployment time" - - if [ $VALIDITY -le $CURRENT_DATE ]; - then - echo_stderr "Error : Invalid minimum validity days supplied" - exit 1 - fi - - # Check whether KEYSTORE supplied can be opened for reading - # Redirecting as no need to display the contents - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; keytool -list -v -keystore $KEYSTORE -storepass $PASSWORD -storetype $KEY_STORE_TYPE > /dev/null 2>&1" - if [ $? != 0 ]; - then - echo_stderr "Error opening the keystore : $KEYSTORE" - exit 1 - fi - - aliasList=`runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; keytool -list -v -keystore $KEYSTORE -storepass $PASSWORD -storetype $KEY_STORE_TYPE | grep Alias" |awk '{print $3}'` - if [[ -z $aliasList ]]; - then - echo_stderr "Error : No alias found in supplied certificate $KEYSTORE" - exit 1 - fi - - for alias in $aliasList - do - VALIDITY_PERIOD=`runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; keytool -list -v -keystore $KEYSTORE -storepass $PASSWORD -storetype $KEY_STORE_TYPE -alias $alias | grep Valid"` - echo "$KEYSTORE is \"$VALIDITY_PERIOD\"" - CERT_UNTIL_DATE=`echo $VALIDITY_PERIOD | awk -F'until:|\r' '{print $2}'` - CERT_UNTIL_SECONDS=`date -d "$CERT_UNTIL_DATE" +%s` - VALIDITY_REMIANS_SECONDS=`expr $CERT_UNTIL_SECONDS - $VALIDITY` - if [[ $VALIDITY_REMIANS_SECONDS -le 0 ]]; - then - echo_stderr "$KEYSTORE is \"$VALIDITY_PERIOD\"" - echo_stderr "Error : Supplied certificate $KEYSTORE is either expired or expiring soon within $MIN_CERT_VALIDITY day" - exit 1 - fi - done - echo "$KEYSTORE validation is successful" -} - -#Creates weblogic deployment model for admin domain -function create_admin_model() -{ - echo "Creating admin domain model" - cat /dev/null > $DOMAIN_PATH/admin-domain.yaml - - if [ "${isCustomSSLEnabled,,}" == "true" ]; - then - cat <$DOMAIN_PATH/admin-domain.yaml -domainInfo: - AdminUserName: "$wlsUserName" - AdminPassword: "$wlsPassword" - ServerStartMode: prod -topology: - Name: "$wlsDomainName" - AdminServerName: admin -EOF - - cat <>$DOMAIN_PATH/admin-domain.yaml - Server: - 'admin': - ListenPort: $wlsAdminPort - NetworkAccessPoint: - 'adminT3Channel': - ListenAddress: '$wlsAdminHost' - ListenPort: $wlsAdminT3ChannelPort - Protocol: t3 - Enabled: true - ListenPortEnabled: $isHTTPAdminListenPortEnabled - RestartDelaySeconds: 10 - KeyStores: 'CustomIdentityAndCustomTrust' - CustomIdentityKeyStoreFileName: "$customIdentityKeyStoreFileName" - CustomIdentityKeyStoreType: "$customIdentityKeyStoreType" - CustomIdentityKeyStorePassPhraseEncrypted: "$customIdentityKeyStorePassPhrase" - CustomTrustKeyStoreFileName: "$customTrustKeyStoreFileName" - CustomTrustKeyStoreType: "$customTrustKeyStoreType" - CustomTrustKeyStorePassPhraseEncrypted: "$customTrustKeyStorePassPhrase" - SSL: - ServerPrivateKeyAlias: "$serverPrivateKeyAlias" - ServerPrivateKeyPassPhraseEncrypted: "$serverPrivateKeyPassPhrase" - ListenPort: $wlsSSLAdminPort - Enabled: true - ServerStart: - Arguments: '${SERVER_STARTUP_ARGS}' - WebServer: - FrontendHost: '${adminPublicHostName}' - FrontendHTTPSPort: $wlsSSLAdminPort - FrontendHTTPPort: $wlsAdminPort -EOF - else - cat <>$DOMAIN_PATH/admin-domain.yaml -domainInfo: - AdminUserName: "$wlsUserName" - AdminPassword: "$wlsPassword" - ServerStartMode: prod -topology: - Name: "$wlsDomainName" - AdminServerName: admin - Server: - 'admin': - NetworkAccessPoint: - 'adminT3Channel': - ListenAddress: '$wlsAdminHost' - ListenPort: $wlsAdminT3ChannelPort - Protocol: t3 - Enabled: true - ListenPort: $wlsAdminPort - ListenPortEnabled: $isHTTPAdminListenPortEnabled - RestartDelaySeconds: 10 - SSL: - ListenPort: $wlsSSLAdminPort - Enabled: true - ServerStart: - Arguments: '${SERVER_STARTUP_ARGS}' - WebServer: - FrontendHost: '${adminPublicHostName}' - FrontendHTTPSPort: $wlsSSLAdminPort - FrontendHTTPPort: $wlsAdminPort -EOF - fi - -#check if remoteanonymous attributes are supported in current WLS version -#if supported, disable them by setting the attributes to false - -hasRemoteAnonymousAttribs="$(containsRemoteAnonymousT3RMIIAttribs)" -echo "hasRemoteAnonymousAttribs: ${hasRemoteAnonymousAttribs}" - -if [ "${hasRemoteAnonymousAttribs}" == "true" ]; -then -echo "adding settings to disable remote anonymous t3/rmi disabled under domain security configuration" -cat <>$DOMAIN_PATH/admin-domain.yaml - SecurityConfiguration: - RemoteAnonymousRmiiiopEnabled: false - RemoteAnonymousRmit3Enabled: false -EOF -fi - -} - -#Function to create Admin Only Domain -function create_adminDomain() -{ - echo "Creating Admin Only Domain" - echo "Creating domain path $DOMAIN_PATH" - sudo mkdir -p $DOMAIN_PATH - - # WebLogic base images are already having weblogic-deploy, hence no need to download - if [ ! -d "$DOMAIN_PATH/weblogic-deploy" ]; - then - echo "Deployment tool not found in the path $DOMAIN_PATH" - exit 1 - fi - - storeCustomSSLCerts - - create_admin_model - sudo chown -R $username:$groupname $DOMAIN_PATH - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; $DOMAIN_PATH/weblogic-deploy/bin/createDomain.sh -oracle_home $oracleHome -domain_parent $DOMAIN_PATH -domain_type WLS -model_file $DOMAIN_PATH/admin-domain.yaml" - if [[ $? != 0 ]]; then - echo "Error : Domain creation failed" - exit 1 - fi -} - -# Boot properties for admin server -function admin_boot_setup() -{ -echo "Creating admin server boot properties" - #Create the boot.properties directory - mkdir -p "$DOMAIN_PATH/$wlsDomainName/servers/admin/security" - echo "username=$wlsUserName" > "$DOMAIN_PATH/$wlsDomainName/servers/admin/security/boot.properties" - echo "password=$wlsPassword" >> "$DOMAIN_PATH/$wlsDomainName/servers/admin/security/boot.properties" - sudo chown -R $username:$groupname $DOMAIN_PATH/$wlsDomainName/servers - echo "Completed admin server boot properties" -} - -# Create adminserver as service -function create_adminserver_service() -{ -echo "Creating weblogic admin server service" -cat </etc/systemd/system/wls_admin.service -[Unit] -Description=WebLogic Adminserver service -After=network-online.target -Wants=network-online.target - -[Service] -Type=simple -WorkingDirectory=/u01/domains -Environment="JAVA_OPTIONS=${SERVER_STARTUP_ARGS}" -ExecStart=/bin/bash ${startWebLogicScript} -ExecStop=/bin/bash ${stopWebLogicScript} -User=oracle -Group=oracle -KillMode=process -LimitNOFILE=65535 -Restart=always -RestartSec=3 - -[Install] -WantedBy=multi-user.target -EOF -echo "Completed weblogic admin server service" -} - -#This function to wait for admin server -function wait_for_admin() -{ - #wait for admin to start -count=1 -CHECK_URL="http://$wlsAdminURL/weblogic/ready" -status=`curl --insecure -ILs $CHECK_URL | tac | grep -m1 HTTP/1.1 | awk {'print $2'}` -while [[ "$status" != "200" ]] -do - echo "Waiting for admin server to start" - count=$((count+1)) - if [ $count -le 30 ]; - then - sleep 1m - else - echo "Error : Maximum attempts exceeded while starting admin server" - exit 1 - fi - status=`curl --insecure -ILs $CHECK_URL | tac | grep -m1 HTTP/1.1 | awk {'print $2'}` - if [ "$status" == "200" ]; - then - echo "Server $wlsServerName started succesfully..." - break - fi -done -} - -function validateInput() -{ - if [ -z "$wlsDomainName" ]; - then - echo_stderr "wlsDomainName is required. " - exit 1 - fi - - if [[ -z "$wlsUserName" || -z "$wlsPassword" ]] - then - echo_stderr "wlsUserName or wlsPassword is required. " - exit 1 - fi - - if [ -z "$wlsAdminHost" ]; - then - echo_stderr "wlsAdminHost is required. " - exit 1 - fi - - if [ -z "$oracleHome" ]; - then - echo_stderr "oracleHome is required. " - exit 1 - fi - - if [ -z "$storageAccountName" ] || [ -z "${storageAccountKey}" ] || [ -z ${mountpointPath} ] - then - echo_stderr "storageAccountName, storageAccountKey and mountpointPath is required. " - exit 1 - fi - - if [ -z "$isHTTPAdminListenPortEnabled" ]; - then - echo_stderr "isHTTPAdminListenPortEnabled is required. " - exit 1 - fi - - if [ -z "$adminPublicHostName" ]; - then - echo_stderr "adminPublicHostName is required. " - exit 1 - fi - - if [ "${isCustomSSLEnabled,,}" != "true" ]; - then - echo_stderr "Custom SSL value is not provided. Defaulting to false" - isCustomSSLEnabled="false" - else - if [ -z "$customIdentityKeyStoreData" ] || [ -z "$customIdentityKeyStorePassPhrase" ] || - [ -z "$customIdentityKeyStoreType" ] || [ -z "$customTrustKeyStoreData" ] || - [ -z "$customTrustKeyStorePassPhrase" ] || [ -z "$customTrustKeyStoreType" ] || - [ -z "$serverPrivateKeyAlias" ] || [ -z "$serverPrivateKeyPassPhrase" ]; - then - echo "One of the required values for enabling Custom SSL \ - (CustomKeyIdentityKeyStoreData,CustomKeyIdentityKeyStorePassPhrase,CustomKeyIdentityKeyStoreType,CustomKeyTrustKeyStoreData,CustomKeyTrustKeyStorePassPhrase,CustomKeyTrustKeyStoreType) \ - has not been provided." - exit 1 - fi - fi - - if [ -z "$virtualNetworkNewOrExisting" ]; - then - echo_stderr "virtualNetworkNewOrExisting is required. " - exit 1 - fi - - if [ -z "$storageAccountPrivateIp" ]; - then - echo_stderr "storageAccountPrivateIp is required. " - exit 1 - fi - - if [ -z "${fileShareName}" ]; - then - echo_stderr "fileShareName is required. " - exit 1 - fi -} - -function enableAndStartAdminServerService() -{ - echo "Starting weblogic admin server as service" - sudo systemctl enable wls_admin - sudo systemctl daemon-reload - sudo systemctl start wls_admin -} - -function updateNetworkRules() -{ - # for Oracle Linux 7.3, 7.4, iptable is not running. - if [ -z `command -v firewall-cmd` ]; then - return 0 - fi - - # for Oracle Linux 7.6, open weblogic ports - echo "update network rules for admin server" - sudo firewall-cmd --zone=public --add-port=$wlsAdminPort/tcp - sudo firewall-cmd --zone=public --add-port=$wlsSSLAdminPort/tcp - sudo firewall-cmd --zone=public --add-port=$wlsAdminT3ChannelPort/tcp - sudo firewall-cmd --runtime-to-permanent - sudo systemctl restart firewalld -} - -# Create custom stopWebLogic script and add it to wls_admin service -# This script is created as stopWebLogic.sh will not work if non ssl admin listening port 7001 is disabled -# Refer https://github.com/wls-eng/arm-oraclelinux-wls/issues/164 -function createStopWebLogicScript() -{ - -cat <${stopWebLogicScript} -#!/bin/sh -# This is custom script for stopping weblogic server using ADMIN_URL supplied -export ADMIN_URL="t3://${wlsAdminURL}" -${DOMAIN_PATH}/${wlsDomainName}/bin/stopWebLogic.sh -EOF - -sudo chown -R $username:$groupname ${stopWebLogicScript} -sudo chmod -R 750 ${stopWebLogicScript} - -} - -function validateSSLKeyStores() -{ - sudo chown -R $username:$groupname $KEYSTORE_PATH - - #validate identity keystore - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; keytool -list -v -keystore $customIdentityKeyStoreFileName -storepass $customIdentityKeyStorePassPhrase -storetype $customIdentityKeyStoreType | grep 'Entry type:' | grep 'PrivateKeyEntry'" - - if [[ $? != 0 ]]; then - echo "Error : Identity Keystore Validation Failed !!" - exit 1 - fi - - # Verify Identity keystore validity period more than MIN_CERT_VALIDITY - verifyCertValidity $customIdentityKeyStoreFileName $customIdentityKeyStorePassPhrase $CURRENT_DATE $MIN_CERT_VALIDITY $customIdentityKeyStoreType - - #validate Trust keystore - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; keytool -list -v -keystore $customTrustKeyStoreFileName -storepass $customTrustKeyStorePassPhrase -storetype $customTrustKeyStoreType | grep 'Entry type:' | grep 'trustedCertEntry'" - - if [[ $? != 0 ]]; then - echo "Error : Trust Keystore Validation Failed !!" - exit 1 - fi - - # Verify Identity keystore validity period more than MIN_CERT_VALIDITY - verifyCertValidity $customTrustKeyStoreFileName $customTrustKeyStorePassPhrase $CURRENT_DATE $MIN_CERT_VALIDITY $customTrustKeyStoreType - - echo "ValidateSSLKeyStores Successfull !!" -} - -function storeCustomSSLCerts() -{ - if [ "${isCustomSSLEnabled,,}" == "true" ]; - then - - setupKeyStoreDir - - echo "Custom SSL is enabled. Storing CertInfo as files..." - customIdentityKeyStoreFileName="$KEYSTORE_PATH/identity.keystore" - customTrustKeyStoreFileName="$KEYSTORE_PATH/trust.keystore" - - customIdentityKeyStoreData=$(echo "$customIdentityKeyStoreData" | base64 --decode) - customIdentityKeyStorePassPhrase=$(echo "$customIdentityKeyStorePassPhrase" | base64 --decode) - customIdentityKeyStoreType=$(echo "$customIdentityKeyStoreType" | base64 --decode) - - customTrustKeyStoreData=$(echo "$customTrustKeyStoreData" | base64 --decode) - customTrustKeyStorePassPhrase=$(echo "$customTrustKeyStorePassPhrase" | base64 --decode) - customTrustKeyStoreType=$(echo "$customTrustKeyStoreType" | base64 --decode) - - serverPrivateKeyAlias=$(echo "$serverPrivateKeyAlias" | base64 --decode) - serverPrivateKeyPassPhrase=$(echo "$serverPrivateKeyPassPhrase" | base64 --decode) - - #decode cert data once again as it would got base64 encoded while storing in azure keyvault - echo "$customIdentityKeyStoreData" | base64 --decode > $customIdentityKeyStoreFileName - echo "$customTrustKeyStoreData" | base64 --decode > $customTrustKeyStoreFileName - - validateSSLKeyStores - - else - echo "Custom SSL is not enabled" - fi -} - -# Mount the Azure file share on all VMs created -function mountFileShare() -{ - echo "Creating mount point" - echo "Mount point: $mountpointPath" - sudo mkdir -p $mountpointPath - if [ ! -d "/etc/smbcredentials" ]; then - sudo mkdir /etc/smbcredentials - fi - if [ ! -f "/etc/smbcredentials/${storageAccountName}.cred" ]; then - echo "Crearing smbcredentials" - echo "username=$storageAccountName >> /etc/smbcredentials/${storageAccountName}.cred" - echo "password=$storageAccountKey >> /etc/smbcredentials/${storageAccountName}.cred" - sudo bash -c "echo "username=$storageAccountName" >> /etc/smbcredentials/${storageAccountName}.cred" - sudo bash -c "echo "password=$storageAccountKey" >> /etc/smbcredentials/${storageAccountName}.cred" - fi - echo "chmod 600 /etc/smbcredentials/${storageAccountName}.cred" - sudo chmod 600 /etc/smbcredentials/${storageAccountName}.cred - echo "//${storageAccountPrivateIp}/${fileShareName} $mountpointPath cifs nofail,vers=2.1,credentials=/etc/smbcredentials/${storageAccountName}.cred,dir_mode=0777,file_mode=0777,serverino" - sudo bash -c "echo \"//${storageAccountPrivateIp}/${fileShareName} $mountpointPath cifs nofail,vers=2.1,credentials=/etc/smbcredentials/${storageAccountName}.cred,dir_mode=0777,file_mode=0777,serverino\" >> /etc/fstab" - echo "mount -t cifs //${storageAccountPrivateIp}/${fileShareName} $mountpointPath -o vers=2.1,credentials=/etc/smbcredentials/${storageAccountName}.cred,dir_mode=0777,file_mode=0777,serverino" - sudo mount -t cifs //${storageAccountPrivateIp}/${fileShareName} $mountpointPath -o vers=2.1,credentials=/etc/smbcredentials/${storageAccountName}.cred,dir_mode=0777,file_mode=0777,serverino - if [[ $? != 0 ]]; - then - echo "Failed to mount //${storageAccountPrivateIp}/${fileShareName} $mountpointPath" - exit 1 - fi -} - -#this function set the umask 027 (chmod 740) as required by WebLogic security checks -function setUMaskForSecurityDir() -{ - echo "setting umask 027 (chmod 740) for domain/admin security directory" - - if [ -f "$DOMAIN_PATH/$wlsDomainName/servers/$wlsServerName/security/boot.properties" ]; - then - runuser -l oracle -c "chmod 740 $DOMAIN_PATH/$wlsDomainName/servers/$wlsServerName/security/boot.properties" - fi - - if [ -d "$DOMAIN_PATH/$wlsDomainName/servers/$wlsServerName/security" ]; - then - runuser -l oracle -c "chmod 740 $DOMAIN_PATH/$wlsDomainName/servers/$wlsServerName/security" - fi - -} - -#this function checks if remote Anonymous T3/RMI Attributes are available as part of domain security configuration -function containsRemoteAnonymousT3RMIIAttribs() -{ - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; $DOMAIN_PATH/weblogic-deploy/bin/modelHelp.sh -oracle_home $oracleHome topology:/SecurityConfiguration | grep RemoteAnonymousRmiiiopEnabled" >> /dev/null - - result1=$? - - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; $DOMAIN_PATH/weblogic-deploy/bin/modelHelp.sh -oracle_home $oracleHome topology:/SecurityConfiguration | grep RemoteAnonymousRmit3Enabled" >> /dev/null - - result2=$? - - if [ $result1 == 0 ] && [ $result2 == 0 ]; then - echo "true" - else - echo "false" - fi -} - -function generateCustomHostNameVerifier() -{ - mkdir -p ${CUSTOM_HOSTNAME_VERIFIER_HOME} - mkdir -p ${CUSTOM_HOSTNAME_VERIFIER_HOME}/src/main/java - mkdir -p ${CUSTOM_HOSTNAME_VERIFIER_HOME}/src/test/java - cp ${BASE_DIR}/generateCustomHostNameVerifier.sh ${CUSTOM_HOSTNAME_VERIFIER_HOME}/generateCustomHostNameVerifier.sh - cp ${BASE_DIR}/WebLogicCustomHostNameVerifier.java ${CUSTOM_HOSTNAME_VERIFIER_HOME}/src/main/java/WebLogicCustomHostNameVerifier.java - cp ${BASE_DIR}/HostNameValuesTemplate.txt ${CUSTOM_HOSTNAME_VERIFIER_HOME}/src/main/java/HostNameValuesTemplate.txt - cp ${BASE_DIR}/WebLogicCustomHostNameVerifierTest.java ${CUSTOM_HOSTNAME_VERIFIER_HOME}/src/test/java/WebLogicCustomHostNameVerifierTest.java - chown -R $username:$groupname ${CUSTOM_HOSTNAME_VERIFIER_HOME} - chmod +x ${CUSTOM_HOSTNAME_VERIFIER_HOME}/generateCustomHostNameVerifier.sh - - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; ${CUSTOM_HOSTNAME_VERIFIER_HOME}/generateCustomHostNameVerifier.sh ${wlsAdminHost} ${adminPublicHostName} ${adminPublicHostName} ${dnsLabelPrefix} ${wlsDomainName} ${location}" -} - -function copyCustomHostNameVerifierJarsToWebLogicClasspath() -{ - runuser -l oracle -c "cp ${CUSTOM_HOSTNAME_VERIFIER_HOME}/output/*.jar $oracleHome/wlserver/server/lib/;" - - echo "Modify WLS CLASSPATH to include hostname verifier jars...." - sed -i 's;^WEBLOGIC_CLASSPATH="${WL_HOME}/server/lib/postgresql.*;&\nWEBLOGIC_CLASSPATH="${WL_HOME}/server/lib/hostnamevalues.jar:${WL_HOME}/server/lib/weblogicustomhostnameverifier.jar:${WEBLOGIC_CLASSPATH}";' $oracleHome/oracle_common/common/bin/commExtEnv.sh - echo "Modified WLS CLASSPATH to include hostname verifier jars." -} - - -function configureCustomHostNameVerifier() -{ - echo "configureCustomHostNameVerifier for domain $wlsDomainName for server $wlsServerName" - cat <$DOMAIN_PATH/configureCustomHostNameVerifier.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -try: - edit("$wlsServerName") - startEdit() - - cd('/Servers/$wlsServerName/SSL/$wlsServerName') - cmo.setHostnameVerifier('com.oracle.azure.weblogic.security.util.WebLogicCustomHostNameVerifier') - cmo.setHostnameVerificationIgnored(false) - cmo.setTwoWaySSLEnabled(false) - cmo.setClientCertificateEnforced(false) - - save() - activate() -except Exception,e: - print e - print "Failed to configureCustomHostNameVerifier for domain $wlsDomainName" - dumpStack() - raise Exception('Failed to configureCustomHostNameVerifier for domain $wlsDomainName') -disconnect() -EOF -sudo chown -R $username:$groupname $DOMAIN_PATH -runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST $DOMAIN_PATH/configureCustomHostNameVerifier.py" -if [[ $? != 0 ]]; then - echo "Error : Failed to configureCustomHostNameVerifier for domain $wlsDomainName" - exit 1 -fi - -} - -#main script starts here - - -SCRIPT_PWD=`pwd` -CURR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -BASE_DIR="$(readlink -f ${CURR_DIR})" - -# Used for certificate expiry validation -CURRENT_DATE=`date +%s` -# Supplied certificate to have minimum days validity for the deployment -MIN_CERT_VALIDITY="1" - - -#read arguments from stdin -read wlsDomainName wlsUserName wlsPassword wlsAdminHost oracleHome storageAccountName storageAccountKey mountpointPath isHTTPAdminListenPortEnabled adminPublicHostName dnsLabelPrefix location virtualNetworkNewOrExisting storageAccountPrivateIp fileShareName isCustomSSLEnabled customIdentityKeyStoreData customIdentityKeyStorePassPhrase customIdentityKeyStoreType customTrustKeyStoreData customTrustKeyStorePassPhrase customTrustKeyStoreType serverPrivateKeyAlias serverPrivateKeyPassPhrase - -wlsServerName="admin" -DOMAIN_PATH="/u01/domains" -CUSTOM_HOSTNAME_VERIFIER_HOME="/u01/app/custom-hostname-verifier" -startWebLogicScript="${DOMAIN_PATH}/${wlsDomainName}/startWebLogic.sh" -stopWebLogicScript="${DOMAIN_PATH}/${wlsDomainName}/bin/customStopWebLogic.sh" - -validateInput - -installUtilities - -mountFileShare - -SERVER_STARTUP_ARGS="-Dlog4j2.formatMsgNoLookups=true" -KEYSTORE_PATH="${DOMAIN_PATH}/${wlsDomainName}/keystores" -wlsAdminPort=7001 -wlsSSLAdminPort=7002 -wlsAdminT3ChannelPort=7005 - -if [ "${isHTTPAdminListenPortEnabled,,}" == "true" ]; -then - wlsAdminURL="$wlsAdminHost:$wlsAdminPort" -else - wlsAdminURL="$wlsAdminHost:$wlsAdminT3ChannelPort" -fi - -username="oracle" -groupname="oracle" - -create_adminDomain - -createStopWebLogicScript - -cleanup - -updateNetworkRules - -create_adminserver_service - -admin_boot_setup - -generateCustomHostNameVerifier - -copyCustomHostNameVerifierJarsToWebLogicClasspath - -setUMaskForSecurityDir - -enableAndStartAdminServerService - -echo "Waiting for admin server to be available" -wait_for_admin -echo "Weblogic admin server is up and running" - -configureCustomHostNameVerifier - -cleanup diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/scripts/updateDNSZones.sh b/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/scripts/updateDNSZones.sh deleted file mode 100644 index 78f21e8a2..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/scripts/updateDNSZones.sh +++ /dev/null @@ -1,108 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Description -# This script updates the Azure DNS Zones used for configuring DNS for WebLogic Admin Server and Azure Application Gateway. - -# Inputs: -# RESOURCE_GROUP_NAME -# DNS_ZONE_NAME -# DNS_RECORDSET_NAMES -# DNS_TARGET_RESOURCES -# DNS_RECORD_NAMES_LENGTH -# DNS_TARGET_RESOURCES_LENGTH -# DNS_RECORD_TTL -# DNS_CNAME_RECORDSET_NAMES -# DNS_CNAME_ALIAS -# DNS_CNAME_RECORDSET_LENGTH -# DNS_CNAME_ALIAS_LENGTH -# MANAGED_IDENTITY_ID - -if [[ ${DNS_RECORD_NAMES_LENGTH} != ${DNS_TARGET_RESOURCES_LENGTH} ]]; then - echo "Error: number of A record set names is not equal to that of target resources." - exit 1 -fi - -if [[ ${DNS_CNAME_RECORDSET_LENGTH} != ${DNS_CNAME_ALIAS_LENGTH} ]]; then - echo "Error: number of CNAME record set names is not equal to that of alias." - exit 1 -fi - -# check if the zone exist -az network dns zone show -g ${RESOURCE_GROUP_NAME} -n ${DNS_ZONE_NAME} - -# query name server for testing -nsforTest=$(az network dns record-set ns show -g ${RESOURCE_GROUP_NAME} -z ${DNS_ZONE_NAME} -n @ --query "nsRecords"[0].nsdname -o tsv) -echo name server: ${nsforTest} - -if [ ${DNS_RECORD_NAMES_LENGTH} -gt 0 ]; then - recordSetNamesArr=$(echo $DNS_RECORDSET_NAMES | tr "," "\n") - targetResourcesArr=$(echo $DNS_TARGET_RESOURCES | tr "," "\n") - - index=0 - for record in $recordSetNamesArr; do - count=0 - for target in $targetResourcesArr; do - if [ $count -eq $index ]; then - echo Create A record with name: $record, target IP: $target - az network dns record-set a create \ - -g ${RESOURCE_GROUP_NAME} \ - -z ${DNS_ZONE_NAME} \ - -n ${record} \ - --target-resource ${target} \ - --ttl ${DNS_RECORD_TTL} - - nslookup ${record}.${DNS_ZONE_NAME} ${nsforTest} - if [ $? -eq 1 ];then - echo Error: failed to create record with name: $record, target Id: $target - exit 1 - fi - fi - - count=$((count + 1)) - done - - index=$((index + 1)) - done -fi - -if [ ${DNS_CNAME_RECORDSET_LENGTH} -gt 0 ];then - cnameRecordSetArr=$(echo $DNS_CNAME_RECORDSET_NAMES | tr "," "\n") - cnameRecordAliasArr=$(echo $DNS_CNAME_ALIAS | tr "," "\n") - - index=0 - for record in $cnameRecordSetArr; do - count=0 - for target in $cnameRecordAliasArr; do - if [ $count -eq $index ]; then - echo Create CNAME record with name: $record, alias: $target - az network dns record-set cname create \ - -g ${RESOURCE_GROUP_NAME} \ - -z ${DNS_ZONE_NAME} \ - -n ${record} \ - --ttl ${DNS_RECORD_TTL} - - az network dns record-set cname set-record \ - -g ${RESOURCE_GROUP_NAME} \ - -z ${DNS_ZONE_NAME} \ - --cname ${target} \ - --record-set-name ${record} - - nslookup ${record}.${DNS_ZONE_NAME} ${nsforTest} - if [ $? -eq 1 ];then - echo Error: failed to create CNAME record with name: $record, alia: $target - exit 1 - fi - fi - - count=$((count + 1)) - done - - index=$((index + 1)) - done -fi - -# delete user assigned managed identity - -az identity delete --ids ${MANAGED_IDENTITY_ID} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/test/scripts/gen-parameters-db.sh b/weblogic-azure-vm/arm-oraclelinux-wls-admin/test/scripts/gen-parameters-db.sh deleted file mode 100644 index c5b38edc1..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/test/scripts/gen-parameters-db.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -#read arguments from stdin -read parametersPath repoPath testbranchName - -cat < ${parametersPath} -{ - "\$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "value": "https://raw.githubusercontent.com/${repoPath}/${testbranchName}/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/" - }, - "_artifactsLocationSasToken": { - "value": "" - }, - "adminPasswordOrKey": { - "value": "GEN-UNIQUE" - }, - "adminUsername": { - "value": "GEN-UNIQUE" - }, - "databaseType": { - "value": "postgresql" - }, - "dbPassword": { - "value": "GEN-UNIQUE" - }, - "dbUser": { - "value": "GEN-UNIQUE" - }, - "dsConnectionURL": { - "value": "GEN-UNIQUE" - }, - "enableDB": { - "value": true - }, - "jdbcDataSourceName": { - "value": "jdbc/postgresql" - }, - "vmSize": { - "value": "Standard_B2ms" - }, - "wlsPassword": { - "value": "GEN-UNIQUE" - }, - "wlsUserName": { - "value": "GEN-UNIQUE" - } - } -} -EOF diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/test/scripts/gen-parameters-deploy.sh b/weblogic-azure-vm/arm-oraclelinux-wls-admin/test/scripts/gen-parameters-deploy.sh deleted file mode 100644 index ba0fc0ea7..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/test/scripts/gen-parameters-deploy.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -#Generate parameters with value for deploying db template independently - -#read arguments from stdin -read parametersPath adminPasswordOrKey skuUrnVersion wlsdomainname adminVMName dbPassword dbAdminUser dbName location wlsusername wlspassword repoPath testbranchName - -cat < ${parametersPath}/parameters-deploy.json -{ - "adminPasswordOrKey": { - "value": "${adminPasswordOrKey}" - }, - "adminUsername": { - "value": "weblogic" - }, - "adminVMName":{ - "value": "${adminVMName}" - }, - "databaseType": { - "value": "postgresql" - }, - "dbPassword": { - "value": "${dbPassword}" - }, - "dbUser": { - "value": "${dbAdminUser}" - }, - "dsConnectionURL": { - "value": "jdbc:postgresql://${dbName}.postgres.database.azure.com:5432/postgres?sslmode=require" - }, - "jdbcDataSourceName": { - "value": "jdbc/WebLogicDB" - }, - "location": { - "value": "${location}" - }, - "skuUrnVersion": { - "value": "${skuUrnVersion}" - }, - "vmSize": { - "value": "Standard_B2ms" - }, - "wlsDomainName": { - "value": "${wlsdomainname}" - }, - "wlsPassword": { - "value": "${wlsPassword}" - }, - "wlsUserName": { - "value": "${wlsUserName}" - }, - "_artifactsLocation":{ - "value": "https://raw.githubusercontent.com/${repoPath}/${testbranchName}/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/" - }, - } -EOF diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/test/scripts/gen-parameters.sh b/weblogic-azure-vm/arm-oraclelinux-wls-admin/test/scripts/gen-parameters.sh deleted file mode 100644 index c712c8931..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/test/scripts/gen-parameters.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -#read arguments from stdin -read parametersPath repoPath testbranchName - -cat < ${parametersPath} -{ - "\$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "value": "https://raw.githubusercontent.com/${repoPath}/${testbranchName}/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/" - }, - "_artifactsLocationSasToken": { - "value": "" - }, - "adminPasswordOrKey": { - "value": "GEN-UNIQUE" - }, - "adminUsername": { - "value": "GEN-UNIQUE" - }, - "enableDB": { - "value": false - }, - "vmSize": { - "value": "Standard_B2ms" - }, - "wlsPassword": { - "value": "GEN-UNIQUE" - }, - "wlsUserName": { - "value": "GEN-UNIQUE" - } - } -} -EOF diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/test/scripts/verify-deployments.sh b/weblogic-azure-vm/arm-oraclelinux-wls-admin/test/scripts/verify-deployments.sh deleted file mode 100644 index 2ec36ff30..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/test/scripts/verify-deployments.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -#read arguments from stdin -read prefix location template repoPath testbranchName scriptsDir - -groupName=${prefix}-preflight - -# create Azure resources for preflight testing -az group create --verbose --name $groupName --location ${location} - -# generate parameters for testing differnt cases -parametersList=() -# parameters for cluster -bash ${scriptsDir}/gen-parameters.sh <<< "${scriptsDir}/parameters.json $repoPath $testbranchName" -parametersList+=(${scriptsDir}/parameters.json) - -# parameters for cluster+db -bash ${scriptsDir}/gen-parameters-db.sh <<< "${scriptsDir}/parameters-db.json $repoPath $testbranchName" -parametersList+=(${scriptsDir}/parameters-db.json) - -# run preflight tests -success=true -for parameters in "${parametersList[@]}"; -do - az deployment group validate -g ${groupName} -f ${template} -p @${parameters} --no-prompt - if [[ $? != 0 ]]; then - echo "deployment validation for ${parameters} failed!" - success=false - fi -done - -# release Azure resources -az group delete --yes --no-wait --verbose --name $groupName - -if [[ $success == "false" ]]; then - exit 1 -else - exit 0 -fi diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/test/scripts/verify-services.sh b/weblogic-azure-vm/arm-oraclelinux-wls-admin/test/scripts/verify-services.sh deleted file mode 100644 index e1332b630..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/test/scripts/verify-services.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -# Copyright (c) 2024, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Verify the service using systemctl status -function verifyServiceStatus() -{ - serviceName=$1 - systemctl status $serviceName | grep "active (running)" - if [[ $? != 0 ]]; then - echo "$serviceName is not in active (running) state" - exit 1 - fi - echo "$serviceName is active (running)" -} - -#Verify the service using systemctl is-active -function verifyServiceActive() -{ - serviceName=$1 - state=$(systemctl is-active $serviceName) - if [[ $state == "active" ]]; then - echo "$serviceName is active" - else - echo "$serviceName is not active" - exit 1 - fi -} - -echo "Testing on admin server" -servicesList="rngd wls_admin" - -for service in $servicesList -do - verifyServiceStatus $service - verifyServiceActive $service -done - -exit 0 diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/test/scripts/verify-wls-access.sh b/weblogic-azure-vm/arm-oraclelinux-wls-admin/test/scripts/verify-wls-access.sh deleted file mode 100644 index cc808ac28..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/test/scripts/verify-wls-access.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Verifying admin server is accessible - -#read arguments from stdin -read adminPublicIP adminPort - -CURL_PARMS="--connect-timeout 60 --max-time 180 --retry 10 --retry-delay 30 --retry-max-time 180 --retry-connrefused" - -echo "Verifying http://${adminPublicIP}:${adminPort}/weblogic/ready" -curl ${CURL_PARMS} http://${adminPublicIP}:${adminPort}/weblogic/ready - -if [[ $? != 0 ]]; then - echo "Failed : WebLogic admin server is not accessible" - exit 1 -else - echo "WebLogic admin server is accessible" -fi - -# Verifying whether admin console is accessible -echo "Checking WebLogic admin console is acessible" -curl ${CURL_PARMS} http://${adminPublicIP}:${adminPort}/console/ -if [[ $? != 0 ]]; then - echo "WebLogic admin console is not accessible" - exit 1 -else - echo "WebLogic admin console is accessible" - exit 0 -fi diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/README.md b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/README.md deleted file mode 100644 index c1a10b45a..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/README.md +++ /dev/null @@ -1,11 +0,0 @@ - - -## WebLogic Server (with N-Node Cluster) on Microsoft Azure - Marketplace Offerings - -This git repository is used to maintain the Azure Resource Management (ARM) templates and other scripts -used for the implementation of WebLogic Server (with N-Node Cluster) on Microsoft Azure. - -For WebLogic Server running in the Azure Virtual Machines documentation, please refer to the [README documentation](https://github.com/oracle/weblogic-azure/weblogic-azure-vm/README.md). diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/addnode-coherence/pom.xml b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/addnode-coherence/pom.xml deleted file mode 100644 index a5390bff4..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/addnode-coherence/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - 4.0.0 - - - com.oracle.weblogic.azure - weblogic-azure-vm - 1.0.0 - ../../pom.xml - - - com.oracle.weblogic.azure - arm-oraclelinux-wls-cluster-addnode-coherence - ${version.arm-oraclelinux-wls-cluster-addnode-coherence} - - jar - ${project.artifactId} - - - -TestParameter '@{"SampleName"="addnode-coherence/src/main";"RawRepoPath"="${artifactsLocationBase}/arm-oraclelinux-wls-cluster/"}' - ${project.basedir}/../../.. - false - false - - - - - - - diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/addnode-coherence/src/main/arm/addnodedeploy.parameters.json b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/addnode-coherence/src/main/arm/addnodedeploy.parameters.json deleted file mode 100644 index 427809198..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/addnode-coherence/src/main/arm/addnodedeploy.parameters.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "adminPasswordOrKey": { - "value": "GEN-SSH-PUB-KEY" - }, - "adminUsername": { - "value": "GEN-UNIQUE" - }, - "adminVMName": { - "value": "GEN-UNIQUE" - }, - "dnsLabelPrefix": { - "value": "GEN-UNIQUE" - }, - "numberOfExistingCacheNodes": { - "value": 1 - }, - "numberOfNewCacheNodes": { - "value": 1 - }, - "skuUrnVersion": { - "value": "GEN-UNIQUE" - }, - "storageAccountName": { - "value": "GEN-UNIQUE" - }, - "usePreviewImage": { - "value": "GEN-UNIQUE" - }, - "vmSize": { - "value": "GEN-UNIQUE" - }, - "wlsDomainName": { - "value": "GEN-UNIQUE" - }, - "wlsPassword": { - "value": "GEN-UNIQUE" - }, - "wlsUserName": { - "value": "GEN-UNIQUE" - }, - "enableDNSConfiguration": { - "value": false - }, - "customDNSNameForAdminServer" : { - "value": "GEN-UNIQUE" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/addnode-coherence/src/main/arm/mainTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/addnode-coherence/src/main/arm/mainTemplate.json deleted file mode 100644 index c3febcf13..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/addnode-coherence/src/main/arm/mainTemplate.json +++ /dev/null @@ -1,468 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - }, - "defaultValue": "${artifactsLocationBase}/arm-oraclelinux-wls-cluster/addnode-coherence/src/main/" - }, - "_artifactsLocationSasToken": { - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - }, - "defaultValue": "" - }, - "adminPasswordOrKey": { - "type": "securestring", - "metadata": { - "description": "SSH Key or password for the Virtual Machine. SSH key is recommended." - } - }, - "adminUsername": { - "type": "string", - "defaultValue": "weblogic", - "metadata": { - "description": "User name for the Virtual Machine." - } - }, - "adminVMName": { - "defaultValue": "adminVM", - "type": "string", - "metadata": { - "description": "Admin Server hosting VM name." - } - }, - "authenticationType": { - "type": "string", - "defaultValue": "password", - "allowedValues": [ - "sshPublicKey", - "password" - ], - "metadata": { - "description": "Type of authentication to use on the Virtual Machine. SSH key is recommended." - } - }, - "dnsLabelPrefix": { - "type": "string", - "defaultValue": "wls", - "metadata": { - "description": "Unique DNS Name for the Public IP used to access the Virtual Machine." - } - }, - "elkSettings": { - "type": "secureObject", - "defaultValue": { - "enable": false, - "elasticsearchEndpoint": "null", - "elasticsearchPassword": "null", - "elasticsearchUserName": "null", - "logIndex": "null", - "logsToIntegrate": [ "HTTPAccessLog", "ServerLog", "DomainLog", "DataSourceLog", "StandardErrorAndOutput", "NodeManagerLog" ] - }, - "metadata": { - "description": "If enable is true, must specify all the properties of elkSettings. logsToIntegrate must be value of an array." - } - }, - "enableCoherenceWebLocalStorage": { - "defaultValue": true, - "type": "bool", - "metadata": { - "description": "Specifies whether Local Storage is enabled for the Coherence*Web cluster tier." - } - }, - "guidValue": { - "type": "string", - "defaultValue": "[newGuid()]" - }, - "location": { - "type": "string", - "metadata": { - "description": "Location for all resources." - } - }, - "managedServerPrefix": { - "type": "string", - "defaultValue": "msp", - "metadata": { - "description": "Provide managed server prefix name" - } - }, - "numberOfExistingCacheNodes": { - "type": "int", - "defaultValue": 1, - "minValue": 1, - "maxValue": 20, - "metadata": { - "description": "Number of existing Coherence cache servers, used to name new virtual machines and managed server for cache." - } - }, - "numberOfNewCacheNodes": { - "type": "int", - "defaultValue": 1, - "minValue": 1, - "maxValue": 20, - "metadata": { - "description": "Number of new Coherence cahce servers, used to create virtual machines and managed server for cache." - } - }, - "skuUrnVersion": { - "type": "string", - "defaultValue": "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest", - "allowedValues": [ - "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest", - "owls-141100-jdk11-ol87;Oracle:weblogic-141100-jdk11-ol87:owls-141100-jdk11-ol87;latest", - "owls-141100-jdk8-ol91;Oracle:weblogic-141100-jdk8-ol91:owls-141100-jdk8-ol91;latest", - "owls-141100-jdk8-ol87;Oracle:weblogic-141100-jdk8-ol87:owls-141100-jdk8-ol87;latest", - "owls-122140-jdk8-ol91;Oracle:weblogic-122140-jdk8-ol91:owls-122140-jdk8-ol91;latest", - "owls-122140-jdk8-ol87;Oracle:weblogic-122140-jdk8-ol87:owls-122140-jdk8-ol87;latest", - "owls-122140-jdk8-ol76;Oracle:weblogic-122140-jdk8-ol76:owls-122140-jdk8-ol7;latest", - "owls-141100-jdk8-ol76;Oracle:weblogic-141100-jdk8-ol76:owls-141100-jdk8-ol7;latest", - "owls-141100-jdk11-ol76;Oracle:weblogic-141100-jdk11-ol76:owls-141100-jdk11-ol7;latest", - "owls-141100-jdk11-rhel87;Oracle:weblogic-141100-jdk11-rhel87:owls-141100-jdk11-rhel87;latest", - "owls-141100-jdk8-rhel87;Oracle:weblogic-141100-jdk8-rhel87:owls-141100-jdk8-rhel87;latest", - "owls-122140-jdk8-rhel87;Oracle:weblogic-122140-jdk8-rhel87:owls-122140-jdk8-rhel87;latest", - "owls-122140-jdk8-rhel76;Oracle:weblogic-122140-jdk8-rhel76:owls-122140-jdk8-rhel76;latest", - "owls-141100-jdk8-rhel76;Oracle:weblogic-141100-jdk8-rhel76:owls-141100-jdk8-rhel76;latest", - "owls-141100-jdk11-rhel76;Oracle:weblogic-141100-jdk11-rhel76:owls-141100-jdk11-rhel76;latest" - ], - "metadata": { - "description": "The Oracle Linux image with Weblogic and Java preinstalled. Semicolon separated string of Sku, URN, and Version" - } - }, - "storageAccountName": { - "type": "string", - "metadata": { - "description": "Name of storage account. One storage account can store 20 vitual machines with 2 VHDs of 500 IOPS." - } - }, - "usePreviewImage": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "Bool value, if it's set to true, will deploy with preview weblogic image." - } - }, - "vmSize": { - "defaultValue": "Standard_A3", - "type": "string", - "metadata": { - "description": "Select appropriate VM Size for Coherence" - } - }, - "virtualNetworkName": { - "type": "string", - "defaultValue": "wls-vnet", - "metadata": { - "description": "Name of the existing or new VNET" - } - }, - "virtualNetworkResourceGroupName": { - "type": "string", - "defaultValue": "[resourceGroup().name]", - "metadata": { - "description": "Resource group of Virtual network" - } - }, - "subnetName": { - "type": "string", - "defaultValue": "wls-subnet", - "metadata": { - "description": "Name of the existing or new Subnet" - } - }, - "wlsDomainName": { - "type": "string", - "defaultValue": "wlsd", - "metadata": { - "description": "Provide Weblogic domain name" - } - }, - "wlsPassword": { - "type": "securestring", - "metadata": { - "description": "Password for your Weblogic domain name" - } - }, - "wlsUserName": { - "defaultValue": "weblogic", - "type": "string", - "metadata": { - "description": "Username for your Weblogic domain name" - } - }, - "enableDNSConfiguration": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "Boolean value indicating, if DNS Zone Configuration is enabled or not" - } - }, - "customDNSNameForAdminServer": { - "type": "string", - "defaultValue": "none", - "metadata": { - "description": "Custom DNS Name for WebLogic Admin Server" - } - }, - "customSSLSettings": { - "type": "secureObject", - "defaultValue": { - "enable": false, - "customIdentityKeyStoreBase64String": "null", - "customIdentityKeyStorePassPhrase": "null", - "customIdentityKeyStoreType": "null", - "customTrustKeyStoreBase64String": "null", - "customTrustKeyStorePassPhrase": "null", - "customTrustKeyStoreType": "null", - "privateKeyAlias":"null", - "privateKeyPassPhrase":"null" - }, - "metadata": { - "description": "If enable is true, must specify all customSSLSettings configured in WebLogic Admin Server. customIdentityKeyStoreBase64String & customTrustKeyStoreBase64String are the custom identity & trust keystore data repectively, i.e., contents of identity.jks, trust.jks keystore files in base64 encoding. Similarly, all other custom ssl settings are also required to configure SSL settings" - } - } - }, - "variables": { - "const_cacheServerIndexOffset": "[add(parameters('numberOfExistingCacheNodes'), 1)]", - "const_hyphen": "-", - "const_imageOffer": "[concat('weblogic',variables('const_hyphen'), split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[1],variables('const_hyphen'),split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[2],variables('const_hyphen'),split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[3],if(parameters('usePreviewImage'),'-preview',''))]", - "const_imagePublisher": "oracle", - "const_linuxConfiguration": { - "disablePasswordAuthentication": true, - "ssh": { - "publicKeys": [ - { - "path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]", - "keyData": "[parameters('adminPasswordOrKey')]" - } - ] - } - }, - "const_mountPointPath": "[concat('/mnt/', variables('name_share'))]", - "const_publicIPAddressType": "Dynamic", - "const_vmSize": "[parameters('vmSize')]", - "const_wlsDomainPath": "/u01/domains", - "const_wlsHome": "/u01/app/wls/install/oracle/middleware/oracle_home", - "name_linuxImageOfferSKU": "[first(split(parameters('skuUrnVersion'), ';'))]", - "name_linuxImageVersion": "[last(split(parameters('skuUrnVersion'),';'))]", - "name_nic": "_NIC", - "name_publicIPAddress": "_PublicIP", - "name_scriptCoherenceFile": "setupCoherence.sh", - "name_scriptELKConfiguration": "elkIntegration.sh", - "name_share": "wlsshare", - "name_subnet": "[parameters('subnetName')]", - "name_virtualNetwork": "[parameters('virtualNetworkName')]", - "name_vmMachine": "[concat(parameters('managedServerPrefix'),'StorageVM')]", - "name_wlsServerPrefix": "[concat(parameters('managedServerPrefix'),'Storage')]", - "ref_subnet": "[resourceId(parameters('virtualNetworkResourceGroupName'), 'Microsoft.Network/virtualNetworks/subnets', variables('name_virtualNetwork'), variables('name_subnet'))]", - "name_customHostnameGeneratorscriptFile": "generateCustomHostNameVerifier.sh", - "name_customHostnameVerifierJavaFile": "src/main/java/WebLogicCustomHostNameVerifier.java", - "name_customHostnameValuesTemplate": "src/main/java/HostNameValuesTemplate.txt", - "name_customHostnameVerifierTest" : "src/test/java/WebLogicCustomHostNameVerifierTest.java" - }, - "functions": [ - { - "namespace": "array", - "members": { - "join": { - "parameters": [ - { - "name": "items", - "type": "array" - } - ], - "output": { - "type": "string", - "value": "[replace(replace(replace(string(parameters('items')), '[\"', ''), '\"]', ''), '\",\"', ',')]" - } - } - } - } - ], - "resources": [ - { - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${cluster.addnode.coherence.start}", - "type": "Microsoft.Resources/deployments", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "apiVersion": "${azure.apiVersionForPublicIPAddresses}", - "type": "Microsoft.Network/publicIPAddresses", - "name": "[concat(variables('name_vmMachine'),copyIndex(variables('const_cacheServerIndexOffset')),variables('name_publicIPAddress'))]", - "location": "[parameters('location')]", - "copy": { - "name": "publicIPLoop", - "count": "[parameters('numberOfNewCacheNodes')]" - }, - "properties": { - "publicIPAllocationMethod": "[variables('const_publicIPAddressType')]", - "dnsSettings": { - "domainNameLabel": "[concat(toLower(parameters('dnsLabelPrefix')),copyindex(variables('const_cacheServerIndexOffset')),'-',take(replace(parameters('guidValue'),'-',''),10),'-',toLower(parameters('wlsDomainName')))]" - } - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualNetworks}", - "type": "Microsoft.Network/virtualNetworks/subnets", - "name": "[concat(variables('name_virtualNetwork'), '/', variables('name_subnet'))]", - "condition": "[and(empty(variables('name_virtualNetwork')), empty(variables('name_subnet')))]" - }, - { - "apiVersion": "${azure.apiVersionForNetworkInterfaces}", - "type": "Microsoft.Network/networkInterfaces", - "name": "[concat(variables('name_vmMachine'), copyIndex(variables('const_cacheServerIndexOffset')), variables('name_nic'))]", - "location": "[parameters('location')]", - "copy": { - "name": "nicLoop", - "count": "[parameters('numberOfNewCacheNodes')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.Network/publicIPAddresses/', concat(variables('name_vmMachine'),copyIndex(variables('const_cacheServerIndexOffset')),variables('name_publicIPAddress')))]" - ], - "properties": { - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses',concat(variables('name_vmMachine'),copyIndex(variables('const_cacheServerIndexOffset')),variables('name_publicIPAddress')))]" - }, - "subnet": { - "id": "[variables('ref_subnet')]" - } - } - } - ], - "dnsSettings": { - "internalDnsNameLabel": "[concat(variables('name_vmMachine'), copyIndex(variables('const_cacheServerIndexOffset')))]" - } - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines", - "name": "[concat(variables('name_vmMachine'), copyIndex(variables('const_cacheServerIndexOffset')))]", - "location": "[parameters('location')]", - "copy": { - "name": "virtualMachineLoop", - "count": "[parameters('numberOfNewCacheNodes')]" - }, - "dependsOn": [ - "nicLoop" - ], - "properties": { - "hardwareProfile": { - "vmSize": "[variables('const_vmSize')]" - }, - "osProfile": { - "computerName": "[concat(variables('name_vmMachine'), copyIndex(variables('const_cacheServerIndexOffset')))]", - "adminUsername": "[parameters('adminUsername')]", - "adminPassword": "[parameters('adminPasswordOrKey')]", - "linuxConfiguration": "[if(equals(parameters('authenticationType'), 'password'), json('null'), variables('const_linuxConfiguration'))]" - }, - "storageProfile": { - "imageReference": { - "publisher": "[variables('const_imagePublisher')]", - "offer": "[variables('const_imageOffer')]", - "sku": "[variables('name_linuxImageOfferSKU')]", - "version": "[variables('name_linuxImageVersion')]" - }, - "osDisk": { - "createOption": "FromImage", - "managedDisk": { - "storageAccountType": "Standard_LRS" - } - } - }, - "networkProfile": { - "networkInterfaces": [ - { - "id": "[resourceId('Microsoft.Network/networkInterfaces',concat(variables('name_vmMachine'), copyIndex(variables('const_cacheServerIndexOffset')), variables('name_nic')))]" - } - ] - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": true, - "storageUri": "[reference(resourceId('Microsoft.Storage/storageAccounts/', parameters('storageAccountName')), '${azure.apiVersionForStorage}').primaryEndpoints.blob]" - } - } - }, - "plan": { - "name": "[variables('name_linuxImageOfferSKU')]", - "publisher": "[variables('const_imagePublisher')]", - "product": "[variables('const_imageOffer')]" - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines/extensions", - "name": "[concat(variables('name_vmMachine'), copyIndex(variables('const_cacheServerIndexOffset')),'/newuserscript')]", - "location": "[parameters('location')]", - "copy": { - "name": "virtualMachineExtensionLoop", - "count": "[parameters('numberOfNewCacheNodes')]" - }, - "dependsOn": [ - "virtualMachineLoop" - ], - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.0", - "autoUpgradeMinorVersion": true, - "settings": { - "fileUris": [ - "[uri(parameters('_artifactsLocation'), concat('../../../arm-oraclelinux-wls-cluster/src/main/scripts/', variables('name_scriptCoherenceFile'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocation'), concat('../../../arm-oraclelinux-wls-cluster/src/main/scripts/', variables('name_scriptELKConfiguration'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocation'), concat('../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameGeneratorscriptFile'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocation'), concat('../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameVerifierJavaFile'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocation'), concat('../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameValuesTemplate'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocation'), concat('../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameVerifierTest'), parameters('_artifactsLocationSasToken')))]" - ] - }, - "protectedSettings": { - "commandToExecute": "[concat('sh',' ',variables('name_scriptCoherenceFile'), ' <<< \"', parameters('wlsDomainName'),' ',parameters('wlsUserName'),' ',parameters('wlsPassword'),' ',parameters('adminVMName'),' ',variables('const_wlsHome'),' ',variables('const_wlsDomainPath'),' ', parameters('storageAccountName'), ' ', listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName')), '${azure.apiVersionForStorage}').keys[0].value,' ', variables('const_mountPointPath'),' ', parameters('enableCoherenceWebLocalStorage'),' ',parameters('elkSettings').enable, ' ',parameters('elkSettings').elasticsearchEndpoint,' ', parameters('elkSettings').elasticsearchUserName,' ', parameters('elkSettings').elasticsearchPassword, ' ', array.join(parameters('elkSettings').logsToIntegrate), ' ',parameters('elkSettings').logIndex, ' ',variables('name_wlsServerPrefix'),' ',copyIndex(variables('const_cacheServerIndexOffset')),' ',if(parameters('enableDNSConfiguration'),parameters('customDNSNameForAdminServer'),parameters('adminVMName')),' ',parameters('dnsLabelPrefix'),' ',parameters('location'),' ','True',' ',parameters('customSSLSettings').enable,' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').customIdentityKeyStoreBase64String, 'null'),' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').customIdentityKeyStorePassPhrase, 'null'),' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').customIdentityKeyStoreType, 'null'),' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').customTrustKeyStoreBase64String, 'null'),' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').customTrustKeyStorePassPhrase, 'null'),' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').customTrustKeyStoreType, 'null'),' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').privateKeyAlias, 'null'),' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').privateKeyPassPhrase, 'null'),'\"')]" - } - } - }, - { - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${cluster.addnode.coherence.end}", - "type": "Microsoft.Resources/deployments", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - } - ], - "outputs": { - "artifactsLocationPassedIn": { - "type": "string", - "value": "[parameters('_artifactsLocation')]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/addnode/pom.xml b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/addnode/pom.xml deleted file mode 100644 index 02b157da1..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/addnode/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - 4.0.0 - - - com.oracle.weblogic.azure - weblogic-azure-vm - 1.0.0 - ../../pom.xml - - - com.oracle.weblogic.azure - arm-oraclelinux-wls-cluster-addnode - ${version.arm-oraclelinux-wls-cluster-addnode} - - jar - ${project.artifactId} - - - -TestParameter '@{"SampleName"="addnode/src/main";"RawRepoPath"="${artifactsLocationBase}/arm-oraclelinux-wls-cluster/"}' - ${project.basedir}/../../.. - false - false - - - - - - - diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/addnode/src/main/arm/addnodedeploy.parameters.json b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/addnode/src/main/arm/addnodedeploy.parameters.json deleted file mode 100644 index 9db481610..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/addnode/src/main/arm/addnodedeploy.parameters.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "value":"GEN-UNIQUE" - }, - "aadsSettings": { - "value": { - "enable": true, - "publicIP": "GEN-UNIQUE", - "serverHost": "GEN-UNIQUE", - "certificateBase64String": "GEN-UNIQUE" - } - }, - "adminPasswordOrKey": { - "value": "GEN-SSH-PUB-KEY" - }, - "adminURL": { - "value": "GEN-UNIQUE" - }, - "adminVMName": { - "value": "GEN-UNIQUE" - }, - "adminUsername": { - "value": "GEN-UNIQUE" - }, - "appGatewaySettings": { - "value": { - "enable": true, - "publicIPName": "GEN-UNIQUE", - "certificateBase64String": "GEN-UNIQUE", - "certificatePassword": "GEN-UNIQUE" - } - }, - "dnsLabelPrefix": { - "value": "GEN-UNIQUE" - }, - "location": { - "value": "GEN-UNIQUE" - }, - "managedServerPrefix": { - "value": "GEN-UNIQUE" - }, - "numberOfExistingNodes": { - "value": "GEN-UNIQUE" - }, - "numberOfNewNodes": { - "value": "GEN-UNIQUE" - }, - "skuUrnVersion": { - "value": "GEN-UNIQUE" - }, - "storageAccountName": { - "value": "GEN-UNIQUE" - }, - "usePreviewImage": { - "value": "GEN-UNIQUE" - }, - "vmSize": { - "value": "GEN-UNIQUE" - }, - "wlsDomainName": { - "value": "GEN-UNIQUE" - }, - "wlsUserName": { - "value": "GEN-UNIQUE" - }, - "wlsPassword": { - "value": "GEN-UNIQUE" - }, - "enableDNSConfiguration": { - "value": false - }, - "customDNSNameForAdminServer" : { - "value": "GEN-UNIQUE" - }, - "customSSLSettings": { - "value": { - "enable": false, - "customIdentityKeyStoreBase64String": "GEN-UNIQUE", - "customIdentityKeyStorePassPhrase": "GEN-UNIQUE", - "customIdentityKeyStoreType": "GEN-UNIQUE", - "customTrustKeyStoreBase64String": "GEN-UNIQUE", - "customTrustKeyStorePassPhrase": "GEN-UNIQUE", - "customTrustKeyStoreType": "GEN-UNIQUE", - "privateKeyAlias": "GEN-UNIQUE", - "privateKeyPassPhrase": "GEN-UNIQUE" - } - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/addnode/src/main/arm/mainTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/addnode/src/main/arm/mainTemplate.json deleted file mode 100644 index be5a0898e..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/addnode/src/main/arm/mainTemplate.json +++ /dev/null @@ -1,718 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - }, - "defaultValue": "${artifactsLocationBase}/arm-oraclelinux-wls-cluster/addnode/src/main/" - }, - "_artifactsLocationSasToken": { - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - }, - "defaultValue": "" - }, - "aadsSettings": { - "type": "secureObject", - "defaultValue": { - "enable": false, - "publicIP": "null", - "serverHost": "null", - "certificateBase64String": "null" - }, - "metadata": { - "description": "If enable is true, must specify all aadSettings. publicIP is the Azure Active Directory LDAP server public IP address. serverHost is the LDAP server host. certificateBase64String is based64 string of LADP client certificate that will be imported to trust store of WebLogic Server to enable SSL connection of AD provider." - } - }, - "adminPasswordOrKey": { - "type": "securestring", - "metadata": { - "description": "SSH Key or password for the Virtual Machine. SSH key is recommended." - } - }, - "adminURL": { - "type": "string", - "metadata": { - "description": "Provide admin URL with vm0_public_ip:7001" - } - }, - "adminVMName": { - "type": "string", - "defaultValue": "adminVM", - "metadata": { - "description": "Provide admin VM Name ex: adminVM" - } - }, - "adminUsername": { - "type": "string", - "defaultValue": "weblogic", - "metadata": { - "description": "User name for the Virtual Machine." - } - }, - "appGatewaySettings": { - "type": "secureObject", - "defaultValue": { - "enable": false, - "publicIPName": "null", - "certificateBase64String": "null", - "certificatePassword": "null" - }, - "metadata": { - "description": "If enable is true, must specify all appGatewaySettings. name is resource name of application gateway, used to re-deploy existing application gateway. publicIPName is public IP name of application gateway, used to set public address to new managed servers, certificateBase64String is base64 string of the application gateway ssl server certificate, certificatePassword is password of the certificate." - } - }, - "authenticationType": { - "type": "string", - "defaultValue": "password", - "allowedValues": [ - "sshPublicKey", - "password" - ], - "metadata": { - "description": "Type of authentication to use on the Virtual Machine. SSH key is recommended." - } - }, - "dnsLabelPrefix": { - "type": "string", - "defaultValue": "wls", - "metadata": { - "description": "Unique DNS Name for the Public IP used to access the Virtual Machine." - } - }, - "elkSettings": { - "type": "object", - "defaultValue": { - "enable": false, - "elasticsearchEndpoint": "null", - "elasticsearchPassword": "null", - "elasticsearchUserName": "null", - "logIndex": "null", - "logsToIntegrate": [ "HTTPAccessLog", "ServerLog", "DomainLog", "DataSourceLog", "StandardErrorAndOutput", "NodeManagerLog" ] - }, - "metadata": { - "description": "If enable is true, must specify all the properties of elkSettings. logsToIntegrate must be value of an array." - } - }, - "enableCoherence": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "If true, create Coherence Cluster with data tier for caches." - } - }, - "guidValue": { - "type": "string", - "defaultValue": "[newGuid()]" - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]", - "metadata": { - "description": "Location for all resources." - } - }, - "managedServerPrefix": { - "type": "string", - "defaultValue": "msp", - "metadata": { - "description": "Provide managed server prefix" - } - }, - "numberOfExistingNodes": { - "type": "int", - "minValue": 1, - "maxValue": 20, - "metadata": { - "description": "The number of existing application managed servers, used to generate new virtual machine name." - } - }, - "numberOfNewNodes": { - "type": "int", - "defaultValue": 1, - "minValue": 1, - "maxValue": 20, - "metadata": { - "description": "The number of managed server to add." - } - }, - "skuUrnVersion": { - "type": "string", - "defaultValue": "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest", - "allowedValues": [ - "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest", - "owls-141100-jdk11-ol87;Oracle:weblogic-141100-jdk11-ol87:owls-141100-jdk11-ol87;latest", - "owls-141100-jdk8-ol91;Oracle:weblogic-141100-jdk8-ol91:owls-141100-jdk8-ol91;latest", - "owls-141100-jdk8-ol87;Oracle:weblogic-141100-jdk8-ol87:owls-141100-jdk8-ol87;latest", - "owls-122140-jdk8-ol91;Oracle:weblogic-122140-jdk8-ol91:owls-122140-jdk8-ol91;latest", - "owls-122140-jdk8-ol87;Oracle:weblogic-122140-jdk8-ol87:owls-122140-jdk8-ol87;latest", - "owls-122140-jdk8-ol76;Oracle:weblogic-122140-jdk8-ol76:owls-122140-jdk8-ol7;latest", - "owls-141100-jdk8-ol76;Oracle:weblogic-141100-jdk8-ol76:owls-141100-jdk8-ol7;latest", - "owls-141100-jdk11-ol76;Oracle:weblogic-141100-jdk11-ol76:owls-141100-jdk11-ol7;latest", - "owls-141100-jdk11-rhel87;Oracle:weblogic-141100-jdk11-rhel87:owls-141100-jdk11-rhel87;latest", - "owls-141100-jdk8-rhel87;Oracle:weblogic-141100-jdk8-rhel87:owls-141100-jdk8-rhel87;latest", - "owls-122140-jdk8-rhel87;Oracle:weblogic-122140-jdk8-rhel87:owls-122140-jdk8-rhel87;latest", - "owls-122140-jdk8-rhel76;Oracle:weblogic-122140-jdk8-rhel76:owls-122140-jdk8-rhel76;latest", - "owls-141100-jdk8-rhel76;Oracle:weblogic-141100-jdk8-rhel76:owls-141100-jdk8-rhel76;latest", - "owls-141100-jdk11-rhel76;Oracle:weblogic-141100-jdk11-rhel76:owls-141100-jdk11-rhel76;latest" - ], - "metadata": { - "description": "The Oracle Linux image with Weblogic and Java preinstalled. Semicolon separated string of Sku, URN, and Version" - } - }, - "storageAccountName": { - "type": "string", - "metadata": { - "description": "Name of storage account. One storage account can store 20 vitual machines with 2 VHDs of 500 IOPS." - } - }, - "usePreviewImage": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "Bool value, if it's set to true, will deploy with preview weblogic image." - } - }, - "vmSize": { - "type": "string", - "defaultValue": "Standard_A3", - "metadata": { - "description": "Select appropriate VM Size as per requirement" - } - }, - "virtualNetworkName": { - "type": "string", - "defaultValue": "wls-vnet", - "metadata": { - "description": "Name of the existing or new VNET" - } - }, - "virtualNetworkResourceGroupName": { - "type": "string", - "defaultValue": "[resourceGroup().name]", - "metadata": { - "description": "Resource group of Virtual network" - } - }, - "subnetName": { - "type": "string", - "defaultValue": "wls-subnet", - "metadata": { - "description": "Name of the existing or new Subnet" - } - }, - "wlsDomainName": { - "type": "string", - "defaultValue": "wlsd", - "metadata": { - "description": "Provide existing running Weblogic domain name" - } - }, - "wlsUserName": { - "type": "string", - "metadata": { - "description": "Username for your Weblogic domain name" - } - }, - "wlsPassword": { - "type": "securestring", - "metadata": { - "description": "Password for your Weblogic domain name" - } - }, - "enableDNSConfiguration": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "Boolean value indicating, if DNS Zone Configuration is enabled or not" - } - }, - "customDNSNameForAdminServer": { - "type": "string", - "defaultValue": "none", - "metadata": { - "description": "Custom DNS Name for WebLogic Admin Server" - } - }, - "customSSLSettings": { - "type": "secureObject", - "defaultValue": { - "enable": false, - "customIdentityKeyStoreBase64String": "null", - "customIdentityKeyStorePassPhrase": "null", - "customIdentityKeyStoreType": "null", - "customTrustKeyStoreBase64String": "null", - "customTrustKeyStorePassPhrase": "null", - "customTrustKeyStoreType": "null", - "privateKeyAlias":"null", - "privateKeyPassPhrase":"null" - }, - "metadata": { - "description": "If enable is true, must specify all customSSLSettings. customIdentityKeyStoreBase64String & customTrustKeyStoreBase64String are the custom identity & trust keystore data repectively, i.e., contents of identity.jks, trust.jks keystore files in base64 encoding. Similarly, all other custom ssl settings are also required to configure SSL settings" - } - } - }, - "variables": { - "const_appNodeMachineOffset": "[add(parameters('numberOfExistingNodes'), 1)]", - "const_appGatewayFrontEndHTTPPort": 80, - "const_appGatewayFrontEndHTTPSPort": 443, - "const_backendPort": 8001, - "const_hyphen": "-", - "const_imageOffer": "[concat('weblogic',variables('const_hyphen'), split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[1],variables('const_hyphen'),split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[2],variables('const_hyphen'),split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[3],if(parameters('usePreviewImage'),'-preview',''))]", - "const_imagePublisher": "oracle", - "const_linuxConfiguration": { - "disablePasswordAuthentication": true, - "ssh": { - "publicKeys": [ - { - "path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]", - "keyData": "[parameters('adminPasswordOrKey')]" - } - ] - } - }, - "const_mountPointPath": "[concat('/mnt/', variables('name_share'))]", - "const_publicIPAddressType": "Dynamic", - "const_vmSize": "[parameters('vmSize')]", - "const_wlsHome": "/u01/app/wls/install/oracle/middleware/oracle_home", - "const_wlsDomainPath": "/u01/domains", - "name_appGateway": "myAppGateway", - "name_appGatewayCertificate": "appGwSslCertificate", - "name_appGatewaySubnet": "appGatewaySubnet", - "name_availabilitySet": "WLSCluster-AvailabilitySet", - "name_backendAddressPool": "myGatewayBackendPool", - "name_frontEndIPConfig": "appGwPublicFrontendIp", - "name_httpListener": "HTTPListener", - "name_httpPort": "http_port", - "name_httpsListener": "HTTPSListener", - "name_httpsPort": "https_port", - "name_httpSetting": "myHTTPSetting", - "name_linuxImageOfferSKU": "[first(split(parameters('skuUrnVersion'), ';'))]", - "name_linuxImageVersion": "[last(split(parameters('skuUrnVersion'),';'))]", - "name_nic": "_NIC", - "name_probe": "HTTPhealthProbe", - "name_publicIPAddress": "_PublicIP", - "name_scriptELKConfiguration": "elkIntegration.sh", - "name_scriptFile": "addnode.sh", - "name_share": "wlsshare", - "name_subnet": "[parameters('subnetName')]", - "name_virtualNetwork": "[parameters('virtualNetworkName')]", - "name_vmMachine": "[concat(parameters('managedServerPrefix'),'VM')]", - "ref_backendAddressPool": "[resourceId('Microsoft.Network/applicationGateways/backendAddressPools', variables('name_appGateway'),variables('name_backendAddressPool'))]", - "ref_backendHttpSettings": "[resourceId('Microsoft.Network/applicationGateways/backendHttpSettingsCollection', variables('name_appGateway'),variables('name_httpSetting'))]", - "ref_backendProbe": "[resourceId('Microsoft.Network/applicationGateways/probes', variables('name_appGateway'),variables('name_probe'))]", - "ref_frontendHTTPPort": "[resourceId('Microsoft.Network/applicationGateways/frontendPorts', variables('name_appGateway'),variables('name_httpPort'))]", - "ref_frontendHTTPSPort": "[resourceId('Microsoft.Network/applicationGateways/frontendPorts', variables('name_appGateway'),variables('name_httpsPort'))]", - "ref_frontendIPConfiguration": "[resourceId('Microsoft.Network/applicationGateways/frontendIPConfigurations', variables('name_appGateway'),variables('name_frontEndIPConfig'))]", - "ref_httpListener": "[resourceId('Microsoft.Network/applicationGateways/httpListeners', variables('name_appGateway'),variables('name_httpListener'))]", - "ref_httpsListener": "[resourceId('Microsoft.Network/applicationGateways/httpListeners', variables('name_appGateway'),variables('name_httpsListener'))]", - "ref_sslCertificate": "[resourceId('Microsoft.Network/applicationGateways/sslCertificates', variables('name_appGateway'),variables('name_appGatewayCertificate'))]", - "ref_subnet": "[resourceId(parameters('virtualNetworkResourceGroupName'), 'Microsoft.Network/virtualNetworks/subnets', variables('name_virtualNetwork'), variables('name_subnet'))]", - "name_customHostnameGeneratorscriptFile": "generateCustomHostNameVerifier.sh", - "name_customHostnameVerifierJavaFile": "src/main/java/WebLogicCustomHostNameVerifier.java", - "name_customHostnameValuesTemplate": "src/main/java/HostNameValuesTemplate.txt", - "name_customHostnameVerifierTest" : "src/test/java/WebLogicCustomHostNameVerifierTest.java" - }, - "functions": [ - { - "namespace": "array", - "members": { - "join": { - "parameters": [ - { - "name": "items", - "type": "array" - } - ], - "output": { - "type": "string", - "value": "[replace(replace(replace(string(parameters('items')), '[\"', ''), '\"]', ''), '\",\"', ',')]" - } - } - } - } - ], - "resources": [ - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${cluster.addnode.start}", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [] - } - } - }, - { - "apiVersion": "${azure.apiVersionForPublicIPAddresses}", - "type": "Microsoft.Network/publicIPAddresses", - "name": "[concat(variables('name_vmMachine'),copyIndex(variables('const_appNodeMachineOffset')),variables('name_publicIPAddress'))]", - "location": "[parameters('location')]", - "copy": { - "name": "publicIPLoop", - "count": "[parameters('numberOfNewNodes')]" - }, - "properties": { - "publicIPAllocationMethod": "[variables('const_publicIPAddressType')]", - "dnsSettings": { - "domainNameLabel": "[concat(toLower(parameters('dnsLabelPrefix')),copyindex(),'-',take(replace(parameters('guidValue'),'-',''),10),'-',toLower(parameters('wlsDomainName')))]" - } - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualNetworks}", - "type": "Microsoft.Network/virtualNetworks/subnets", - "name": "[concat(variables('name_virtualNetwork'), '/', variables('name_subnet'))]", - "condition": "[and(empty(variables('name_virtualNetwork')), empty(variables('name_subnet')))]" - }, - { - "apiVersion": "${azure.apiVersionForNetworkInterfaces}", - "type": "Microsoft.Network/networkInterfaces", - "name": "[concat(variables('name_vmMachine'),copyIndex(variables('const_appNodeMachineOffset')), variables('name_nic'))]", - "location": "[parameters('location')]", - "copy": { - "name": "nicLoop", - "count": "[parameters('numberOfNewNodes')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.Network/publicIPAddresses/', concat(variables('name_vmMachine'),copyIndex(variables('const_appNodeMachineOffset')),variables('name_publicIPAddress')))]" - ], - "properties": { - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses',concat(variables('name_vmMachine'),copyIndex(variables('const_appNodeMachineOffset')),variables('name_publicIPAddress')))]" - }, - "subnet": { - "id": "[variables('ref_subnet')]" - } - } - } - ], - "dnsSettings": { - "internalDnsNameLabel": "[concat(variables('name_vmMachine'), copyIndex(variables('const_appNodeMachineOffset')))]" - } - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines", - "name": "[concat(variables('name_vmMachine'), copyIndex(variables('const_appNodeMachineOffset')))]", - "location": "[parameters('location')]", - "copy": { - "name": "virtualMachineLoop", - "count": "[parameters('numberOfNewNodes')]" - }, - "dependsOn": [ - "nicLoop" - ], - "properties": { - "availabilitySet": { - "id": "[resourceId('Microsoft.Compute/availabilitySets',variables('name_availabilitySet'))]" - }, - "hardwareProfile": { - "vmSize": "[variables('const_vmSize')]" - }, - "osProfile": { - "computerName": "[concat(variables('name_vmMachine'), copyIndex(variables('const_appNodeMachineOffset')))]", - "adminUsername": "[parameters('adminUsername')]", - "adminPassword": "[parameters('adminPasswordOrKey')]", - "linuxConfiguration": "[if(equals(parameters('authenticationType'), 'password'), json('null'), variables('const_linuxConfiguration'))]" - }, - "storageProfile": { - "imageReference": { - "publisher": "[variables('const_imagePublisher')]", - "offer": "[variables('const_imageOffer')]", - "sku": "[variables('name_linuxImageOfferSKU')]", - "version": "[variables('name_linuxImageVersion')]" - }, - "osDisk": { - "createOption": "FromImage", - "managedDisk": { - "storageAccountType": "Standard_LRS" - } - } - }, - "networkProfile": { - "networkInterfaces": [ - { - "id": "[resourceId('Microsoft.Network/networkInterfaces',concat(variables('name_vmMachine'), copyIndex(variables('const_appNodeMachineOffset')), variables('name_nic')))]" - } - ] - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": true, - "storageUri": "[reference(resourceId('Microsoft.Storage/storageAccounts/', parameters('storageAccountName')), '${azure.apiVersionForStorage}').primaryEndpoints.blob]" - } - } - }, - "plan": { - "name": "[variables('name_linuxImageOfferSKU')]", - "publisher": "[variables('const_imagePublisher')]", - "product": "[variables('const_imageOffer')]" - } - }, - { - "type": "Microsoft.Network/applicationGateways", - "apiVersion": "${azure.apiVersionForApplicationGateways}", - "condition": "[parameters('appGatewaySettings').enable]", - "name": "[variables('name_appGateway')]", - "location": "[parameters('location')]", - "dependsOn": [ - "virtualMachineLoop" - ], - "properties": { - "sku": { - "name": "WAF_v2", - "tier": "WAF_v2" - }, - "gatewayIPConfigurations": [ - { - "name": "appGatewayIpConfig", - "properties": { - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets',variables('name_virtualNetwork'),variables('name_appGatewaySubnet'))]" - } - }, - "type": "Microsoft.Network/applicationGateways/gatewayIPConfigurations" - } - ], - "frontendIPConfigurations": [ - { - "name": "appGwPublicFrontendIp", - "type": "Microsoft.Network/applicationGateways/frontendIPConfigurations", - "properties": { - "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('appGatewaySettings').publicIPName)]" - } - } - } - ], - "frontendPorts": [ - { - "name": "http_port", - "properties": { - "port": "[int(variables('const_appGatewayFrontEndHTTPPort'))]" - }, - "type": "Microsoft.Network/applicationGateways/frontendPorts" - }, - { - "name": "https_port", - "properties": { - "port": "[int(variables('const_appGatewayFrontEndHTTPSPort'))]" - }, - "type": "Microsoft.Network/applicationGateways/frontendPorts" - } - ], - "sslCertificates": [ - { - "name": "appGwSslCertificate", - "properties": { - "data": "[parameters('appGatewaySettings').certificateBase64String]", - "password": "[parameters('appGatewaySettings').certificatePassword]" - } - } - ], - "backendAddressPools": [ - { - "name": "myGatewayBackendPool", - "properties": { - "copy": [ - { - "name": "BackendAddresses", - "count": "[add(add(int(parameters('numberOfNewNodes')),int(variables('const_appNodeMachineOffset'))), -1)]", - "input": { - "fqdn": "[concat(variables('name_vmMachine'), copyIndex('BackendAddresses',1))]" - } - } - ] - }, - "type": "Microsoft.Network/applicationGateways/backendAddressPools" - } - ], - "backendHttpSettingsCollection": [ - { - "name": "myHTTPSetting", - "properties": { - "provisioningState": "Succeeded", - "port": "[int(variables('const_backendPort'))]", - "protocol": "Http", - "cookieBasedAffinity": "Enabled", - "pickHostNameFromBackendAddress": true, - "affinityCookieName": "ApplicationGatewayAffinity", - "requestTimeout": 20, - "probe": { - "id": "[variables('ref_backendProbe')]" - } - }, - "type": "Microsoft.Network/applicationGateways/backendHttpSettingsCollection" - } - ], - "httpListeners": [ - { - "name": "HTTPListener", - "properties": { - "frontendIPConfiguration": { - "id": "[variables('ref_frontendIPConfiguration')]" - }, - "frontendPort": { - "id": "[variables('ref_frontendHTTPPort')]" - }, - "protocol": "Http", - "requireServerNameIndication": false - }, - "type": "Microsoft.Network/applicationGateways/httpListeners" - }, - { - "name": "HTTPSListener", - "properties": { - "frontendIPConfiguration": { - "id": "[variables('ref_frontendIPConfiguration')]" - }, - "frontendPort": { - "id": "[variables('ref_frontendHTTPSPort')]" - }, - "protocol": "Https", - "requireServerNameIndication": false, - "SslCertificate": { - "id": "[variables('ref_sslCertificate')]" - } - }, - "type": "Microsoft.Network/applicationGateways/httpListeners" - } - - ], - "requestRoutingRules": [ - { - "name": "HTTPRoutingRule", - "properties": { - "ruleType": "Basic", - "priority": 1000, - "httpListener": { - "id": "[variables('ref_httpListener')]" - }, - "backendAddressPool": { - "id": "[variables('ref_backendAddressPool')]" - }, - "backendHttpSettings": { - "id": "[variables('ref_backendHttpSettings')]" - } - }, - "type": "Microsoft.Network/applicationGateways/requestRoutingRules" - }, - { - "name": "HTTPSRoutingRule", - "properties": { - "ruleType": "Basic", - "priority": 1001, - "httpListener": { - "id": "[variables('ref_httpsListener')]" - }, - "backendAddressPool": { - "id": "[variables('ref_backendAddressPool')]" - }, - "backendHttpSettings": { - "id": "[variables('ref_backendHttpSettings')]" - } - }, - "type": "Microsoft.Network/applicationGateways/requestRoutingRules" - } - ], - "probes": [ - { - "name": "HTTPhealthProbe", - "properties": { - "protocol": "Http", - "path": "/weblogic/ready", - "interval": 30, - "timeout": 30, - "unhealthyThreshold": 3, - "pickHostNameFromBackendHttpSettings": true, - "minServers": 0, - "match": { - "statusCodes": [ - "200-399" - ] - } - }, - "type": "Microsoft.Network/applicationGateways/probes" - } - ], - "enableHttp2": false, - "autoscaleConfiguration": { - "minCapacity": 2, - "maxCapacity": 3 - } - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines/extensions", - "name": "[concat(variables('name_vmMachine'), copyIndex(variables('const_appNodeMachineOffset')), '/newuserscript')]", - "location": "[parameters('location')]", - "copy": { - "name": "virtualMachineExtensionLoop", - "count": "[parameters('numberOfNewNodes')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/', concat(variables('name_vmMachine'), copyIndex(variables('const_appNodeMachineOffset'))))]" - ], - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.0", - "autoUpgradeMinorVersion": true, - "settings": { - "fileUris": [ - "[uri(parameters('_artifactsLocation'), concat('scripts/', variables('name_scriptFile'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocation'), concat('../../../arm-oraclelinux-wls-cluster/src/main/scripts/', variables('name_scriptELKConfiguration'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocation'), concat('../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameGeneratorscriptFile'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocation'), concat('../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameVerifierJavaFile'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocation'), concat('../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameValuesTemplate'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocation'), concat('../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameVerifierTest'), parameters('_artifactsLocationSasToken')))]" - - ] - }, - "protectedSettings": { - "commandToExecute": "[concat('sh',' ',variables('name_scriptFile'),' <<< \"',parameters('wlsDomainName'),' ',parameters('wlsUserName'),' ',parameters('wlsPassword'),' ',parameters('managedServerPrefix'),' ', copyIndex(variables('const_appNodeMachineOffset')),' ', parameters('adminURL'),' ',parameters('adminVMName'),' ',variables('const_wlsHome'),' ',variables('const_wlsDomainPath'),' ',parameters('storageAccountName'), ' ', listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName')), '${azure.apiVersionForStorage}').keys[0].value,' ', variables('const_mountPointPath'),' ', if(parameters('aadsSettings').enable, parameters('aadsSettings').certificateBase64String, 'null'),' ',if(parameters('aadsSettings').enable, parameters('aadsSettings').publicIP, 'null'),' ', if(parameters('aadsSettings').enable, parameters('aadsSettings').serverHost, 'null'),' ',if(parameters('appGatewaySettings').enable, reference(resourceId('Microsoft.Network/publicIPAddresses', parameters('appGatewaySettings').publicIPName),'${azure.apiVersionForPublicIPAddresses}').dnsSettings.fqdn, 'null'), ' ',parameters('elkSettings').enable, ' ',parameters('elkSettings').elasticsearchEndpoint,' ', parameters('elkSettings').elasticsearchUserName,' ', parameters('elkSettings').elasticsearchPassword, ' ', array.join(parameters('elkSettings').logsToIntegrate), ' ',parameters('elkSettings').logIndex, ' ', parameters('enableCoherence'),' ',if(parameters('enableDNSConfiguration'),parameters('customDNSNameForAdminServer'),parameters('adminVMName')),' ',parameters('dnsLabelPrefix'),' ',parameters('location'),' ',parameters('customSSLSettings').enable,' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').customIdentityKeyStoreBase64String, 'null'),' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').customIdentityKeyStorePassPhrase, 'null'),' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').customIdentityKeyStoreType, 'null'),' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').customTrustKeyStoreBase64String, 'null'),' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').customTrustKeyStorePassPhrase, 'null'),' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').customTrustKeyStoreType, 'null'),' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').privateKeyAlias, 'null'),' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').privateKeyPassPhrase, 'null'),'\"')]" } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${cluster.addnode.end}", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [] - } - } - } - ], - "outputs": { - "wlsDomainLocation": { - "type": "string", - "value": "[concat('/u01/domains/', parameters('wlsDomainName'))]" - }, - "logIndex": { - "type": "string", - "value": "[if(parameters('elkSettings').enable, parameters('elkSettings').logIndex, '')]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/addnode/src/main/scripts/addnode.sh b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/addnode/src/main/scripts/addnode.sh deleted file mode 100644 index 4a099172f..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/addnode/src/main/scripts/addnode.sh +++ /dev/null @@ -1,861 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# Description -# This script is to add and configure new managed server node to existing WebLogic domain - -#Function to output message to StdErr -function echo_stderr () -{ - echo "$@" >&2 -} - -#Function to display usage message -function usage() -{ - echo_stderr "./addnode.sh <<< \"\"" -} - -function installUtilities() -{ - echo "Installing zip unzip wget vnc-server rng-tools cifs-utils" - sudo yum install -y zip unzip wget vnc-server rng-tools cifs-utils - - #Setting up rngd utils - attempt=1 - while [[ $attempt -lt 4 ]] - do - echo "Starting rngd service attempt $attempt" - sudo systemctl start rngd - attempt=`expr $attempt + 1` - sudo systemctl status rngd | grep running - if [[ $? == 0 ]]; - then - echo "rngd utility service started successfully" - break - fi - sleep 1m - done -} - -function validateInput() -{ - if [ -z "$wlsDomainName" ]; - then - echo_stderr "wlsDomainName is required. " - fi - - if [[ -z "$wlsUserName" || -z "$wlsPassword" ]] - then - echo_stderr "wlsUserName or wlsPassword is required. " - exit 1 - fi - - if [ -z "$managedServerPrefix" ]; - then - echo_stderr "managedServerPrefix is required. " - fi - - if [ -z "$serverIndex" ]; - then - echo_stderr "serverIndex is required. " - fi - - wlsServerName=${managedServerPrefix}${serverIndex} - - if [ -z "$wlsAdminURL" ]; - then - echo_stderr "wlsAdminURL is required. " - fi - - if [ -z "$oracleHome" ]; - then - echo_stderr "oracleHome is required. " - fi - - if [ -z "$wlsDomainPath" ]; - then - echo_stderr "wlsDomainPath is required. " - fi - - if [ -z "$storageAccountName" ]; - then - echo_stderr "storageAccountName is required. " - fi - - if [ -z "$storageAccountKey" ]; - then - echo_stderr "storageAccountKey is required. " - fi - - if [ -z "$mountpointPath" ]; - then - echo_stderr "mountpointPath is required. " - fi - - if [[ -z "$wlsADSSLCer" || -z "$wlsLDAPPublicIP" || -z "$adServerHost" ]] - then - echo_stderr "wlsADSSLCer, wlsLDAPPublicIP and adServerHost are required. " - exit 1 - fi - - if [[ "$wlsADSSLCer" != "null" && "$wlsLDAPPublicIP" != "null" && "$adServerHost" != "null" ]] - then - enableAAD="true" - fi - - if [ -z "$appGWHostName" ]; - then - echo_stderr "appGWHostName is required. " - fi - - if [ -z "$enableELK" ]; - then - echo_stderr "enableELK is required. " - fi - - if [ -z "$elasticURI" ]; - then - echo_stderr "elasticURI is required. " - fi - - if [ -z "$elasticUserName" ]; - then - echo_stderr "elasticUserName is required. " - fi - - if [ -z "$elasticPassword" ]; - then - echo_stderr "elasticPassword is required. " - fi - - if [ -z "$logsToIntegrate" ]; - then - echo_stderr "logsToIntegrate is required. " - fi - - if [ -z "$logIndex" ]; - then - echo_stderr "logIndex is required. " - fi - - if [ -z "$enableCoherence" ]; - then - echo_stderr "enableCoherence is required. " - fi - - if [ "${isCustomSSLEnabled}" == "true" ]; - then - if [[ -z "$customIdentityKeyStoreBase64String" || -z "$customIdentityKeyStorePassPhrase" || -z "$customIdentityKeyStoreType" || - -z "$customTrustKeyStoreBase64String" || -z "$customTrustKeyStorePassPhrase" || -z "$customTrustKeyStoreType" || - -z "$privateKeyAlias" || -z "$privateKeyPassPhrase" ]] - then - echo_stderr "customIdentityKeyStoreBase64String, customIdentityKeyStorePassPhrase, customIdentityKeyStoreType, customTrustKeyStoreBase64String, customTrustKeyStorePassPhrase, customTrustKeyStoreType, privateKeyAlias and privateKeyPassPhrase are required. " - exit 1 - fi - fi -} - -#Function to cleanup all temporary files -function cleanup() -{ - echo "Cleaning up temporary files..." - rm -rf $wlsDomainPath/managed-domain.yaml - rm -rf $wlsDomainPath/weblogic-deploy.zip - rm -rf $wlsDomainPath/weblogic-deploy - rm -rf $wlsDomainPath/*.py - rm -rf ${CUSTOM_HOSTNAME_VERIFIER_HOME} - echo "Cleanup completed." -} - -#Creates weblogic deployment model for cluster domain managed server -function create_managed_model() -{ - echo "Creating admin domain model" - cat <$wlsDomainPath/managed-domain.yaml -domainInfo: - AdminUserName: "$wlsUserName" - AdminPassword: "$wlsPassword" - ServerStartMode: prod -topology: - Name: "$wlsDomainName" - Machine: - '$nmHost': - NodeManager: - ListenAddress: "$nmHost" - ListenPort: $nmPort - NMType : ssl - Cluster: - '$wlsClusterName': - MigrationBasis: 'consensus' - Server: - '$wlsServerName' : - ListenPort: $wlsManagedPort - Notes: "$wlsServerName managed server" - Cluster: "$wlsClusterName" - Machine: "$nmHost" - ServerStart: - Arguments: '${SERVER_STARTUP_ARGS}' - SecurityConfiguration: - NodeManagerUsername: "$wlsUserName" - NodeManagerPasswordEncrypted: "$wlsPassword" -EOF -} - -#This function to add machine for a given managed server -function create_machine_model() -{ - echo "Creating machine name model for managed server $wlsServerName" - cat <$wlsDomainPath/add-machine.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -edit("$wlsServerName") -startEdit() -cd('/') -cmo.createMachine('$nmHost') -cd('/Machines/$nmHost/NodeManager/$nmHost') -cmo.setListenPort(int($nmPort)) -cmo.setListenAddress('$nmHost') -cmo.setNMType('ssl') -save() -resolve() -activate() -destroyEditSession("$wlsServerName") -disconnect() -EOF -} - -#This function to add managed serverto admin node -function create_ms_server_model() -{ - echo "Creating managed server $wlsServerName model" - - cat <$wlsDomainPath/add-server.py - -isCustomSSLEnabled='${isCustomSSLEnabled}' - -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -edit("$wlsServerName") -startEdit() -cd('/') -cmo.createServer('$wlsServerName') -cd('/Servers/$wlsServerName') -cmo.setMachine(getMBean('/Machines/$nmHost')) -cmo.setCluster(getMBean('/Clusters/$wlsClusterName')) -cmo.setListenAddress('$nmHost') -cmo.setListenPort(int($wlsManagedPort)) -cmo.setListenPortEnabled(true) - -if isCustomSSLEnabled == 'true' : - cmo.setKeyStores('CustomIdentityAndCustomTrust') - cmo.setCustomIdentityKeyStoreFileName('$customSSLIdentityKeyStoreFile') - cmo.setCustomIdentityKeyStoreType('$customIdentityKeyStoreType') - set('CustomIdentityKeyStorePassPhrase', '$customIdentityKeyStorePassPhrase') - cmo.setCustomTrustKeyStoreFileName('$customSSLTrustKeyStoreFile') - cmo.setCustomTrustKeyStoreType('$customTrustKeyStoreType') - set('CustomTrustKeyStorePassPhrase', '$customTrustKeyStorePassPhrase') - - cd('/Servers/$wlsServerName/SSL/$wlsServerName') - cmo.setServerPrivateKeyAlias('$privateKeyAlias') - set('ServerPrivateKeyPassPhrase', '$privateKeyPassPhrase') - -cd('/Servers/$wlsServerName/ServerStart/$wlsServerName') -arguments = '${SERVER_STARTUP_ARGS} -Dweblogic.Name=$wlsServerName ' -oldArgs = cmo.getArguments() -if oldArgs != None: - newArgs = oldArgs + ' ' + arguments -else: - newArgs = arguments -cmo.setArguments(newArgs) -EOF - - if [ "$appGWHostName" != "null" ]; then - cat <>$wlsDomainPath/add-server.py -cd('/Servers/$wlsServerName') -create('T3Channel','NetworkAccessPoint') -cd('/Servers/$wlsServerName/NetworkAccessPoints/T3Channel') -set('Protocol','t3') -set('ListenAddress','') -set('ListenPort',$channelPort) -set('PublicAddress', '$appGWHostName') -set('PublicPort', $channelPort) -set('Enabled','true') - -cd('/Servers/$wlsServerName') -create('HTTPChannel','NetworkAccessPoint') -cd('/Servers/$wlsServerName/NetworkAccessPoints/HTTPChannel') -set('Protocol','http') -set('ListenAddress','') -set('ListenPort',$channelPort) -set('PublicAddress', '$appGWHostName') -set('PublicPort', $channelPort) -set('Enabled','true') -EOF - fi - -cat <>$wlsDomainPath/add-server.py -cd('/Servers/$wlsServerName/SSL/$wlsServerName') -cmo.setEnabled(false) -EOF - - if [ "${enableAAD}" == "true" ]; then - cat <>$wlsDomainPath/add-server.py -#need to revisit this as HostNameVerification is not supported -#cmo.setHostnameVerificationIgnored(true) -EOF - fi - - . $oracleHome/oracle_common/common/bin/setWlstEnv.sh - ${JAVA_HOME}/bin/java -version 2>&1 | grep -e "1[.]8[.][0-9]*_" > /dev/null - java8Status=$? - if [ "${java8Status}" == "0" ]; then - cat <>$wlsDomainPath/add-server.py -cd('/Servers/$wlsServerName//ServerStart/$wlsServerName') -arguments = '-Dweblogic.Name=$wlsServerName -Dweblogic.management.server=http://$wlsAdminURL -Djdk.tls.client.protocols=TLSv1.2' -EOF -else - cat <>$wlsDomainPath/add-server.py -cd('/Servers/$wlsServerName//ServerStart/$wlsServerName') -arguments = '-Dweblogic.Name=$wlsServerName -Dweblogic.management.server=http://$wlsAdminURL' -EOF - fi - - if [[ "${enableELK,,}" == "true" ]]; then - cat <>$wlsDomainPath/add-server.py -cd('/Servers/$wlsServerName/WebServer/$wlsServerName/WebServerLog/$wlsServerName') -cmo.setLogFileFormat('extended') -cmo.setELFFields('date time time-taken bytes c-ip s-ip c-dns s-dns cs-method cs-uri sc-status sc-comment ctx-ecid ctx-rid') - -cd('/Servers/$wlsServerName/Log/$wlsServerName') -cmo.setRedirectStderrToServerLogEnabled(true) -cmo.setRedirectStdoutToServerLogEnabled(true) -cmo.setStdoutLogStack(true) -EOF - fi - - if [[ "${enableCoherence,,}" == "true" ]]; then - cat <>$wlsDomainPath/add-server.py -arguments = arguments + ' -Dcoherence.localport=$coherenceLocalport -Dcoherence.localport.adjust=$coherenceLocalportAdjust' -EOF - fi - - cat <>$wlsDomainPath/add-server.py -cd('/Servers/$wlsServerName//ServerStart/$wlsServerName') -oldArgs = cmo.getArguments() -if oldArgs != None: - newArgs = oldArgs + ' ' + arguments -else: - newArgs = arguments -cmo.setArguments(newArgs) -save() -resolve() -activate() -destroyEditSession("$wlsServerName") -nmEnroll('$wlsDomainPath/$wlsDomainName','$wlsDomainPath/$wlsDomainName/nodemanager') -nmGenBootStartupProps('$wlsServerName') -disconnect() -EOF -} - -#This function to wait for admin server -function wait_for_admin() -{ - #wait for admin to start -count=1 -CHECK_URL="http://$wlsAdminURL/weblogic/ready" -status=`curl --insecure -ILs $CHECK_URL | tac | grep -m1 HTTP/1.1 | awk {'print $2'}` -echo "Waiting for admin server to start" -while [[ "$status" != "200" ]] -do - echo "." - count=$((count+1)) - if [ $count -le 30 ]; - then - sleep 1m - else - echo "Error : Maximum attempts exceeded while starting admin server" - exit 1 - fi - status=`curl --insecure -ILs $CHECK_URL | tac | grep -m1 HTTP/1.1 | awk {'print $2'}` - if [ "$status" == "200" ]; - then - echo "Server $wlsServerName started succesfully..." - break - fi -done -} - -# Create systemctl service for nodemanager -function create_nodemanager_service() -{ - echo "Setting CrashRecoveryEnabled true at $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties" - sed -i.bak -e 's/CrashRecoveryEnabled=false/CrashRecoveryEnabled=true/g' $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - if [ $? != 0 ]; - then - echo "Warning : Failed in setting option CrashRecoveryEnabled=true. Continuing without the option." - mv $wlsDomainPath/nodemanager/nodemanager.properties.bak $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - fi - -if [ "${isCustomSSLEnabled}" == "true" ]; -then - echo "KeyStores=CustomIdentityAndCustomTrust" >> $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomIdentityKeystoreType=${customIdentityKeyStoreType}" >> $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomIdentityKeyStoreFileName=${customSSLIdentityKeyStoreFile}" >> $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomIdentityKeyStorePassPhrase=${customIdentityKeyStorePassPhrase}" >> $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomIdentityAlias=${privateKeyAlias}" >> $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomIdentityPrivateKeyPassPhrase=${privateKeyPassPhrase}" >> $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomTrustKeystoreType=${customTrustKeyStoreType}" >> $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomTrustKeyStoreFileName=${customSSLTrustKeyStoreFile}" >> $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomTrustKeyStorePassPhrase=${customTrustKeyStorePassPhrase}" >> $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties -fi - - sudo chown -R $username:$groupname $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties* - echo "Creating NodeManager service" - cat </etc/systemd/system/wls_nodemanager.service - [Unit] -Description=WebLogic nodemanager service - -[Service] -Type=simple -# Note that the following three parameters should be changed to the correct paths -# on your own system -WorkingDirectory=$wlsDomainPath/$wlsDomainName -Environment="JAVA_OPTIONS=${SERVER_STARTUP_ARGS}" -ExecStart="$wlsDomainPath/$wlsDomainName/bin/startNodeManager.sh" -ExecStop="$wlsDomainPath/$wlsDomainName/bin/stopNodeManager.sh" -User=oracle -Group=oracle -KillMode=process -LimitNOFILE=65535 - -[Install] -WantedBy=multi-user.target -EOF -} - -#This function to start managed server -function start_managed() -{ - echo "Starting managed server $wlsServerName" - cat <$wlsDomainPath/start-server.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -try: - start('$wlsServerName', 'Server') -except: - print "Failed starting managed server $wlsServerName" - dumpStack() -disconnect() -EOF -sudo chown -R $username:$groupname $wlsDomainPath -runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST $wlsDomainPath/start-server.py" -if [[ $? != 0 ]]; then - echo "Error : Failed in starting managed server $wlsServerName" - exit 1 -fi -} - -# Create managed server setup -function create_managedSetup(){ - echo "Creating Managed Server Setup" - cd $wlsDomainPath - wget -q $WEBLOGIC_DEPLOY_TOOL - if [[ $? != 0 ]]; then - echo "Error : Downloading weblogic-deploy-tool failed" - exit 1 - fi - sudo unzip -o weblogic-deploy.zip -d $wlsDomainPath - echo "Creating managed server model files" - create_managed_model - create_machine_model - create_ms_server_model - echo "Completed managed server model files" - sudo chown -R $username:$groupname $wlsDomainPath - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; $wlsDomainPath/weblogic-deploy/bin/createDomain.sh -oracle_home $oracleHome -domain_parent $wlsDomainPath -domain_type WLS -model_file $wlsDomainPath/managed-domain.yaml" - if [[ $? != 0 ]]; then - echo "Error : Managed setup failed" - exit 1 - fi - wait_for_admin - - # For issue https://github.com/wls-eng/arm-oraclelinux-wls/issues/89 - getSerializedSystemIniFileFromShare - - echo "Adding machine to managed server $wlsServerName" - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST $wlsDomainPath/add-machine.py" - if [[ $? != 0 ]]; then - echo "Error : Adding machine for managed server $wlsServerName failed" - exit 1 - fi - echo "Adding managed server $wlsServerName" - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST $wlsDomainPath/add-server.py" - if [[ $? != 0 ]]; then - echo "Error : Adding server $wlsServerName failed" - exit 1 - fi -} - -function enabledAndStartNodeManagerService() -{ - sudo systemctl enable wls_nodemanager - sudo systemctl daemon-reload - attempt=1 - while [[ $attempt -lt 6 ]] - do - echo "Starting nodemanager service attempt $attempt" - sudo systemctl start wls_nodemanager - attempt=`expr $attempt + 1` - sudo systemctl status wls_nodemanager | grep running - if [[ $? == 0 ]]; - then - echo "wls_nodemanager service started successfully" - break - fi - sleep 3m - done -} - -function updateNetworkRules() -{ - # for Oracle Linux 7.3, 7.4, iptable is not running. - if [ -z `command -v firewall-cmd` ]; then - return 0 - fi - - # for Oracle Linux 7.6, open weblogic ports - tag=$1 - if [ ${tag} == 'admin' ]; then - echo "update network rules for admin server" - sudo firewall-cmd --zone=public --add-port=$wlsAdminPort/tcp - sudo firewall-cmd --zone=public --add-port=$wlsAdminChannelPort/tcp - sudo firewall-cmd --zone=public --add-port=$wlsSSLAdminPort/tcp - sudo firewall-cmd --zone=public --add-port=$wlsManagedPort/tcp - sudo firewall-cmd --zone=public --add-port=$nmPort/tcp - else - echo "update network rules for managed server" - sudo firewall-cmd --zone=public --add-port=$wlsManagedPort/tcp - sudo firewall-cmd --zone=public --add-port=$nmPort/tcp - - # open ports for coherence - sudo firewall-cmd --zone=public --add-port=$coherenceListenPort/tcp - sudo firewall-cmd --zone=public --add-port=$coherenceListenPort/udp - sudo firewall-cmd --zone=public --add-port=$coherenceLocalport-$coherenceLocalportAdjust/tcp - sudo firewall-cmd --zone=public --add-port=$coherenceLocalport-$coherenceLocalportAdjust/udp - sudo firewall-cmd --zone=public --add-port=7/tcp - fi - - sudo firewall-cmd --runtime-to-permanent - sudo systemctl restart firewalld -} - -# Mount the Azure file share on all VMs created -function mountFileShare() -{ - echo "Creating mount point" - echo "Mount point: $mountpointPath" - sudo mkdir -p $mountpointPath - if [ ! -d "/etc/smbcredentials" ]; then - sudo mkdir /etc/smbcredentials - fi - if [ ! -f "/etc/smbcredentials/${storageAccountName}.cred" ]; then - echo "Crearing smbcredentials" - echo "username=$storageAccountName >> /etc/smbcredentials/${storageAccountName}.cred" - echo "password=$storageAccountKey >> /etc/smbcredentials/${storageAccountName}.cred" - sudo bash -c "echo "username=$storageAccountName" >> /etc/smbcredentials/${storageAccountName}.cred" - sudo bash -c "echo "password=$storageAccountKey" >> /etc/smbcredentials/${storageAccountName}.cred" - fi - echo "chmod 600 /etc/smbcredentials/${storageAccountName}.cred" - sudo chmod 600 /etc/smbcredentials/${storageAccountName}.cred - echo "//${storageAccountName}.file.core.windows.net/wlsshare $mountpointPath cifs nofail,vers=2.1,credentials=/etc/smbcredentials/${storageAccountName}.cred,dir_mode=0777,file_mode=0777,serverino" - sudo bash -c "echo \"//${storageAccountName}.file.core.windows.net/wlsshare $mountpointPath cifs nofail,vers=2.1,credentials=/etc/smbcredentials/${storageAccountName}.cred,dir_mode=0777,file_mode=0777,serverino\" >> /etc/fstab" - echo "mount -t cifs //${storageAccountName}.file.core.windows.net/wlsshare $mountpointPath -o vers=2.1,credentials=/etc/smbcredentials/${storageAccountName}.cred,dir_mode=0777,file_mode=0777,serverino" - sudo mount -t cifs //${storageAccountName}.file.core.windows.net/wlsshare $mountpointPath -o vers=2.1,credentials=/etc/smbcredentials/${storageAccountName}.cred,dir_mode=0777,file_mode=0777,serverino - if [[ $? != 0 ]]; - then - echo "Failed to mount //${storageAccountName}.file.core.windows.net/wlsshare $mountpointPath" - exit 1 - fi -} - -# Get SerializedSystemIni.dat file from share point to managed server vm -function getSerializedSystemIniFileFromShare() -{ - runuser -l oracle -c "mv ${wlsDomainPath}/${wlsDomainName}/security/SerializedSystemIni.dat ${wlsDomainPath}/${wlsDomainName}/security/SerializedSystemIni.dat.backup" - runuser -l oracle -c "cp ${mountpointPath}/SerializedSystemIni.dat ${wlsDomainPath}/${wlsDomainName}/security/." - ls -lt ${wlsDomainPath}/${wlsDomainName}/security/SerializedSystemIni.dat - if [[ $? != 0 ]]; - then - echo "Failed to get ${mountpointPath}/SerializedSystemIni.dat" - exit 1 - fi - runuser -l oracle -c "chmod 640 ${wlsDomainPath}/${wlsDomainName}/security/SerializedSystemIni.dat" -} - -function mapLDAPHostWithPublicIP() -{ - echo "map LDAP host with pubilc IP" - - # remove existing ip address for the same host - sudo sed -i '/${adServerHost}/d' /etc/hosts - sudo echo "${wlsLDAPPublicIP} ${adServerHost}" >> /etc/hosts -} - -function parseLDAPCertificate() -{ - echo "create key store" - cer_begin=0 - cer_size=${#wlsADSSLCer} - cer_line_len=64 - mkdir ${SCRIPT_PWD}/security - touch ${SCRIPT_PWD}/security/AzureADLDAPCerBase64String.txt - while [ ${cer_begin} -lt ${cer_size} ] - do - cer_sub=${wlsADSSLCer:$cer_begin:$cer_line_len} - echo ${cer_sub} >> ${SCRIPT_PWD}/security/AzureADLDAPCerBase64String.txt - cer_begin=$((cer_begin+$cer_line_len)) - done - - openssl base64 -d -in ${SCRIPT_PWD}/security/AzureADLDAPCerBase64String.txt -out ${SCRIPT_PWD}/security/AzureADTrust.cer - addsCertificate=${SCRIPT_PWD}/security/AzureADTrust.cer -} - -function importAADCertificate() -{ - # import the key to java security - . $oracleHome/oracle_common/common/bin/setWlstEnv.sh - # For Entra ID failure: exception happens when importing certificate to JDK 11.0.7 - # ISSUE: https://github.com/wls-eng/arm-oraclelinux-wls/issues/109 - # JRE was removed since JDK 11. - java_version=$(java -version 2>&1 | sed -n ';s/.* version "\(.*\)\.\(.*\)\..*"/\1\2/p;') - if [ ${java_version:0:3} -ge 110 ]; - then - java_cacerts_path=${JAVA_HOME}/lib/security/cacerts - else - java_cacerts_path=${JAVA_HOME}/jre/lib/security/cacerts - fi - - # remove existing certificate. - queryAADTrust=$(${JAVA_HOME}/bin/keytool -list -keystore ${java_cacerts_path} -storepass changeit | grep "aadtrust") - if [ -n "${queryAADTrust}" ]; - then - sudo ${JAVA_HOME}/bin/keytool -delete -alias aadtrust -keystore ${java_cacerts_path} -storepass changeit - fi - - sudo ${JAVA_HOME}/bin/keytool -noprompt -import -alias aadtrust -file ${addsCertificate} -keystore ${java_cacerts_path} -storepass changeit -} - -function importAADCertificateIntoWLSCustomTrustKeyStore() -{ - if [ "${isCustomSSLEnabled,,}" == "true" ]; - then - # set java home - . $oracleHome/oracle_common/common/bin/setWlstEnv.sh - - #validate Trust keystore - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; keytool -list -v -keystore $customSSLTrustKeyStoreFile -storepass $customTrustKeyStorePassPhrase -storetype $customTrustKeyStoreType | grep 'Entry type:' | grep 'trustedCertEntry'" - - if [[ $? != 0 ]]; then - echo "Error : Trust Keystore Validation Failed !!" - exit 1 - fi - - # For SSL enabled causes Entra ID failure #225 - # ISSUE: https://github.com/wls-eng/arm-oraclelinux-wls/issues/225 - - echo "Importing Entra ID Certificate into WLS Custom Trust Key Store: " - - sudo ${JAVA_HOME}/bin/keytool -noprompt -import -trustcacerts -keystore {KEYSTORE_PATH}/trust.keystore -storepass ${customTrustKeyStorePassPhrase} -alias aadtrust -file ${addsCertificate} -storetype ${customTrustKeyStoreType} - else - echo "customSSL not enabled. Not required to configure Entra ID for WebLogic Custom SSL" - fi -} - -function validateSSLKeyStores() -{ - sudo chown -R $username:$groupname $KEYSTORE_PATH - - #validate identity keystore - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; keytool -list -v -keystore $customSSLIdentityKeyStoreFile -storepass $customIdentityKeyStorePassPhrase -storetype $customIdentityKeyStoreType | grep 'Entry type:' | grep 'PrivateKeyEntry'" - - if [[ $? != 0 ]]; then - echo "Error : Identity Keystore Validation Failed !!" - exit 1 - fi - - #validate Trust keystore - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; keytool -list -v -keystore $customSSLTrustKeyStoreFile -storepass $customTrustKeyStorePassPhrase -storetype $customTrustKeyStoreType | grep 'Entry type:' | grep 'trustedCertEntry'" - - if [[ $? != 0 ]]; then - echo "Error : Trust Keystore Validation Failed !!" - exit 1 - fi - - echo "ValidateSSLKeyStores Successfull !!" -} - -function parseAndSaveCustomSSLKeyStoreData() -{ - echo "create key stores for custom ssl settings" - - mkdir -p ${KEYSTORE_PATH} - touch ${KEYSTORE_PATH}/identityKeyStoreCerBase64String.txt - - echo "$customIdentityKeyStoreBase64String" > ${KEYSTORE_PATH}/identityKeyStoreCerBase64String.txt - cat ${KEYSTORE_PATH}/identityKeyStoreCerBase64String.txt | base64 -d > ${KEYSTORE_PATH}/identity.keystore - customSSLIdentityKeyStoreFile=${KEYSTORE_PATH}/identity.keystore - customIdentityKeyStorePassPhrase="$(echo $customIdentityKeyStorePassPhrase | base64 --decode)" - - rm -rf ${KEYSTORE_PATH}/identityKeyStoreCerBase64String.txt - - mkdir -p ${KEYSTORE_PATH} - touch ${KEYSTORE_PATH}/trustKeyStoreCerBase64String.txt - - echo "$customTrustKeyStoreBase64String" > ${KEYSTORE_PATH}/trustKeyStoreCerBase64String.txt - cat ${KEYSTORE_PATH}/trustKeyStoreCerBase64String.txt | base64 -d > ${KEYSTORE_PATH}/trust.keystore - customSSLTrustKeyStoreFile=${KEYSTORE_PATH}/trust.keystore - customTrustKeyStorePassPhrase="$(echo $customTrustKeyStorePassPhrase | base64 --decode)" - - rm -rf ${KEYSTORE_PATH}/trustKeyStoreCerBase64String.txt - - privateKeyAlias="$(echo $privateKeyAlias | base64 --decode)" - privateKeyPassPhrase="$(echo $privateKeyPassPhrase | base64 --decode)" - - validateSSLKeyStores -} - -function generateCustomHostNameVerifier() -{ - mkdir -p ${CUSTOM_HOSTNAME_VERIFIER_HOME} - mkdir -p ${CUSTOM_HOSTNAME_VERIFIER_HOME}/src/main/java - mkdir -p ${CUSTOM_HOSTNAME_VERIFIER_HOME}/src/test/java - cp ${BASE_DIR}/generateCustomHostNameVerifier.sh ${CUSTOM_HOSTNAME_VERIFIER_HOME}/generateCustomHostNameVerifier.sh - cp ${BASE_DIR}/WebLogicCustomHostNameVerifier.java ${CUSTOM_HOSTNAME_VERIFIER_HOME}/src/main/java/WebLogicCustomHostNameVerifier.java - cp ${BASE_DIR}/HostNameValuesTemplate.txt ${CUSTOM_HOSTNAME_VERIFIER_HOME}/src/main/java/HostNameValuesTemplate.txt - cp ${BASE_DIR}/WebLogicCustomHostNameVerifierTest.java ${CUSTOM_HOSTNAME_VERIFIER_HOME}/src/test/java/WebLogicCustomHostNameVerifierTest.java - chown -R $username:$groupname ${CUSTOM_HOSTNAME_VERIFIER_HOME} - chmod +x ${CUSTOM_HOSTNAME_VERIFIER_HOME}/generateCustomHostNameVerifier.sh - - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; ${CUSTOM_HOSTNAME_VERIFIER_HOME}/generateCustomHostNameVerifier.sh ${wlsAdminHost} ${customDNSNameForAdminServer} ${customDNSNameForAdminServer} ${dnsLabelPrefix} ${wlsDomainName} ${location}" -} - -function copyCustomHostNameVerifierJarsToWebLogicClasspath() -{ - runuser -l oracle -c "cp ${CUSTOM_HOSTNAME_VERIFIER_HOME}/output/*.jar $oracleHome/wlserver/server/lib/;" - - echo "Modify WLS CLASSPATH to include hostname verifier jars...." - sed -i 's;^WEBLOGIC_CLASSPATH="${WL_HOME}/server/lib/postgresql.*;&\nWEBLOGIC_CLASSPATH="${WL_HOME}/server/lib/hostnamevalues.jar:${WL_HOME}/server/lib/weblogicustomhostnameverifier.jar:${WEBLOGIC_CLASSPATH}";' $oracleHome/oracle_common/common/bin/commExtEnv.sh - echo "Modified WLS CLASSPATH to include hostname verifier jars." -} - - -function configureCustomHostNameVerifier() -{ - echo "configureCustomHostNameVerifier for domain $wlsDomainName for server $wlsServerName" - cat <${wlsDomainPath}/configureCustomHostNameVerifier.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -try: - edit("$wlsServerName") - startEdit() - - cd('/Servers/$wlsServerName/SSL/$wlsServerName') - cmo.setHostnameVerifier('com.oracle.azure.weblogic.security.util.WebLogicCustomHostNameVerifier') - cmo.setHostnameVerificationIgnored(false) - cmo.setTwoWaySSLEnabled(false) - cmo.setClientCertificateEnforced(false) - - save() - activate() -except Exception,e: - print e - print "Failed to configureCustomHostNameVerifier for domain $wlsDomainName" - dumpStack() - raise Exception('Failed to configureCustomHostNameVerifier for domain $wlsDomainName') -disconnect() -EOF -sudo chown -R $username:$groupname ${wlsDomainPath} -runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST ${wlsDomainPath}/configureCustomHostNameVerifier.py" -if [[ $? != 0 ]]; then - echo "Error : Failed to configureCustomHostNameVerifier for domain $wlsDomainName" - exit 1 -fi - -} - -#main script starts here - -SCRIPT_PWD=`pwd` -CURR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -BASE_DIR="$(readlink -f ${CURR_DIR})" - -#read arguments from stdin -read wlsDomainName wlsUserName wlsPassword managedServerPrefix serverIndex wlsAdminURL wlsAdminHost oracleHome wlsDomainPath storageAccountName storageAccountKey mountpointPath wlsADSSLCer wlsLDAPPublicIP adServerHost appGWHostName enableELK elasticURI elasticUserName elasticPassword logsToIntegrate logIndex enableCoherence customDNSNameForAdminServer dnsLabelPrefix location isCustomSSLEnabled customIdentityKeyStoreBase64String customIdentityKeyStorePassPhrase customIdentityKeyStoreType customTrustKeyStoreBase64String customTrustKeyStorePassPhrase customTrustKeyStoreType privateKeyAlias privateKeyPassPhrase - -isCustomSSLEnabled="${isCustomSSLEnabled,,}" - -coherenceListenPort=7574 -coherenceLocalport=42000 -coherenceLocalportAdjust=42200 -enableAAD="false" -wlsAdminPort=7001 -wlsAdminChannelPort=7005 -wlsManagedPort=8001 -wlsClusterName="cluster1" -nmHost=`hostname` -nmPort=5556 -channelPort=8501 -AppGWHttpPort=80 -AppGWHttpsPort=443 -WEBLOGIC_DEPLOY_TOOL=https://github.com/oracle/weblogic-deploy-tooling/releases/download/weblogic-deploy-tooling-1.8.1/weblogic-deploy.zip -username="oracle" -groupname="oracle" -CUSTOM_HOSTNAME_VERIFIER_HOME="/u01/app/custom-hostname-verifier" -KEYSTORE_PATH="$wlsDomainPath/$wlsDomainName/keystores" -SERVER_STARTUP_ARGS="-Dlog4j2.formatMsgNoLookups=true" - -chmod ugo+x ${SCRIPT_PWD}/elkIntegration.sh - -validateInput -cleanup -installUtilities -mountFileShare -updateNetworkRules "managed" - -if [ "$isCustomSSLEnabled" == "true" ];then - parseAndSaveCustomSSLKeyStoreData -fi - -if [ "$enableAAD" == "true" ];then - mapLDAPHostWithPublicIP - parseLDAPCertificate - importAADCertificate - importAADCertificateIntoWLSCustomTrustKeyStore -fi - -create_managedSetup -generateCustomHostNameVerifier -copyCustomHostNameVerifierJarsToWebLogicClasspath -create_nodemanager_service -enabledAndStartNodeManagerService -configureCustomHostNameVerifier -start_managed - -echo "enable ELK? ${enableELK}" -if [[ "${enableELK,,}" == "true" ]];then - echo "Set up ELK..." - ${SCRIPT_PWD}/elkIntegration.sh \ - ${oracleHome} \ - ${wlsAdminURL} \ - ${wlsUserName} \ - ${wlsPassword} \ - "admin" \ - ${elasticURI} \ - ${elasticUserName} \ - ${elasticPassword} \ - ${wlsDomainName} \ - ${wlsDomainPath}/${wlsDomainName} \ - ${logsToIntegrate} \ - ${serverIndex} \ - ${logIndex} \ - ${managedServerPrefix} -fi - -cleanup diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/pom.xml b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/pom.xml deleted file mode 100644 index 3b068084c..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/pom.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - 4.0.0 - - - com.oracle.weblogic.azure - weblogic-azure-vm - 1.0.0 - ../../pom.xml - - - com.oracle.weblogic.azure - arm-oraclelinux-wls-cluster - ${version.arm-oraclelinux-wls-cluster} - - jar - ${project.artifactId} - - - ${project.basedir}/../../.. - false - false - - - - - - - diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/clusterdeploy.parameters.json b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/clusterdeploy.parameters.json deleted file mode 100644 index 44995e9ec..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/clusterdeploy.parameters.json +++ /dev/null @@ -1,198 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "adminUsername": { - "value": "GEN-UNIQUE" - }, - "adminPasswordOrKey": { - "value": "GEN-SSH-PUB-KEY" - }, - "adminVMName":{ - "value": "GEN-UNIQUE" - }, - "appGatewayCertificateOption":{ - "value": "GEN-UNIQUE" - }, - "appGatewaySSLBackendCertData":{ - "value": "GEN-UNIQUE" - }, - "appGatewaySSLCertData":{ - "value": "GEN-UNIQUE" - }, - "appGatewaySSLCertPassword":{ - "value": "GEN-UNIQUE" - }, - "authenticationType": { - "value": "password" - }, - "databaseType": { - "value": "mysql" - }, - "dbGlobalTranProperty": { - "value": "OnePhaseCommit" - }, - "dbIdentity": { - "value": {} - }, - "dbPassword": { - "value": "GEN-UNIQUE" - }, - "dbUser": { - "value": "GEN-UNIQUE" - }, - "denyPublicTrafficForManagedServer": { - "value": false - }, - "dsConnectionURL": { - "value": "GEN-UNIQUE" - }, - "dnsLabelPrefix": { - "value": "GEN-UNIQUE" - }, - "dnsNameforApplicationGateway":{ - "value": "GEN-UNIQUE" - }, - "dnszoneName": { - "value": "GEN-UNIQUE" - }, - "dnszoneResourceGroup": { - "value": "GEN-UNIQUE" - }, - "dnszoneAdminConsoleLabel": { - "value": "GEN-UNIQUE" - }, - "dnszoneAppGatewayLabel": { - "value": "GEN-UNIQUE" - }, - "enableAppGateway": { - "value": false - }, - "enableCoherence": { - "value": false - }, - "enableCoherenceWebLocalStorage": { - "value": false - }, - "enableCookieBasedAffinity": { - "value": false - }, - "enableDB": { - "value": false - }, - "enableDNSConfiguration": { - "value": false - }, - "enableHTTPAdminListenPort": { - "value": false - }, - "enablePswlessConnection": { - "value": false - }, - "gatewayPublicIPAddressName": { - "value": "GEN-UNIQUE" - }, - "hasDNSZones": { - "value": false - }, - "jdbcDataSourceName": { - "value": "GEN-UNIQUE" - }, - "keyVaultSku": { - "value": "standard" - }, - "location": { - "value": "eastus" - }, - "portsToExpose": { - "value": "GEN-UNIQUE" - }, - "skuUrnVersion": { - "value": "GEN-UNIQUE" - }, - "tagsByResource": { - "value": {} - }, - "usePreviewImage": { - "value": false - }, - "useSystemAssignedManagedIdentity": { - "value": false - }, - "wlsDomainName": { - "value": "GEN-UNIQUE" - }, - "wlsUserName": { - "value": "GEN-UNIQUE" - }, - "wlsPassword": { - "value": "GEN-UNIQUE" - }, - "managedServerPrefix":{ - "value": "GEN-UNIQUE" - }, - "virtualNetworkNewOrExisting": { - "value": "new" - }, - "virtualNetworkName": { - "value": "GEN-UNIQUE" - }, - "virtualNetworkResourceGroupName": { - "value": "GEN-UNIQUE" - }, - "addressPrefixes": { - "value": "10.0.0.0/16" - }, - "subnetName": { - "value": "GEN-UNIQUE" - }, - "subnetPrefix":{ - "value": "10.0.0.0/24" - }, - "subnetForAppGateway":{ - "value": "GEN-UNIQUE" - }, - "subnetPrefixForAppGateway":{ - "value": "10.0.1.0/24" - }, - "vmSize":{ - "value": "GEN-UNIQUE" - }, - "vmSizeSelectForCoherence":{ - "value": "GEN-UNIQUE" - }, - "numberOfInstances": { - "value": "GEN-UNIQUE" - }, - "denyPublicTrafficForAdminServer": { - "value": false - }, - "enableCustomSSL": { - "value": false - }, - "uploadedCustomIdentityKeyStoreData": { - "value": "GEN-UNIQUE" - }, - "uploadedCustomIdentityKeyStorePassphrase": { - "value": "GEN-UNIQUE" - }, - "uploadedCustomIdentityKeyStoreType": { - "value": "JKS" - }, - "uploadedCustomTrustKeyStoreData": { - "value": "GEN-UNIQUE" - }, - "uploadedCustomTrustKeyStorePassPhrase": { - "value": "GEN-UNIQUE" - }, - "uploadedCustomTrustKeyStoreType": { - "value": "JKS" - }, - "uploadedPrivateKeyAlias": { - "value": "GEN-UNIQUE" - }, - "uploadedPrivateKeyPassPhrase": { - "value": "GEN-UNIQUE" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/createUiDefinition.json b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/createUiDefinition.json deleted file mode 100644 index 93b04f6fd..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/createUiDefinition.json +++ /dev/null @@ -1,1478 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/0.1.2-preview/CreateUIDefinition.MultiVm.json#", - "handler": "Microsoft.Azure.CreateUIDef", - "version": "0.1.2-preview", - "parameters": { - "config": { - "basics": { - "resourceGroup": { - "allowExisting": true - } - } - }, - "basics": [ - { - "name": "skuUrnVersion", - "type": "Microsoft.Common.DropDown", - "label": "Oracle WebLogic Image", - "defaultValue": "WebLogic Server 14.1.1.0.0 and JDK 11 on Oracle Linux 9.1", - "toolTip": "Choose Oracle WebLogic image, which is provided by Oracle, with Java and WebLogic preinstalled.", - "constraints": { - "allowedValues": [ - { - "label": "WebLogic Server 14.1.1.0.0 and JDK 11 on Oracle Linux 9.1", - "value": "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest" - }, - { - "label": "WebLogic Server 14.1.1.0.0 and JDK 11 on Oracle Linux 8.7", - "value": "owls-141100-jdk11-ol87;Oracle:weblogic-141100-jdk11-ol87:owls-141100-jdk11-ol87;latest" - }, - { - "label": "WebLogic Server 14.1.1.0.0 and JDK 8 on Oracle Linux 9.1", - "value": "owls-141100-jdk8-ol91;Oracle:weblogic-141100-jdk8-ol91:owls-141100-jdk8-ol91;latest" - }, - { - "label": "WebLogic Server 14.1.1.0.0 and JDK 8 on Oracle Linux 8.7", - "value": "owls-141100-jdk8-ol87;Oracle:weblogic-141100-jdk8-ol87:owls-141100-jdk8-ol87;latest" - }, - { - "label": "WebLogic Server 12.2.1.4.0 and JDK 8 on Oracle Linux 9.1", - "value": "owls-122140-jdk8-ol91;Oracle:weblogic-122140-jdk8-ol91:owls-122140-jdk8-ol91;latest" - }, - { - "label": "WebLogic Server 12.2.1.4.0 and JDK 8 on Oracle Linux 8.7", - "value": "owls-122140-jdk8-ol87;Oracle:weblogic-122140-jdk8-ol87:owls-122140-jdk8-ol87;latest" - }, - { - "label": "WebLogic Server 12.2.1.4.0 and JDK8 on Oracle Linux 7.6", - "value": "owls-122140-jdk8-ol76;Oracle:weblogic-122140-jdk8-ol76:owls-122140-jdk8-ol7;latest" - }, - { - "label": "WebLogic Server 14.1.1.0.0 and JDK8 on Oracle Linux 7.6", - "value": "owls-141100-jdk8-ol76;Oracle:weblogic-141100-jdk8-ol76:owls-141100-jdk8-ol7;latest" - }, - { - "label": "WebLogic Server 14.1.1.0.0 and JDK11 on Oracle Linux 7.6", - "value": "owls-141100-jdk11-ol76;Oracle:weblogic-141100-jdk11-ol76:owls-141100-jdk11-ol7;latest" - }, - { - "label": "WebLogic Server 14.1.1.0.0 and JDK11 on Red Hat Enterprise Linux 8.7", - "value": "owls-141100-jdk11-rhel87;Oracle:weblogic-141100-jdk11-rhel87:owls-141100-jdk11-rhel87;latest" - }, - { - "label": "WebLogic Server 14.1.1.0.0 and JDK8 on Red Hat Enterprise Linux 8.7", - "value": "owls-141100-jdk8-rhel87;Oracle:weblogic-141100-jdk8-rhel87:owls-141100-jdk8-rhel87;latest" - }, - { - "label": "WebLogic Server 12.2.1.4.0 and JDK8 on Red Hat Enterprise Linux 8.7", - "value": "owls-122140-jdk8-rhel87;Oracle:weblogic-122140-jdk8-rhel87:owls-122140-jdk8-rhel87;latest" - } - ], - "required": true - }, - "visible": true - }, - { - "name": "vmSizeSelect", - "type": "Microsoft.Compute.SizeSelector", - "label": "Virtual machine size", - "toolTip": "The size of virtual machine to provision.", - "recommendedSizes": [ - "Standard_A1", - "Standard_A2", - "Standard_A3", - "Standard_A4", - "Standard_B1ms" - ], - "constraints": { - "excludedSizes": [ - "Standard_B1ls", - "Standard_A0", - "Basic_A0", - "Standard_B1s", - ${azure.armBased.vmSize.list} - ] - }, - "osPlatform": "Linux", - "count": "1", - "visible": true - }, - { - "name": "invalidVMSizeInfo", - "type": "Microsoft.Common.InfoBox", - "visible": "[contains(basics('vmSizeSelect'),'p')]", - "options": { - "icon": "Error", - "text": "The VM size you selected includes the feature letter 'p', indicating it uses ARM CPUs. ARM platform is not supported. Please select a different VM size. For more information, refer to the Azure virtual machine sizes naming conventions." - } - }, - { - "name": "basicsRequired", - "type": "Microsoft.Common.Section", - "label": "Credentials for Virtual Machines and WebLogic", - "elements": [ - { - "name": "adminUsername", - "type": "Microsoft.Common.TextBox", - "label": "Username for admin account of VMs", - "defaultValue": "weblogic", - "toolTip": "Use only letters and numbers", - "constraints": { - "required": true, - "validations": [ - { - "regex": "^[a-z0-9A-Z]{1,30}$", - "message": "The value must be 1-30 characters long and must only contain letters and numbers." - }, - { - "isValid": "[not(contains(basics('vmSizeSelect'),'p'))]", - "message": "ARM platform is not supported. Please select a different VM size." - } - ] - }, - "visible": true - }, - { - "name": "adminPasswordOrKey", - "type": "Microsoft.Compute.CredentialsCombo", - "label": { - "authenticationType": "Authentication type", - "password": "Password", - "confirmPassword": "Confirm password", - "sshPublicKey": "SSH public key" - }, - "toolTip": { - "authenticationType": "Use username and password or SSH public key for authentication to the VM", - "password": "Password for admin account of VMs", - "sshPublicKey": "SSH key for admin account of VMs" - }, - "constraints": { - "required": true, - "customPasswordRegex": "^((?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])|(?=.*[0-9])(?=.*[a-z])(?=.*[!@#$%^&*])|(?=.*[0-9])(?=.*[A-Z])(?=.*[!@#$%^&*])|(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*])).{12,72}$", - "customValidationMessage": "Password must be at least 12 characters long and have 3 out of the following: one number, one lower case, one upper case, or one special character" - }, - "options": { - "hideConfirmation": false, - "hidePassword": false - }, - "osPlatform": "Linux", - "visible": true - }, - { - "name": "wlsUserName", - "type": "Microsoft.Common.TextBox", - "label": "Username for WebLogic Administrator", - "defaultValue": "weblogic", - "toolTip": "Use only letters and numbers", - "constraints": { - "required": true, - "regex": "^[a-z0-9A-Z]{1,30}$", - "validationMessage": "The value must be 1-30 characters long and must only contain letters and numbers." - }, - "visible": true - }, - { - "name": "wlsPassword", - "type": "Microsoft.Common.PasswordBox", - "label": { - "password": "Password for WebLogic Administrator", - "confirmPassword": "Confirm password" - }, - "toolTip": "Password for WebLogic Administrator", - "constraints": { - "required": true, - "regex": "^(?=.*[A-Z])(?=.*[a-z])(?=.*\\d)[A-Za-z\\d]{12,}$", - "validationMessage": "The password must contain at least 12 characters, with at least 1 uppercase letter, 1 lowercase letter and 1 number, and special characters are not allowed." - }, - "options": { - "hideConfirmation": false - }, - "visible": true - }, - { - "name": "numberOfInstances", - "type": "Microsoft.Common.TextBox", - "label": "Number of VMs", - "defaultValue": "4", - "toolTip": "The number of VMs to create, with one WebLogic node per VM", - "constraints": { - "required": true, - "regex": "^(2|3|4|5)$", - "validationMessage": "Number of VMs to deploy, limit 5 since this offer is using a single storage account." - }, - "visible": true - } - ], - "visible": true - }, - { - "name": "basicsOptional", - "type": "Microsoft.Common.Section", - "label": "Optional Basic Configuration", - "elements": [ - { - "name": "basicsOptionalAcceptDefaults", - "type": "Microsoft.Common.OptionsGroup", - "label": "Accept defaults for optional configuration?", - "defaultValue": "Yes", - "toolTip": "Select 'No' to edit optional basic configuration.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": "false" - }, - { - "label": "No", - "value": "true" - } - ], - "required": true - } - }, - { - "name": "managedServerPrefix", - "type": "Microsoft.Common.TextBox", - "label": "Managed Server Prefix", - "toolTip": "The string to prepend to the name of the managed server.", - "defaultValue": "msp", - "constraints": { - "required": true, - "regex": "^[a-z0-9A-Z]{3,20}$", - "validationMessage": "The prefix must be between 3 and 20 characters long and contain letters, numbers only." - }, - "visible": "[bool(basics('basicsOptional').basicsOptionalAcceptDefaults)]" - }, - { - "name": "wlsDomainName", - "type": "Microsoft.Common.TextBox", - "label": "WebLogic Domain Name", - "toolTip": "The name of the WebLogic Domain to create.", - "defaultValue": "clusterDomain", - "constraints": { - "required": true, - "regex": "^[a-z0-9A-Z]{3,20}$", - "validationMessage": "The Domain Name must be between 3 and 20 characters long and contain letters, numbers only." - }, - "visible": "[bool(basics('basicsOptional').basicsOptionalAcceptDefaults)]" - }, - { - "name": "enableAdminHTTPListenPort", - "type": "Microsoft.Common.OptionsGroup", - "label": "Enable HTTP listen port on WebLogic Administration Server?", - "defaultValue": "Yes", - "toolTip": "Select 'No' to disable HTTP listen port on WebLogic Administration Server.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": true - }, - { - "label": "No", - "value": false - } - ], - "required": true - }, - "visible": "[bool(basics('basicsOptional').basicsOptionalAcceptDefaults)]" - }, - { - "name": "useSystemAssignedManagedIdentity", - "label": "Cause a system assigned managed identity to be created for the VM(s).", - "type": "Microsoft.Common.OptionsGroup", - "toolTip": "System assigned managed identities enable credential-free secure access to many Azure resources from this VM.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": true - }, - { - "label": "No", - "value": false - } - ], - "required": true - }, - "defaultValue": "Yes", - "visible": "[bool(basics('basicsOptional').basicsOptionalAcceptDefaults)]" - } - ], - "visible": true - }, - { - "name": "howToReportIssues", - "type": "Microsoft.Common.Section", - "label": "Report issues, get help, and share feedback", - "elements": [ - { - "name": "help", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "See the documentation for this offer.", - "link": { - "label": "Offer documentation", - "uri": "https://aka.ms/wls-vm-docs" - } - } - }, - { - "name": "howToReportIssueText", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "If you encounter problems during the deployment of Oracle WebLogic Server, report them here.", - "link": { - "label": "Issue tracker", - "uri": "https://aka.ms/arm-oraclelinux-wls-issues?version=${project.version}" - } - } - }, - { - "name": "howToJoinSlack", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "If you want to interact directly with the Oracle WebLogic community, join the public Slack channel named 'oracle-weblogic'.", - "link": { - "label": "Join Slack", - "uri": "https://aka.ms/arm-oraclelinux-wls-slack" - } - } - }, - { - "name": "survey", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "To get free help with Azure migration from the development team, fill out this survey.", - "link": { - "label": "Take survey", - "uri": "https://aka.ms/wls-on-azure-survey" - } - } - } - ], - "visible": true - } - ], - "steps": [ - { - "name": "section_sslConfiguration", - "type": "Microsoft.Common.Section", - "label": "TLS/SSL Configuration", - "elements": [ - { - "name": "sslConfigurationText", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "Selecting 'Yes' here will cause the template to provision WebLogic Administration Console on HTTPS (Secure) port, with your own TLS/SSL Certificate.", - "link": { - "label": "Learn more", - "uri": "https://aka.ms/arm-oraclelinux-wls-ssl-config" - } - } - }, - { - "name": "enableCustomSSL", - "type": "Microsoft.Common.OptionsGroup", - "label": "Configure WebLogic Administration Console on HTTPS (Secure) port, with your own TLS/SSL Certificate?", - "defaultValue": "No", - "toolTip": "Select 'Yes' to configure WebLogic Administration Console on HTTPS (Secure) port with your own SSL Certificate.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": true - }, - { - "label": "No", - "value": false - } - ], - "required": false - } - }, - { - "name": "uploadedCustomSSLSettings", - "type": "Microsoft.Common.Section", - "visible": "[steps('section_sslConfiguration').enableCustomSSL]", - "label": "TLS/SSL Configuration Settings", - "elements": [ - { - "name": "sslKeystoreInfo0", - "type": "Microsoft.Common.InfoBox", - "visible": "true", - "options": { - "icon": "Info", - "text": "You must provide different files for identity and trust KeyStores. Select here for more details.", - "uri": "https://aka.ms/arm-oraclelinux-wls-ssl-configuration" - } - }, - { - "name": "uploadedCustomIdentityKeyStoreData", - "type": "Microsoft.Common.FileUpload", - "label": "Identity KeyStore Data file(.jks,.p12)", - "toolTip": "Identity KeyStore for TLS/SSL configuration", - "constraints": { - "required": true, - "accept": ".jks,.p12" - }, - "options": { - "multiple": false, - "uploadMode": "file", - "openMode": "binary" - }, - "visible": true - }, - { - "name": "uploadedCustomIdentityKeyStorePassphrase", - "type": "Microsoft.Common.PasswordBox", - "label": { - "password": "Password", - "confirmPassword": "Confirm password" - }, - "toolTip": " The passphrase for the Identity KeyStore", - "constraints": { - "required": true, - "regex": "^.{6,}$", - "validationMessage": "Keypass must be at least 6 characters long." - }, - "options": { - "hideConfirmation": false - }, - "visible": true - }, - { - "name": "uploadedCustomIdentityKeyStoreType", - "type": "Microsoft.Common.DropDown", - "visible": "true", - "label": "The Identity KeyStore type (JKS,PKCS12)", - "defaultValue": "JKS", - "toolTip": "One of the supported KeyStore types", - "constraints": { - "allowedValues": [ - { - "label": "JKS", - "value": "JKS" - }, - { - "label": "PKCS12", - "value": "PKCS12" - } - ], - "required": true - } - }, - { - "name": "uploadedPrivateKeyAlias", - "type": "Microsoft.Common.TextBox", - "visible": "true", - "label": "The alias of the server's private key within the Identity KeyStore", - "defaultValue": "", - "toolTip": "Use only letters and numbers", - "constraints": { - "required": true, - "regex": "^[a-z0-9A-Z]{1,30}$", - "validationMessage": "The value must be 1-30 characters long and must only contain letters and numbers." - } - }, - { - "name": "uploadedPrivateKeyPassPhrase", - "type": "Microsoft.Common.PasswordBox", - "visible": "true", - "label": { - "password": "The passphrase for the server's private key within the Identity KeyStore", - "confirmPassword": "Confirm passphrase" - }, - "toolTip": "Use only letters and numbers", - "constraints": { - "required": true, - "regex": "^.{6,}$", - "validationMessage": "Keypass must be at least 6 characters long." - }, - "options": { - "hideConfirmation": false - } - }, - { - "name": "uploadedCustomTrustKeyStoreData", - "type": "Microsoft.Common.FileUpload", - "label": "Trust KeyStore Data file(.jks,.p12)", - "toolTip": "Trust KeyStore for TLS/SSL configuration.", - "constraints": { - "required": true, - "accept": ".jks,.p12" - }, - "options": { - "multiple": false, - "uploadMode": "file", - "openMode": "binary" - }, - "visible": true - }, - { - "name": "uploadedCustomTrustKeyStorePassPhrase", - "type": "Microsoft.Common.PasswordBox", - "label": { - "password": "Password", - "confirmPassword": "Confirm password" - }, - "toolTip": " The passphrase for the Trust KeyStore", - "constraints": { - "required": true, - "regex": "^.{6,}$", - "validationMessage": "Keypass must be at least 6 characters long." - }, - "options": { - "hideConfirmation": false - }, - "visible": true - }, - { - "name": "uploadedCustomTrustKeyStoreType", - "type": "Microsoft.Common.DropDown", - "visible": "true", - "label": "The Trust KeyStore type (JKS,PKCS12)", - "defaultValue": "JKS", - "toolTip": "One of the supported KeyStore types", - "constraints": { - "allowedValues": [ - { - "label": "JKS", - "value": "JKS" - }, - { - "label": "PKCS12", - "value": "PKCS12" - } - ], - "required": true - } - } - ] - } - ] - }, - { - "name": "section_appGateway", - "type": "Microsoft.Common.Section", - "label": "Azure Application Gateway", - "elements": [ - { - "name": "connectToAGText", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "Selecting 'Yes' here will cause the template to provision an Azure Application Gateway (WAF_v2 or later SKU), a public IP, and a backend pool consisting of the worker nodes in the cluster. Further configuration may be necessary after deployment.", - "link": { - "label": "Learn more", - "uri": "https://aka.ms/arm-oraclelinux-wls-cluster-app-gateway-overview" - } - } - }, - { - "name": "enableAppGateway", - "type": "Microsoft.Common.OptionsGroup", - "label": "Connect to Azure Application Gateway?", - "defaultValue": "No", - "toolTip": "Select 'Yes' to create an Azure Application Gateway as the load balancer for the cluster.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": true - }, - { - "label": "No", - "value": false - } - ], - "required": false - } - }, - { - "name": "enableCookieBasedAffinity", - "type": "Microsoft.Common.CheckBox", - "label": "Enable cookie based affinity", - "defaultValue": "true", - "toolTip": "If checked, enable cookie based affinity", - "visible": "[steps('section_appGateway').enableAppGateway]" - }, - { - "name": "sslText00", - "type": "Microsoft.Common.TextBlock", - "visible": "[steps('section_appGateway').enableAppGateway]", - "options": { - "text": "Choose an option for providing the TLS/SSL certificate and whether or not to deny public traffic to the managed servers:" - } - }, - { - "name": "sslText01", - "type": "Microsoft.Common.TextBlock", - "visible": "[steps('section_appGateway').enableAppGateway]", - "options": { - "text": "    ⁃ Upload a TLS/SSL certificate: Upload the pre-signed certificate now." - } - }, - { - "name": "sslText02", - "type": "Microsoft.Common.TextBlock", - "visible": "[steps('section_appGateway').enableAppGateway]", - "options": { - "text": "    ⁃ Generate a self-signed certificate: generate a self-signed certificate and apply it during deployment.", - "link": { - "label": "Learn more", - "uri": "https://aka.ms/arm-oraclelinux-wls-cluster-app-gateway-key-vault" - } - } - }, - { - "name": "certificateOption", - "type": "Microsoft.Common.OptionsGroup", - "label": "Select desired TLS/SSL certificate option", - "defaultValue": "Generate a self-signed certificate", - "toolTip": "Select desired TLS/SSL certificate option", - "constraints": { - "allowedValues": [ - { - "label": "Upload a TLS/SSL certificate", - "value": "haveCert" - }, - { - "label": "Generate a self-signed certificate", - "value": "generateCert" - } - ], - "required": true - }, - "visible": "[steps('section_appGateway').enableAppGateway]" - }, - { - "name": "appGatewaySSLCertData", - "type": "Microsoft.Common.FileUpload", - "label": "TLS/SSL certificate(.pfx)", - "toolTip": "TLS/SSL certificate used for App Gateway", - "constraints": { - "required": true, - "accept": ".pfx" - }, - "options": { - "multiple": false, - "uploadMode": "file", - "openMode": "binary" - }, - "visible": "[equals(steps('section_appGateway').certificateOption, 'haveCert')]" - }, - { - "name": "appGatewaySSLCertPassword", - "type": "Microsoft.Common.PasswordBox", - "label": { - "password": "Password", - "confirmPassword": "Confirm password" - }, - "toolTip": "TLS/SSL certificate password", - "constraints": { - "required": "[equals(steps('section_appGateway').certificateOption, 'haveCert')]", - "regex": "^((?=.*[0-9])(?=.*[a-z])|(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])|(?=.*[0-9])(?=.*[a-z])(?=.*[!@#$%^&*])|(?=.*[0-9])(?=.*[A-Z])(?=.*[!@#$%^&*])|(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*])).{6,128}$", - "validationMessage": "The password must contain at least 6 characters, with at least 1 uppercase letter, 1 lowercase letter and 1 number." - }, - "options": { - "hideConfirmation": false - }, - "visible": "[equals(steps('section_appGateway').certificateOption, 'haveCert')]" - }, - { - "name": "infoGenerateCertIndentity", - "type": "Microsoft.Common.InfoBox", - "visible": "[equals(steps('section_appGateway').certificateOption, 'generateCert')]", - "options": { - "icon": "Info", - "text": "This option will create a self-signed TLS/SSL certificate for gateway TLS/SSL termination. The Azure identity deploying
    this feature must have one of the following two sets of Azure role-based access control roles:
  • Contributor and User Access Administrator of the current subscription.
  • Owner of the current subscription.
  • " - } - }, - { - "name": "sslBackendCertData", - "type": "Microsoft.Common.FileUpload", - "label": "Trusted root certificate(.cer, .cert)", - "toolTip": "Trusted root certificate (CA certificate) used to set up end to end TLS/SSL", - "constraints": { - "required": true, - "accept": ".cer, .cert" - }, - "options": { - "multiple": false, - "uploadMode": "file", - "openMode": "binary" - }, - "visible": "[and(steps('section_appGateway').enableAppGateway, steps('section_sslConfiguration').enableCustomSSL)]" - } - ], - "visible": true - }, - { - "name": "section_networkingConfiguration", - "type": "Microsoft.Common.Section", - "label": "Networking", - "elements": [ - { - "name": "infoGatewaySubnet", - "type": "Microsoft.Common.InfoBox", - "visible": "[steps('section_appGateway').enableAppGateway]", - "options": { - "icon": "Warning", - "text": "Please make sure you are using a dedicated subnet for Application Gateway.", - "uri": "https://docs.microsoft.com/en-us/azure/application-gateway/configuration-infrastructure" - } - }, - { - "name": "vnetInfo", - "type": "Microsoft.Common.InfoBox", - "visible": "true", - "options": { - "icon": "Info", - "text": "When creating a new virtual network, the subnet's address prefix is calculated automatically based on the virtual
    network's address prefix. When using an existing virtual network, a minimum virtual network size of /24 and a
    minimum subnet size of /24 are required. If deploying an Application Gateway, it must be deployed in its own
    dedicated subnet with a minimum subnet size of /29." - } - }, - { - "name": "virtualNetworkWithAppGateway", - "type": "Microsoft.Network.VirtualNetworkCombo", - "visible": "[steps('section_appGateway').enableAppGateway]", - "label": { - "virtualNetwork": "Virtual network", - "subnets": "Subnets" - }, - "toolTip": { - "virtualNetwork": "Name of the virtual network", - "subnets": "Subnets for the virtual network" - }, - "defaultValue": { - "name": "[concat('wlscluster-vnet-',take(guid(), 8))]", - "addressPrefixSize": "/23" - }, - "constraints": { - "minAddressPrefixSize": "/23" - }, - "subnets": { - "subnet1": { - "label": "Subnet for WebLogic", - "defaultValue": { - "name": "wls-subnet", - "addressPrefixSize": "/28" - }, - "constraints": { - "minAddressPrefixSize": "/29", - "minAddressCount": "[add(int(basics('basicsRequired').numberOfInstances), 1)]", - "requireContiguousAddresses": false - } - }, - "subnet2": { - "label": "Subnet for Application Gateway", - "defaultValue": { - "name": "appgateway-subnet", - "addressPrefixSize": "/24" - }, - "constraints": { - "minAddressPrefixSize": "/24", - "minAddressCount": 250, - "requireContiguousAddresses": false - } - } - } - }, - { - "name": "virtualNetworkWithoutAppGateway", - "type": "Microsoft.Network.VirtualNetworkCombo", - "visible": "[not(steps('section_appGateway').enableAppGateway)]", - "label": { - "virtualNetwork": "Virtual network", - "subnets": "Subnets" - }, - "toolTip": { - "virtualNetwork": "Name of the virtual network", - "subnets": "Subnets for the virtual network" - }, - "defaultValue": { - "name": "wls-vnet", - "addressPrefixSize": "/28" - }, - "constraints": { - "minAddressPrefixSize": "/28" - }, - "subnets": { - "subnet1": { - "label": "Subnet for WebLogic", - "defaultValue": { - "name": "wls-subnet", - "addressPrefixSize": "/28" - }, - "constraints": { - "minAddressPrefixSize": "/29", - "minAddressCount": "[add(int(basics('basicsRequired').numberOfInstances), 1)]", - "requireContiguousAddresses": false - } - } - } - }, - { - "name": "denyPublicTrafficForAdminServer", - "type": "Microsoft.Common.OptionsGroup", - "label": "Deny public traffic for admin server?", - "defaultValue": "No", - "toolTip": "Select 'Yes' to deny public traffic for admin server. Configuration here for port 7001 and 7002 has a higher priority than above.", - "visible": "[or(equals(steps('section_networkingConfiguration').virtualNetworkWithAppGateway.newOrExisting, 'new'), equals(steps('section_networkingConfiguration').virtualNetworkWithoutAppGateway.newOrExisting, 'new'))]", - "constraints": { - "allowedValues": [ - { - "label": "No", - "value": false - }, - { - "label": "Yes", - "value": true - } - ], - "required": true - } - }, - { - "name": "denyPublicTrafficForManagedServer", - "type": "Microsoft.Common.OptionsGroup", - "label": "Deny public traffic for managed server?", - "defaultValue": "Yes", - "toolTip": "Select 'Yes' to deny traffic from the public Internet from reaching managed servers directly. This setting has a higher priority than 'Ports and port ranges to expose' in basic blade.", - "constraints": { - "allowedValues": [ - { - "label": "No", - "value": false - }, - { - "label": "Yes", - "value": true - } - ], - "required": true - }, - "visible": "[and(steps('section_appGateway').enableAppGateway, or(equals(steps('section_networkingConfiguration').virtualNetworkWithAppGateway.newOrExisting, 'new'), equals(steps('section_networkingConfiguration').virtualNetworkWithoutAppGateway.newOrExisting, 'new')))]" - }, - { - "name": "dnsConfigurationText", - "type": "Microsoft.Common.TextBlock", - "visible": "[or(equals(steps('section_networkingConfiguration').virtualNetworkWithAppGateway.newOrExisting, 'new'), equals(steps('section_networkingConfiguration').virtualNetworkWithoutAppGateway.newOrExisting, 'new'))]", - "options": { - "text": "Selecting 'Yes' here will cause the template to provision Oracle WebLogic Server Administration Console and Application Gateway using a custom DNS Name (for example: applications.contoso.com)", - "link": { - "label": "Learn more", - "uri": "https://aka.ms/arm-oraclelinux-wls-dns" - } - } - }, - { - "name": "enableCustomDNS", - "type": "Microsoft.Common.OptionsGroup", - "visible": "[or(equals(steps('section_networkingConfiguration').virtualNetworkWithAppGateway.newOrExisting, 'new'), equals(steps('section_networkingConfiguration').virtualNetworkWithoutAppGateway.newOrExisting, 'new'))]", - "label": "Configure Custom DNS Alias?", - "defaultValue": "No", - "toolTip": "Select 'Yes' to configure Custom DNS Alias.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": true - }, - { - "label": "No", - "value": false - } - ], - "required": false - } - }, - { - "name": "dnsLabelPrefix", - "type": "Microsoft.Common.TextBox", - "label": "DNS Label Prefix", - "toolTip": "The string to prepend to the DNS label.", - "defaultValue": "wls", - "constraints": { - "required": true, - "regex": "^[a-z0-9A-Z]{3,10}$", - "validationMessage": "The prefix must be between 3 and 10 characters long and contain letters, numbers only." - }, - "visible": "[bool(steps('section_networkingConfiguration').enableCustomDNS)]" - }, - { - "name": "portsToExpose", - "label": "Ports and port ranges to expose (N or N-N, comma separated)", - "type": "Microsoft.Common.TextBox", - "toolTip": "Ports and port ranges to expose (N or N-N, comma separated)", - "defaultValue": "80,443,7001-9000", - "constraints": { - "required": true, - "regex": "^((([0-9]+-[0-9]+)|([0-9]+))[,]?)+[^,]$", - "validationMessage": "Only numbers, hyphen separated ranges of numbers, separated by commas" - }, - "visible": "[bool(steps('section_networkingConfiguration').enableCustomDNS)]" - }, - { - "name": "customDNSSettings", - "type": "Microsoft.Common.Section", - "label": "DNS Configuration Settings", - "visible": "[bool(steps('section_networkingConfiguration').enableCustomDNS)]", - "elements": [ - { - "name": "bringDNSZone", - "type": "Microsoft.Common.OptionsGroup", - "label": "Use an existing Azure DNS Zone", - "defaultValue": "No", - "toolTip": "Select 'Yes' to configure Custom DNS Alias based on an existing Azure DNS Zone. Select 'No' to create an Azure DNS Zone and Custom DNS Alias.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": true - }, - { - "label": "No", - "value": false - } - ] - } - }, - { - "name": "createDNSZoneText", - "type": "Microsoft.Common.InfoBox", - "visible": "[not(bool(steps('section_networkingConfiguration').customDNSSettings.bringDNSZone))]", - "options": { - "icon": "Info", - "text": "You must perform DNS Domain Delegation at your DNS Registry after deployment.", - "uri": "https://aka.ms/dns-domain-delegation" - } - }, - { - "name": "infoDNSIndentity", - "type": "Microsoft.Common.InfoBox", - "visible": "[bool(steps('section_networkingConfiguration').customDNSSettings.bringDNSZone)]", - "options": { - "icon": "Info", - "text": "This option will add/update records in your Azure DNS Zone. The Azure identity deploying this feature must have one of the following two sets of Azure role-based access control roles:
  • Contributor and User Access Administrator of the current subscription.
  • Owner of the current subscription.
  • " - } - }, - { - "name": "dnszoneName", - "type": "Microsoft.Common.TextBox", - "label": "DNS Zone Name", - "defaultValue": "", - "toolTip": "Use only letters and numbers and periods to separate Domains", - "constraints": { - "required": true, - "regex": "^([0-9a-zA-Z_-]{1,63}\\.){1,33}[0-9a-zA-Z_-]{1,63}$", - "validationMessage": "There must be between 2 and 34 labels. For example, \"contoso.com\" has 2 labels. Each label must contain between 1 and 63 characters. Each label must only contain letters, numbers, underscores, and dashes." - } - }, - { - "name": "dnsZoneResourceGroup", - "type": "Microsoft.Common.TextBox", - "label": "Name of the resource group contains the DNS Zone in current subscription", - "defaultValue": "", - "toolTip": "Name of the resource group which contains the DNS Zone in current subscription", - "constraints": { - "required": true, - "regex": "^[a-z0-9A-Z.\\-_()]{0,89}([a-z0-9A-Z\\-_()]{1})$", - "validationMessage": "[if(greater(length(steps('section_networkingConfiguration').existingDNSZonesSettings.dnsZoneResourceGroup), 90),'Resource group names only allow up to 90 characters.', 'Resource group names only allow alphanumeric characters, periods, underscores, hyphens and parenthesis and cannot end in a period.')]" - }, - "visible": "[steps('section_networkingConfiguration').customDNSSettings.bringDNSZone]" - }, - { - "name": "dnszoneAdminConsoleLabel", - "type": "Microsoft.Common.TextBox", - "label": "Label for Oracle WebLogic Administration Console", - "defaultValue": "admin", - "toolTip": "Specify a label to generate subdomain of Oracle WebLogic Administration Console", - "constraints": { - "required": true, - "validations": [ - { - "regex": "^([0-9a-zA-Z_-]{1,63}\\.){0,33}[0-9a-zA-Z_-]{1,63}$", - "message": "Each label must contain between 1 and 63 characters. Each label must only contain letters, numbers, underscores, and dashes." - }, - { - "isValid": "[less(sub(length(concat(steps('section_networkingConfiguration').customDNSSettings.dnszoneAdminConsoleLabel,'.',steps('section_networkingConfiguration').customDNSSettings.dnszoneName)),length(replace(concat(steps('section_networkingConfiguration').customDNSSettings.dnszoneAdminConsoleLabel,'.',steps('section_networkingConfiguration').customDNSSettings.dnszoneName), '.', ''))),34)]", - "message": "Subdomain must be between 2 and 34 labels. For example, \"admin.contoso.com\" has 3 labels." - } - ] - } - }, - { - "name": "dnszoneGatewayLabel", - "type": "Microsoft.Common.TextBox", - "label": "Label for Application Gateway", - "defaultValue": "www", - "toolTip": "Specify a label to generate subdomain of Application Gateway", - "constraints": { - "required": true, - "validations": [ - { - "regex": "^([0-9a-zA-Z_-]{1,63}\\.){0,33}[0-9a-zA-Z_-]{1,63}$", - "message": "Each label must contain between 1 and 63 characters. Each label must only contain letters, numbers, underscores, and dashes." - }, - { - "isValid": "[less(sub(length(concat(if(empty(steps('section_networkingConfiguration').customDNSSettings.dnszoneGatewayLabel), '', steps('section_networkingConfiguration').customDNSSettings.dnszoneGatewayLabel),'.',steps('section_networkingConfiguration').customDNSSettings.dnszoneName)),length(replace(concat(if(empty(steps('section_networkingConfiguration').customDNSSettings.dnszoneGatewayLabel), '', steps('section_networkingConfiguration').customDNSSettings.dnszoneGatewayLabel),'.',steps('section_networkingConfiguration').customDNSSettings.dnszoneName), '.', ''))),34)]", - "message": "Subdomain must be between 2 and 34 labels. For example, \"applications.contoso.com\" has 3 labels." - } - ] - }, - "visible": "[and(bool(steps('section_appGateway').enableAppGateway), bool(steps('section_networkingConfiguration').enableCustomDNS))]" - } - ] - } - ] - }, - { - "name": "section_database", - "type": "Microsoft.Common.Section", - "label": "Database", - "subLabel": { - "preValidation": "Configure integrations to database", - "postValidation": "Done" - }, - "bladeTitle": "Database", - "elements": [ - { - "name": "aboutDatabase", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "Selecting 'Yes' here and providing the configuration will cause the template to configure the WebLogic Server to connect to the desired pre-existing database. The database must be network accessible to the VNET and subnets created by the template." - } - }, - { - "name": "enableDB", - "type": "Microsoft.Common.OptionsGroup", - "label": "Connect to database?", - "defaultValue": "No", - "toolTip": "Select 'Yes' and provide required info to configure the connection to a database.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": "true" - }, - { - "label": "No", - "value": "false" - } - ], - "required": true - } - }, - { - "name": "databaseConnectionInfo", - "type": "Microsoft.Common.Section", - "label": "Connection settings", - "elements": [ - { - "name": "databaseType", - "type": "Microsoft.Common.DropDown", - "label": "Choose database type", - "toolTip": "Choose database type", - "defaultValue": "Oracle database", - "constraints": { - "allowedValues": [ - { - "label": "PostgreSQL (Supports passwordless connection)", - "value": "postgresql" - }, - { - "label": "Oracle database", - "value": "oracle" - }, - { - "label": "Microsoft SQL Server (Supports passwordless connection)", - "value": "sqlserver" - }, - { - "label": "MySQL (Supports passwordless connection)", - "value": "mysql" - } - ], - "required": true - }, - "visible": true - }, - { - "name": "mysqlJDBCDriverInfo", - "type": "Microsoft.Common.InfoBox", - "visible": "[and(bool(steps('section_database').enableDB),equals(steps('section_database').databaseConnectionInfo.databaseType, 'mysql'))]", - "options": { - "icon": "Info", - "text": "To support passwordless connection and various functionalities, the offer will upgrade the
    Oracle WebLogic Server MySQL driver with recent MySQL Connector Java driver." - } - }, - { - "name": "jdbcDataSourceName", - "type": "Microsoft.Common.TextBox", - "label": "JNDI Name", - "toolTip": "The JNDI name for the database JDBC connection", - "defaultValue": "", - "constraints": { - "required": true, - "validations": [ - { - "regex": "^[a-z0-9A-Z/]{1,30}$", - "message": "The value must be 1-30 characters long and must only contain letters, numbers, and slashes (/)." - } - ] - }, - "visible": true - }, - { - "name": "dsConnectionURL", - "type": "Microsoft.Common.TextBox", - "label": "DataSource Connection String", - "toolTip": "The JDBC connection string for the database", - "defaultValue": "", - "constraints": { - "required": true, - "validations": [ - { - "regex": "^jdbc:.*$", - "message": "A valid JDBC URL must start with 'jdbc:'." - }, - { - "isValid": "[startsWith(steps('section_database').databaseConnectionInfo.dsConnectionURL, concat('jdbc:', steps('section_database').databaseConnectionInfo.databaseType))]", - "message": "A valid JDBC URL for the chosen database type must be provided." - }, - { - "isValid": "[if(and(bool(steps('section_database').databaseConnectionInfo.enablePswlessConnection), equals(steps('section_database').databaseConnectionInfo.databaseType, 'mysql')), and(not(contains(steps('section_database').databaseConnectionInfo.dsConnectionURL, 'defaultAuthenticationPlugin')),not(contains(steps('section_database').databaseConnectionInfo.dsConnectionURL, 'authenticationPlugins')), not(contains(steps('section_database').databaseConnectionInfo.dsConnectionURL, 'azure.clientId'))), 'true')]", - "message": "The offer will append defaultAuthenticationPlugin, authenticationPlugins with Azure provided plugins, and append azure.clientId with your managed identity client ID automatically, please do not specify them in your connection string." - }, - { - "isValid": "[if(and(bool(steps('section_database').databaseConnectionInfo.enablePswlessConnection), equals(steps('section_database').databaseConnectionInfo.databaseType, 'postgresql')), and(not(contains(steps('section_database').databaseConnectionInfo.dsConnectionURL, 'authenticationPluginClassName')),not(contains(steps('section_database').databaseConnectionInfo.dsConnectionURL, 'azure.clientId'))), 'true')]", - "message": "The offer will append authenticationPluginClassName with Azure provided plugins, and append azure.clientId with your managed identity client ID automatically, please do not specify them in your connection string." - }, - { - "isValid": "[if(and(bool(steps('section_database').databaseConnectionInfo.enablePswlessConnection), equals(steps('section_database').databaseConnectionInfo.databaseType, 'sqlserver')), and(not(contains(steps('section_database').databaseConnectionInfo.dsConnectionURL, 'authentication=ActiveDirectoryMSI')),not(contains(steps('section_database').databaseConnectionInfo.dsConnectionURL, 'msiClientId'))), 'true')]", - "message": "The offer will append authentication with ActiveDirectoryMSI, and append msiClientId with your managed identity client ID automatically, please do not specify them in your connection string." - }, - { - "isValid": "[if(and(bool(steps('section_database').databaseConnectionInfo.enablePswlessConnection0),equals(steps('section_database').databaseConnectionInfo.databaseType, 'sqlserver')), greater(length(steps('section_database').databaseConnectionInfo.dbIdentity.userAssignedIdentities),0), bool('true'))]", - "message": "You must select at least one managed identity that has access to your database." - } - ] - }, - "visible": true - }, - { - "name": "dbGlobalTranPro", - "type": "Microsoft.Common.DropDown", - "label": "Global transactions protocol", - "defaultValue": "OnePhaseCommit", - "multiLine": true, - "toolTip": "Determines the transaction protocol (global transaction processing behavior) for the data source.", - "constraints": { - "allowedValues": [ - { - "label": "TwoPhaseCommit", - "description": "Standard XA transaction processing. Requires an XA driver.", - "value": "TwoPhaseCommit" - }, - { - "label": "LoggingLastResource", - "description": "A performance enhancement for one non-XA resource.", - "value": "LoggingLastResource" - }, - { - "label": "EmulateTwoPhaseCommit", - "description": "Enables one non-XA resource to participate in a global transaction, but has some risk to data.", - "value": "EmulateTwoPhaseCommit" - }, - { - "label": "OnePhaseCommit", - "description": "One-phase XA transaction processing using a non-XA driver. This is the default setting.", - "value": "OnePhaseCommit" - }, - { - "label": "None", - "description": "Support for local transactions only.", - "value": "None" - } - ], - "required": true - }, - "visible": true - }, - { - "name": "enablePswlessConnection0", - "type": "Microsoft.Common.CheckBox", - "label": "Use passwordless datasource connection", - "toolTip": "Use passwordless datasource connection.", - "visible": "[and(bool(steps('section_database').enableDB),equals(steps('section_database').databaseConnectionInfo.databaseType, 'sqlserver'))]" - }, - { - "name": "dbUser", - "type": "Microsoft.Common.TextBox", - "label": "Database username", - "toolTip": "Use only letters and numbers", - "defaultValue": "", - "constraints": { - "required": true, - "validations": [ - { - "regex": "^(?!\\-)([a-z0-9A-Z@\\-]{1,128})([^\\-])$", - "message": "The value must be 1-128 characters long and must only contain letters, numbers, hyphen(-) and the at sign, no hyphen allowed at the beginning and the end of database username." - }, - { - "isValid": "[if(bool(steps('section_database').databaseConnectionInfo.enablePswlessConnection), greater(length(steps('section_database').databaseConnectionInfo.dbIdentity.userAssignedIdentities),0), bool('true'))]", - "message": "You must select at least one managed identity that has access to your database." - } - ] - }, - "visible": "[and(bool(steps('section_database').enableDB), not(and(steps('section_database').databaseConnectionInfo.enablePswlessConnection0, equals(steps('section_database').databaseConnectionInfo.databaseType, 'sqlserver'))))]" - }, - { - "name": "enablePswlessConnection", - "type": "Microsoft.Common.CheckBox", - "label": "Use passwordless datasource connection", - "toolTip": "Use passwordless datasource connection.", - "visible": "[and(bool(steps('section_database').enableDB),or(equals(steps('section_database').databaseConnectionInfo.databaseType, 'mysql'),equals(steps('section_database').databaseConnectionInfo.databaseType, 'postgresql')))]" - }, - { - "name": "dbPassword", - "type": "Microsoft.Common.PasswordBox", - "label": { - "password": "Database Password", - "confirmPassword": "Confirm password" - }, - "toolTip": "Database Password", - "constraints": { - "required": true, - "regex": "^((?=.*[0-9])(?=.*[a-zA-Z!@#$%^&*])).{5,128}$", - "validationMessage": "The password must be between 5 and 128 characters long and have at least one number." - }, - "options": { - "hideConfirmation": false - }, - "visible": "[and(bool(steps('section_database').enableDB), not(or(steps('section_database').databaseConnectionInfo.enablePswlessConnection, steps('section_database').databaseConnectionInfo.enablePswlessConnection0)))]" - }, - { - "name": "dbIdentity", - "type": "Microsoft.ManagedIdentity.IdentitySelector", - "label": "Connect database with Managed Identity", - "toolTip": { - "userAssignedIdentity": "Select a user assigned identity that has access to your database. For how to create a database user for your managed identity, see https://aka.ms/javaee-db-identity." - }, - "defaultValue": { - "systemAssignedIdentity": "Off" - }, - "options": { - "hideSystemAssignedIdentity": true, - "hideUserAssignedIdentity": false - }, - "visible": "[and(bool(steps('section_database').enableDB), or(steps('section_database').databaseConnectionInfo.enablePswlessConnection, steps('section_database').databaseConnectionInfo.enablePswlessConnection0))]" - } - ], - "visible": "[bool(steps('section_database').enableDB)]" - } - ] - }, - { - "name": "section_coherence", - "label": "Coherence", - "subLabel": { - "preValidation": "Configure Coherence.", - "postValidation": "Done" - }, - "bladeTitle": "Coherence", - "elements": [ - { - "name": "aboutCoherence", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "Selecting 'Yes' here and providing the configuration will cause the template to configure the Coherence cluster, the WebLogic Domain will be configured with a data tier for cache.", - "link": { - "label": "Learn more", - "uri": "https://aka.ms/arm-oraclelinux-wls-coherence" - } - } - }, - { - "name": "enableCoherence", - "type": "Microsoft.Common.OptionsGroup", - "label": "Use Coherence cache?", - "defaultValue": "No", - "toolTip": "Select 'Yes' and provide required info to configure Coherence cluster.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": "true" - }, - { - "label": "No", - "value": "false" - } - ], - "required": true - } - }, - { - "name": "coherenceInfo", - "type": "Microsoft.Common.Section", - "label": "Coherence settings", - "elements": [ - { - "name": "coherenceVMSizeSelect", - "type": "Microsoft.Compute.SizeSelector", - "label": "Coherence virtual machine size", - "toolTip": "The size of virtual machine for Coherence cache servers.", - "recommendedSizes": [ - "[basics('vmSizeSelect')]" - ], - "constraints": { - "excludedSizes": [ - "Standard_B1ls", - "Standard_A0", - "Basic_A0", - "Standard_B1s" - ] - }, - "osPlatform": "Linux", - "count": "1", - "visible": true - }, - { - "name": "numberOfCoherenceCacheInstances", - "type": "Microsoft.Common.TextBox", - "label": "Number of Coherence cache servers", - "toolTip": "Specifies number of Coherence cache instances, used to create virtual machine and WebLogic Managed Server.", - "defaultValue": "1", - "constraints": { - "required": true, - "regex": "^[0-9]+$", - "validationMessage": "The value must be a valid number." - } - }, - { - "name": "enableCoherenceWebLocalStorage", - "type": "Microsoft.Common.OptionsGroup", - "label": "Coherence Web Local Storage enabled", - "defaultValue": "Yes", - "toolTip": "Specifies whether Local Storage is enabled for the Coherence*Web cluster tier", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": "true" - }, - { - "label": "No", - "value": "false" - } - ], - "required": true - } - } - ], - "visible": "[bool(steps('section_coherence').enableCoherence)]" - } - ] - }, - { - "name": "section_tags", - "label": "Tags", - "elements": [ - { - "name": "tagsByResource", - "type": "Microsoft.Common.TagsByResource", - "resources": [ - "${identifier.applicationGateways}", - "${identifier.virtualMachines}", - "${identifier.virtualMachinesExtensions}", - "${identifier.publicIPAddresses}", - "${identifier.availabilitySets}", - "${identifier.vaults}", - "${identifier.userAssignedIdentities}", - "${identifier.dnszones}", - "${identifier.networkInterfaces}", - "${identifier.networkSecurityGroups}", - "${identifier.privateEndpoints}", - "${identifier.virtualNetworks}", - "${identifier.deploymentScripts}", - "${identifier.storageAccounts}", - "${identifier.resourcesDeployment}" - ], - "toolTip": "Tags help you organize your resources and categorize them for billing or management purposes. You can apply tags to resources deployed by the offer." - } - ] - } - ], - "outputs": { - "Location": "[location()]", - "adminPasswordOrKey": "[if(equals(basics('basicsRequired').adminPasswordOrKey.authenticationType, 'password'), basics('basicsRequired').adminPasswordOrKey.password, basics('basicsRequired').adminPasswordOrKey.sshPublicKey)]", - "adminUsername": "[basics('basicsRequired').adminUsername]", - "addressPrefixes": "[if(steps('section_appGateway').enableAppGateway, steps('section_networkingConfiguration').virtualNetworkWithAppGateway.addressPrefixes, steps('section_networkingConfiguration').virtualNetworkWithoutAppGateway.addressPrefixes)]", - "appGatewayCertificateOption": "[steps('section_appGateway').certificateOption]", - "appGatewaySSLBackendCertData": "[steps('section_appGateway').sslBackendCertData]", - "appGatewaySSLCertData": "[steps('section_appGateway').appGatewaySSLCertData]", - "appGatewaySSLCertPassword": "[steps('section_appGateway').appGatewaySSLCertPassword]", - "authenticationType": "[basics('basicsRequired').adminPasswordOrKey.authenticationType]", - "enableDB": "[bool(steps('section_database').enableDB)]", - "databaseType": "[steps('section_database').databaseConnectionInfo.databaseType]", - "denyPublicTrafficForAdminServer": "[steps('section_networkingConfiguration').denyPublicTrafficForAdminServer]", - "denyPublicTrafficForManagedServer": "[steps('section_networkingConfiguration').denyPublicTrafficForManagedServer]", - "dnsLabelPrefix": "[steps('section_networkingConfiguration').dnsLabelPrefix]", - "dnszoneName": "[steps('section_networkingConfiguration').customDNSSettings.dnszoneName]", - "dnszoneResourceGroup": "[steps('section_networkingConfiguration').customDNSSettings.dnsZoneResourceGroup]", - "dnszoneAdminConsoleLabel": "[steps('section_networkingConfiguration').customDNSSettings.dnszoneAdminConsoleLabel]", - "dnszoneAppGatewayLabel": "[steps('section_networkingConfiguration').customDNSSettings.dnszoneGatewayLabel]", - "dsConnectionURL": "[steps('section_database').databaseConnectionInfo.dsConnectionURL]", - "dbGlobalTranPro": "[steps('section_database').databaseConnectionInfo.dbGlobalTranPro]", - "dbIdentity": "[steps('section_database').databaseConnectionInfo.dbIdentity]", - "dbPassword": "[steps('section_database').databaseConnectionInfo.dbPassword]", - "dbUser": "[steps('section_database').databaseConnectionInfo.dbUser]", - "enableAppGateway": "[steps('section_appGateway').enableAppGateway]", - "enableCoherence": "[bool(steps('section_coherence').enableCoherence)]", - "enableCoherenceWebLocalStorage": "[bool(if(bool(steps('section_coherence').enableCoherence),steps('section_coherence').coherenceInfo.enableCoherenceWebLocalStorage,'false'))]", - "enableCookieBasedAffinity": "[bool(steps('section_appGateway').enableCookieBasedAffinity)]", - "enableDNSConfiguration": "[bool(steps('section_networkingConfiguration').enableCustomDNS)]", - "enablePswlessConnection": "[or(bool(steps('section_database').databaseConnectionInfo.enablePswlessConnection), bool(steps('section_database').databaseConnectionInfo.enablePswlessConnection0))]", - "hasDNSZones": "[bool(if(bool(steps('section_networkingConfiguration').enableCustomDNS), steps('section_networkingConfiguration').customDNSSettings.bringDNSZone, 'false'))]", - "jdbcDataSourceName": "[steps('section_database').databaseConnectionInfo.jdbcDataSourceName]", - "managedServerPrefix": "[basics('basicsOptional').managedServerPrefix]", - "numberOfCoherenceCacheInstances": "[int(if(bool(steps('section_coherence').enableCoherence),steps('section_coherence').coherenceInfo.numberOfCoherenceCacheInstances,'1'))]", - "numberOfInstances": "[int(basics('basicsRequired').numberOfInstances)]", - "portsToExpose": "[steps('section_networkingConfiguration').portsToExpose]", - "skuUrnVersion": "[basics('skuUrnVersion')]", - "useSystemAssignedManagedIdentity": "[basics('basicsOptional').useSystemAssignedManagedIdentity]", - "vmSize": "[basics('vmSizeSelect')]", - "vmSizeSelectForCoherence": "[steps('section_coherence').coherenceInfo.coherenceVMSizeSelect]", - "wlsDomainName": "[basics('basicsOptional').wlsDomainName]", - "wlsPassword": "[basics('basicsRequired').wlsPassword]", - "wlsUserName": "[basics('basicsRequired').wlsUserName]", - "enableHTTPAdminListenPort": "[basics('basicsOptional').enableAdminHTTPListenPort]", - "enableCustomSSL": "[steps('section_sslConfiguration').enableCustomSSL]", - "subnetName": "[if(steps('section_appGateway').enableAppGateway, steps('section_networkingConfiguration').virtualNetworkWithAppGateway.subnets.subnet1.name, steps('section_networkingConfiguration').virtualNetworkWithoutAppGateway.subnets.subnet1.name)]", - "subnetPrefix": "[if(steps('section_appGateway').enableAppGateway, steps('section_networkingConfiguration').virtualNetworkWithAppGateway.subnets.subnet1.addressPrefix, steps('section_networkingConfiguration').virtualNetworkWithoutAppGateway.subnets.subnet1.addressPrefix)]", - "subnetForAppGateway": "[steps('section_networkingConfiguration').virtualNetworkWithAppGateway.subnets.subnet2.name]", - "subnetPrefixForAppGateway": "[steps('section_networkingConfiguration').virtualNetworkWithAppGateway.subnets.subnet2.addressPrefix]", - "uploadedCustomIdentityKeyStoreData": "[steps('section_sslConfiguration').uploadedCustomSSLSettings.uploadedCustomIdentityKeyStoreData]", - "uploadedCustomIdentityKeyStorePassphrase": "[steps('section_sslConfiguration').uploadedCustomSSLSettings.uploadedCustomIdentityKeyStorePassphrase]", - "uploadedCustomIdentityKeyStoreType": "[steps('section_sslConfiguration').uploadedCustomSSLSettings.uploadedCustomIdentityKeyStoreType]", - "uploadedCustomTrustKeyStoreData": "[steps('section_sslConfiguration').uploadedCustomSSLSettings.uploadedCustomTrustKeyStoreData]", - "uploadedCustomTrustKeyStorePassPhrase": "[steps('section_sslConfiguration').uploadedCustomSSLSettings.uploadedCustomTrustKeyStorePassPhrase]", - "uploadedCustomTrustKeyStoreType": "[steps('section_sslConfiguration').uploadedCustomSSLSettings.uploadedCustomTrustKeyStoreType]", - "uploadedPrivateKeyAlias": "[steps('section_sslConfiguration').uploadedCustomSSLSettings.uploadedPrivateKeyAlias]", - "uploadedPrivateKeyPassPhrase": "[steps('section_sslConfiguration').uploadedCustomSSLSettings.uploadedPrivateKeyPassPhrase]", - "virtualNetworkName": "[if(steps('section_appGateway').enableAppGateway, steps('section_networkingConfiguration').virtualNetworkWithAppGateway.name, steps('section_networkingConfiguration').virtualNetworkWithoutAppGateway.name)]", - "virtualNetworkResourceGroupName": "[if(steps('section_appGateway').enableAppGateway, steps('section_networkingConfiguration').virtualNetworkWithAppGateway.resourceGroup, steps('section_networkingConfiguration').virtualNetworkWithoutAppGateway.resourceGroup)]", - "virtualNetworkNewOrExisting": "[if(steps('section_appGateway').enableAppGateway, steps('section_networkingConfiguration').virtualNetworkWithAppGateway.newOrExisting, steps('section_networkingConfiguration').virtualNetworkWithoutAppGateway.newOrExisting)]", - "tagsByResource": "[steps('section_tags').tagsByResource]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/mainTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/mainTemplate.json deleted file mode 100644 index 9e5d28398..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/mainTemplate.json +++ /dev/null @@ -1,1442 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "defaultValue": "[deployment().properties.templateLink.uri]", - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - } - }, - "_artifactsLocationSasToken": { - "defaultValue": "", - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - } - }, - "adminPasswordOrKey": { - "type": "securestring", - "metadata": { - "description": "SSH Key or password for the Virtual Machine. SSH key is recommended." - } - }, - "adminUsername": { - "defaultValue": "weblogic", - "type": "string", - "metadata": { - "description": "User name for the Virtual Machine." - } - }, - "adminVMNamePrefix": { - "defaultValue": "admin", - "type": "string", - "metadata": { - "description": "Admin Server hosting VM name prefix." - } - }, - "appGatewayCertificateOption": { - "defaultValue": "haveCert", - "type": "string", - "metadata": { - "description": "Three scenarios we support for deploying app gateway" - }, - "allowedValues": [ - "haveCert", - "generateCert" - ] - }, - "appGatewaySSLBackendCertData": { - "defaultValue": "", - "type": "securestring", - "metadata": { - "description": "The one-line, base64 string of the SSL backend certificate data." - } - }, - "appGatewaySSLCertData": { - "defaultValue": "", - "type": "securestring", - "metadata": { - "description": "The one-line, base64 string of the SSL certificate data." - } - }, - "appGatewaySSLCertPassword": { - "defaultValue": "", - "type": "securestring", - "metadata": { - "description": "The value of the password for the SSL Certificate" - } - }, - "authenticationType": { - "type": "string", - "defaultValue": "password", - "allowedValues": [ - "sshPublicKey", - "password" - ], - "metadata": { - "description": "Type of authentication to use on the Virtual Machine. SSH key is recommended." - } - }, - "databaseType": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "One of the supported database types" - } - }, - "dbGlobalTranPro": { - "defaultValue": "OnePhaseCommit", - "type": "string", - "metadata": { - "description": "Determines the transaction protocol (global transaction processing behavior) for the data source." - } - }, - "dbIdentity": { - "defaultValue": {}, - "type": "object", - "metadata": { - "description": "Managed identity that has access to the data source." - } - }, - "dbPassword": { - "defaultValue": "", - "type": "securestring", - "metadata": { - "description": "Password for Database" - } - }, - "dbUser": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "Userid of Database" - } - }, - "denyPublicTrafficForAdminServer": { - "type": "bool", - "defaultValue": false - }, - "denyPublicTrafficForManagedServer": { - "type": "bool", - "defaultValue": false - }, - "dsConnectionURL": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "JDBC Connection String" - } - }, - "dnsLabelPrefix": { - "defaultValue": "wls", - "type": "string", - "metadata": { - "description": "Unique DNS Name for the Public IP used to access the Virtual Machine." - } - }, - "dnsNameforApplicationGateway": { - "defaultValue": "wlsgw", - "type": "string", - "metadata": { - "description": "DNS for ApplicationGateway" - } - }, - "dnszoneName": { - "defaultValue": "contoso.xyz", - "type": "string", - "metadata": { - "description": "Azure DNS Zone name." - } - }, - "dnszoneResourceGroup": { - "type": "string", - "defaultValue": "[resourceGroup().name]", - "metadata": { - "description": "Name of the resource group containing the Azure DNS Zone." - } - }, - "dnszoneAdminConsoleLabel": { - "type": "string", - "defaultValue": "console", - "metadata": { - "description": "Specify a label used to generate subdomain of Oracle WebLogic Administration Console. The final subdomain name will be label.dnszoneName, e.g. console.contoso.xyz" - } - }, - "dnszoneAppGatewayLabel": { - "type": "string", - "defaultValue": "applications", - "metadata": { - "description": "Specify a label used to generate subdomain of Application Gateway. The final subdomain name will be label.dnszoneName, e.g. applications.contoso.xyz" - } - }, - "enableAppGateway": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "If true, deploy an Azure App Gateway in front of the nodes of the cluster" - } - }, - "enableCoherence": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "If true, create Coherence Cluster with data tier for caches." - } - }, - "enableCoherenceWebLocalStorage": { - "defaultValue": true, - "type": "bool", - "metadata": { - "description": "Specifies whether Local Storage is enabled for the Coherence*Web cluster tier." - } - }, - "enableCookieBasedAffinity": { - "defaultValue": true, - "type": "bool", - "metadata": { - "description": "true to enable cookie based affinity." - } - }, - "enableDB": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "If true, use the supplied parameters to connect the cluster to a pre-provisioned database." - } - }, - "enableDNSConfiguration": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "If true, use the supplied parameters to configure custome DNS." - } - }, - "enablePswlessConnection": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "True to enable passwordless JDBC connection." - } - }, - "gatewayPublicIPAddressName": { - "defaultValue": "gwip", - "type": "string", - "metadata": { - "description": "Public IP Name for the Application Gateway" - } - }, - "guidValue": { - "type": "string", - "defaultValue": "[newGuid()]" - }, - "hasDNSZones": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "If true, the template will update records to the existing DNS Zone. If false, the template will create a new DNS Zone." - } - }, - "jdbcDataSourceName": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "JNDI Name for JDBC Datasource" - } - }, - "keyVaultSku": { - "defaultValue": "Standard", - "type": "string", - "metadata": { - "description": "Price tier for Key Vault." - } - }, - "location": { - "defaultValue": "[resourceGroup().location]", - "type": "string", - "metadata": { - "description": "Location for all resources." - } - }, - "managedServerPrefix": { - "defaultValue": "msp", - "type": "string", - "metadata": { - "description": "Provide managed server prefix names" - } - }, - "numberOfInstances": { - "defaultValue": 2, - "type": "int", - "minValue": 2, - "maxValue": 5, - "metadata": { - "description": "Number of VMs to deploy, limit 5 since this sample is using a single storage account" - } - }, - "numberOfCoherenceCacheInstances": { - "defaultValue": 1, - "type": "int", - "minValue": 1, - "maxValue": 10, - "metadata": { - "description": "Number of Coherence cache instances, used to create Virtual Machines and Managed Server for storage." - } - }, - "portsToExpose": { - "defaultValue": "80,443,7001-9000", - "type": "string", - "metadata": { - "description": "Ports and port ranges to expose" - } - }, - "skuUrnVersion": { - "type": "string", - "defaultValue": "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest", - "allowedValues": [ - "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest", - "owls-141100-jdk11-ol87;Oracle:weblogic-141100-jdk11-ol87:owls-141100-jdk11-ol87;latest", - "owls-141100-jdk8-ol91;Oracle:weblogic-141100-jdk8-ol91:owls-141100-jdk8-ol91;latest", - "owls-141100-jdk8-ol87;Oracle:weblogic-141100-jdk8-ol87:owls-141100-jdk8-ol87;latest", - "owls-122140-jdk8-ol91;Oracle:weblogic-122140-jdk8-ol91:owls-122140-jdk8-ol91;latest", - "owls-122140-jdk8-ol87;Oracle:weblogic-122140-jdk8-ol87:owls-122140-jdk8-ol87;latest", - "owls-122140-jdk8-ol76;Oracle:weblogic-122140-jdk8-ol76:owls-122140-jdk8-ol7;latest", - "owls-141100-jdk8-ol76;Oracle:weblogic-141100-jdk8-ol76:owls-141100-jdk8-ol7;latest", - "owls-141100-jdk11-ol76;Oracle:weblogic-141100-jdk11-ol76:owls-141100-jdk11-ol7;latest", - "owls-141100-jdk11-rhel87;Oracle:weblogic-141100-jdk11-rhel87:owls-141100-jdk11-rhel87;latest", - "owls-141100-jdk8-rhel87;Oracle:weblogic-141100-jdk8-rhel87:owls-141100-jdk8-rhel87;latest", - "owls-122140-jdk8-rhel87;Oracle:weblogic-122140-jdk8-rhel87:owls-122140-jdk8-rhel87;latest", - "owls-122140-jdk8-rhel76;Oracle:weblogic-122140-jdk8-rhel76:owls-122140-jdk8-rhel76;latest", - "owls-141100-jdk8-rhel76;Oracle:weblogic-141100-jdk8-rhel76:owls-141100-jdk8-rhel76;latest", - "owls-141100-jdk11-rhel76;Oracle:weblogic-141100-jdk11-rhel76:owls-141100-jdk11-rhel76;latest" - ], - "metadata": { - "description": "The Oracle Linux image with Weblogic and Java preinstalled. Semicolon separated string of Sku, URN, and Version" - } - }, - "tagsByResource": { - "type": "object", - "defaultValue": {}, - "metadata": { - "description": "${label.tagsLabel}" - } - }, - "usePreviewImage": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "Bool value, if it's set to true, will deploy with preview weblogic image." - } - }, - "useSystemAssignedManagedIdentity": { - "type": "bool", - "defaultValue": true, - "metadata": { - "description": "Bool value, if it's set to true, a system assigned managed identity will to be created for the VM(s)" - } - }, - "vmSize": { - "defaultValue": "Standard_A3", - "type": "string", - "metadata": { - "description": "Select appropriate VM Size as per requirement" - } - }, - "vmSizeSelectForCoherence": { - "defaultValue": "Standard_A3", - "type": "string", - "metadata": { - "description": "Select appropriate VM Size for Coherence" - } - }, - "virtualNetworkNewOrExisting": { - "type": "string", - "defaultValue": "new", - "allowedValues": [ - "new", - "existing" - ], - "metadata": { - "description": "Specify whether to create a new or existing virtual network for the VM." - } - }, - "virtualNetworkName": { - "type": "string", - "defaultValue": "[concat('wlscluster-vnet-', uniqueString(utcNow()))]", - "metadata": { - "description": "Name of the existing or new VNET" - } - }, - "virtualNetworkResourceGroupName": { - "type": "string", - "defaultValue": "[resourceGroup().name]", - "metadata": { - "description": "Resource group of Virtual network" - } - }, - "addressPrefixes": { - "type": "array", - "defaultValue": [ - "10.0.0.0/16" - ], - "metadata": { - "description": "Address prefix of the VNET." - } - }, - "subnetName": { - "type": "string", - "defaultValue": "wls-subnet", - "metadata": { - "description": "Name of the existing or new Subnet" - } - }, - "subnetPrefix": { - "type": "string", - "defaultValue": "10.0.0.0/24", - "metadata": { - "description": "Address prefix of the subnet" - } - }, - "subnetForAppGateway": { - "type": "string", - "defaultValue": "appgateway-subnet", - "metadata": { - "description": "Name of the existing or new Subnet for Application Gateway" - } - }, - "subnetPrefixForAppGateway": { - "type": "string", - "defaultValue": "10.0.1.0/24", - "metadata": { - "description": "Address prefix of the subnet for Application Gateway" - } - }, - "wlsDomainName": { - "defaultValue": "wlsd", - "type": "string", - "metadata": { - "description": "Provide Weblogic domain name" - } - }, - "wlsUserName": { - "defaultValue": "weblogic", - "type": "string", - "metadata": { - "description": "Username for your Weblogic domain name" - } - }, - "wlsPassword": { - "type": "securestring", - "metadata": { - "description": "Password for your Weblogic domain name" - } - }, - "enableHTTPAdminListenPort": { - "defaultValue": true, - "type": "bool", - "metadata": { - "description": "Boolean value indicating, if WebLogic Admin Server HTTP Listen Port is enabled or not" - } - }, - "enableCustomSSL": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "Boolean value indicating, if custom SSL is enabled or not" - } - }, - "uploadedCustomIdentityKeyStoreData": { - "type": "string", - "metadata": { - "description": "Custom Identity KeyStore Data" - }, - "defaultValue": "customIdentityKeyStoreData" - }, - "uploadedCustomIdentityKeyStorePassphrase": { - "type": "securestring", - "metadata": { - "description": "Custom Identity KeyStore Passphrase" - }, - "defaultValue": "" - }, - "uploadedCustomIdentityKeyStoreType": { - "type": "string", - "metadata": { - "description": "Weblogic Custom Identity Keystore Type" - }, - "defaultValue": "JKS" - }, - "uploadedCustomTrustKeyStoreData": { - "type": "string", - "metadata": { - "description": "Custom Trust KeyStore Data" - }, - "defaultValue": "customTrustKeyStoreData" - }, - "uploadedCustomTrustKeyStorePassPhrase": { - "type": "securestring", - "metadata": { - "description": "Custom Trust KeyStore PassPhrase" - }, - "defaultValue": "" - }, - "uploadedCustomTrustKeyStoreType": { - "type": "string", - "metadata": { - "description": "Weblogic Custom Trust Keystore Type" - }, - "defaultValue": "JKS" - }, - "uploadedPrivateKeyAlias": { - "type": "string", - "metadata": { - "description": "Alias of the private key" - }, - "defaultValue": "privateKeyAlias" - }, - "uploadedPrivateKeyPassPhrase": { - "type": "securestring", - "metadata": { - "description": "Password of the private key" - }, - "defaultValue": "" - } - }, - "variables": { - "const_appGatewaySSLCertOptionGenerateCert": "generateCert", - "const_azureSubjectName": "[format('{0}.{1}.{2}', variables('name_domainLabelforApplicationGateway'), parameters('location'),'cloudapp.azure.com')]", - "const_globalResourceNameSuffix": "[uniqueString(parameters('guidValue'))]", - "const_vmSize": "[parameters('vmSize')]", - "const_vmSizeCoherence": "[parameters('vmSizeSelectForCoherence')]", - "name_adminVM": "[concat(parameters('adminVMNamePrefix'), variables('const_globalResourceNameSuffix'), 'VM')]", - "name_appGatewayConnector": "_appGatewayConnectorTemplate.json", - "name_clusterLinkedTemplateName": "clusterTemplate.json", - "name_clusterCustomSSLLinkedTemplateName": "clusterCustomSSLTemplate.json", - "name_coherenceTemplateName": "coherenceTemplate.json", - "name_dbLinkedTemplateName": "dbTemplate.json", - "name_dnsNameforApplicationGateway": "[concat(parameters('dnsNameforApplicationGateway'), take(variables('const_globalResourceNameSuffix'), 6))]", - "name_dnszonesLinkedTemplateName": "dnszonesTemplate.json", - "name_domainLabelforApplicationGateway": "[take(concat(variables('name_dnsNameforApplicationGateway'),'-',toLower(resourceGroup().name),'-',toLower(parameters('wlsDomainName'))),63)]", - "name_keyVaultLinkedTemplateName": "_keyvaultWithNewCertTemplate.json", - "name_networkSecurityGroup": "[concat(parameters('dnsLabelPrefix'), '-nsg-', variables('const_globalResourceNameSuffix'))]", - "name_nsgLinkedTemplateName": "nsgNestedTemplate.json", - "name_managedVMNamePrefix": "[concat(parameters('managedServerPrefix'), variables('const_globalResourceNameSuffix'))]", - "clusterTemplateRef": "[concat('cluster',if(parameters('enableCustomSSL'),'CustomSSL',''),'LinkedTemplate')]", - "name_clusterTemplate": "clusterLinkedTemplate", - "name_clusterCustomSSLTemplate": "clusterCustomSSLLinkedTemplate", - "name_keyVaultName": "[concat('wls-kv-', variables('const_globalResourceNameSuffix'))]", - "name_secretName": "mySelfSignedCertificate", - // If adding a new resource, add the resource identifier to the array below - // Also modify createUIDefinition.json to include the new resource - "obj_tagsByResources": { - "${identifier.applicationGateways}": "[funcTags.tagsFilter(parameters('tagsByResource'), '${identifier.applicationGateways}')]", - "${identifier.availabilitySets}": "[funcTags.tagsFilter(parameters('tagsByResource'), '${identifier.availabilitySets}')]", - "${identifier.dnszones}": "[funcTags.tagsFilter(parameters('tagsByResource'), '${identifier.dnszones}')]", - "${identifier.networkInterfaces}": "[funcTags.tagsFilter(parameters('tagsByResource'), '${identifier.networkInterfaces}')]", - "${identifier.networkSecurityGroups}": "[funcTags.tagsFilter(parameters('tagsByResource'), '${identifier.networkSecurityGroups}')]", - "${identifier.publicIPAddresses}": "[funcTags.tagsFilter(parameters('tagsByResource'), '${identifier.publicIPAddresses}')]", - "${identifier.privateEndpoints}": "[funcTags.tagsFilter(parameters('tagsByResource'), '${identifier.privateEndpoints}')]", - "${identifier.storageAccounts}": "[funcTags.tagsFilter(parameters('tagsByResource'), '${identifier.storageAccounts}')]", - "${identifier.vaults}": "[funcTags.tagsFilter(parameters('tagsByResource'), '${identifier.vaults}')]", - "${identifier.virtualNetworks}": "[funcTags.tagsFilter(parameters('tagsByResource'), '${identifier.virtualNetworks}')]", - "${identifier.virtualMachines}": "[funcTags.tagsFilter(parameters('tagsByResource'), '${identifier.virtualMachines}')]", - "${identifier.virtualMachinesExtensions}": "[funcTags.tagsFilter(parameters('tagsByResource'), '${identifier.virtualMachinesExtensions}')]", - "${identifier.deploymentScripts}": "[funcTags.tagsFilter(parameters('tagsByResource'), '${identifier.deploymentScripts}')]", - "${identifier.userAssignedIdentities}": "[funcTags.tagsFilter(parameters('tagsByResource'), '${identifier.userAssignedIdentities}')]", - "${identifier.resourcesDeployment}": "[funcTags.tagsFilter(parameters('tagsByResource'), '${identifier.resourcesDeployment}')]" - } - }, - "functions": [ - { - // This same function is defined in the mainTemplate.json for every other offer. - // Please ensure any changes are applied in all the other places. - "namespace": "funcTags", - "members": { - "tagsFilter": { - "parameters": [ - { - "name": "tagsByResource", - "type": "object" - }, - { - "name": "resourceIdentifier", - "type": "string" - } - ], - "output": { - "type": "object", - "value": "[if(contains(parameters('tagsByResource'), parameters('resourceIdentifier')), parameters('tagsByResource')[parameters('resourceIdentifier')], json('{}'))]" - } - } - } - } - ], - "resources": [ - { - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${cluster.start}", - "type": "Microsoft.Resources/deployments", - "tags": "[variables('obj_tagsByResources')['${identifier.resourcesDeployment}']]", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "[variables('name_clusterTemplate')]", - "tags": "[variables('obj_tagsByResources')['${identifier.resourcesDeployment}']]", - "condition": "[not(parameters('enableCustomSSL'))]", - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_clusterLinkedTemplateName')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "_globalResourceNameSuffix": { - "value": "[variables('const_globalResourceNameSuffix')]" - }, - "adminPasswordOrKey": { - "value": "[parameters('adminPasswordOrKey')]" - }, - "adminUsername": { - "value": "[parameters('adminUsername')]" - }, - "adminVMName": { - "value": "[variables('name_adminVM')]" - }, - "authenticationType": { - "value": "[parameters('authenticationType')]" - }, - "addressPrefixes": { - "value": "[parameters('addressPrefixes')]" - }, - "dnsLabelPrefix": { - "value": "[parameters('dnsLabelPrefix')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "managedServerPrefix": { - "value": "[parameters('managedServerPrefix')]" - }, - "managedVMNamePrefix": { - "value": "[variables('name_managedVMNamePrefix')]" - }, - "numberOfInstances": { - "value": "[parameters('numberOfInstances')]" - }, - "nsgName": { - "value": "[variables('name_networkSecurityGroup')]" - }, - "portsToExpose": { - "value": "[parameters('portsToExpose')]" - }, - "skuUrnVersion": { - "value": "[parameters('skuUrnVersion')]" - }, - "subnetName": { - "value": "[parameters('subnetName')]" - }, - "subnetPrefix": { - "value": "[parameters('subnetPrefix')]" - }, - "subnetForAppGateway": { - "value": "[parameters('subnetForAppGateway')]" - }, - "subnetPrefixForAppGateway": { - "value": "[parameters('subnetPrefixForAppGateway')]" - }, - "tagsByResource": { - "value": "[variables('obj_tagsByResources')]" - }, - "usePreviewImage": { - "value": "[parameters('usePreviewImage')]" - }, - "useSystemAssignedManagedIdentity": { - "value": "[parameters('useSystemAssignedManagedIdentity')]" - }, - "vmSize": { - "value": "[variables('const_vmSize')]" - }, - "virtualNetworkNewOrExisting": { - "value": "[parameters('virtualNetworkNewOrExisting')]" - }, - "virtualNetworkName": { - "value": "[parameters('virtualNetworkName')]" - }, - "virtualNetworkResourceGroupName": { - "value": "[parameters('virtualNetworkResourceGroupName')]" - }, - "wlsDomainName": { - "value": "[parameters('wlsDomainName')]" - }, - "wlsPassword": { - "value": "[parameters('wlsPassword')]" - }, - "wlsUserName": { - "value": "[parameters('wlsUserName')]" - }, - "enableAppGateway": { - "value": "[parameters('enableAppGateway')]" - }, - "enableHTTPAdminListenPort": { - "value": "[parameters('enableHTTPAdminListenPort')]" - }, - "enableDNSConfiguration": { - "value": "[parameters('enableDNSConfiguration')]" - }, - "customDNSNameForAdminServer": { - "value": "[if(parameters('enableDNSConfiguration'), format('{0}.{1}', parameters('dnszoneAdminConsoleLabel'),parameters('dnszoneName')),'')]" - } - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[variables('obj_tagsByResources')['${identifier.resourcesDeployment}']]", - "name": "[variables('name_clusterCustomSSLTemplate')]", - "condition": "[parameters('enableCustomSSL')]", - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_clusterCustomSSLLinkedTemplateName')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "_globalResourceNameSuffix": { - "value": "[variables('const_globalResourceNameSuffix')]" - }, - "adminPasswordOrKey": { - "value": "[parameters('adminPasswordOrKey')]" - }, - "adminUsername": { - "value": "[parameters('adminUsername')]" - }, - "adminVMName": { - "value": "[variables('name_adminVM')]" - }, - "authenticationType": { - "value": "[parameters('authenticationType')]" - }, - "addressPrefixes": { - "value": "[parameters('addressPrefixes')]" - }, - "dnsLabelPrefix": { - "value": "[parameters('dnsLabelPrefix')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "managedServerPrefix": { - "value": "[parameters('managedServerPrefix')]" - }, - "managedVMNamePrefix": { - "value": "[variables('name_managedVMNamePrefix')]" - }, - "numberOfInstances": { - "value": "[parameters('numberOfInstances')]" - }, - "nsgName": { - "value": "[variables('name_networkSecurityGroup')]" - }, - "portsToExpose": { - "value": "[parameters('portsToExpose')]" - }, - "skuUrnVersion": { - "value": "[parameters('skuUrnVersion')]" - }, - "subnetName": { - "value": "[parameters('subnetName')]" - }, - "subnetPrefix": { - "value": "[parameters('subnetPrefix')]" - }, - "subnetForAppGateway": { - "value": "[parameters('subnetForAppGateway')]" - }, - "subnetPrefixForAppGateway": { - "value": "[parameters('subnetPrefixForAppGateway')]" - }, - "tagsByResource": { - "value": "[variables('obj_tagsByResources')]" - }, - "usePreviewImage": { - "value": "[parameters('usePreviewImage')]" - }, - "useSystemAssignedManagedIdentity": { - "value": "[parameters('useSystemAssignedManagedIdentity')]" - }, - "vmSize": { - "value": "[variables('const_vmSize')]" - }, - "virtualNetworkNewOrExisting": { - "value": "[parameters('virtualNetworkNewOrExisting')]" - }, - "virtualNetworkName": { - "value": "[parameters('virtualNetworkName')]" - }, - "virtualNetworkResourceGroupName": { - "value": "[parameters('virtualNetworkResourceGroupName')]" - }, - "wlsDomainName": { - "value": "[parameters('wlsDomainName')]" - }, - "wlsPassword": { - "value": "[parameters('wlsPassword')]" - }, - "wlsUserName": { - "value": "[parameters('wlsUserName')]" - }, - "enableAppGateway": { - "value": "[parameters('enableAppGateway')]" - }, - "enableHTTPAdminListenPort": { - "value": "[parameters('enableHTTPAdminListenPort')]" - }, - "enableDNSConfiguration": { - "value": "[parameters('enableDNSConfiguration')]" - }, - "customDNSNameForAdminServer": { - "value": "[if(parameters('enableDNSConfiguration'), format('{0}.{1}', parameters('dnszoneAdminConsoleLabel'),parameters('dnszoneName')),'')]" - }, - "enableCustomSSL": { - "value": "[parameters('enableCustomSSL')]" - }, - "sslCustomIdentityKeyStoreData": { - "value": "[parameters('uploadedCustomIdentityKeyStoreData')]" - }, - "sslCustomIdentityKeyStorePassPhrase": { - "value": "[parameters('uploadedCustomIdentityKeyStorePassphrase')]" - }, - "sslCustomIdentityKeyStoreType": { - "value": "[parameters('uploadedCustomIdentityKeyStoreType')]" - }, - "sslCustomTrustKeyStoreData": { - "value": "[parameters('uploadedCustomTrustKeyStoreData')]" - }, - "sslCustomTrustKeyStorePassPhrase": { - "value": "[parameters('uploadedCustomTrustKeyStorePassPhrase')]" - }, - "sslCustomTrustKeyStoreType": { - "value": "[parameters('uploadedCustomTrustKeyStoreType')]" - }, - "sslPrivateKeyAlias": { - "value": "[parameters('uploadedPrivateKeyAlias')]" - }, - "sslPrivateKeyPassPhrase": { - "value": "[parameters('uploadedPrivateKeyPassPhrase')]" - } - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[variables('obj_tagsByResources')['${identifier.resourcesDeployment}']]", - "name": "keyVaultwithSelfSignedAppGatewaySSLCert", - "condition": "[and(parameters('enableAppGateway'), equals(parameters('appGatewayCertificateOption'), variables('const_appGatewaySSLCertOptionGenerateCert')))]", - "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', variables('clusterTemplateRef'))]" - ], - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_keyVaultLinkedTemplateName')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_globalResourceNameSuffix": { - "value": "[variables('const_globalResourceNameSuffix')]" - }, - "keyVaultName": { - "value": "[variables('name_keyVaultName')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "secretName": { - "value": "[variables('name_secretName')]" - }, - "sku": { - "value": "[parameters('keyVaultSku')]" - }, - "subjectName": { - "value": "[format('CN={0}', if(parameters('enableDNSConfiguration'), format('{0}.{1}', parameters('dnsNameforApplicationGateway'), parameters('dnszoneName')), variables('const_azureSubjectName')))]" - }, - "tagsByResource": { - "value": "[variables('obj_tagsByResources')]" - } - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[variables('obj_tagsByResources')['${identifier.resourcesDeployment}']]", - "condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'new')]", - "name": "networkSecurityLinkedTemplate", - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_nsgLinkedTemplateName')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "networkSecurityGroupName": { - "value": "[variables('name_networkSecurityGroup')]" - }, - "denyPublicTrafficForAdminServer": { - "value": "[parameters('denyPublicTrafficForAdminServer')]" - }, - "denyPublicTrafficForManagedServer": { - "value": "[parameters('denyPublicTrafficForManagedServer')]" - }, - "enableAppGateway": { - "value": "[parameters('enableAppGateway')]" - } - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', variables('clusterTemplateRef'))]" - ] - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[variables('obj_tagsByResources')['${identifier.resourcesDeployment}']]", - "name": "appGatewayLinkedTemplate", - "condition": "[parameters('enableAppGateway')]", - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_appGatewayConnector')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "adminVMName": { - "value": "[variables('name_adminVM')]" - }, - "appGatewayName": { - "value": "[concat(parameters('dnsLabelPrefix'), '-agw-', variables('const_globalResourceNameSuffix'))]" - }, - "appGatewayCertificateOption": { - "value": "[parameters('appGatewayCertificateOption')]" - }, - "appGatewaySSLBackendCertData": { - "value": "[parameters('appGatewaySSLBackendCertData')]" - }, - "autoGeneratedSSLCertKeyVaultName": { - "value": "[if(equals(parameters('appGatewayCertificateOption'), variables('const_appGatewaySSLCertOptionGenerateCert')), reference('keyVaultwithSelfSignedAppGatewaySSLCert', '${azure.apiVersionForDeployment}').outputs.keyvaultName.value, '')]" - }, - "autoGeneratedSSLCertSecretName": { - "value": "[if(equals(parameters('appGatewayCertificateOption'), variables('const_appGatewaySSLCertOptionGenerateCert')), reference('keyVaultwithSelfSignedAppGatewaySSLCert', '${azure.apiVersionForDeployment}').outputs.secretName.value, '')]" - }, - "customDomainNameforApplicationGateway": { - "value": "[format('{0}.{1}', parameters('dnszoneAppGatewayLabel'), parameters('dnszoneName'))]" - }, - "domainLabelforApplicationGateway": { - "value": "[variables('name_domainLabelforApplicationGateway')]" - }, - "enableCustomSSL": { - "value": "[parameters('enableCustomSSL')]" - }, - "enableCookieBasedAffinity": { - "value": "[parameters('enableCookieBasedAffinity')]" - }, - "gatewayPublicIPAddressName": { - "value": "[concat(parameters('gatewayPublicIPAddressName'), variables('const_globalResourceNameSuffix'))]" - }, - "location": { - "value": "[parameters('location')]" - }, - "managedVMNamePrefix": { - "value": "[variables('name_managedVMNamePrefix')]" - }, - "numberOfInstances": { - "value": "[parameters('numberOfInstances')]" - }, - "overrideHostName": { - "value": "[parameters('enableDNSConfiguration')]" - }, - "sslCertData": { - "value": "[parameters('appGatewaySSLCertData')]" - }, - "sslCertPswData": { - "value": "[parameters('appGatewaySSLCertPassword')]" - }, - "tagsByResource": { - "value": "[variables('obj_tagsByResources')]" - }, - "virtualNetworkNewOrExisting": { - "value": "[parameters('virtualNetworkNewOrExisting')]" - }, - "virtualNetworkResourceGroupName": { - "value": "[parameters('virtualNetworkResourceGroupName')]" - }, - "virtualNetworkName": { - "value": "[parameters('virtualNetworkName')]" - }, - "subnetForAppGateway": { - "value": "[parameters('subnetForAppGateway')]" - }, - "wlsDomainName": { - "value": "[parameters('wlsDomainName')]" - }, - "wlsPassword": { - "value": "[parameters('wlsPassword')]" - }, - "wlsUserName": { - "value": "[parameters('wlsUserName')]" - } - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', 'keyVaultwithSelfSignedAppGatewaySSLCert')]", - "[resourceId('Microsoft.Resources/deployments', variables('clusterTemplateRef'))]" - ] - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[variables('obj_tagsByResources')['${identifier.resourcesDeployment}']]", - "name": "dnszonesLinkedTemplate", - "condition": "[parameters('enableDNSConfiguration')]", - "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', 'appGatewayLinkedTemplate')]" - ], - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_dnszonesLinkedTemplateName')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "_globalResourceNameSuffix": { - "value": "[variables('const_globalResourceNameSuffix')]" - }, - "dnszonesARecordSetNames": { - "value": [ - "[parameters('dnszoneAdminConsoleLabel')]" - ] - }, - "dnszonesCNAMEAlias": { - "value": "[if(parameters('enableAppGateway'), createArray(reference('appGatewayLinkedTemplate', '${azure.apiVersionForDeployment}').outputs.appGatewayAlias.value), createArray())]" - }, - "dnszonesCNAMERecordSetNames": { - "value": "[if(parameters('enableAppGateway'), createArray(parameters('dnszoneAppGatewayLabel')), createArray())]" - }, - "dnszoneName": { - "value": "[parameters('dnszoneName')]" - }, - "hasDNSZones": { - "value": "[parameters('hasDNSZones')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "resourceGroup": { - "value": "[parameters('dnszoneResourceGroup')]" - }, - "targetResources": { - "value": [ - "[reference(variables('clusterTemplateRef'), '${azure.apiVersionForDeployment}').outputs._adminPublicIPId.value]" - ] - }, - "tagsByResource": { - "value": "[variables('obj_tagsByResources')]" - } - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[variables('obj_tagsByResources')['${identifier.resourcesDeployment}']]", - "name": "dbLinkedTemplate", - "condition": "[parameters('enableDB')]", - "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', 'dnszonesLinkedTemplate')]" - ], - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_dbLinkedTemplateName')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "adminVMName": { - "value": "[variables('name_adminVM')]" - }, - "databaseType": { - "value": "[parameters('databaseType')]" - }, - "dbGlobalTranPro": { - "value": "[parameters('dbGlobalTranPro')]" - }, - "dbIdentity": { - "value": "[parameters('dbIdentity')]" - }, - "dbPassword": { - "value": "[parameters('dbPassword')]" - }, - "dbUser": { - "value": "[parameters('dbUser')]" - }, - "dsConnectionURL": { - "value": "[parameters('dsConnectionURL')]" - }, - "enablePswlessConnection": { - "value": "[parameters('enablePswlessConnection')]" - }, - "jdbcDataSourceName": { - "value": "[parameters('jdbcDataSourceName')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "managedServerPrefix": { - "value": "[parameters('managedServerPrefix')]" - }, - "managedVMNamePrefix": { - "value": "[variables('name_managedVMNamePrefix')]" - }, - "numberOfManagedApplicationInstances": { - "value": "[add(parameters('numberOfInstances'),-1)]" - }, - "tagsByResource": { - "value": "[variables('obj_tagsByResources')]" - }, - "wlsDomainName": { - "value": "[parameters('wlsDomainName')]" - }, - "wlsPassword": { - "value": "[parameters('wlsPassword')]" - }, - "wlsUserName": { - "value": "[parameters('wlsUserName')]" - } - } - } - }, - { - "name": "coherenceTemplate", - "type": "Microsoft.Resources/deployments", - "tags": "[variables('obj_tagsByResources')['${identifier.resourcesDeployment}']]", - "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', 'dbLinkedTemplate')]" - ], - "apiVersion": "${azure.apiVersionForDeployment}", - "condition": "[and(parameters('enableCoherence'),not(parameters('enableCustomSSL')))]", - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_coherenceTemplateName')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "_globalResourceNameSuffix": { - "value": "[variables('const_globalResourceNameSuffix')]" - }, - "adminPasswordOrKey": { - "value": "[parameters('adminPasswordOrKey')]" - }, - "adminUsername": { - "value": "[parameters('adminUsername')]" - }, - "adminVMName": { - "value": "[variables('name_adminVM')]" - }, - "authenticationType": { - "value": "[parameters('authenticationType')]" - }, - "dnsLabelPrefix": { - "value": "[parameters('dnsLabelPrefix')]" - }, - "enableCoherenceWebLocalStorage": { - "value": "[parameters('enableCoherenceWebLocalStorage')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "managedServerPrefix": { - "value": "[parameters('managedServerPrefix')]" - }, - "managedVMNamePrefix": { - "value": "[variables('name_managedVMNamePrefix')]" - }, - "numberOfCoherenceCacheInstances": { - "value": "[parameters('numberOfCoherenceCacheInstances')]" - }, - "skuUrnVersion": { - "value": "[parameters('skuUrnVersion')]" - }, - "storageAccountName": { - "value": "[reference(variables('clusterTemplateRef'), '${azure.apiVersionForDeployment}').outputs.storageAccountName.value]" - }, - "subnetName": { - "value": "[parameters('subnetName')]" - }, - "tagsByResource": { - "value": "[variables('obj_tagsByResources')]" - }, - "usePreviewImage": { - "value": "[parameters('usePreviewImage')]" - }, - "vmSizeSelectForCoherence": { - "value": "[variables('const_vmSizeCoherence')]" - }, - "virtualNetworkResourceGroupName": { - "value": "[parameters('virtualNetworkResourceGroupName')]" - }, - "virtualNetworkName": { - "value": "[parameters('virtualNetworkName')]" - }, - "wlsDomainName": { - "value": "[parameters('wlsDomainName')]" - }, - "wlsPassword": { - "value": "[parameters('wlsPassword')]" - }, - "wlsUserName": { - "value": "[parameters('wlsUserName')]" - }, - "enableDNSConfiguration": { - "value": "[parameters('enableDNSConfiguration')]" - }, - "customDNSNameForAdminServer": { - "value": "[if(parameters('enableDNSConfiguration'), format('{0}.{1}', parameters('dnszoneAdminConsoleLabel'),parameters('dnszoneName')),'')]" - }, - "enableCustomSSL": { - "value": "[parameters('enableCustomSSL')]" - } - } - } - }, - { - "name": "coherenceTemplateWithCustomSSL", - "type": "Microsoft.Resources/deployments", - "tags": "[variables('obj_tagsByResources')['${identifier.resourcesDeployment}']]", - "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', 'dbLinkedTemplate')]" - ], - "apiVersion": "${azure.apiVersionForDeployment}", - "condition": "[and(parameters('enableCoherence'),parameters('enableCustomSSL'))]", - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_coherenceTemplateName')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "_globalResourceNameSuffix": { - "value": "[variables('const_globalResourceNameSuffix')]" - }, - "adminPasswordOrKey": { - "value": "[parameters('adminPasswordOrKey')]" - }, - "adminUsername": { - "value": "[parameters('adminUsername')]" - }, - "adminVMName": { - "value": "[variables('name_adminVM')]" - }, - "authenticationType": { - "value": "[parameters('authenticationType')]" - }, - "dnsLabelPrefix": { - "value": "[parameters('dnsLabelPrefix')]" - }, - "enableCoherenceWebLocalStorage": { - "value": "[parameters('enableCoherenceWebLocalStorage')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "managedServerPrefix": { - "value": "[parameters('managedServerPrefix')]" - }, - "managedVMNamePrefix": { - "value": "[variables('name_managedVMNamePrefix')]" - }, - "numberOfCoherenceCacheInstances": { - "value": "[parameters('numberOfCoherenceCacheInstances')]" - }, - "skuUrnVersion": { - "value": "[parameters('skuUrnVersion')]" - }, - "storageAccountName": { - "value": "[reference(variables('clusterTemplateRef'), '${azure.apiVersionForDeployment}').outputs.storageAccountName.value]" - }, - "subnetName": { - "value": "[parameters('subnetName')]" - }, - "tagsByResource": { - "value": "[variables('obj_tagsByResources')]" - }, - "usePreviewImage": { - "value": "[parameters('usePreviewImage')]" - }, - "vmSizeSelectForCoherence": { - "value": "[variables('const_vmSizeCoherence')]" - }, - "virtualNetworkResourceGroupName": { - "value": "[parameters('virtualNetworkResourceGroupName')]" - }, - "virtualNetworkName": { - "value": "[parameters('virtualNetworkName')]" - }, - "wlsDomainName": { - "value": "[parameters('wlsDomainName')]" - }, - "wlsPassword": { - "value": "[parameters('wlsPassword')]" - }, - "wlsUserName": { - "value": "[parameters('wlsUserName')]" - }, - "enableDNSConfiguration": { - "value": "[parameters('enableDNSConfiguration')]" - }, - "customDNSNameForAdminServer": { - "value": "[if(parameters('enableDNSConfiguration'), format('{0}.{1}', parameters('dnszoneAdminConsoleLabel'),parameters('dnszoneName')),'')]" - }, - "enableCustomSSL": { - "value": "[parameters('enableCustomSSL')]" - }, - "sslCustomIdentityKeyStoreData": { - "value": "[parameters('uploadedCustomIdentityKeyStoreData')]" - }, - "sslCustomIdentityKeyStorePassPhrase": { - "value": "[parameters('uploadedCustomIdentityKeyStorePassphrase')]" - }, - "sslCustomIdentityKeyStoreType": { - "value": "[parameters('uploadedCustomIdentityKeyStoreType')]" - }, - "sslCustomTrustKeyStoreData": { - "value": "[parameters('uploadedCustomTrustKeyStoreData')]" - }, - "sslCustomTrustKeyStorePassPhrase": { - "value": "[parameters('uploadedCustomTrustKeyStorePassPhrase')]" - }, - "sslCustomTrustKeyStoreType": { - "value": "[parameters('uploadedCustomTrustKeyStoreType')]" - }, - "sslPrivateKeyAlias": { - "value": "[parameters('uploadedPrivateKeyAlias')]" - }, - "sslPrivateKeyPassPhrase": { - "value": "[parameters('uploadedPrivateKeyPassPhrase')]" - } - } - } - }, - { - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${cluster.end}", - "type": "Microsoft.Resources/deployments", - "tags": "[variables('obj_tagsByResources')['${identifier.resourcesDeployment}']]", - "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', variables('clusterTemplateRef'))]", - "[resourceId('Microsoft.Resources/deployments', 'keyVaultwithSelfSignedAppGatewaySSLCert')]", - "[resourceId('Microsoft.Resources/deployments', 'appGatewayLinkedTemplate')]", - "[resourceId('Microsoft.Resources/deployments', 'dnszonesLinkedTemplate')]", - "[resourceId('Microsoft.Resources/deployments', 'dbLinkedTemplate')]", - "[resourceId('Microsoft.Resources/deployments', 'coherenceTemplate')]", - "[resourceId('Microsoft.Resources/deployments', 'coherenceTemplateWithCustomSSL')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [] - } - } - } - ], - "outputs": { - "adminVMName": { - "type": "string", - "value": "[variables('name_adminVM')]" - }, - "managedServerVMNamePrefix": { - "type": "string", - "value": "[concat(parameters('managedServerPrefix'), variables('const_globalResourceNameSuffix'), 'VM')]" - }, - "wlsDomainLocation": { - "type": "string", - "value": "[reference(variables('clusterTemplateRef'), '${azure.apiVersionForDeployment}').outputs.wlsDomainLocation.value]" - }, - "adminHostName": { - "type": "string", - "value": "[reference(variables('clusterTemplateRef'), '${azure.apiVersionForDeployment}').outputs.adminHostName.value]" - }, - "adminConsole": { - "type": "string", - "value": "[if(parameters('enableDNSConfiguration'), uri(format('http://{0}.{1}:7001/console/', parameters('dnszoneAdminConsoleLabel'), parameters('dnszoneName')), ''),reference(variables('clusterTemplateRef'), '${azure.apiVersionForDeployment}').outputs.adminConsole.value)]" - }, - "adminSecuredConsole": { - "type": "string", - "value": "[if(parameters('enableDNSConfiguration'), uri(format('https://{0}.{1}:7002/console/', parameters('dnszoneAdminConsoleLabel'), parameters('dnszoneName')), ''),reference(variables('clusterTemplateRef'), '${azure.apiVersionForDeployment}').outputs.adminSecuredConsole.value)]" - }, - "appGatewayURL": { - "type": "string", - "value": "[if(parameters('enableAppGateway'), if(parameters('enableDNSConfiguration'), uri(concat('http://',parameters('dnszoneAppGatewayLabel'),'.',parameters('dnszoneName')),''), reference('appGatewayLinkedTemplate', '${azure.apiVersionForDeployment}').outputs.appGatewayURL.value),'')]" - }, - "appGatewaySecuredURL": { - "type": "string", - "value": "[if(parameters('enableAppGateway'), if(parameters('enableDNSConfiguration'), uri(concat('https://',parameters('dnszoneAppGatewayLabel'),'.',parameters('dnszoneName')),''), reference('appGatewayLinkedTemplate', '${azure.apiVersionForDeployment}').outputs.appGatewaySecuredURL.value),'')]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/metadata.json b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/metadata.json deleted file mode 100644 index 53c55dfe7..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/metadata.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "$schema": "https://aka.ms/azure-quickstart-templates-metadata-schema#", - "type": "QuickStart", - "itemDisplayName": "Creating Weblogic Cluster Domain on Oracle Linux VM with pre-installed Weblogic Server", - "icon": "oracle-linux", - "description": "This template allows you to create Weblogic Cluster Domain on Oracle Linux VM with pre-installed Weblogic Server. This will deploy a A3 size VM in the resource group location and return the FQDN of the VM.", - "summary": "This template takes a minimum amount of parameters and creates Weblogic Cluster Domain, using the latest patched version.", - "githubUsername": "wls-eng", - "dateUpdated": "2019-08-01" -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/_appGatewayConnectorTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/_appGatewayConnectorTemplate.json deleted file mode 100644 index 8b4415932..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/_appGatewayConnectorTemplate.json +++ /dev/null @@ -1,416 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - } - }, - "_artifactsLocationSasToken": { - "defaultValue": "", - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - } - }, - "adminVMName": { - "type": "string", - "metadata": { - "description": "Admin Server hosting VM name." - } - }, - "appGatewayName": { - "type": "string", - "metadata": { - "description": "Name of the Application Gateway" - } - }, - "appGatewayCertificateOption": { - "defaultValue": "haveCert", - "type": "string", - "metadata": { - "description": "Three scenarios we support for deploying app gateway" - }, - "allowedValues": [ - "haveCert", - "generateCert" - ] - }, - "appGatewaySSLBackendCertData": { - "defaultValue": "", - "type": "securestring", - "metadata": { - "description": "The one-line, base64 string of the SSL backend certificate data." - } - }, - "autoGeneratedSSLCertKeyVaultName": { - "defaultValue": "[newGuid()]", - "type": "string", - "metadata": { - "description": "Name of Key Vault that stores auto-generated self-signed certificate." - } - }, - "autoGeneratedSSLCertSecretName": { - "defaultValue": "[newGuid()]", - "type": "string", - "metadata": { - "description": "Name of Key Vault Secret that stores auto-generated self-signed certificate." - } - }, - "customDomainNameforApplicationGateway": { - "defaultValue": "application.contoso.xyz", - "type": "string", - "metadata": { - "description": "Custom DNS Zone domain name for the Application Gateway" - } - }, - "domainLabelforApplicationGateway": { - "defaultValue": "wlsgw", - "type": "string", - "metadata": { - "description": "Azure DNS for Application Gateway" - } - }, - "enableCustomSSL": { - "defaultValue": false, - "type": "bool" - }, - "enableCookieBasedAffinity": { - "defaultValue": true, - "type": "bool", - "metadata": { - "description": "true to enable cookie based affinity." - } - }, - "gatewayPublicIPAddressName": { - "defaultValue": "gwip", - "type": "string", - "metadata": { - "description": "Public IP Name for the Application Gateway" - } - }, - "location": { - "type": "string", - "metadata": { - "description": "Location for all resources." - } - }, - "managedVMNamePrefix": { - "type": "string", - "metadata": { - "description": "Provide managed VM prefix names" - } - }, - "numberOfInstances": { - "defaultValue": 2, - "type": "int", - "minValue": 2, - "maxValue": 5, - "metadata": { - "description": "Number of VMs to deploy, limit 5 since this sample is using a single storage account" - } - }, - "overrideHostName": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "If true, will override the host name with dnszoneSubDomain." - } - }, - "sslCertData": { - "defaultValue": "[newGuid()]", - "type": "securestring", - "metadata": { - "description": "Uploaded certificate base64 string." - } - }, - "sslCertPswData": { - "defaultValue": "[newGuid()]", - "type": "securestring", - "metadata": { - "description": "The password of uploaded certificate." - } - }, - "tagsByResource": { - "type": "object", - "defaultValue": {}, - "metadata": { - "description": "${label.tagsLabel}" - } - }, - "virtualNetworkNewOrExisting": { - "type": "string", - "defaultValue": "new", - "allowedValues": [ - "new", - "existing" - ], - "metadata": { - "description": "Specify whether to create a new or existing virtual network for the VM." - } - }, - "virtualNetworkName": { - "type": "string", - "defaultValue": "wls-vnet", - "metadata": { - "description": "Name of the existing or new VNET" - } - }, - "virtualNetworkResourceGroupName": { - "type": "string", - "defaultValue": "[resourceGroup().name]", - "metadata": { - "description": "Resource group of Virtual network" - } - }, - "subnetForAppGateway": { - "type": "string", - "defaultValue": "appgateway-subnet", - "metadata": { - "description": "Name of the existing or new Subnet for Application Gateway" - } - }, - "wlsDomainName": { - "defaultValue": "wlsd", - "type": "string", - "metadata": { - "description": "Provide WebLogic domain name" - } - }, - "wlsUserName": { - "defaultValue": "weblogic", - "type": "string", - "metadata": { - "description": "Username for your WebLogic domain name" - } - }, - "wlsPassword": { - "type": "securestring", - "metadata": { - "description": "Password for your WebLogic domain name" - } - } - }, - "variables": { - "const_appGatewaySSLCertOptionGenerateCert": "generateCert", - "const_appGatewaySSLCertOptionHaveCert": "haveCert", - "name_appGatewayLinkedTemplate": "appGatewayNestedTemplate.json" - }, - "resources": [ - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${cluster.appgateway.custom.certificate}", - "condition": "[not(equals(parameters('appGatewayCertificateOption'), variables('const_appGatewaySSLCertOptionGenerateCert')))]", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "appGatewaywithExistingSSLCertTemplate", - "condition": "[equals(parameters('appGatewayCertificateOption'), variables('const_appGatewaySSLCertOptionHaveCert'))]", - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_appGatewayLinkedTemplate')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "adminVMName": { - "value": "[parameters('adminVMName')]" - }, - "appGatewayName": { - "value": "[parameters('appGatewayName')]" - }, - "appGatewaySSLBackendCertData": { - "value": "[parameters('appGatewaySSLBackendCertData')]" - }, - "appGatewaySSLCertificateData": { - "value": "[parameters('sslCertData')]" - }, - "appGatewaySSLCertificatePassword": { - "value": "[parameters('sslCertPswData')]" - }, - "customDomainName": { - "value": "[parameters('customDomainNameforApplicationGateway')]" - }, - "dnsNameforApplicationGateway": { - "value": "[parameters('domainLabelforApplicationGateway')]" - }, - "enableCustomSSL": { - "value": "[parameters('enableCustomSSL')]" - }, - "enableCookieBasedAffinity": { - "value": "[parameters('enableCookieBasedAffinity')]" - }, - "gatewayPublicIPAddressName": { - "value": "[parameters('gatewayPublicIPAddressName')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "managedVMNamePrefix": { - "value": "[parameters('managedVMNamePrefix')]" - }, - "numberOfInstances": { - "value": "[parameters('numberOfInstances')]" - }, - "overrideHostName": { - "value": "[parameters('overrideHostName')]" - }, - "tagsByResource": { - "value": "[parameters('tagsByResource')]" - }, - "virtualNetworkNewOrExisting": { - "value": "[parameters('virtualNetworkNewOrExisting')]" - }, - "virtualNetworkName": { - "value": "[parameters('virtualNetworkName')]" - }, - "virtualNetworkResourceGroupName": { - "value": "[parameters('virtualNetworkResourceGroupName')]" - }, - "subnetForAppGateway": { - "value": "[parameters('subnetForAppGateway')]" - }, - "wlsDomainName": { - "value": "[parameters('wlsDomainName')]" - }, - "wlsPassword": { - "value": "[parameters('wlsPassword')]" - }, - "wlsUserName": { - "value": "[parameters('wlsUserName')]" - } - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "appGatewaywithSelfSignedSSLCertTemplate", - "condition": "[equals(parameters('appGatewayCertificateOption'), variables('const_appGatewaySSLCertOptionGenerateCert'))]", - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_appGatewayLinkedTemplate')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "adminVMName": { - "value": "[parameters('adminVMName')]" - }, - "appGatewayName": { - "value": "[parameters('appGatewayName')]" - }, - "appGatewaySSLBackendCertData": { - "value": "[parameters('appGatewaySSLBackendCertData')]" - }, - "appGatewaySSLCertificateData": { - "reference": { - "keyVault": { - "id": "[resourceId('Microsoft.KeyVault/vaults', parameters('autoGeneratedSSLCertKeyVaultName'))]" - }, - "secretName": "[parameters('autoGeneratedSSLCertSecretName')]" - } - }, - "appGatewaySSLCertificatePassword": { - "value": "" - }, - "customDomainName": { - "value": "[parameters('customDomainNameforApplicationGateway')]" - }, - "dnsNameforApplicationGateway": { - "value": "[parameters('domainLabelforApplicationGateway')]" - }, - "enableCustomSSL": { - "value": "[parameters('enableCustomSSL')]" - }, - "enableCookieBasedAffinity": { - "value": "[parameters('enableCookieBasedAffinity')]" - }, - "gatewayPublicIPAddressName": { - "value": "[parameters('gatewayPublicIPAddressName')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "managedVMNamePrefix": { - "value": "[parameters('managedVMNamePrefix')]" - }, - "numberOfInstances": { - "value": "[parameters('numberOfInstances')]" - }, - "overrideHostName": { - "value": "[parameters('overrideHostName')]" - }, - "tagsByResource": { - "value": "[parameters('tagsByResource')]" - }, - "virtualNetworkNewOrExisting": { - "value": "[parameters('virtualNetworkNewOrExisting')]" - }, - "virtualNetworkName": { - "value": "[parameters('virtualNetworkName')]" - }, - "virtualNetworkResourceGroupName": { - "value": "[parameters('virtualNetworkResourceGroupName')]" - }, - "subnetForAppGateway": { - "value": "[parameters('subnetForAppGateway')]" - }, - "wlsDomainName": { - "value": "[parameters('wlsDomainName')]" - }, - "wlsPassword": { - "value": "[parameters('wlsPassword')]" - }, - "wlsUserName": { - "value": "[parameters('wlsUserName')]" - } - } - } - } - ], - "outputs": { - "appGatewayAlias": { - "type": "string", - "value": "[if(equals(parameters('appGatewayCertificateOption'),variables('const_appGatewaySSLCertOptionHaveCert')), - reference('appGatewaywithExistingSSLCertTemplate', '${azure.apiVersionForDeployment}').outputs.appGatewayAlias.value, - reference('appGatewaywithSelfSignedSSLCertTemplate', '${azure.apiVersionForDeployment}').outputs.appGatewayAlias.value)]" - }, - "appGatewayURL": { - "type": "string", - "value": "[if(equals(parameters('appGatewayCertificateOption'),variables('const_appGatewaySSLCertOptionHaveCert')),reference('appGatewaywithExistingSSLCertTemplate', '${azure.apiVersionForDeployment}').outputs.appGatewayURL.value, reference('appGatewaywithSelfSignedSSLCertTemplate', '${azure.apiVersionForDeployment}').outputs.appGatewayURL.value)]" - }, - "appGatewaySecuredURL": { - "type": "string", - "value": "[if(equals(parameters('appGatewayCertificateOption'),variables('const_appGatewaySSLCertOptionHaveCert')),reference('appGatewaywithExistingSSLCertTemplate', '${azure.apiVersionForDeployment}').outputs.appGatewaySecuredURL.value, reference('appGatewaywithSelfSignedSSLCertTemplate', '${azure.apiVersionForDeployment}').outputs.appGatewaySecuredURL.value)]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/_appendUserManagedIdentity.json b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/_appendUserManagedIdentity.json deleted file mode 100644 index ba47748a4..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/_appendUserManagedIdentity.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "vmName": { - "type": "string" - }, - "existingIdentities": { - "type": "object" - }, - "newIdentities": { - "type": "object" - }, - "location": { - "type": "string" - } - }, - "resources": [ - { - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines", - "name": "[parameters('vmName')]", - "location": "[parameters('location')]", - "identity": { - "type": "userAssigned", - "userAssignedIdentities": "[union(parameters('existingIdentities'),parameters('newIdentities'))]" - } - } - ] -} \ No newline at end of file diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/_dbTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/_dbTemplate.json deleted file mode 100644 index 4daf450f0..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/_dbTemplate.json +++ /dev/null @@ -1,258 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - } - }, - "_artifactsLocationDbTemplate": { - "defaultValue": "[if(contains(parameters('_artifactsLocation'), 'githubusercontent'), parameters('_artifactsLocation'), deployment().properties.templateLink.uri)]", - "type": "string", - "metadata": { - "description": "If we are deploying from the command line, use the passed in _artifactsLocation, otherwise use the default." - } - }, - "_artifactsLocationSasToken": { - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - }, - "defaultValue": "" - }, - "adminVMName": { - "defaultValue": "adminVM", - "type": "string", - "metadata": { - "description": "Admin Server hosting VM name." - } - }, - "databaseType": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "One of the supported database types" - } - }, - "dbGlobalTranPro": { - "defaultValue": "OnePhaseCommit", - "type": "string", - "metadata": { - "description": "Determines the transaction protocol (global transaction processing behavior) for the data source." - } - }, - "dsConnectionURL": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "JDBC Connection String" - } - }, - "dbUser": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "Userid of Database" - } - }, - "dbPassword": { - "defaultValue": "[newGuid()]", - "type": "securestring", - "metadata": { - "description": "Password for Database" - } - }, - "enablePswlessConnection": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "True to enable passwordless connection." - } - }, - "jdbcDataSourceName": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "JNDI Name for JDBC Datasource" - } - }, - "location": { - "type": "string", - "metadata": { - "description": "Location for all resources." - } - }, - "tagsByResource": { - "type": "object", - "defaultValue": {}, - "metadata": { - "description": "${label.tagsLabel}" - } - }, - "wlsUserName": { - "defaultValue": "weblogic", - "type": "string", - "metadata": { - "description": "Username for your Weblogic domain name" - } - }, - "wlsPassword": { - "type": "securestring", - "metadata": { - "description": "Password for your Weblogic domain name" - } - } - }, - "variables": { - "const_wlsAdminPort": "7005", - "const_wlsHome": "/u01/app/wls/install/oracle/middleware/oracle_home", - "name_scriptFilePrefix": "datasourceConfig-", - "name_scriptFileSuffix-sqlserver": "sqlserver.sh", - "name_scriptFileSuffix-oracle": "oracle.sh", - "name_scriptFileSuffix-postgresql": "postgresql.sh", - "name_scriptFileSuffix-mysql": "mysql.sh" - }, - "resources": [ - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${cluster.database.start}", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines/extensions", - "tags": "[parameters('tagsByResource')['${identifier.virtualMachinesExtensions}']]", - "name": "[concat(parameters('adminVMName'),'/newuserscript')]", - "location": "[parameters('location')]", - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.0", - "autoUpgradeMinorVersion": true, - "settings": { - "fileUris": [ - "[uri(parameters('_artifactsLocationDbTemplate'), concat('../scripts/', variables('name_scriptFilePrefix'), variables('name_scriptFileSuffix-sqlserver'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationDbTemplate'), concat('../scripts/', variables('name_scriptFilePrefix'), variables('name_scriptFileSuffix-oracle'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationDbTemplate'), concat('../scripts/', variables('name_scriptFilePrefix'), variables('name_scriptFileSuffix-postgresql'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationDbTemplate'), concat('../scripts/', variables('name_scriptFilePrefix'), variables('name_scriptFileSuffix-mysql'), parameters('_artifactsLocationSasToken')))]" - ] - }, - "protectedSettings": { - "commandToExecute": "[concat('sh',' ',variables('name_scriptFilePrefix'),parameters('databaseType'),'.sh <<< \"',variables('const_wlsHome'),' ',parameters('adminVMName'),' ',variables('const_wlsAdminPort'),' ',parameters('wlsUserName'),' ',base64(parameters('wlsPassword')),' ',base64(parameters('jdbcDataSourceName')),' ',base64(parameters('dsConnectionURL')),' ',parameters('dbUser'),' ',base64(parameters('dbPassword')), ' ',parameters('dbGlobalTranPro'), ' ', parameters('enablePswlessConnection'), '\"')]" - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${cluster.database.end}", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${database.oracle}", - "condition": "[if(contains(parameters('databaseType'), 'oracle'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${database.postgresql}", - "condition": "[if(contains(parameters('databaseType'), 'postgresql'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${database.mysql}", - "condition": "[if(contains(parameters('databaseType'), 'mysql'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${database.sqlserver}", - "condition": "[if(contains(parameters('databaseType'), 'sqlserver'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - } - ], - "outputs": { - "artifactsLocationPassedIn": { - "type": "string", - "value": "[parameters('_artifactsLocation')]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/_dnszones/_createDNSZonesTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/_dnszones/_createDNSZonesTemplate.json deleted file mode 100644 index 2dfcf0629..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/_dnszones/_createDNSZonesTemplate.json +++ /dev/null @@ -1,124 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "dnszonesARecordSetNames": { - "type": "array", - "metadata": { - "description": "An array of A record names. Used to create A record set." - } - }, - "dnszonesCNAMEAlias": { - "type": "array", - "metadata": { - "description": "An array of CNAME record alias. Used to create CNAME records." - } - }, - "dnszonesCNAMERecordSetNames": { - "type": "array", - "metadata": { - "description": "An array of CNAME record names. Used to create CNAME record set." - } - }, - "dnszoneName": { - "type": "string", - "metadata": { - "description": "Azure DNS Zone name." - } - }, - "location": { - "type": "string", - "metadata": { - "description": "Location for all resources." - } - }, - "targetResources": { - "type": "array", - "metadata": { - "description": "References to Azure resources from where the DNS resource value is taken. Each item is corresponding to values of dnszonesARecordSetNames." - } - }, - "tagsByResource": { - "type": "object", - "defaultValue": {}, - "metadata": { - "description": "${label.tagsLabel}" - } - }, - "ttl": { - "type": "int", - "defaultValue": 3600, - "metadata": { - "description": "The TTL (time-to-live) of the records in the record sets." - } - } - }, - "variables": { - // Tempalte validation fails on record name expression 'parameters('arrayValue')[copyIndex]' if the array is empty, though the deployment will be skipped. - // Concat a sample array if an array is empty, and do not deploy the sample record. - "const_dnszonesARecordSetNames": "[concat(parameters('dnszonesARecordSetNames'), variables('const_sampleValuetoPassValidation'))]", - "const_dnszonesCNAMERecordSetNames": "[concat(parameters('dnszonesCNAMERecordSetNames'),variables('const_sampleValuetoPassValidation'))]", - "const_hasARecords": "[greater(length(parameters('dnszonesARecordSetNames')),0)]", - "const_hasCNAMERecords": "[greater(length(parameters('dnszonesCNAMERecordSetNames')), 0)]", - "const_sampleValuetoPassValidation": [ - "test" - ] - }, - "resources": [ - { - "type": "Microsoft.Network/dnszones", - "apiVersion": "${azure.apiVersionForDNSZone}", - "tags": "[parameters('tagsByResource')['${identifier.dnszones}']]", - "name": "[parameters('dnszoneName')]", - "location": "[parameters('location')]", - "properties": { - "zoneType": "Public" - } - }, - { - "type": "Microsoft.Network/dnszones/A", - "apiVersion": "${azure.apiVersionForDNSZone}", - "condition": "[variables('const_hasARecords')]", - "name": "[concat(parameters('dnszoneName'), '/', variables('const_dnszonesARecordSetNames')[copyIndex()])]", - "copy": { - "name": "dnszonesALoop", - "count": "[length(parameters('dnszonesARecordSetNames'))]" - }, - "dependsOn": [ - "[resourceId('Microsoft.Network/dnszones', parameters('dnszoneName'))]" - ], - "properties": { - "TTL": "[parameters('ttl')]", - "targetResource": { - "id": "[parameters('targetResources')[copyIndex()]]" - } - } - }, - { - "type": "Microsoft.Network/dnszones/CNAME", - "apiVersion": "${azure.apiVersionForDNSZone}", - "condition": "[variables('const_hasCNAMERecords')]", - "name": "[concat(parameters('dnszoneName'),'/', variables('const_dnszonesCNAMERecordSetNames')[copyIndex()])]", - "location": "[parameters('location')]", - "copy": { - "name": "dnszonesCNAMELoop", - "count": "[length(parameters('dnszonesCNAMERecordSetNames'))]" - }, - "dependsOn": [ - "dnszonesALoop" - ], - "properties": { - "TTL": "[parameters('ttl')]", - "CNAMERecord": { - "cname": "[parameters('dnszonesCNAMEAlias')[copyIndex()]]" - } - } - } - ], - "outputs": { - "dnszonesName": { - "type": "string", - "value": "[parameters('dnszoneName')]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/_dnszones/_uamiAndRoleAssignment.json b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/_dnszones/_uamiAndRoleAssignment.json deleted file mode 100644 index 0e2b79f4d..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/_dnszones/_uamiAndRoleAssignment.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "location": { - "type": "string" - }, - "uamiName": { - "type": "string" - }, - "tagsByResource": { - "type": "object", - "defaultValue": {}, - "metadata": { - "description": "${label.tagsLabel}" - } - } - }, - "functions": [], - "variables": { - "const_roleDefinitionIdOfContributor": "b24988ac-6180-42a0-ab88-20f7382dd24c", - "name_deploymentScriptContributorRoleAssignmentName": "[guid(format('{0}{1}Deployment Script', resourceGroup().id, parameters('uamiName')))]" - }, - "resources": [ - { - "type": "Microsoft.ManagedIdentity/userAssignedIdentities", - "apiVersion": "${azure.apiVersionForIdentity}", - "tags": "[parameters('tagsByResource')['${identifier.userAssignedIdentities}']]", - "name": "[parameters('uamiName')]", - "location": "[parameters('location')]" - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "[variables('name_deploymentScriptContributorRoleAssignmentName')]", - "subscriptionId": "[subscription().subscriptionId]", - "location": "[parameters('location')]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "roleDefinition": { - "value": "[variables('const_roleDefinitionIdOfContributor')]" - }, - "principalId": { - "value": "[reference(resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', parameters('uamiName'))).principalId]" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "roleDefinition": { - "type": "string", - "defaultValue": "" - }, - "principalId": { - "type": "string", - "defaultValue": "" - } - }, - "functions": [], - "variables": { - "name_roleAssignmentName": "[guid(format('{0}{1}Role assignment in subscription scope', subscription().id, parameters('principalId')))]" - }, - "resources": [ - { - "type": "Microsoft.Authorization/roleAssignments", - "apiVersion": "${azure.apiVersionForRoleAssignment}", - "name": "[variables('name_roleAssignmentName')]", - "properties": { - "description": "Assign subscription scope role to User Assigned Managed Identity ", - "principalId": "[parameters('principalId')]", - "principalType": "ServicePrincipal", - "roleDefinitionId": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinition'))]" - } - } - ], - "outputs": { - "roleId": { - "type": "string", - "value": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinition'))]" - } - } - } - } - } - ], - "outputs": { - "uamiIdForDeploymentScript": { - "type": "string", - "value": "[resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', parameters('uamiName'))]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/_dnszones/_updateDNSZonesTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/_dnszones/_updateDNSZonesTemplate.json deleted file mode 100644 index c77d29f55..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/_dnszones/_updateDNSZonesTemplate.json +++ /dev/null @@ -1,220 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - } - }, - "_artifactsLocationDNSZonesTemplate": { - "defaultValue": "[if(contains(parameters('_artifactsLocation'), 'githubusercontent'), concat(parameters('_artifactsLocation'),'nestedtemplates/'), deployment().properties.templateLink.uri)]", - "type": "string", - "metadata": { - "description": "If we are deploying from the command line, use the passed in _artifactsLocation, otherwise use the default." - } - }, - "_globalResourceNameSuffix": { - "type": "string", - "metadata": { - "description": "A unique suffix that was specified during the deployment of the solution template." - } - }, - "_artifactsLocationSasToken": { - "defaultValue": "", - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - } - }, - "dnszonesARecordSetNames": { - "type": "array", - "metadata": { - "description": "An array of A record names. Used to create A records." - } - }, - "dnszonesCNAMEAlias": { - "type": "array", - "metadata": { - "description": "An array of CNAME record alias. Used to create CNAME records." - } - }, - "dnszonesCNAMERecordSetNames": { - "type": "array", - "metadata": { - "description": "An array of CNAME record names. Used to create CNAME record set." - } - }, - "dnszoneName": { - "type": "string", - "metadata": { - "description": "Azure DNS Zone name." - } - }, - "location": { - "type": "string", - "metadata": { - "description": "Location for all resources." - } - }, - "resourceGroup": { - "type": "string", - "metadata": { - "description": "Name of the resource group that has an Azure DNS Zone deployed." - } - }, - "targetResources": { - "type": "array", - "metadata": { - "description": "References to Azure resources from where the DNS resource value is taken. Each item is corresponding to values of dnszonesARecordSetNames." - } - }, - "tagsByResource": { - "type": "object", - "defaultValue": {}, - "metadata": { - "description": "${label.tagsLabel}" - } - }, - "ttl": { - "type": "int", - "defaultValue": 3600, - "metadata": { - "description": "The TTL (time-to-live) of the records in the record sets." - } - }, - "utcValue": { - "type": "string", - "defaultValue": "[utcNow()]", - "metadata": { - "description": "Current deployment time. Used as a tag in deployment script." - } - } - }, - "functions": [ - { - "namespace": "array", - "members": { - "join": { - "parameters": [ - { - "name": "items", - "type": "array" - } - ], - "output": { - "type": "string", - "value": "[replace(replace(replace(string(parameters('items')), '[\"', ''), '\"]', ''), '\",\"', ',')]" - } - } - } - } - ], - "variables": { - "name_deploymentScriptUserDefinedManagedIdentity": "wls-vm-dns-user-defined-managed-itentity", - "name_scriptDNSConfiguration": "updateDNSZones.sh", - "name_templateUAMIDeployment": "_uamiAndRoleAssignment.json" - }, - "resources": [ - { - "type": "Microsoft.Resources/deployments", - "name": "uamiDeployment", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "apiVersion": "${azure.apiVersionForDeployment}", - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/_dnszones/', variables('name_templateUAMIDeployment')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "location": { - "value": "[parameters('location')]" - }, - "uamiName": { - "value": "[variables('name_deploymentScriptUserDefinedManagedIdentity')]" - }, - "tagsByResource": { - "value": "[parameters('tagsByResource')]" - } - } - } - }, - { - "type": "Microsoft.Resources/deploymentScripts", - "apiVersion": "${azure.apiVersionForDeploymentScript}", - "tags": "[parameters('tagsByResource')['${identifier.deploymentScripts}']]", - "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', 'uamiDeployment')]" - ], - "name": "[concat('script-createDNSRecords-', parameters('_globalResourceNameSuffix'))]", - "location": "[parameters('location')]", - "identity": { - "type": "UserAssigned", - "userAssignedIdentities": { - "[resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', variables('name_deploymentScriptUserDefinedManagedIdentity'))]": {} - } - }, - "kind": "AzureCLI", - "properties": { - "forceUpdateTag": "[parameters('utcValue')]", - "AzCliVersion": "${azure.cli.version}", - "timeout": "PT30M", - "environmentVariables": [ - { - "name": "DNS_CNAME_ALIAS", - "value": "[array.join(parameters('dnszonesCNAMEAlias'))]" - }, - { - "name": "DNS_CNAME_ALIAS_LENGTH", - "value": "[length(parameters('dnszonesCNAMEAlias'))]" - }, - { - "name": "DNS_CNAME_RECORDSET_LENGTH", - "value": "[length(parameters('dnszonesCNAMERecordSetNames'))]" - }, - { - "name": "DNS_CNAME_RECORDSET_NAMES", - "value": "[array.join(parameters('dnszonesCNAMERecordSetNames'))]" - }, - { - "name": "DNS_RECORDSET_NAMES", - "value": "[array.join(parameters('dnszonesARecordSetNames'))]" - }, - { - "name": "DNS_RECORD_NAMES_LENGTH", - "value": "[length(parameters('dnszonesARecordSetNames'))]" - }, - { - "name": "DNS_TARGET_RESOURCES_LENGTH", - "value": "[length(parameters('targetResources'))]" - }, - { - "name": "DNS_TARGET_RESOURCES", - "value": "[array.join(parameters('targetResources'))]" - }, - { - "name": "DNS_RECORD_TTL", - "value": "[parameters('ttl')]" - }, - { - "name": "DNS_ZONE_NAME", - "value": "[parameters('dnszoneName')]" - }, - { - "name": "MANAGED_IDENTITY_ID", - "value": "[resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', variables('name_deploymentScriptUserDefinedManagedIdentity'))]" - }, - { - "name": "RESOURCE_GROUP_NAME", - "value": "[parameters('resourceGroup')]" - } - ], - "primaryScriptUri": "[uri(parameters('_artifactsLocationDNSZonesTemplate'), concat('../../scripts/', variables('name_scriptDNSConfiguration'), parameters('_artifactsLocationSasToken')))]", - "cleanupPreference": "OnSuccess", - "retentionInterval": "P1D" - } - } - ] -} \ No newline at end of file diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/_installJdbcLibsTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/_installJdbcLibsTemplate.json deleted file mode 100644 index b6d2087d7..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/_installJdbcLibsTemplate.json +++ /dev/null @@ -1,135 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - } - }, - "_artifactsLocationInstallJdbcLibsTemplate": { - "defaultValue": "[if(contains(parameters('_artifactsLocation'), 'githubusercontent'), parameters('_artifactsLocation'), deployment().properties.templateLink.uri)]", - "type": "string", - "metadata": { - "description": "If we are deploying from the command line, use the passed in _artifactsLocation, otherwise use the default." - } - }, - "_artifactsLocationSasToken": { - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - }, - "defaultValue": "" - }, - "adminVMName": { - "type": "string", - "defaultValue": "adminVM", - "metadata": { - "description": "Admin Server hosting VM name." - } - }, - "databaseType": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "One of the supported database types" - } - }, - "enablePswlessConnection": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "True to enable passwordless connection." - } - }, - "location": { - "type": "string", - "metadata": { - "description": "Location for all resources." - } - }, - "managedServerPrefix": { - "type": "string", - "defaultValue": "msp", - "metadata": { - "description": "Provide managed server prefix name" - } - }, - "managedVMNamePrefix": { - "type": "string", - "metadata": { - "description": "Managed Server hosting VM name prefix." - } - }, - "numberOfManagedApplicationInstances": { - "type": "int", - "defaultValue": 2, - "minValue": 1, - "maxValue": 20, - "metadata": { - "description": "Number of VMs that have been deployed to host managed application server." - } - }, - "tagsByResource": { - "type": "object", - "defaultValue": {}, - "metadata": { - "description": "${label.tagsLabel}" - } - }, - "wlsDomainName": { - "type": "string", - "defaultValue": "wlsd", - "metadata": { - "description": "Provide Weblogic domain name" - } - }, - "wlsPassword": { - "type": "securestring", - "metadata": { - "description": "Password for your Weblogic domain name" - } - }, - "wlsUserName": { - "type": "string", - "metadata": { - "description": "Username for your Weblogic domain name" - } - } - }, - "variables": { - "const_managedVMPrefix": "[concat(parameters('managedVMNamePrefix'), 'VM')]", - "const_wlsAdminPort": "7005", - "const_wlsDomainPath": "[concat('/u01/domains/', parameters('wlsDomainName'))]", - "const_wlsHome": "/u01/app/wls/install/oracle/middleware/oracle_home", - "name_scriptInstallJdbcLibs": "installJdbcDrivers.sh" - }, - "resources": [ - { - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines/extensions", - "tags": "[parameters('tagsByResource')['${identifier.virtualMachinesExtensions}']]", - "name": "[concat(variables('const_managedVMPrefix'), copyIndex(1),'/newuserscript')]", - "location": "[parameters('location')]", - "copy": { - "name": "appVirtualMachineExtensionLoop", - "count": "[parameters('numberOfManagedApplicationInstances')]" - }, - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.0", - "autoUpgradeMinorVersion": true, - "settings": { - "fileUris": [ - "[uri(parameters('_artifactsLocationInstallJdbcLibsTemplate'), concat('../scripts/', variables('name_scriptInstallJdbcLibs'), parameters('_artifactsLocationSasToken')))]" - ] - }, - "protectedSettings": { - "commandToExecute": "[concat('sh',' ',variables('name_scriptInstallJdbcLibs'),' <<< \"',variables('const_wlsHome'),' ',variables('const_wlsDomainPath'),' ',parameters('managedServerPrefix'), copyIndex(1), ' ', parameters('adminVMName'), ' ',variables('const_wlsAdminPort'),' ',parameters('wlsUserName'),' ',base64(parameters('wlsPassword')),' ',parameters('databaseType'),' ',parameters('enablePswlessConnection'), '\"')]" - } - } - } - ] -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/_keyvaultWithNewCertTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/_keyvaultWithNewCertTemplate.json deleted file mode 100644 index 87c767643..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/_keyvaultWithNewCertTemplate.json +++ /dev/null @@ -1,229 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_globalResourceNameSuffix": { - "type": "string", - "metadata": { - "description": "A unique suffix that was specified during the deployment of the solution template." - } - }, - "keyvaultName": { - "type": "string", - "defaultValue": "[concat('wls-kv-', uniqueString(resourceGroup().id, deployment().name))]", - "metadata": { - "description": "Used to name the new Azure Key Vault resoure." - } - }, - "location": { - "type": "string", - "metadata": { - "description": "Location for all resources." - } - }, - "permission": { - "type": "object", - "defaultValue": { - "certificates": [ - "get", - "list", - "update", - "create" - ] - }, - "metadata": { - "description": "Access permission of the key vault, will applied to all access policies." - } - }, - "secretName": { - "type": "string", - "defaultValue": "mySelfSignedCertificate", - "metadata": { - "description": "Used to name the new certificate resource." - } - }, - "sku": { - "type": "string", - "metadata": { - "description": "Price tier for Key Vault." - }, - "defaultValue": "Standard" - }, - "subjectName": { - "type": "string", - "metadata": { - "description": "Subject name to create a new certificate, example: 'CN=contoso.com'." - } - }, - "tagsByResource": { - "type": "object", - "defaultValue": {}, - "metadata": { - "description": "${label.tagsLabel}" - } - }, - "utcValue": { - "type": "string", - "defaultValue": "[utcNow()]" - } - }, - "variables": { - "const_roleDefinitionIdOfContributor": "b24988ac-6180-42a0-ab88-20f7382dd24c", - "name_deploymentScriptUserDefinedManagedIdentity": "[concat('wls-vm-keyvault-user-defined-managed-itentity', parameters('_globalResourceNameSuffix'))]", - "name_roleAssignmentName": "[guid(format('{0}{1}Role assignment in resource group scope', subscription().id, parameters('utcValue')))]" - }, - "resources": [ - { - "type": "Microsoft.ManagedIdentity/userAssignedIdentities", - "apiVersion": "${azure.apiVersionForIdentity}", - "tags": "[parameters('tagsByResource')['${identifier.userAssignedIdentities}']]", - "name": "[variables('name_deploymentScriptUserDefinedManagedIdentity')]", - "location": "[parameters('location')]" - }, - { - "type": "Microsoft.Authorization/roleAssignments", - "apiVersion": "${azure.apiVersionForRoleAssignment}", - "name": "[variables('name_roleAssignmentName')]", - "dependsOn": [ - "[resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', variables('name_deploymentScriptUserDefinedManagedIdentity'))]" - ], - "properties": { - "description": "Assign subscription scope role to User Assigned Managed Identity ", - "principalId": "[reference(resourceId('Microsoft.ManagedIdentity/userAssignedIdentities',variables('name_deploymentScriptUserDefinedManagedIdentity'))).principalId]", - "principalType": "ServicePrincipal", - "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', variables('const_roleDefinitionIdOfContributor'))]" - } - }, - { - "type": "Microsoft.KeyVault/vaults", - "apiVersion": "${azure.apiVersionForKeyVault}", - "tags": "[parameters('tagsByResource')['${identifier.vaults}']]", - "name": "[parameters('keyvaultName')]", - "dependsOn": [ - "[resourceId('Microsoft.Authorization/roleAssignments', variables('name_roleAssignmentName'))]" - ], - "location": "[parameters('location')]", - "properties": { - "sku": { - "family": "A", - "name": "[parameters('sku')]" - }, - "tenantId": "[subscription().tenantId]", - "accessPolicies": [ - { - "objectId": "[reference(resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', variables('name_deploymentScriptUserDefinedManagedIdentity'))).principalId]", - "tenantId": "[subscription().tenantId]", - "permissions": "[parameters('permission')]" - } - ], - "enabledForDeployment": false, - "enabledForDiskEncryption": false, - "enabledForTemplateDeployment": true, - "enableSoftDelete": true, - "enableRbacAuthorization": false - } - }, - { - "type": "Microsoft.Resources/deploymentScripts", - "apiVersion": "${azure.apiVersionForDeploymentScript}", - "tags": "[parameters('tagsByResource')['${identifier.deploymentScripts}']]", - "name": "[concat('script-generate-certificate-', parameters('_globalResourceNameSuffix'))]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.KeyVault/vaults', parameters('keyvaultName'))]" - ], - "identity": { - "type": "UserAssigned", - "userAssignedIdentities": { - "[resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', variables('name_deploymentScriptUserDefinedManagedIdentity'))]": {} - } - }, - "kind": "AzurePowerShell", - "properties": { - "forceUpdateTag": "[parameters('utcValue')]", - "azPowerShellVersion": "${azure.powershell.version}", - "timeout": "PT30M", - "arguments": "[format(' -vaultName {0} -certificateName {1} -subjectName {2}', parameters('keyvaultName'), parameters('secretName'), parameters('subjectName'))]", - "environmentVariables": [ - { - "name": "MANAGED_IDENTITY_ID", - "value": "[variables('name_deploymentScriptUserDefinedManagedIdentity')]" - }, - { - "name": "RESOURCE_GROUP_NAME", - "value": "[resourceGroup().name]" - } - ], - "scriptContent": " - param( - [string] [Parameter(Mandatory=$true)] $vaultName, - [string] [Parameter(Mandatory=$true)] $certificateName, - [string] [Parameter(Mandatory=$true)] $subjectName - ) - - $ErrorActionPreference = 'Stop' - $DeploymentScriptOutputs = @{} - - $existingCert = Get-AzKeyVaultCertificate -VaultName $vaultName -Name $certificateName - - if ($existingCert -and $existingCert.Certificate.Subject -eq $subjectName) { - - Write-Host 'Certificate $certificateName in vault $vaultName is already present.' - - $DeploymentScriptOutputs['certThumbprint'] = $existingCert.Thumbprint - $existingCert | Out-String - } - else { - $policy = New-AzKeyVaultCertificatePolicy -SubjectName $subjectName -IssuerName Self -ValidityInMonths 12 -Verbose - - # private key is added as a secret that can be retrieved in the ARM template - Add-AzKeyVaultCertificate -VaultName $vaultName -Name $certificateName -CertificatePolicy $policy -Verbose - - $newCert = Get-AzKeyVaultCertificate -VaultName $vaultName -Name $certificateName - - # it takes a few seconds for KeyVault to finish - $tries = 0 - do { - Write-Host 'Waiting for certificate creation completion...' - Start-Sleep -Seconds 10 - $operation = Get-AzKeyVaultCertificateOperation -VaultName $vaultName -Name $certificateName - $tries++ - - if ($operation.Status -eq 'failed') - { - throw 'Creating certificate $certificateName in vault $vaultName failed with error $($operation.ErrorMessage)' - } - - if ($tries -gt 120) - { - throw 'Timed out waiting for creation of certificate $certificateName in vault $vaultName' - } - } while ($operation.Status -ne 'completed') - - $DeploymentScriptOutputs['certThumbprint'] = $newCert.Thumbprint - $newCert | Out-String - } - - # Do not load MSI module to resolve issue 288. It's loaded by default in new PowerShell. - # Install-Module -Name Az.ManagedServiceIdentity -AllowClobber -Force - # delete user assigned managed identity. - $identityName = [System.Environment]::GetEnvironmentVariable('MANAGED_IDENTITY_ID') - $resourceGroupName= [System.Environment]::GetEnvironmentVariable('RESOURCE_GROUP_NAME') - Get-AzUserAssignedIdentity -ResourceGroupName $resourceGroupName -Name $identityName | Remove-AzUserAssignedIdentity - ", - "cleanupPreference": "OnSuccess", - "retentionInterval": "P1D" - } - } - ], - "outputs": { - "keyvaultName": { - "type": "string", - "value": "[parameters('keyvaultName')]" - }, - "secretName": { - "type": "string", - "value": "[parameters('secretName')]" - } - } -} \ No newline at end of file diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/_pswlessDbTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/_pswlessDbTemplate.json deleted file mode 100644 index d060897d6..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/_pswlessDbTemplate.json +++ /dev/null @@ -1,340 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - } - }, - "_artifactsLocationSasToken": { - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - }, - "defaultValue": "" - }, - "adminVMName": { - "type": "string", - "defaultValue": "adminVM", - "metadata": { - "description": "Admin Server hosting VM name." - } - }, - "databaseType": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "One of the supported database types" - } - }, - "dbGlobalTranPro": { - "defaultValue": "OnePhaseCommit", - "type": "string", - "metadata": { - "description": "Determines the transaction protocol (global transaction processing behavior) for the data source." - } - }, - "dbIdentity": { - "defaultValue": {}, - "type": "object", - "metadata": { - "description": "Managed identity that has access to the data source." - } - }, - "dbUser": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "Userid of Database" - } - }, - "dsConnectionURL": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "JDBC Connection String" - } - }, - "jdbcDataSourceName": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "JNDI Name for JDBC Datasource" - } - }, - "location": { - "type": "string", - "metadata": { - "description": "Location for all resources." - } - }, - "managedServerPrefix": { - "type": "string", - "defaultValue": "msp", - "metadata": { - "description": "Provide managed server prefix name" - } - }, - "managedVMNamePrefix": { - "type": "string", - "metadata": { - "description": "Provide managed VM name prefix" - } - }, - "numberOfManagedApplicationInstances": { - "type": "int", - "defaultValue": 2, - "minValue": 1, - "maxValue": 20, - "metadata": { - "description": "Number of VMs that have been deployed to host managed application server." - } - }, - "tagsByResource": { - "type": "object", - "defaultValue": {}, - "metadata": { - "description": "${label.tagsLabel}" - } - }, - "wlsDomainName": { - "type": "string", - "defaultValue": "wlsd", - "metadata": { - "description": "Provide Weblogic domain name" - } - }, - "wlsPassword": { - "type": "securestring", - "metadata": { - "description": "Password for your Weblogic domain name" - } - }, - "wlsUserName": { - "type": "string", - "metadata": { - "description": "Username for your Weblogic domain name" - } - } - }, - "variables": { - "const_connectionString": "[if(and(equals(parameters('databaseType'),'sqlserver'), equals(last(parameters('dsConnectionURL')),';')), take(parameters('dsConnectionURL'), add(length(parameters('dsConnectionURL')),-1)),parameters('dsConnectionURL'))]", - "const_identityAPIVersion": "${azure.apiVersionForIdentity}", - "const_managedVMPrefix": "[concat(parameters('managedVMNamePrefix'), 'VM')]", - "const_msiDefaultUser": "msiUser", - "name_appendIdentityTemplate": "_appendUserManagedIdentity.json", - "name_installJdbcLibsTemplate": "_installJdbcLibsTemplate.json", - "name_dbTemplate": "_dbTemplate.json", - "array_azureJdbcPlugins": { - "mysql": "defaultAuthenticationPlugin=com.azure.identity.extensions.jdbc.mysql.AzureMysqlAuthenticationPlugin&authenticationPlugins=com.azure.identity.extensions.jdbc.mysql.AzureMysqlAuthenticationPlugin", - "postgresql": "authenticationPluginClassName=com.azure.identity.extensions.jdbc.postgresql.AzurePostgresqlAuthenticationPlugin", - "sqlserver": "authentication=ActiveDirectoryMSI" - }, - "array_urlJoiner": { - "mysql": "[if(contains(variables('const_connectionString'), '?'), '&', '?')]", - "postgresql": "[if(contains(variables('const_connectionString'), '?'), '&', '?')]", - "sqlserver": ";" - }, - "array_paramJoiner": { - "mysql": "&", - "postgresql": "&", - "sqlserver": ";" - }, - "array_msiClientId": { - "mysql": "azure.clientId", - "postgresql": "azure.clientId", - "sqlserver": "msiClientId" - }, - "obj_dbIdentity": { - "[items(parameters('dbIdentity').userAssignedIdentities)[0].key]": {} - }, - "obj_empty": {} - }, - "resources": [ - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${cluster.pswless.database.start}", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "[concat('assignDbIdentityTo',variables('const_managedVMPrefix'), copyIndex(1))]", - "copy": { - "name": "virtualMachineIdentityLoop", - "count": "[parameters('numberOfManagedApplicationInstances')]" - }, - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_appendIdentityTemplate')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "vmName": { - "value": "[concat(variables('const_managedVMPrefix'), copyIndex(1))]" - }, - "newIdentities": { - "value": "[variables('obj_dbIdentity')]" - }, - "existingIdentities": { - "value": "[if(equals(reference(resourceId('Microsoft.Compute/virtualMachines',concat(variables('const_managedVMPrefix'), copyIndex(1))), '${azure.apiVersionForDeployment}', 'Full').identity.type,'UserAssigned'),reference(resourceId('Microsoft.Compute/virtualMachines',concat(variables('const_managedVMPrefix'), copyIndex(1))), '${azure.apiVersionForDeployment}', 'Full').identity.userAssignedIdentities, variables('obj_empty'))]" - }, - "location": { - "value": "[parameters('location')]" - } - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "installJdbcLibsTemplate", - "condition": "[or(equals(parameters('databaseType'),'mysql'), equals(parameters('databaseType'),'postgresql'))]", - "dependsOn": [ - "virtualMachineIdentityLoop" - ], - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_installJdbcLibsTemplate')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "adminVMName": { - "value": "[parameters('adminVMName')]" - }, - "databaseType": { - "value": "[parameters('databaseType')]" - }, - "enablePswlessConnection": { - "value": true - }, - "location": { - "value": "[parameters('location')]" - }, - "managedServerPrefix": { - "value": "[parameters('managedServerPrefix')]" - }, - "managedVMNamePrefix": { - "value": "[parameters('managedVMNamePrefix')]" - }, - "numberOfManagedApplicationInstances": { - "value": "[parameters('numberOfManagedApplicationInstances')]" - }, - "tagsByResource": { - "value": "[parameters('tagsByResource')]" - }, - "wlsDomainName": { - "value": "[parameters('wlsDomainName')]" - }, - "wlsPassword": { - "value": "[parameters('wlsPassword')]" - }, - "wlsUserName": { - "value": "[parameters('wlsUserName')]" - } - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "passwordlessDatasourceDeployment", - "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', 'installJdbcLibsTemplate')]" - ], - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_dbTemplate')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "adminVMName": { - "value": "[parameters('adminVMName')]" - }, - "databaseType": { - "value": "[parameters('databaseType')]" - }, - "dbGlobalTranPro": { - "value": "[parameters('dbGlobalTranPro')]" - }, - "dsConnectionURL": { - "value": "[uri(format('{0}{4}{1}{5}{2}={3}', variables('const_connectionString'), variables('array_azureJdbcPlugins')[parameters('databaseType')], variables('array_msiClientId')[parameters('databaseType')], reference(items(parameters('dbIdentity').userAssignedIdentities)[0].key,variables('const_identityAPIVersion'), 'full').properties.clientId, variables('array_urlJoiner')[parameters('databaseType')], variables('array_paramJoiner')[parameters('databaseType')]), '')]" - }, - "dbUser": { - "value": "[if(equals(parameters('databaseType'), 'sqlserver'), variables('const_msiDefaultUser'), parameters('dbUser'))]" - }, - "enablePswlessConnection": { - "value": true - }, - "jdbcDataSourceName": { - "value": "[parameters('jdbcDataSourceName')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "tagsByResource": { - "value": "[parameters('tagsByResource')]" - }, - "wlsPassword": { - "value": "[parameters('wlsPassword')]" - }, - "wlsUserName": { - "value": "[parameters('wlsUserName')]" - } - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${cluster.pswless.database.end}", - "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', 'passwordlessDatasourceDeployment')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [] - } - } - } - ], - "outputs": { - "artifactsLocationPassedIn": { - "type": "string", - "value": "[parameters('_artifactsLocation')]" - } - } -} \ No newline at end of file diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/appGatewayNestedTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/appGatewayNestedTemplate.json deleted file mode 100644 index 74a24fc17..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/appGatewayNestedTemplate.json +++ /dev/null @@ -1,517 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - } - }, - "_artifactsLocationAGWTemplate": { - "defaultValue": "[if(contains(parameters('_artifactsLocation'), 'githubusercontent'), parameters('_artifactsLocation'), deployment().properties.templateLink.uri)]", - "type": "string", - "metadata": { - "description": "If we are deploying from the command line, use the passed in _artifactsLocation, otherwise use the default." - } - }, - "_artifactsLocationSasToken": { - "defaultValue": "", - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - } - }, - "adminVMName": { - "defaultValue": "adminVM", - "type": "string", - "metadata": { - "description": "Admin Server hosting VM name." - } - }, - "appGatewayName": { - "type": "string", - "metadata": { - "description": "Application Gateway name" - } - }, - "appGatewaySSLBackendCertData": { - "type": "securestring" - }, - "appGatewaySSLCertificateData": { - "type": "securestring" - }, - "appGatewaySSLCertificatePassword": { - "type": "securestring" - }, - "customDomainName": { - "defaultValue": "application.contoso.xyz", - "type": "string", - "metadata": { - "description": "Custom DNS Zone domain name for the Application Gateway" - } - }, - "dnsNameforApplicationGateway": { - "defaultValue": "[take(format('{0}{1}-{2}-{3}', 'wlsgw',take(replace(parameters('guidValue'),'-',''),6), toLower(resourceGroup().name),toLower(parameters('wlsDomainName'))),63)]", - "type": "string", - "metadata": { - "description": "DNS for ApplicationGateway" - } - }, - "enableCookieBasedAffinity": { - "defaultValue": true, - "type": "bool", - "metadata": { - "description": "true to enable cookie based affinity." - } - }, - "enableCustomSSL": { - "defaultValue": false, - "type": "bool" - }, - "gatewayPublicIPAddressName": { - "defaultValue": "gwip", - "type": "string", - "metadata": { - "description": "Public IP Name for the Application Gateway" - } - }, - "guidValue": { - "type": "string", - "defaultValue": "[newGuid()]" - }, - "location": { - "type": "string", - "metadata": { - "description": "Location for all resources." - } - }, - "managedVMNamePrefix": { - "type": "string", - "metadata": { - "description": "Managed Server hosting VM name prefix." - } - }, - "numberOfInstances": { - "defaultValue": 2, - "type": "int", - "minValue": 2, - "maxValue": 5, - "metadata": { - "description": "Number of VMs to deploy, limit 5 since this sample is using a single storage account" - } - }, - "overrideHostName": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "If true, will override the host name with dnszoneSubDomain." - } - }, - "tagsByResource": { - "type": "object", - "defaultValue": {}, - "metadata": { - "description": "${label.tagsLabel}" - } - }, - "virtualNetworkNewOrExisting": { - "type": "string", - "defaultValue": "new", - "allowedValues": [ - "new", - "existing" - ], - "metadata": { - "description": "Specify whether to create a new or existing virtual network for the VM." - } - }, - "virtualNetworkName": { - "type": "string", - "defaultValue": "wls-vnet", - "metadata": { - "description": "Name of the existing or new VNET" - } - }, - "virtualNetworkResourceGroupName": { - "type": "string", - "defaultValue": "[resourceGroup().name]", - "metadata": { - "description": "Resource group of Virtual network" - } - }, - "subnetForAppGateway": { - "type": "string", - "defaultValue": "appgateway-subnet", - "metadata": { - "description": "Name of the existing or new Subnet for Application Gateway" - } - }, - "wlsDomainName": { - "defaultValue": "wlsd", - "type": "string", - "metadata": { - "description": "Provide Weblogic domain name" - } - }, - "wlsPassword": { - "type": "securestring", - "metadata": { - "description": "Password for your Weblogic domain name" - } - }, - "wlsUserName": { - "defaultValue": "weblogic", - "type": "string", - "metadata": { - "description": "Username for your Weblogic domain name" - } - } - }, - "variables": { - "const_adminServerName": "admin", - "const_appGatewayFrontEndHTTPPort": 80, - "const_appGatewayFrontEndHTTPSPort": 443, - "const_backendPort": 8001, - "name_nic_with_pub_ip": "_NIC_with_pub_ip", - "name_nic_without_pub_ip": "_NIC_without_pub_ip", - "const_wlsAdminPort": "7005", - "const_wlsHome": "/u01/app/wls/install/oracle/middleware/oracle_home", - "name_appGatewayCertificate": "appGwSslCertificate", - "name_appGatewaySubnet": "[parameters('subnetForAppGateway')]", - "name_backendAddressPool": "myGatewayBackendPool", - "name_frontEndIPConfig": "appGwPublicFrontendIp", - "name_httpListener": "HTTPListener", - "name_httpPort": "http_port", - "name_httpSetting": "myHTTPSetting", - "name_httpsListener": "HTTPSListener", - "name_httpsPort": "https_port", - "name_managedVMNamePrefix": "[concat(parameters('managedVMNamePrefix'),'VM')]", - "name_probe": "HTTPhealthProbe", - "name_scriptAGWConfiguration": "setupApplicationGateway.sh", - "name_virtualNetwork": "[parameters('virtualNetworkName')]", - "obj_backendTrustedRootCerts": [ - { - "name": "appGatewayTrustedRootCert", - "properties": { - "data": "[parameters('appGatewaySSLBackendCertData')]" - } - } - ], - "obj_HTTPSettingsDefault": { - "provisioningState": "Succeeded", - "port": "[int(variables('const_backendPort'))]", - "protocol": "Http", - "cookieBasedAffinity": "[if(parameters('enableCookieBasedAffinity'), 'Enabled', 'Disabled')]", - "pickHostNameFromBackendAddress": true, - "affinityCookieName": "ApplicationGatewayAffinity", - "requestTimeout": 20, - "probe": { - "id": "[variables('ref_backendProbe')]" - } - }, - "obj_HTTPSettingsCustomDNS": { - "provisioningState": "Succeeded", - "port": "[int(variables('const_backendPort'))]", - "protocol": "Http", - "cookieBasedAffinity": "[if(parameters('enableCookieBasedAffinity'), 'Enabled', 'Disabled')]", - "hostName": "[parameters('customDomainName')]", - "pickHostNameFromBackendAddress": false, - "affinityCookieName": "ApplicationGatewayAffinity", - "requestTimeout": 20, - "probe": { - "id": "[variables('ref_backendProbe')]" - } - }, - "ref_appGatewayPublicIP": "[resourceId('Microsoft.Network/publicIPAddresses',parameters('gatewayPublicIPAddressName'))]", - "ref_appGatewaySubnet": "[resourceId(parameters('virtualNetworkResourceGroupName'),'Microsoft.Network/virtualNetworks/subnets', variables('name_virtualNetwork'), variables('name_appGatewaySubnet'))]", - "ref_backendAddressPool": "[resourceId('Microsoft.Network/applicationGateways/backendAddressPools', parameters('appGatewayName'),variables('name_backendAddressPool'))]", - "ref_backendHttpSettings": "[resourceId('Microsoft.Network/applicationGateways/backendHttpSettingsCollection', parameters('appGatewayName'),variables('name_httpSetting'))]", - "ref_backendProbe": "[resourceId('Microsoft.Network/applicationGateways/probes', parameters('appGatewayName'),variables('name_probe'))]", - "ref_frontendHTTPPort": "[resourceId('Microsoft.Network/applicationGateways/frontendPorts', parameters('appGatewayName'),variables('name_httpPort'))]", - "ref_frontendHTTPSPort": "[resourceId('Microsoft.Network/applicationGateways/frontendPorts', parameters('appGatewayName'),variables('name_httpsPort'))]", - "ref_frontendIPConfiguration": "[resourceId('Microsoft.Network/applicationGateways/frontendIPConfigurations', parameters('appGatewayName'),variables('name_frontEndIPConfig'))]", - "ref_httpListener": "[resourceId('Microsoft.Network/applicationGateways/httpListeners', parameters('appGatewayName'),variables('name_httpListener'))]", - "ref_httpsListener": "[resourceId('Microsoft.Network/applicationGateways/httpListeners', parameters('appGatewayName'),variables('name_httpsListener'))]", - "ref_sslCertificate": "[resourceId('Microsoft.Network/applicationGateways/sslCertificates', parameters('appGatewayName'),variables('name_appGatewayCertificate'))]" - }, - "resources": [ - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${cluster.appgateway.start}", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "apiVersion": "${azure.apiVersionForPublicIPAddresses}", - "type": "Microsoft.Network/publicIPAddresses", - "tags": "[parameters('tagsByResource')['${identifier.publicIPAddresses}']]", - "name": "[parameters('gatewayPublicIPAddressName')]", - "sku": { - "name": "Standard" - }, - "location": "[parameters('location')]", - "properties": { - "publicIPAllocationMethod": "Static", - "dnsSettings": { - "domainNameLabel": "[parameters('dnsNameforApplicationGateway')]" - } - } - }, - { - "type": "Microsoft.Network/applicationGateways", - "apiVersion": "${azure.apiVersionForApplicationGateways}", - "tags": "[parameters('tagsByResource')['${identifier.applicationGateways}']]", - "name": "[parameters('appGatewayName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/publicIPAddresses', parameters('gatewayPublicIPAddressName'))]" - ], - "properties": { - "sku": { - "name": "WAF_v2", - "tier": "WAF_v2" - }, - "gatewayIPConfigurations": [ - { - "name": "appGatewayIpConfig", - "properties": { - "subnet": { - "id": "[variables('ref_appGatewaySubnet')]" - } - }, - "type": "Microsoft.Network/applicationGateways/gatewayIPConfigurations" - } - ], - "frontendIPConfigurations": [ - { - "name": "appGwPublicFrontendIp", - "type": "Microsoft.Network/applicationGateways/frontendIPConfigurations", - "properties": { - "publicIPAddress": { - "id": "[variables('ref_appGatewayPublicIP')]" - } - } - } - ], - "frontendPorts": [ - { - "name": "http_port", - "properties": { - "port": "[int(variables('const_appGatewayFrontEndHTTPPort'))]" - }, - "type": "Microsoft.Network/applicationGateways/frontendPorts" - }, - { - "name": "https_port", - "properties": { - "port": "[int(variables('const_appGatewayFrontEndHTTPSPort'))]" - }, - "type": "Microsoft.Network/applicationGateways/frontendPorts" - } - ], - "sslCertificates": [ - { - "name": "appGwSslCertificate", - "properties": { - "data": "[parameters('appGatewaySSLCertificateData')]", - "password": "[parameters('appGatewaySSLCertificatePassword')]" - } - } - ], - "trustedRootCertificates": "[if(parameters('enableCustomSSL'),variables('obj_backendTrustedRootCerts'), '[]')]", - "backendAddressPools": [ - { - "name": "myGatewayBackendPool", - "properties": { - "copy": [ - { - "name": "BackendAddresses", - "count": "[sub(int(parameters('numberOfInstances')),1)]", - "input": { - "ipAddress": "[reference(resourceId('Microsoft.Network/networkInterfaces', concat(variables('name_managedVMNamePrefix'), copyIndex('BackendAddresses',1), if(equals(parameters('virtualNetworkNewOrExisting'), 'new'), variables('name_nic_with_pub_ip'), variables('name_nic_without_pub_ip')))),'${azure.apiVersionForNetworkInterfaces}').ipConfigurations[0].properties.privateIPAddress]" - } - } - ] - }, - "type": "Microsoft.Network/applicationGateways/backendAddressPools" - } - ], - "backendHttpSettingsCollection": [ - { - "name": "myHTTPSetting", - // Solve the URL redirection issue - "properties": "[if(parameters('overrideHostName'), variables('obj_HTTPSettingsCustomDNS'),variables('obj_HTTPSettingsDefault'))]", - "type": "Microsoft.Network/applicationGateways/backendHttpSettingsCollection" - } - ], - "httpListeners": [ - { - "name": "HTTPListener", - "properties": { - "frontendIPConfiguration": { - "id": "[variables('ref_frontendIPConfiguration')]" - }, - "frontendPort": { - "id": "[variables('ref_frontendHTTPPort')]" - }, - "protocol": "Http", - "requireServerNameIndication": false - }, - "type": "Microsoft.Network/applicationGateways/httpListeners" - }, - { - "name": "HTTPSListener", - "properties": { - "frontendIPConfiguration": { - "id": "[variables('ref_frontendIPConfiguration')]" - }, - "frontendPort": { - "id": "[variables('ref_frontendHTTPSPort')]" - }, - "protocol": "Https", - "requireServerNameIndication": false, - "SslCertificate": { - "id": "[variables('ref_sslCertificate')]" - } - }, - "type": "Microsoft.Network/applicationGateways/httpListeners" - } - - ], - "requestRoutingRules": [ - { - "name": "HTTPRoutingRule", - "properties": { - "ruleType": "Basic", - "priority": 1000, - "httpListener": { - "id": "[variables('ref_httpListener')]" - }, - "backendAddressPool": { - "id": "[variables('ref_backendAddressPool')]" - }, - "backendHttpSettings": { - "id": "[variables('ref_backendHttpSettings')]" - } - }, - "type": "Microsoft.Network/applicationGateways/requestRoutingRules" - }, - { - "name": "HTTPSRoutingRule", - "properties": { - "ruleType": "Basic", - "priority": 1001, - "httpListener": { - "id": "[variables('ref_httpsListener')]" - }, - "backendAddressPool": { - "id": "[variables('ref_backendAddressPool')]" - }, - "backendHttpSettings": { - "id": "[variables('ref_backendHttpSettings')]" - } - }, - "type": "Microsoft.Network/applicationGateways/requestRoutingRules" - } - ], - "probes": [ - { - "name": "HTTPhealthProbe", - "properties": { - "protocol": "Http", - "path": "/weblogic/ready", - "interval": 30, - "timeout": 30, - "unhealthyThreshold": 3, - "pickHostNameFromBackendHttpSettings": true, - "minServers": 0, - "match": { - "statusCodes": [ - "200-399" - ] - } - }, - "type": "Microsoft.Network/applicationGateways/probes" - } - ], - "webApplicationFirewallConfiguration": { - "enabled": true, - "firewallMode": "Prevention", - "ruleSetType": "OWASP", - "ruleSetVersion": "3.0" - }, - "enableHttp2": false, - "autoscaleConfiguration": { - "minCapacity": 2, - "maxCapacity": 3 - } - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines/extensions", - "tags": "[parameters('tagsByResource')['${identifier.virtualMachinesExtensions}']]", - "name": "[concat(parameters('adminVMName'),'/newuserscript')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/applicationGateways', parameters('appGatewayName'))]" - ], - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.0", - "autoUpgradeMinorVersion": true, - "settings": { - "fileUris": [ - "[uri(parameters('_artifactsLocationAGWTemplate'), concat('../scripts/', variables('name_scriptAGWConfiguration'), parameters('_artifactsLocationSasToken')))]" - ] - }, - "protectedSettings": { - "commandToExecute": "[concat('sh',' ',variables('name_scriptAGWConfiguration'),' <<< \"', variables('const_adminServerName'),' ',parameters('wlsUserName'),' ',parameters('wlsPassword'),' ',parameters('adminVMName'),' ',variables('const_wlsAdminPort'),' ', if(parameters('overrideHostName'), parameters('customDomainName'), reference(variables('ref_appGatewayPublicIP'), '${azure.apiVersionForPublicIPAddresses}').dnsSettings.fqdn), ' ',variables('const_wlsHome'),'\"')]" - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${cluster.appgateway.end}", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - } - ], - "outputs": { - "appGatewayAlias": { - "type": "string", - "value": "[reference(variables('ref_appGatewayPublicIP'), '${azure.apiVersionForPublicIPAddresses}').dnsSettings.fqdn]" - }, - "appGatewayURL": { - "type": "string", - "value": "[uri(format('http://{0}',reference(variables('ref_appGatewayPublicIP'), '${azure.apiVersionForPublicIPAddresses}').dnsSettings.fqdn),'')]" - }, - "appGatewaySecuredURL": { - "type": "string", - "value": "[uri(format('https://{0}',reference(variables('ref_appGatewayPublicIP'), '${azure.apiVersionForPublicIPAddresses}').dnsSettings.fqdn),'')]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/clusterCustomSSLTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/clusterCustomSSLTemplate.json deleted file mode 100644 index 3d750c4e9..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/clusterCustomSSLTemplate.json +++ /dev/null @@ -1,1150 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - } - }, - "_artifactsLocationClusterTemplate": { - "defaultValue": "[if(contains(parameters('_artifactsLocation'), 'githubusercontent'), parameters('_artifactsLocation'), deployment().properties.templateLink.uri)]", - "type": "string", - "metadata": { - "description": "If we are deploying from the command line, use the passed in _artifactsLocation, otherwise use the default." - } - }, - "_artifactsLocationSasToken": { - "defaultValue": "", - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - } - }, - "_globalResourceNameSuffix":{ - "type": "string", - "metadata": { - "description": "The suffix to be appended to the globally unique resource name" - } - }, - "adminPasswordOrKey": { - "type": "securestring", - "metadata": { - "description": "SSH Key or password for the Virtual Machine. SSH key is recommended." - } - }, - "adminUsername": { - "defaultValue": "weblogic", - "type": "string", - "metadata": { - "description": "User name for the Virtual Machine." - } - }, - "adminVMName": { - "defaultValue": "adminVM", - "type": "string", - "metadata": { - "description": "Admin Server hosting VM name." - } - }, - "authenticationType": { - "defaultValue": "password", - "type": "string", - "allowedValues": [ - "sshPublicKey", - "password" - ], - "metadata": { - "description": "Type of authentication to use on the Virtual Machine. SSH key is recommended." - } - }, - "dnsLabelPrefix": { - "type": "string", - "metadata": { - "description": "Unique DNS Name for the Public IP used to access the Virtual Machine." - } - }, - "location": { - "type": "string", - "metadata": { - "description": "Location for all resources." - } - }, - "managedServerPrefix": { - "type": "string", - "defaultValue": "msp", - "metadata": { - "description": "Provide managed server prefix name" - } - }, - "managedVMNamePrefix": { - "type": "string", - "metadata": { - "description": "Provide managed server VM prefix name" - } - }, - "numberOfInstances": { - "type": "int", - "defaultValue": 2, - "minValue": 2, - "maxValue": 5, - "metadata": { - "description": "Number of VMs to deploy, limit 5 since this sample is using a single storage account" - } - }, - "nsgName": { - "type": "string", - "metadata": { - "description": "Name of the new Network Security Group" - } - }, - "portsToExpose": { - "type": "string", - "defaultValue": "80,443,7001-9000", - "metadata": { - "description": "Ports and port ranges to expose" - } - }, - "skuUrnVersion": { - "type": "string", - "defaultValue": "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest", - "allowedValues": [ - "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest", - "owls-141100-jdk11-ol87;Oracle:weblogic-141100-jdk11-ol87:owls-141100-jdk11-ol87;latest", - "owls-141100-jdk8-ol91;Oracle:weblogic-141100-jdk8-ol91:owls-141100-jdk8-ol91;latest", - "owls-141100-jdk8-ol87;Oracle:weblogic-141100-jdk8-ol87:owls-141100-jdk8-ol87;latest", - "owls-122140-jdk8-ol91;Oracle:weblogic-122140-jdk8-ol91:owls-122140-jdk8-ol91;latest", - "owls-122140-jdk8-ol87;Oracle:weblogic-122140-jdk8-ol87:owls-122140-jdk8-ol87;latest", - "owls-122140-jdk8-ol76;Oracle:weblogic-122140-jdk8-ol76:owls-122140-jdk8-ol7;latest", - "owls-141100-jdk8-ol76;Oracle:weblogic-141100-jdk8-ol76:owls-141100-jdk8-ol7;latest", - "owls-141100-jdk11-ol76;Oracle:weblogic-141100-jdk11-ol76:owls-141100-jdk11-ol7;latest", - "owls-141100-jdk11-rhel87;Oracle:weblogic-141100-jdk11-rhel87:owls-141100-jdk11-rhel87;latest", - "owls-141100-jdk8-rhel87;Oracle:weblogic-141100-jdk8-rhel87:owls-141100-jdk8-rhel87;latest", - "owls-122140-jdk8-rhel87;Oracle:weblogic-122140-jdk8-rhel87:owls-122140-jdk8-rhel87;latest", - "owls-122140-jdk8-rhel76;Oracle:weblogic-122140-jdk8-rhel76:owls-122140-jdk8-rhel76;latest", - "owls-141100-jdk8-rhel76;Oracle:weblogic-141100-jdk8-rhel76:owls-141100-jdk8-rhel76;latest", - "owls-141100-jdk11-rhel76;Oracle:weblogic-141100-jdk11-rhel76:owls-141100-jdk11-rhel76;latest" - ], - "metadata": { - "description": "The Oracle Linux image with Weblogic and Java preinstalled. Semicolon separated string of Sku, URN, and Version" - } - }, - "tagsByResource": { - "type": "object", - "defaultValue": {}, - "metadata": { - "description": "${label.tagsLabel}" - } - }, - "usePreviewImage": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "Bool value, if it's set to true, will deploy with preview weblogic image." - } - }, - "useSystemAssignedManagedIdentity": { - "type": "bool", - "defaultValue": true, - "metadata": { - "description": "Bool value, if it's set to true, a system assigned managed identity will to be created for the VM(s)" - } - }, - "vmSize": { - "type": "string", - "defaultValue": "Standard_A3", - "metadata": { - "description": "Select appropriate VM Size as per requirement" - } - }, - "virtualNetworkNewOrExisting": { - "type": "string", - "defaultValue": "new", - "allowedValues": [ - "new", - "existing" - ], - "metadata": { - "description": "Specify whether to create a new or existing virtual network for the VM." - } - }, - "virtualNetworkName": { - "type": "string", - "defaultValue": "wls-vnet", - "metadata": { - "description": "Name of the existing or new VNET" - } - }, - "virtualNetworkResourceGroupName": { - "type": "string", - "defaultValue": "[resourceGroup().name]", - "metadata": { - "description": "Resource group of Virtual network" - } - }, - "addressPrefixes": { - "type": "array", - "defaultValue": [ - "10.0.0.0/28" - ], - "metadata": { - "description": "Address prefix of the VNET." - } - }, - "subnetName": { - "type": "string", - "defaultValue": "wls-subnet", - "metadata": { - "description": "Name of the existing or new Subnet" - } - }, - "subnetPrefix": { - "type": "string", - "defaultValue": "10.0.0.0/29", - "metadata": { - "description": "Address prefix of the subnet" - } - }, - "subnetForAppGateway": { - "type": "string", - "defaultValue": "appgateway-subnet", - "metadata": { - "description": "Name of the existing or new Subnet for Application Gateway" - } - }, - "subnetPrefixForAppGateway": { - "type": "string", - "defaultValue": "10.0.1.0/24", - "metadata": { - "description": "Address prefix of the subnet for Application Gateway" - } - }, - "wlsDomainName": { - "type": "string", - "metadata": { - "description": "Provide Weblogic domain name" - } - }, - "wlsUserName": { - "defaultValue": "weblogic", - "type": "string", - "metadata": { - "description": "Username for your Weblogic domain name" - } - }, - "wlsPassword": { - "type": "securestring", - "metadata": { - "description": "Password for your Weblogic domain name" - } - }, - "enableAppGateway": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "If true, deploy an Azure App Gateway in front of the nodes of the cluster" - } - }, - "enableHTTPAdminListenPort":{ - "type": "bool", - "defaultValue": true, - "metadata": { - "description": "Boolean value indicating, if WebLogic Admin Server HTTP Listen Port is enabled or not" - } - }, - "enableDNSConfiguration": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "Boolean value indicating, if DNS Zone Configuration is enabled or not" - } - }, - "customDNSNameForAdminServer": { - "type": "string", - "defaultValue": "none", - "metadata": { - "description": "Custom DNS Name for WebLogic Admin Server" - } - }, - "enableCustomSSL":{ - "defaultValue":true, - "type": "bool", - "metadata": { - "description": "Boolean value indicating, if custom SSL is enabled or not" - } - }, - "sslCustomIdentityKeyStoreData": { - "type": "securestring", - "metadata": { - "description": "Weblogic Custom Identity Keystore Data" - } - }, - "sslCustomIdentityKeyStorePassPhrase": { - "type": "securestring", - "metadata": { - "description": "Weblogic Custom Identity Keystore Passphrase" - } - }, - "sslCustomIdentityKeyStoreType": { - "type": "string", - "metadata": { - "description": "Weblogic Custom Identity Keystore Type" - }, - "defaultValue": "JKS" - }, - "sslCustomTrustKeyStoreData": { - "type": "securestring", - "metadata": { - "description": "Weblogic Custom Trust Store Data" - } - }, - "sslCustomTrustKeyStorePassPhrase": { - "type": "securestring", - "metadata": { - "description": "Weblogic Custom Trust Store Passphrase" - } - }, - "sslCustomTrustKeyStoreType": { - "type": "string", - "metadata": { - "description": "Weblogic Custom Trust Store Type" - }, - "defaultValue": "JKS" - }, - "sslPrivateKeyAlias": { - "type": "string", - "metadata": { - "description": "Weblogic Server Private Key Alias" - } - }, - "sslPrivateKeyPassPhrase": { - "type": "securestring", - "metadata": { - "description": "Weblogic Server Private Key Pass Phrase" - } - } - }, - "variables": { - "const_addressPrefix": "[parameters('addressPrefixes')]", - "const_appGatewaySubnetPrefix": "[parameters('subnetPrefixForAppGateway')]", - "const_hyphen": "-", - "const_imageOffer": "[concat('weblogic',variables('const_hyphen'), split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[1],variables('const_hyphen'),split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[2],variables('const_hyphen'),split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[3],if(parameters('usePreviewImage'),'-preview',''))]", - "const_imagePublisher": "oracle", - "const_linuxConfiguration": { - "disablePasswordAuthentication": true, - "ssh": { - "publicKeys": [ - { - "path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]", - "keyData": "[parameters('adminPasswordOrKey')]" - } - ] - } - }, - "const_managedVMPrefix": "[concat(parameters('managedVMNamePrefix'),'VM')]", - "const_mountPointPath": "[concat('/mnt/', variables('name_share'))]", - "const_publicIPAddressType": "Dynamic", - "const_requiredPortrange": ",65200-65535,5556", - "const_storageAccountType": "Standard_LRS", - "const_subnetPrefix": "[parameters('subnetPrefix')]", - "const_vmSize": "[parameters('vmSize')]", - "const_wlsHome": "/u01/app/wls/install/oracle/middleware/oracle_home", - "name_appGatewaySubnet": "[parameters('subnetForAppGateway')]", - "name_availabilitySet": "[concat('wlscluster-availabilityset-', parameters('_globalResourceNameSuffix'))]", - "name_linuxImageOfferSKU": "[first(split(parameters('skuUrnVersion'), ';'))]", - "name_linuxImageVersion": "[last(split(parameters('skuUrnVersion'),';'))]", - "name_nic": "_NIC", - "name_publicIPAddress": "_PublicIP", - "name_nic_with_pub_ip": "[concat(variables('name_nic'), '_with_pub_ip')]", - "name_nic_without_pub_ip": "[concat(variables('name_nic'), '_without_pub_ip')]", - "name_outputAdminHost_with_pub_ip": "[concat(parameters('adminVMName'),variables('name_publicIPAddress'))]", - "name_outputAdminHost_without_pub_ip": "[concat(parameters('adminVMName'),variables('name_nic_without_pub_ip'))]", - "name_privateSaEndpoint": "[concat('saep', parameters('_globalResourceNameSuffix'))]", - "name_scriptFile": "setupClusterDomain.sh", - "name_share": "wlsshare", - "name_storageAccount": "[concat('olvmstg', parameters('_globalResourceNameSuffix'))]", - "name_subnet": "[parameters('subnetName')]", - "name_virtualNetwork": "[parameters('virtualNetworkName')]", - "ref_fileService": "[resourceId('Microsoft.Storage/storageAccounts/fileServices', variables('name_storageAccount'), 'default')]", - "ref_networkSecurityGroup": "[resourceId('Microsoft.Network/networkSecurityGroups', parameters('nsgName'))]", - "ref_storage": "[resourceId('Microsoft.Storage/storageAccounts', variables('name_storageAccount'))]", - "ref_subnet": "[resourceId(parameters('virtualNetworkResourceGroupName'),'Microsoft.Network/virtualNetworks/subnets', variables('name_virtualNetwork'), variables('name_subnet'))]", - "name_customHostnameGeneratorscriptFile": "generateCustomHostNameVerifier.sh", - "name_customHostnameVerifierJavaFile": "src/main/java/WebLogicCustomHostNameVerifier.java", - "name_customHostnameValuesTemplate": "src/main/java/HostNameValuesTemplate.txt", - "name_customHostnameVerifierTest" : "src/test/java/WebLogicCustomHostNameVerifierTest.java", - "property_subnet_with_app_gateway": [ - { - "name": "[variables('name_subnet')]", - "properties": { - "addressPrefix": "[variables('const_subnetPrefix')]", - "networkSecurityGroup": { - "id": "[variables('ref_networkSecurityGroup')]" - } - } - }, - { - // PENDING(edburns): Assume it is acceptable to create a subnet for the App Gateway, even if the user - // has not requested an App Gateway. In support of this assumption we can note: the user may want an App - // Gateway after deployment. - "name": "[variables('name_appGatewaySubnet')]", - "properties": { - "addressPrefix": "[variables('const_appGatewaySubnetPrefix')]", - "networkSecurityGroup": { - "id": "[variables('ref_networkSecurityGroup')]" - } - } - } - ], - "property_subnet_without_app_gateway": [ - { - "name": "[variables('name_subnet')]", - "properties": { - "addressPrefix": "[variables('const_subnetPrefix')]", - "networkSecurityGroup": { - "id": "[variables('ref_networkSecurityGroup')]" - } - } - } - ] - }, - "resources": [ - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${cluster.cluster.start}", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${cluster.ssl.start}", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "apiVersion": "${azure.apiVersionForNetworkSecurityGroups}", - "type": "Microsoft.Network/networkSecurityGroups", - "tags": "[parameters('tagsByResource')['${identifier.networkSecurityGroups}']]", - "condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'new')]", - "name": "[parameters('nsgName')]", - "location": "[parameters('location')]", - "properties": { - "securityRules": [ - { - "name": "WebLogicPorts", - "properties": { - "protocol": "TCP", - "sourcePortRange": "*", - "sourceAddressPrefix": "*", - "destinationAddressPrefix": "*", - "access": "Allow", - "priority": 320, - "direction": "Inbound", - "destinationPortRanges": "[split(concat(parameters('portsToExpose'),variables('const_requiredPortrange')), ',')]" - } - }, - { - "name": "WebLogicNMPort", - "properties": { - "protocol": "TCP", - "sourcePortRange": "*", - "sourceAddressPrefix": "Internet", - "destinationAddressPrefix": "*", - "access": "Deny", - "priority": 201, - "direction": "Inbound", - "destinationPortRanges": [ "5556" ] - } - }, - { - "name": "WebLogicAdminChannelPort", - "properties": { - "protocol": "TCP", - "sourcePortRange": "*", - "sourceAddressPrefix": "Internet", - "destinationAddressPrefix": "*", - "access": "Deny", - "priority": 202, - "direction": "Inbound", - "destinationPortRanges": [ "7005" ] - } - }, - { - "name": "WebLogicManagedChannelPortsDenied", - "properties": { - "protocol": "*", - "sourcePortRange": "*", - "destinationAddressPrefix": "*", - "access": "Deny", - "priority": 230, - "direction": "Inbound", - "destinationPortRanges": [ - "8501" - ], - "sourceAddressPrefix": "Internet" - } - } - ] - } - }, - { - "type": "Microsoft.Storage/storageAccounts", - "apiVersion": "${azure.apiVersionForStorage}", - "tags": "[parameters('tagsByResource')['${identifier.storageAccounts}']]", - "name": "[variables('name_storageAccount')]", - "location": "[parameters('location')]", - "sku": { - "name": "[variables('const_storageAccountType')]" - }, - "kind": "StorageV2", - "properties": { - "supportsHttpsTrafficOnly": false - }, - "dependsOn": [ - "[parameters('nsgName')]" - ] - }, - { - "apiVersion": "${azure.apiVersionForPrivateEndpoint}", - "name": "[variables('name_privateSaEndpoint')]", - "type": "Microsoft.Network/privateEndpoints", - "tags": "[parameters('tagsByResource')['${identifier.privateEndpoints}']]", - "location": "[parameters('location')]", - "properties": { - "privateLinkServiceConnections": [ - { - "name": "[variables('name_privateSaEndpoint')]", - "properties": { - "privateLinkServiceId": "[resourceId('Microsoft.Storage/storageAccounts/', variables('name_storageAccount'))]", - "groupIds": [ - "file" - ] - } - } - ], - "subnet": { - "id": "[variables('ref_subnet')]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('name_storageAccount'))]", - "[variables('name_virtualNetwork')]" - ] - }, - { - "type": "Microsoft.Storage/storageAccounts/fileServices", - "apiVersion": "${azure.apiVersionForStorageFileService}", - "name": "[concat(variables('name_storageAccount'), '/default')]", - "dependsOn": [ - "[variables('ref_storage')]" - ], - "sku": { - "name": "Standard_LRS", - "tier": "Standard" - } - }, - { - "type": "Microsoft.Storage/storageAccounts/fileServices/shares", - "apiVersion": "${azure.apiVersionForStorageFileService}", - "name": "[concat(variables('name_storageAccount'), '/default/', variables('name_share'))]", - "dependsOn": [ - "[variables('ref_fileService')]", - "[variables('ref_storage')]" - ], - "properties": { - "shareQuota": 5 - } - }, - { - "apiVersion": "${azure.apiVersionForPublicIPAddresses}", - "type": "Microsoft.Network/publicIPAddresses", - "tags": "[parameters('tagsByResource')['${identifier.publicIPAddresses}']]", - "condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'new')]", - "name": "[if(equals(copyIndex(),0),concat(parameters('adminVMName'),variables('name_publicIPAddress')),concat(variables('const_managedVMPrefix'), copyIndex(),variables('name_publicIPAddress')))]", - "location": "[parameters('location')]", - "copy": { - "name": "publicIPLoop", - "count": "[parameters('numberOfInstances')]" - }, - "properties": { - "publicIPAllocationMethod": "[variables('const_publicIPAddressType')]", - "dnsSettings": { - "domainNameLabel": "[take(concat(toLower(parameters('dnsLabelPrefix')), copyindex(),'-', parameters('_globalResourceNameSuffix'),'-',toLower(parameters('wlsDomainName'))), 50)]" - } - }, - "dependsOn": [ - "[variables('name_storageAccount')]" - ] - }, - { - "apiVersion": "${azure.apiVersionForVirtualNetworks}", - "type": "Microsoft.Network/virtualNetworks", - "tags": "[parameters('tagsByResource')['${identifier.virtualNetworks}']]", - "condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'new')]", - "name": "[variables('name_virtualNetwork')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[variables('name_storageAccount')]" - ], - "properties": { - "addressSpace": { - "addressPrefixes": "[variables('const_addressPrefix')]" - }, - "subnets": "[if(parameters('enableAppGateway'), variables('property_subnet_with_app_gateway'), variables('property_subnet_without_app_gateway'))]" - - } - }, - { - "apiVersion": "${azure.apiVersionForNetworkInterfaces}", - "type": "Microsoft.Network/networkInterfaces", - "tags": "[parameters('tagsByResource')['${identifier.networkInterfaces}']]", - "condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'new')]", - "name": "[if(equals(copyIndex(),0),concat(parameters('adminVMName'),variables('name_nic_with_pub_ip')),concat(variables('const_managedVMPrefix'), copyIndex(),variables('name_nic_with_pub_ip')))]", "location": "[parameters('location')]", - "copy": { - "name": "nicLoop_public_ip", - "count": "[parameters('numberOfInstances')]" - }, - "dependsOn": [ - "[variables('name_virtualNetwork')]", - "publicIPLoop" - ], - "properties": { - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses',if(equals(copyIndex(),0),concat(parameters('adminVMName'),variables('name_publicIPAddress')),concat(variables('const_managedVMPrefix'), copyIndex(),variables('name_publicIPAddress'))))]" - }, - "subnet": { - "id": "[variables('ref_subnet')]" - } - } - } - ], - "dnsSettings": { - "internalDnsNameLabel": "[if(equals(copyIndex(),0),parameters('adminVMName'),concat(variables('const_managedVMPrefix'), copyIndex()))]" - } - } - }, - { - "type": "Microsoft.Network/networkInterfaces", - "apiVersion": "${azure.apiVersionForNetworkInterfaces}", - "tags": "[parameters('tagsByResource')['${identifier.networkInterfaces}']]", - "condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'existing')]", - "name": "[if(equals(copyIndex(),0),variables('name_outputAdminHost_without_pub_ip'),concat(variables('const_managedVMPrefix'), copyIndex(),variables('name_nic_without_pub_ip')))]", - "location": "[parameters('location')]", - "copy": { - "name": "nicLoop_private_ip", - "count": "[parameters('numberOfInstances')]" - }, - "dependsOn": [ - "[variables('name_virtualNetwork')]" - ], - "properties": { - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "subnet": { - "id": "[variables('ref_subnet')]" - } - } - } - ] - } - }, - { - "type": "Microsoft.Compute/availabilitySets", - "apiVersion": "${azure.apiVersionForAvailabilitySets}", - "tags": "[parameters('tagsByResource')['${identifier.availabilitySets}']]", - "location": "[parameters('location')]", - "name": "[variables('name_availabilitySet')]", - "properties": { - "platformFaultDomainCount": 2, - "platformUpdateDomainCount": 2 - }, - "dependsOn": [ - "[variables('name_virtualNetwork')]" - ], - "sku": { - "name": "Aligned" - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines", - "tags": "[parameters('tagsByResource')['${identifier.virtualMachines}']]", - "name": "[if(equals(copyIndex(),0),parameters('adminVMName'),concat(variables('const_managedVMPrefix'), copyIndex()))]", - "location": "[parameters('location')]", - "copy": { - "name": "virtualMachineLoop", - "count": "[parameters('numberOfInstances')]" - }, - "dependsOn": [ - "nicLoop_public_ip", - "nicLoop_private_ip", - "[resourceId('Microsoft.Compute/availabilitySets/', variables('name_availabilitySet'))]", - "[variables('name_privateSaEndpoint')]" - ], - "identity": "[if(parameters('useSystemAssignedManagedIdentity'), json('{\"type\":\"SystemAssigned\"}'), null())]", - "properties": { - "availabilitySet": { - "id": "[resourceId('Microsoft.Compute/availabilitySets',variables('name_availabilitySet'))]" - }, - "hardwareProfile": { - "vmSize": "[variables('const_vmSize')]" - }, - "osProfile": { - "computerName": "[if(equals(copyIndex(),0),parameters('adminVMName'),concat(variables('const_managedVMPrefix'), copyIndex()))]", - "adminUsername": "[parameters('adminUsername')]", - "adminPassword": "[parameters('adminPasswordOrKey')]", - "linuxConfiguration": "[if(equals(parameters('authenticationType'), 'password'), json('null'), variables('const_linuxConfiguration'))]" - }, - "storageProfile": { - "imageReference": { - "publisher": "[variables('const_imagePublisher')]", - "offer": "[variables('const_imageOffer')]", - "sku": "[variables('name_linuxImageOfferSKU')]", - "version": "[variables('name_linuxImageVersion')]" - }, - "osDisk": { - "createOption": "FromImage", - "managedDisk": { - "storageAccountType": "Standard_LRS" - } - } - }, - "networkProfile": { - "networkInterfaces": [ - { - "id": "[if(equals(parameters('virtualNetworkNewOrExisting'), 'new'), resourceId('Microsoft.Network/networkInterfaces',if(equals(copyIndex(),0),concat(parameters('adminVMName'),variables('name_nic_with_pub_ip')),concat(variables('const_managedVMPrefix'), copyIndex(),variables('name_nic_with_pub_ip')))), resourceId('Microsoft.Network/networkInterfaces',if(equals(copyIndex(),0),variables('name_outputAdminHost_without_pub_ip'),concat(variables('const_managedVMPrefix'), copyIndex(),variables('name_nic_without_pub_ip')))))]" - } - ] - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": true, - "storageUri": "[reference(resourceId('Microsoft.Storage/storageAccounts/', variables('name_storageAccount')), '${azure.apiVersionForStorage}').primaryEndpoints.blob]" - } - } - }, - "plan": { - "name": "[variables('name_linuxImageOfferSKU')]", - "publisher": "[variables('const_imagePublisher')]", - "product": "[variables('const_imageOffer')]" - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines/extensions", - "tags": "[parameters('tagsByResource')['${identifier.virtualMachinesExtensions}']]", - "name": "[if(equals(copyIndex(),0),concat(parameters('adminVMName'),'/newuserscript'),concat(variables('const_managedVMPrefix'), copyIndex(),'/newuserscript'))]", - "location": "[parameters('location')]", - "copy": { - "name": "virtualMachineExtensionLoop", - "count": "[parameters('numberOfInstances')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/',parameters('adminVMName'))]", - "virtualMachineLoop" - ], - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.0", - "autoUpgradeMinorVersion": true, - "settings": { - "fileUris": [ - "[uri(parameters('_artifactsLocationClusterTemplate'), concat('../scripts/', variables('name_scriptFile'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationClusterTemplate'), concat('../../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameGeneratorscriptFile'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationClusterTemplate'), concat('../../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameVerifierJavaFile'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationClusterTemplate'), concat('../../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameValuesTemplate'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationClusterTemplate'), concat('../../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameVerifierTest'), parameters('_artifactsLocationSasToken')))]" - ] - }, - "protectedSettings": { - "commandToExecute": "[concat('sh',' ',variables('name_scriptFile'),' <<< \"',parameters('wlsDomainName'),' ',parameters('wlsUserName'),' ',parameters('wlsPassword'),' ',if(equals(copyIndex(),0),'admin',concat(parameters('managedServerPrefix'), copyIndex())),' ',parameters('adminVMName'),' ',variables('const_wlsHome'),' ',variables('name_storageAccount'),' ',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('name_storageAccount')), '${azure.apiVersionForStorage}').keys[0].value,' ',variables('const_mountPointPath'),' ',string(parameters('enableHTTPAdminListenPort')),' ',string(parameters('enableCustomSSL')),' ',if(equals(parameters('virtualNetworkNewOrExisting'), 'new'), if(parameters('enableDNSConfiguration'),parameters('customDNSNameForAdminServer'),reference(variables('name_outputAdminHost_with_pub_ip'), '${azure.apiVersionForPublicIPAddresses}').dnsSettings.fqdn), reference(variables('name_outputAdminHost_without_pub_ip')).ipConfigurations[0].properties.privateIPAddress),' ',parameters('dnsLabelPrefix'),' ',parameters('location'),' ', parameters('virtualNetworkNewOrExisting'),' ',reference(resourceId('Microsoft.Network/privateEndpoints/', variables('name_privateSaEndpoint')), '${azure.apiVersionForPrivateEndpoint}').customDnsConfigs[0].ipAddresses[0],' ',base64(parameters('sslCustomIdentityKeyStoreData')),' ',base64(parameters('sslCustomIdentityKeyStorePassPhrase')),' ',base64(parameters('sslCustomIdentityKeyStoreType')),' ',base64(parameters('sslCustomTrustKeyStoreData')),' ',base64(parameters('sslCustomTrustKeyStorePassPhrase')),' ',base64(parameters('sslCustomTrustKeyStoreType')),' ',base64(parameters('sslPrivateKeyAlias')),' ',base64(parameters('sslPrivateKeyPassPhrase')),'\"')]" - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${cluster.ssl.end}", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${cluster.cluster.end}", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${from.owls-141100-jdk11-ol91}", - - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk11-ol91'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${from.owls-141100-jdk11-ol87}", - - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk11-ol87'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${from.owls-141100-jdk8-ol91}", - - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk8-ol91'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${from.owls-141100-jdk8-ol87}", - - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk8-ol87'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${from.owls-122140-jdk8-ol91}", - - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-122140-jdk8-ol91'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${from.owls-122140-jdk8-ol87}", - - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-122140-jdk8-ol87'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${from.owls-122140-jdk8-ol76}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'from.owls-122140-jdk8-ol76'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${from.owls-141100-jdk8-ol76}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk8-ol76'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${from.owls-141100-jdk11-ol76}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk11-ol76'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${from.owls-141100-jdk11-rhel87}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk11-rhel87'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${from.owls-141100-jdk8-rhel87}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk8-rhel87'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${from.owls-122140-jdk8-rhel87}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-122140-jdk8-rhel87'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${from.owls-122140-jdk8-rhel76}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-122140-jdk8-rhel76'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${from.owls-141100-jdk8-rhel76}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk8-rhel76'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${from.owls-141100-jdk11-rhel76}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk11-rhel76'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - } - ], - "outputs": { - "_adminPublicIPId": { - "type": "string", - "value": "[if(equals(parameters('virtualNetworkNewOrExisting'), 'new'),resourceId('Microsoft.Network/publicIPAddresses',concat(parameters('adminVMName'),variables('name_publicIPAddress'))),'')]" - }, - "artifactsLocationPassedIn": { - "type": "string", - "value": "[parameters('_artifactsLocation')]" - }, - "adminHostName": { - "type": "string", - "value": "[if(equals(parameters('virtualNetworkNewOrExisting'), 'new'), reference(variables('name_outputAdminHost_with_pub_ip'), '${azure.apiVersionForPublicIPAddresses}').dnsSettings.fqdn, reference(variables('name_outputAdminHost_without_pub_ip')).ipConfigurations[0].properties.privateIPAddress)]" - }, - "adminConsole": { - "type": "string", - "value": "[uri(concat('http://',if(equals(parameters('virtualNetworkNewOrExisting'), 'new'),reference(variables('name_outputAdminHost_with_pub_ip'), '${azure.apiVersionForPublicIPAddresses}').dnsSettings.fqdn,reference(variables('name_outputAdminHost_without_pub_ip')).ipConfigurations[0].properties.privateIPAddress),':7001/console/'),'')]" - }, - "adminSecuredConsole": { - "type": "string", - "value": "[uri(concat('https://',if(equals(parameters('virtualNetworkNewOrExisting'), 'new'),reference(variables('name_outputAdminHost_with_pub_ip'), '${azure.apiVersionForPublicIPAddresses}').dnsSettings.fqdn,reference(variables('name_outputAdminHost_without_pub_ip')).ipConfigurations[0].properties.privateIPAddress),':7002/console/'),'')]" - }, - "wlsDomainLocation": { - "type": "string", - "value": "[concat('/u01/domains/', parameters('wlsDomainName'))]" - }, - "storageAccountName": { - "type": "string", - "value": "[variables('name_storageAccount')]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/clusterTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/clusterTemplate.json deleted file mode 100644 index 3eb2419a8..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/clusterTemplate.json +++ /dev/null @@ -1,1061 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - } - }, - "_artifactsLocationClusterTemplate": { - "defaultValue": "[if(contains(parameters('_artifactsLocation'), 'githubusercontent'), parameters('_artifactsLocation'), deployment().properties.templateLink.uri)]", - "type": "string", - "metadata": { - "description": "If we are deploying from the command line, use the passed in _artifactsLocation, otherwise use the default." - } - }, - "_artifactsLocationSasToken": { - "defaultValue": "", - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - } - }, - "_globalResourceNameSuffix":{ - "type": "string", - "metadata": { - "description": "The suffix to be appended to the globally unique resource name" - } - }, - "adminPasswordOrKey": { - "type": "securestring", - "metadata": { - "description": "SSH Key or password for the Virtual Machine. SSH key is recommended." - } - }, - "adminUsername": { - "defaultValue": "weblogic", - "type": "string", - "metadata": { - "description": "User name for the Virtual Machine." - } - }, - "adminVMName": { - "defaultValue": "adminVM", - "type": "string", - "metadata": { - "description": "Admin Server hosting VM name." - } - }, - "authenticationType": { - "defaultValue": "password", - "type": "string", - "allowedValues": [ - "sshPublicKey", - "password" - ], - "metadata": { - "description": "Type of authentication to use on the Virtual Machine. SSH key is recommended." - } - }, - "dnsLabelPrefix": { - "type": "string", - "metadata": { - "description": "Unique DNS Name for the Public IP used to access the Virtual Machine." - } - }, - "location": { - "type": "string", - "metadata": { - "description": "Location for all resources." - } - }, - "managedServerPrefix": { - "type": "string", - "defaultValue": "msp", - "metadata": { - "description": "Provide managed server prefix name" - } - }, - "managedVMNamePrefix": { - "type": "string", - "metadata": { - "description": "Provide managed server VM name prefix" - } - }, - "numberOfInstances": { - "type": "int", - "defaultValue": 2, - "minValue": 2, - "maxValue": 5, - "metadata": { - "description": "Number of VMs to deploy, limit 5 since this sample is using a single storage account" - } - }, - "portsToExpose": { - "type": "string", - "defaultValue": "80,443,7001-9000", - "metadata": { - "description": "Ports and port ranges to expose" - } - }, - "skuUrnVersion": { - "type": "string", - "defaultValue": "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest", - "allowedValues": [ - "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest", - "owls-141100-jdk11-ol87;Oracle:weblogic-141100-jdk11-ol87:owls-141100-jdk11-ol87;latest", - "owls-141100-jdk8-ol91;Oracle:weblogic-141100-jdk8-ol91:owls-141100-jdk8-ol91;latest", - "owls-141100-jdk8-ol87;Oracle:weblogic-141100-jdk8-ol87:owls-141100-jdk8-ol87;latest", - "owls-122140-jdk8-ol91;Oracle:weblogic-122140-jdk8-ol91:owls-122140-jdk8-ol91;latest", - "owls-122140-jdk8-ol87;Oracle:weblogic-122140-jdk8-ol87:owls-122140-jdk8-ol87;latest", - "owls-122140-jdk8-ol76;Oracle:weblogic-122140-jdk8-ol76:owls-122140-jdk8-ol7;latest", - "owls-141100-jdk8-ol76;Oracle:weblogic-141100-jdk8-ol76:owls-141100-jdk8-ol7;latest", - "owls-141100-jdk11-ol76;Oracle:weblogic-141100-jdk11-ol76:owls-141100-jdk11-ol7;latest", - "owls-141100-jdk11-rhel87;Oracle:weblogic-141100-jdk11-rhel87:owls-141100-jdk11-rhel87;latest", - "owls-141100-jdk8-rhel87;Oracle:weblogic-141100-jdk8-rhel87:owls-141100-jdk8-rhel87;latest", - "owls-122140-jdk8-rhel87;Oracle:weblogic-122140-jdk8-rhel87:owls-122140-jdk8-rhel87;latest", - "owls-122140-jdk8-rhel76;Oracle:weblogic-122140-jdk8-rhel76:owls-122140-jdk8-rhel76;latest", - "owls-141100-jdk8-rhel76;Oracle:weblogic-141100-jdk8-rhel76:owls-141100-jdk8-rhel76;latest", - "owls-141100-jdk11-rhel76;Oracle:weblogic-141100-jdk11-rhel76:owls-141100-jdk11-rhel76;latest" - ], - "metadata": { - "description": "The Oracle Linux image with Weblogic and Java preinstalled. Semicolon separated string of Sku, URN, and Version" - } - }, - "tagsByResource": { - "type": "object", - "defaultValue": {}, - "metadata": { - "description": "${label.tagsLabel}" - } - }, - "usePreviewImage": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "Bool value, if it's set to true, will deploy with preview weblogic image." - } - }, - "useSystemAssignedManagedIdentity": { - "type": "bool", - "defaultValue": true, - "metadata": { - "description": "Bool value, if it's set to true, a system assigned managed identity will to be created for the VM(s)" - } - }, - "vmSize": { - "type": "string", - "defaultValue": "Standard_A3", - "metadata": { - "description": "Select appropriate VM Size as per requirement" - } - }, - "virtualNetworkNewOrExisting": { - "type": "string", - "defaultValue": "new", - "allowedValues": [ - "new", - "existing" - ], - "metadata": { - "description": "Specify whether to create a new or existing virtual network for the VM." - } - }, - "virtualNetworkName": { - "type": "string", - "defaultValue": "wls-vnet", - "metadata": { - "description": "Name of the existing or new VNET" - } - }, - "virtualNetworkResourceGroupName": { - "type": "string", - "defaultValue": "[resourceGroup().name]", - "metadata": { - "description": "Resource group of Virtual network" - } - }, - "addressPrefixes": { - "type": "array", - "defaultValue": [ - "10.0.0.0/28" - ], - "metadata": { - "description": "Address prefix of the VNET." - } - }, - "nsgName": { - "type": "string", - "metadata": { - "description": "Name of the new Network Security Group" - } - }, - "subnetName": { - "type": "string", - "defaultValue": "wls-subnet", - "metadata": { - "description": "Name of the existing or new Subnet" - } - }, - "subnetPrefix": { - "type": "string", - "defaultValue": "10.0.0.0/29", - "metadata": { - "description": "Address prefix of the subnet" - } - }, - "subnetForAppGateway": { - "type": "string", - "defaultValue": "appgateway-subnet", - "metadata": { - "description": "Name of the existing or new Subnet for Application Gateway" - } - }, - "subnetPrefixForAppGateway": { - "type": "string", - "defaultValue": "10.0.1.0/24", - "metadata": { - "description": "Address prefix of the subnet for Application Gateway" - } - }, - "wlsDomainName": { - "type": "string", - "metadata": { - "description": "Provide Weblogic domain name" - } - }, - "wlsUserName": { - "defaultValue": "weblogic", - "type": "string", - "metadata": { - "description": "Username for your Weblogic domain name" - } - }, - "wlsPassword": { - "type": "securestring", - "metadata": { - "description": "Password for your Weblogic domain name" - } - }, - "enableHTTPAdminListenPort":{ - "type": "bool", - "defaultValue": true, - "metadata": { - "description": "Boolean value indicating, if WebLogic Admin Server HTTP Listen Port is enabled or not" - } - }, - "enableDNSConfiguration": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "Boolean value indicating, if DNS Zone Configuration is enabled or not" - } - }, - "enableAppGateway": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "If true, deploy an Azure App Gateway in front of the nodes of the cluster" - } - }, - "customDNSNameForAdminServer": { - "type": "string", - "defaultValue": "none", - "metadata": { - "description": "Custom DNS Name for WebLogic Admin Server" - } - } - }, - "variables": { - "const_addressPrefix": "[parameters('addressPrefixes')]", - "const_appGatewaySubnetPrefix": "[parameters('subnetPrefixForAppGateway')]", - "const_hyphen": "-", - "const_imageOffer": "[concat('weblogic',variables('const_hyphen'), split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[1],variables('const_hyphen'),split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[2],variables('const_hyphen'),split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[3],if(parameters('usePreviewImage'),'-preview',''))]", - "const_imagePublisher": "oracle", - "const_linuxConfiguration": { - "disablePasswordAuthentication": true, - "ssh": { - "publicKeys": [ - { - "path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]", - "keyData": "[parameters('adminPasswordOrKey')]" - } - ] - } - }, - "const_managedVMPrefix": "[concat(parameters('managedVMNamePrefix'), 'VM')]", - "const_mountPointPath": "[concat('/mnt/', variables('name_share'))]", - "const_publicIPAddressType": "Dynamic", - "const_requiredPortrange": ",65200-65535,5556", - "const_storageAccountType": "Standard_LRS", - "const_subnetPrefix": "[parameters('subnetPrefix')]", - "const_vmSize": "[parameters('vmSize')]", - "const_wlsHome": "/u01/app/wls/install/oracle/middleware/oracle_home", - "name_appGatewaySubnet": "[parameters('subnetForAppGateway')]", - "name_availabilitySet": "[concat('wlscluster-availabilityset-', parameters('_globalResourceNameSuffix'))]", - "name_linuxImageOfferSKU": "[first(split(parameters('skuUrnVersion'), ';'))]", - "name_linuxImageVersion": "[last(split(parameters('skuUrnVersion'),';'))]", - "name_nic": "_NIC", - "name_nic_with_pub_ip": "[concat(variables('name_nic'), '_with_pub_ip')]", - "name_nic_without_pub_ip": "[concat(variables('name_nic'), '_without_pub_ip')]", - "name_publicIPAddress": "_PublicIP", - "name_outputAdminHost_with_pub_ip": "[concat(parameters('adminVMName'),variables('name_publicIPAddress'))]", - "name_outputAdminHost_without_pub_ip": "[concat(parameters('adminVMName'),variables('name_nic_without_pub_ip'))]", - "name_privateSaEndpoint": "[concat('saep', parameters('_globalResourceNameSuffix'))]", - "name_scriptFile": "setupClusterDomain.sh", - "name_share": "wlsshare", - "name_storageAccount": "[concat('olvmstg', parameters('_globalResourceNameSuffix'))]", - "name_subnet": "[parameters('subnetName')]", - "name_virtualNetwork": "[parameters('virtualNetworkName')]", - "ref_fileService": "[resourceId('Microsoft.Storage/storageAccounts/fileServices', variables('name_storageAccount'), 'default')]", - "ref_networkSecurityGroup": "[resourceId('Microsoft.Network/networkSecurityGroups', parameters('nsgName'))]", - "ref_storage": "[resourceId('Microsoft.Storage/storageAccounts', variables('name_storageAccount'))]", - "ref_subnet": "[resourceId(parameters('virtualNetworkResourceGroupName'),'Microsoft.Network/virtualNetworks/subnets', variables('name_virtualNetwork'), variables('name_subnet'))]", - "name_customHostnameGeneratorscriptFile": "generateCustomHostNameVerifier.sh", - "name_customHostnameVerifierJavaFile": "src/main/java/WebLogicCustomHostNameVerifier.java", - "name_customHostnameValuesTemplate": "src/main/java/HostNameValuesTemplate.txt", - "name_customHostnameVerifierTest" : "src/test/java/WebLogicCustomHostNameVerifierTest.java", - "property_subnet_with_app_gateway": [ - { - "name": "[variables('name_subnet')]", - "properties": { - "addressPrefix": "[variables('const_subnetPrefix')]", - "networkSecurityGroup": { - "id": "[variables('ref_networkSecurityGroup')]" - } - } - }, - { - // PENDING(edburns): Assume it is acceptable to create a subnet for the App Gateway, even if the user - // has not requested an App Gateway. In support of this assumption we can note: the user may want an App - // Gateway after deployment. - "name": "[variables('name_appGatewaySubnet')]", - "properties": { - "addressPrefix": "[variables('const_appGatewaySubnetPrefix')]", - "networkSecurityGroup": { - "id": "[variables('ref_networkSecurityGroup')]" - } - } - } - ], - "property_subnet_without_app_gateway": [ - { - "name": "[variables('name_subnet')]", - "properties": { - "addressPrefix": "[variables('const_subnetPrefix')]", - "networkSecurityGroup": { - "id": "[variables('ref_networkSecurityGroup')]" - } - } - } - ] - - }, - "resources": [ - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${cluster.cluster.start}", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "apiVersion": "${azure.apiVersionForNetworkSecurityGroups}", - "type": "Microsoft.Network/networkSecurityGroups", - "tags": "[parameters('tagsByResource')['${identifier.networkSecurityGroups}']]", - "condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'new')]", - "name": "[parameters('nsgName')]", - "location": "[parameters('location')]", - "properties": { - "securityRules": [ - { - "name": "WebLogicPorts", - "properties": { - "protocol": "TCP", - "sourcePortRange": "*", - "sourceAddressPrefix": "*", - "destinationAddressPrefix": "*", - "access": "Allow", - "priority": 320, - "direction": "Inbound", - "destinationPortRanges": "[split(concat(parameters('portsToExpose'),variables('const_requiredPortrange')), ',')]" - } - }, - { - "name": "WebLogicNMPort", - "properties": { - "protocol": "TCP", - "sourcePortRange": "*", - "sourceAddressPrefix": "Internet", - "destinationAddressPrefix": "*", - "access": "Deny", - "priority": 201, - "direction": "Inbound", - "destinationPortRanges": [ "5556" ] - } - }, - { - "name": "WebLogicAdminChannelPort", - "properties": { - "protocol": "TCP", - "sourcePortRange": "*", - "sourceAddressPrefix": "Internet", - "destinationAddressPrefix": "*", - "access": "Deny", - "priority": 202, - "direction": "Inbound", - "destinationPortRanges": [ "7005" ] - } - }, - { - "name": "WebLogicManagedChannelPortsDenied", - "properties": { - "protocol": "*", - "sourcePortRange": "*", - "destinationAddressPrefix": "*", - "access": "Deny", - "priority": 230, - "direction": "Inbound", - "destinationPortRanges": [ - "8501" - ], - "sourceAddressPrefix": "Internet" - } - } - ] - } - }, - { - "type": "Microsoft.Storage/storageAccounts", - "apiVersion": "${azure.apiVersionForStorage}", - "name": "[variables('name_storageAccount')]", - "tags": "[parameters('tagsByResource')['${identifier.storageAccounts}']]", - "location": "[parameters('location')]", - "sku": { - "name": "[variables('const_storageAccountType')]" - }, - "kind": "StorageV2", - "properties": { - "supportsHttpsTrafficOnly": false - }, - "dependsOn": [ - "[parameters('nsgName')]" - ] - }, - { - "apiVersion": "${azure.apiVersionForPrivateEndpoint}", - "name": "[variables('name_privateSaEndpoint')]", - "type": "Microsoft.Network/privateEndpoints", - "tags": "[parameters('tagsByResource')['${identifier.privateEndpoints}']]", - "location": "[parameters('location')]", - "properties": { - "privateLinkServiceConnections": [ - { - "name": "[variables('name_privateSaEndpoint')]", - "properties": { - "privateLinkServiceId": "[resourceId('Microsoft.Storage/storageAccounts/', variables('name_storageAccount'))]", - "groupIds": [ - "file" - ] - } - } - ], - "subnet": { - "id": "[variables('ref_subnet')]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('name_storageAccount'))]", - "[variables('name_virtualNetwork')]" - ] - }, - { - "type": "Microsoft.Storage/storageAccounts/fileServices", - "apiVersion": "${azure.apiVersionForStorageFileService}", - "name": "[concat(variables('name_storageAccount'), '/default')]", - "dependsOn": [ - "[variables('ref_storage')]" - ], - "sku": { - "name": "Standard_LRS", - "tier": "Standard" - } - }, - { - "type": "Microsoft.Storage/storageAccounts/fileServices/shares", - "apiVersion": "${azure.apiVersionForStorageFileService}", - "name": "[concat(variables('name_storageAccount'), '/default/', variables('name_share'))]", - "dependsOn": [ - "[variables('ref_fileService')]", - "[variables('ref_storage')]" - ], - "properties": { - "shareQuota": 5 - } - }, - { - "apiVersion": "${azure.apiVersionForPublicIPAddresses}", - "type": "Microsoft.Network/publicIPAddresses", - "tags": "[parameters('tagsByResource')['${identifier.publicIPAddresses}']]", - "condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'new')]", - "name": "[if(equals(copyIndex(),0),concat(parameters('adminVMName'),variables('name_publicIPAddress')),concat(variables('const_managedVMPrefix'), copyIndex(),variables('name_publicIPAddress')))]", - "location": "[parameters('location')]", - "copy": { - "name": "publicIPLoop", - "count": "[parameters('numberOfInstances')]" - }, - "properties": { - "publicIPAllocationMethod": "[variables('const_publicIPAddressType')]", - "dnsSettings": { - "domainNameLabel": "[take(concat(toLower(parameters('dnsLabelPrefix')), copyindex(),'-', parameters('_globalResourceNameSuffix'),'-',toLower(parameters('wlsDomainName'))), 50)]" - } - }, - "dependsOn": [ - "[variables('name_storageAccount')]" - ] - }, - { - "apiVersion": "${azure.apiVersionForVirtualNetworks}", - "type": "Microsoft.Network/virtualNetworks", - "tags": "[parameters('tagsByResource')['${identifier.virtualNetworks}']]", - "condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'new')]", - "name": "[variables('name_virtualNetwork')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[variables('name_storageAccount')]" - ], - "properties": { - "addressSpace": { - "addressPrefixes": "[variables('const_addressPrefix')]" - }, - "subnets": "[if(parameters('enableAppGateway'), variables('property_subnet_with_app_gateway'), variables('property_subnet_without_app_gateway'))]" - } - }, - { - "apiVersion": "${azure.apiVersionForNetworkInterfaces}", - "type": "Microsoft.Network/networkInterfaces", - "tags": "[parameters('tagsByResource')['${identifier.networkInterfaces}']]", - "condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'new')]", - "name": "[if(equals(copyIndex(),0),concat(parameters('adminVMName'),variables('name_nic_with_pub_ip')),concat(variables('const_managedVMPrefix'), copyIndex(),variables('name_nic_with_pub_ip')))]", "location": "[parameters('location')]", - "copy": { - "name": "nicLoop_public_ip", - "count": "[parameters('numberOfInstances')]" - }, - "dependsOn": [ - "[variables('name_virtualNetwork')]", - "publicIPLoop" - ], - "properties": { - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses',if(equals(copyIndex(),0),concat(parameters('adminVMName'),variables('name_publicIPAddress')),concat(variables('const_managedVMPrefix'), copyIndex(),variables('name_publicIPAddress'))))]" - }, - "subnet": { - "id": "[variables('ref_subnet')]" - } - } - } - ], - "dnsSettings": { - "internalDnsNameLabel": "[if(equals(copyIndex(),0),parameters('adminVMName'),concat(variables('const_managedVMPrefix'), copyIndex()))]" - } - } - }, - { - "type": "Microsoft.Network/networkInterfaces", - "apiVersion": "${azure.apiVersionForNetworkInterfaces}", - "tags": "[parameters('tagsByResource')['${identifier.networkInterfaces}']]", - "condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'existing')]", - "name": "[if(equals(copyIndex(),0),variables('name_outputAdminHost_without_pub_ip'),concat(variables('const_managedVMPrefix'), copyIndex(),variables('name_nic_without_pub_ip')))]", - "location": "[parameters('location')]", - "copy": { - "name": "nicLoop_private_ip", - "count": "[parameters('numberOfInstances')]" - }, - "dependsOn": [ - "[variables('name_virtualNetwork')]" - ], - "properties": { - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "subnet": { - "id": "[variables('ref_subnet')]" - } - } - } - ] - } - }, - { - "type": "Microsoft.Compute/availabilitySets", - "apiVersion": "${azure.apiVersionForAvailabilitySets}", - "tags": "[parameters('tagsByResource')['${identifier.availabilitySets}']]", - "location": "[parameters('location')]", - "name": "[variables('name_availabilitySet')]", - "properties": { - "platformFaultDomainCount": 2, - "platformUpdateDomainCount": 2 - }, - "dependsOn": [ - "[variables('name_virtualNetwork')]" - ], - "sku": { - "name": "Aligned" - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines", - "tags": "[parameters('tagsByResource')['${identifier.virtualMachines}']]", - "name": "[if(equals(copyIndex(),0),parameters('adminVMName'),concat(variables('const_managedVMPrefix'), copyIndex()))]", - "location": "[parameters('location')]", - "copy": { - "name": "virtualMachineLoop", - "count": "[parameters('numberOfInstances')]" - }, - "dependsOn": [ - "nicLoop_public_ip", - "nicLoop_private_ip", - "[resourceId('Microsoft.Compute/availabilitySets/', variables('name_availabilitySet'))]", - "[variables('name_privateSaEndpoint')]" - ], - "identity": "[if(parameters('useSystemAssignedManagedIdentity'), json('{\"type\":\"SystemAssigned\"}'), null())]", - "properties": { - "availabilitySet": { - "id": "[resourceId('Microsoft.Compute/availabilitySets',variables('name_availabilitySet'))]" - }, - "hardwareProfile": { - "vmSize": "[variables('const_vmSize')]" - }, - "osProfile": { - "computerName": "[if(equals(copyIndex(),0),parameters('adminVMName'),concat(variables('const_managedVMPrefix'), copyIndex()))]", - "adminUsername": "[parameters('adminUsername')]", - "adminPassword": "[parameters('adminPasswordOrKey')]", - "linuxConfiguration": "[if(equals(parameters('authenticationType'), 'password'), json('null'), variables('const_linuxConfiguration'))]" - }, - "storageProfile": { - "imageReference": { - "publisher": "[variables('const_imagePublisher')]", - "offer": "[variables('const_imageOffer')]", - "sku": "[variables('name_linuxImageOfferSKU')]", - "version": "[variables('name_linuxImageVersion')]" - }, - "osDisk": { - "createOption": "FromImage", - "managedDisk": { - "storageAccountType": "Standard_LRS" - } - } - }, - "networkProfile": { - "networkInterfaces": [ - { - "id": "[if(equals(parameters('virtualNetworkNewOrExisting'), 'new'), resourceId('Microsoft.Network/networkInterfaces',if(equals(copyIndex(),0),concat(parameters('adminVMName'),variables('name_nic_with_pub_ip')),concat(variables('const_managedVMPrefix'), copyIndex(),variables('name_nic_with_pub_ip')))), resourceId('Microsoft.Network/networkInterfaces',if(equals(copyIndex(),0),variables('name_outputAdminHost_without_pub_ip'),concat(variables('const_managedVMPrefix'), copyIndex(),variables('name_nic_without_pub_ip')))))]" - } - ] - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": true, - "storageUri": "[reference(resourceId('Microsoft.Storage/storageAccounts/', variables('name_storageAccount')), '${azure.apiVersionForStorage}').primaryEndpoints.blob]" - } - } - }, - "plan": { - "name": "[variables('name_linuxImageOfferSKU')]", - "publisher": "[variables('const_imagePublisher')]", - "product": "[variables('const_imageOffer')]" - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines/extensions", - "tags": "[parameters('tagsByResource')['${identifier.virtualMachinesExtensions}']]", - "name": "[if(equals(copyIndex(),0),concat(parameters('adminVMName'),'/newuserscript'),concat(variables('const_managedVMPrefix'), copyIndex(),'/newuserscript'))]", - "location": "[parameters('location')]", - "copy": { - "name": "virtualMachineExtensionLoop", - "count": "[parameters('numberOfInstances')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/',parameters('adminVMName'))]", - "virtualMachineLoop" - ], - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.0", - "autoUpgradeMinorVersion": true, - "settings": { - "fileUris": [ - "[uri(parameters('_artifactsLocationClusterTemplate'), concat('../scripts/', variables('name_scriptFile'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationClusterTemplate'), concat('../../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameGeneratorscriptFile'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationClusterTemplate'), concat('../../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameVerifierJavaFile'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationClusterTemplate'), concat('../../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameValuesTemplate'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationClusterTemplate'), concat('../../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameVerifierTest'), parameters('_artifactsLocationSasToken')))]" - ] - }, - "protectedSettings": { - "commandToExecute": "[concat('sh',' ',variables('name_scriptFile'),' <<< \"',parameters('wlsDomainName'),' ',parameters('wlsUserName'),' ',parameters('wlsPassword'),' ',if(equals(copyIndex(),0),'admin',concat(parameters('managedServerPrefix'), copyIndex())),' ',parameters('adminVMName'),' ',variables('const_wlsHome'),' ',variables('name_storageAccount'),' ',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('name_storageAccount')), '${azure.apiVersionForStorage}').keys[0].value,' ',variables('const_mountPointPath'),' ',string(parameters('enableHTTPAdminListenPort')),' ','false',' ',if(equals(parameters('virtualNetworkNewOrExisting'), 'new'), if(parameters('enableDNSConfiguration'),parameters('customDNSNameForAdminServer'),reference(variables('name_outputAdminHost_with_pub_ip'), '${azure.apiVersionForPublicIPAddresses}').dnsSettings.fqdn), reference(variables('name_outputAdminHost_without_pub_ip')).ipConfigurations[0].properties.privateIPAddress),' ',parameters('dnsLabelPrefix'),' ',parameters('location'), ' ', parameters('virtualNetworkNewOrExisting'),' ',reference(resourceId('Microsoft.Network/privateEndpoints/', variables('name_privateSaEndpoint')), '${azure.apiVersionForPrivateEndpoint}').customDnsConfigs[0].ipAddresses[0],'\"')]" - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${cluster.cluster.end}", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${from.owls-141100-jdk11-ol91}", - - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk11-ol91'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${from.owls-141100-jdk11-ol87}", - - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk11-ol87'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${from.owls-141100-jdk8-ol91}", - - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk8-ol91'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${from.owls-141100-jdk8-ol87}", - - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk8-ol87'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${from.owls-122140-jdk8-ol91}", - - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-122140-jdk8-ol91'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${from.owls-122140-jdk8-ol87}", - - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-122140-jdk8-ol87'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${from.owls-122140-jdk8-ol76}", - - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'from.owls-122140-jdk8-ol76'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${from.owls-141100-jdk8-ol76}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk8-ol76'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${from.owls-141100-jdk11-ol76}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk11-ol76'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${from.owls-141100-jdk11-rhel87}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk11-rhel87'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${from.owls-141100-jdk8-rhel87}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk8-rhel87'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${from.owls-122140-jdk8-rhel87}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-122140-jdk8-rhel87'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${from.owls-122140-jdk8-rhel76}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-122140-jdk8-rhel76'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${from.owls-141100-jdk8-rhel76}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk8-rhel76'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "${from.owls-141100-jdk11-rhel76}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk11-rhel76'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - } - ], - "outputs": { - "_adminPublicIPId": { - "type": "string", - "value": "[if(equals(parameters('virtualNetworkNewOrExisting'), 'new'),resourceId('Microsoft.Network/publicIPAddresses',concat(parameters('adminVMName'),variables('name_publicIPAddress'))),'')]" - }, - "artifactsLocationPassedIn": { - "type": "string", - "value": "[parameters('_artifactsLocation')]" - }, - "adminHostName": { - "type": "string", - "value": "[if(equals(parameters('virtualNetworkNewOrExisting'), 'new'), reference(variables('name_outputAdminHost_with_pub_ip'), '${azure.apiVersionForPublicIPAddresses}').dnsSettings.fqdn, reference(variables('name_outputAdminHost_without_pub_ip')).ipConfigurations[0].properties.privateIPAddress)]" - }, - "adminConsole": { - "type": "string", - "value": "[uri(concat('http://',if(equals(parameters('virtualNetworkNewOrExisting'), 'new'),reference(variables('name_outputAdminHost_with_pub_ip'), '${azure.apiVersionForPublicIPAddresses}').dnsSettings.fqdn,reference(variables('name_outputAdminHost_without_pub_ip')).ipConfigurations[0].properties.privateIPAddress),':7001/console/'),'')]" - }, - "adminSecuredConsole": { - "type": "string", - "value": "[uri(concat('https://',if(equals(parameters('virtualNetworkNewOrExisting'), 'new'),reference(variables('name_outputAdminHost_with_pub_ip'), '${azure.apiVersionForPublicIPAddresses}').dnsSettings.fqdn,reference(variables('name_outputAdminHost_without_pub_ip')).ipConfigurations[0].properties.privateIPAddress),':7002/console/'),'')]" - }, - "wlsDomainLocation": { - "type": "string", - "value": "[concat('/u01/domains/', parameters('wlsDomainName'))]" - }, - "storageAccountName": { - "type": "string", - "value": "[variables('name_storageAccount')]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/coherenceTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/coherenceTemplate.json deleted file mode 100644 index 6144795df..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/coherenceTemplate.json +++ /dev/null @@ -1,515 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - } - }, - "_artifactsLocationCoherenceTemplate": { - "defaultValue": "[if(contains(parameters('_artifactsLocation'), 'githubusercontent'), parameters('_artifactsLocation'), deployment().properties.templateLink.uri)]", - "type": "string", - "metadata": { - "description": "If we are deploying from the command line, use the passed in _artifactsLocation, otherwise use the default." - } - }, - "_artifactsLocationSasToken": { - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - }, - "defaultValue": "" - }, - "_globalResourceNameSuffix":{ - "type": "string", - "metadata": { - "description": "The suffix to be appended to the globally unique resource name" - } - }, - "adminPasswordOrKey": { - "type": "securestring", - "metadata": { - "description": "SSH Key or password for the Virtual Machine. SSH key is recommended." - } - }, - "adminUsername": { - "type": "string", - "defaultValue": "weblogic", - "metadata": { - "description": "User name for the Virtual Machine." - } - }, - "adminVMName": { - "defaultValue": "adminVM", - "type": "string", - "metadata": { - "description": "Virtual machine name of which hosts WebLogic Administration Server." - } - }, - "authenticationType": { - "type": "string", - "defaultValue": "password", - "allowedValues": [ - "sshPublicKey", - "password" - ], - "metadata": { - "description": "Type of authentication to use on the Virtual Machine. SSH key is recommended." - } - }, - "dnsLabelPrefix": { - "type": "string", - "defaultValue": "wls", - "metadata": { - "description": "Unique DNS Name for the Public IP used to access the Virtual Machine." - } - }, - "enableCoherenceWebLocalStorage": { - "defaultValue": true, - "type": "bool", - "metadata": { - "description": "Specifies whether Local Storage is enabled for the Coherence*Web cluster tier." - } - }, - "location": { - "type": "string", - "metadata": { - "description": "Location for all resources." - } - }, - "managedServerPrefix": { - "type": "string", - "defaultValue": "msp", - "metadata": { - "description": "Provide managed server prefix name" - } - }, - "managedVMNamePrefix": { - "type": "string", - "metadata": { - "description": "Managed VM name prefix" - } - }, - "numberOfCoherenceCacheInstances": { - "defaultValue": 1, - "type": "int", - "minValue": 1, - "maxValue": 10, - "metadata": { - "description": "Number of Coherence cache instances, used to create Virtual Machines and Managed Server." - } - }, - "skuUrnVersion": { - "type": "string", - "defaultValue": "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest", - "allowedValues": [ - "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest", - "owls-141100-jdk11-ol87;Oracle:weblogic-141100-jdk11-ol87:owls-141100-jdk11-ol87;latest", - "owls-141100-jdk8-ol91;Oracle:weblogic-141100-jdk8-ol91:owls-141100-jdk8-ol91;latest", - "owls-141100-jdk8-ol87;Oracle:weblogic-141100-jdk8-ol87:owls-141100-jdk8-ol87;latest", - "owls-122140-jdk8-ol91;Oracle:weblogic-122140-jdk8-ol91:owls-122140-jdk8-ol91;latest", - "owls-122140-jdk8-ol87;Oracle:weblogic-122140-jdk8-ol87:owls-122140-jdk8-ol87;latest", - "owls-122140-jdk8-ol76;Oracle:weblogic-122140-jdk8-ol76:owls-122140-jdk8-ol7;latest", - "owls-141100-jdk8-ol76;Oracle:weblogic-141100-jdk8-ol76:owls-141100-jdk8-ol7;latest", - "owls-141100-jdk11-ol76;Oracle:weblogic-141100-jdk11-ol76:owls-141100-jdk11-ol7;latest", - "owls-141100-jdk11-rhel87;Oracle:weblogic-141100-jdk11-rhel87:owls-141100-jdk11-rhel87;latest", - "owls-141100-jdk8-rhel87;Oracle:weblogic-141100-jdk8-rhel87:owls-141100-jdk8-rhel87;latest", - "owls-122140-jdk8-rhel87;Oracle:weblogic-122140-jdk8-rhel87:owls-122140-jdk8-rhel87;latest", - "owls-122140-jdk8-rhel76;Oracle:weblogic-122140-jdk8-rhel76:owls-122140-jdk8-rhel76;latest", - "owls-141100-jdk8-rhel76;Oracle:weblogic-141100-jdk8-rhel76:owls-141100-jdk8-rhel76;latest", - "owls-141100-jdk11-rhel76;Oracle:weblogic-141100-jdk11-rhel76:owls-141100-jdk11-rhel76;latest" - ], - "metadata": { - "description": "The Oracle Linux image with Weblogic and Java preinstalled. Semicolon separated string of Sku, URN, and Version" - } - }, - "storageAccountName": { - "type": "string", - "metadata": { - "description": "Name of storage account. One storage account can store 20 vitual machines with 2 VHDs of 500 IOPS." - } - }, - "subnetName": { - "type": "string", - "defaultValue": "wls-subnet", - "metadata": { - "description": "Name of the existing or new Subnet" - } - }, - "tagsByResource": { - "type": "object", - "defaultValue": {}, - "metadata": { - "description": "${label.tagsLabel}" - } - }, - "usePreviewImage": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "Bool value, if it's set to true, will deploy with preview weblogic image." - } - }, - "vmSizeSelectForCoherence": { - "defaultValue": "Standard_A3", - "type": "string", - "metadata": { - "description": "Select appropriate VM Size for Coherence cache server" - } - }, - "virtualNetworkResourceGroupName": { - "type": "string", - "defaultValue": "[resourceGroup().name]", - "metadata": { - "description": "Resource group of Virtual network" - } - }, - "virtualNetworkName": { - "type": "string", - "defaultValue": "wls-vnet", - "metadata": { - "description": "Name of the existing or new VNET" - } - }, - "wlsDomainName": { - "type": "string", - "defaultValue": "wlsd", - "metadata": { - "description": "Provide Weblogic domain name" - } - }, - "wlsPassword": { - "type": "securestring", - "metadata": { - "description": "Password for your Weblogic domain name" - } - }, - "wlsUserName": { - "defaultValue": "weblogic", - "type": "string", - "metadata": { - "description": "Username for your Weblogic domain name" - } - }, - "enableDNSConfiguration": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "Boolean value indicating, if DNS Zone Configuration is enabled or not" - } - }, - "customDNSNameForAdminServer": { - "type": "string", - "defaultValue": "none", - "metadata": { - "description": "Custom DNS Name for WebLogic Admin Server" - } - }, - "enableCustomSSL":{ - "defaultValue":false, - "type": "bool", - "metadata": { - "description": "Boolean value indicating, if custom SSL is enabled or not" - } - }, - "sslCustomIdentityKeyStoreData": { - "type": "securestring", - "defaultValue":"", - "metadata": { - "description": "Weblogic Custom Identity Keystore Data" - } - }, - "sslCustomIdentityKeyStorePassPhrase": { - "type": "securestring", - "defaultValue":"", - "metadata": { - "description": "Weblogic Custom Identity Keystore Passphrase" - } - }, - "sslCustomIdentityKeyStoreType": { - "type": "string", - "metadata": { - "description": "Weblogic Custom Identity Keystore Type" - }, - "defaultValue": "JKS" - }, - "sslCustomTrustKeyStoreData": { - "type": "securestring", - "defaultValue":"", - "metadata": { - "description": "Weblogic Custom Trust Store Data" - } - }, - "sslCustomTrustKeyStorePassPhrase": { - "type": "securestring", - "defaultValue":"", - "metadata": { - "description": "Weblogic Custom Trust Store Passphrase" - } - }, - "sslCustomTrustKeyStoreType": { - "type": "string", - "metadata": { - "description": "Weblogic Custom Trust Store Type" - }, - "defaultValue": "JKS" - }, - "sslPrivateKeyAlias": { - "type": "string", - "defaultValue":"null", - "metadata": { - "description": "Weblogic Server Private Key Alias" - } - }, - "sslPrivateKeyPassPhrase": { - "type": "securestring", - "defaultValue":"", - "metadata": { - "description": "Weblogic Server Private Key Pass Phrase" - } - } - }, - "variables": { - "const_hyphen": "-", - "const_imageOffer": "[concat('weblogic',variables('const_hyphen'), split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[1],variables('const_hyphen'),split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[2],variables('const_hyphen'),split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[3],if(parameters('usePreviewImage'),'-preview',''))]", - "const_imagePublisher": "oracle", - "const_linuxConfiguration": { - "disablePasswordAuthentication": true, - "ssh": { - "publicKeys": [ - { - "path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]", - "keyData": "[parameters('adminPasswordOrKey')]" - } - ] - } - }, - "const_mountPointPath": "[concat('/mnt/', variables('name_share'))]", - "const_publicIPAddressType": "Dynamic", - "const_vmSize": "[parameters('vmSizeSelectForCoherence')]", - "const_wlsDomainPath": "/u01/domains", - "const_wlsHome": "/u01/app/wls/install/oracle/middleware/oracle_home", - "name_linuxImageOfferSKU": "[first(split(parameters('skuUrnVersion'), ';'))]", - "name_linuxImageVersion": "[last(split(parameters('skuUrnVersion'),';'))]", - "name_nic": "_NIC", - "name_publicIPAddress": "_PublicIP", - "name_scriptFile": "setupCoherence.sh", - "name_share": "wlsshare", - "name_subnet": "[parameters('subnetName')]", - "name_virtualNetwork": "[parameters('virtualNetworkName')]", - "name_vmPrefix": "[concat(parameters('managedVMNamePrefix'), 'StorageVM')]", - "name_wlsServerPrefix": "[concat(parameters('managedServerPrefix'),'Storage')]", - "ref_subnet": "[resourceId(parameters('virtualNetworkResourceGroupName'),'Microsoft.Network/virtualNetworks/subnets', variables('name_virtualNetwork'), variables('name_subnet'))]", - "name_customHostnameGeneratorscriptFile": "generateCustomHostNameVerifier.sh", - "name_customHostnameVerifierJavaFile": "src/main/java/WebLogicCustomHostNameVerifier.java", - "name_customHostnameValuesTemplate": "src/main/java/HostNameValuesTemplate.txt", - "name_customHostnameVerifierTest" : "src/test/java/WebLogicCustomHostNameVerifierTest.java" - }, - "functions": [ - { - "namespace": "array", - "members": { - "join": { - "parameters": [ - { - "name": "items", - "type": "array" - } - ], - "output": { - "type": "string", - "value": "[replace(replace(replace(string(parameters('items')), '[\"', ''), '\"]', ''), '\",\"', ',')]" - } - } - } - } - ], - "resources": [ - { - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${cluster.coherence.start}", - "type": "Microsoft.Resources/deployments", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "apiVersion": "${azure.apiVersionForPublicIPAddresses}", - "type": "Microsoft.Network/publicIPAddresses", - "tags": "[parameters('tagsByResource')['${identifier.publicIPAddresses}']]", - "name": "[concat(variables('name_vmPrefix'),copyIndex(1),variables('name_publicIPAddress'))]", - "location": "[parameters('location')]", - "copy": { - "name": "publicIPLoop", - "count": "[parameters('numberOfCoherenceCacheInstances')]" - }, - "properties": { - "publicIPAllocationMethod": "[variables('const_publicIPAddressType')]", - "dnsSettings": { - "domainNameLabel": "[take(concat(toLower(parameters('dnsLabelPrefix')), 'co', copyindex(),'-', parameters('_globalResourceNameSuffix'),'-',toLower(parameters('wlsDomainName'))), 50)]" - } - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualNetworks}", - "type": "Microsoft.Network/virtualNetworks/subnets", - "name": "[concat(variables('name_virtualNetwork'), '/', variables('name_subnet'))]", - "condition": "[and(empty(variables('name_virtualNetwork')), empty(variables('name_subnet')))]" - }, - { - "apiVersion": "${azure.apiVersionForNetworkInterfaces}", - "type": "Microsoft.Network/networkInterfaces", - "tags": "[parameters('tagsByResource')['${identifier.networkInterfaces}']]", - "name": "[concat(variables('name_vmPrefix'), copyIndex(1), variables('name_nic'))]", - "location": "[parameters('location')]", - "copy": { - "name": "nicLoop", - "count": "[parameters('numberOfCoherenceCacheInstances')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.Network/publicIPAddresses/', concat(variables('name_vmPrefix'),copyIndex(1),variables('name_publicIPAddress')))]" - ], - "properties": { - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses',concat(variables('name_vmPrefix'),copyIndex(1),variables('name_publicIPAddress')))]" - }, - "subnet": { - "id": "[variables('ref_subnet')]" - } - } - } - ], - "dnsSettings": { - "internalDnsNameLabel": "[concat(variables('name_vmPrefix'), copyIndex(1))]" - } - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines", - "tags": "[parameters('tagsByResource')['${identifier.virtualMachines}']]", - "name": "[concat(variables('name_vmPrefix'), copyIndex(1))]", - "location": "[parameters('location')]", - "copy": { - "name": "virtualMachineLoop", - "count": "[parameters('numberOfCoherenceCacheInstances')]" - }, - "dependsOn": [ - "nicLoop" - ], - "properties": { - "hardwareProfile": { - "vmSize": "[variables('const_vmSize')]" - }, - "osProfile": { - "computerName": "[concat(variables('name_vmPrefix'), copyIndex(1))]", - "adminUsername": "[parameters('adminUsername')]", - "adminPassword": "[parameters('adminPasswordOrKey')]", - "linuxConfiguration": "[if(equals(parameters('authenticationType'), 'password'), json('null'), variables('const_linuxConfiguration'))]" - }, - "storageProfile": { - "imageReference": { - "publisher": "[variables('const_imagePublisher')]", - "offer": "[variables('const_imageOffer')]", - "sku": "[variables('name_linuxImageOfferSKU')]", - "version": "[variables('name_linuxImageVersion')]" - }, - "osDisk": { - "createOption": "FromImage", - "managedDisk": { - "storageAccountType": "Standard_LRS" - } - } - }, - "networkProfile": { - "networkInterfaces": [ - { - "id": "[resourceId('Microsoft.Network/networkInterfaces',concat(variables('name_vmPrefix'), copyIndex(1), variables('name_nic')))]" - } - ] - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": true, - "storageUri": "[reference(resourceId('Microsoft.Storage/storageAccounts/', parameters('storageAccountName')), '${azure.apiVersionForStorage}').primaryEndpoints.blob]" - } - } - }, - "plan": { - "name": "[variables('name_linuxImageOfferSKU')]", - "publisher": "[variables('const_imagePublisher')]", - "product": "[variables('const_imageOffer')]" - } - }, - { - "type": "Microsoft.Compute/virtualMachines/extensions", - "tags": "[parameters('tagsByResource')['${identifier.virtualMachinesExtensions}']]", - "name": "[if(equals(copyIndex(),0),concat(parameters('adminVMName'),'/newuserscript'),concat(variables('name_vmPrefix'), copyIndex(),'/newuserscript'))]", - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "location": "[parameters('location')]", - "copy": { - "name": "virtualMachineExtensionLoop", - "count": "[add(parameters('numberOfCoherenceCacheInstances'),1)]" - }, - "dependsOn": [ - "virtualMachineLoop" - ], - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.0", - "autoUpgradeMinorVersion": true, - "settings": { - "fileUris": [ - "[uri(parameters('_artifactsLocationCoherenceTemplate'), concat('../scripts/', variables('name_scriptFile'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationCoherenceTemplate'), concat('../../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameGeneratorscriptFile'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationCoherenceTemplate'), concat('../../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameVerifierJavaFile'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationCoherenceTemplate'), concat('../../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameValuesTemplate'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationCoherenceTemplate'), concat('../../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameVerifierTest'), parameters('_artifactsLocationSasToken')))]" - ] - }, - "protectedSettings": { - "commandToExecute": "[concat('sh',' ',variables('name_scriptFile'), ' <<< \"', parameters('wlsDomainName'),' ',parameters('wlsUserName'),' ',parameters('wlsPassword'),' ', parameters('adminVMName'),' ',variables('const_wlsHome'),' ',variables('const_wlsDomainPath'),' ', parameters('storageAccountName'),' ',listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName')), '${azure.apiVersionForStorage}').keys[0].value,' ', variables('const_mountPointPath'),' ', parameters('enableCoherenceWebLocalStorage'),' ',variables('name_wlsServerPrefix'),' ',copyIndex(),' ',if(parameters('enableDNSConfiguration'),parameters('customDNSNameForAdminServer'),parameters('adminVMName')),' ',parameters('dnsLabelPrefix'),' ',parameters('location'),' ','False',' ',string(parameters('enableCustomSSL')),' ',base64(parameters('sslCustomIdentityKeyStoreData')),' ',base64(parameters('sslCustomIdentityKeyStorePassPhrase')),' ',base64(parameters('sslCustomIdentityKeyStoreType')),' ',base64(parameters('sslCustomTrustKeyStoreData')),' ',base64(parameters('sslCustomTrustKeyStorePassPhrase')),' ',base64(parameters('sslCustomTrustKeyStoreType')),' ',base64(parameters('sslPrivateKeyAlias')),' ',base64(parameters('sslPrivateKeyPassPhrase')),'\"')]" - } - } - }, - { - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${cluster.coherence.end}", - "type": "Microsoft.Resources/deployments", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - } - ], - "outputs": { - "artifactsLocationPassedIn": { - "type": "string", - "value": "[parameters('_artifactsLocation')]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/dbTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/dbTemplate.json deleted file mode 100644 index f5beb33c8..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/dbTemplate.json +++ /dev/null @@ -1,332 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - } - }, - "_artifactsLocationSasToken": { - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - }, - "defaultValue": "" - }, - "adminVMName": { - "type": "string", - "defaultValue": "adminVM", - "metadata": { - "description": "Admin Server hosting VM name." - } - }, - "databaseType": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "One of the supported database types" - } - }, - "dbGlobalTranPro": { - "defaultValue": "OnePhaseCommit", - "type": "string", - "metadata": { - "description": "Determines the transaction protocol (global transaction processing behavior) for the data source." - } - }, - "dbIdentity": { - "defaultValue": {}, - "type": "object", - "metadata": { - "description": "Managed identity that has access to the data source." - } - }, - "dbPassword": { - "defaultValue": "[newGuid()]", - "type": "securestring", - "metadata": { - "description": "Password for Database" - } - }, - "dbUser": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "Userid of Database" - } - }, - "dsConnectionURL": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "JDBC Connection String" - } - }, - "enablePswlessConnection": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "True to enable passwordless connection." - } - }, - "jdbcDataSourceName": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "JNDI Name for JDBC Datasource" - } - }, - "location": { - "type": "string", - "metadata": { - "description": "Location for all resources." - } - }, - "managedServerPrefix": { - "type": "string", - "defaultValue": "msp", - "metadata": { - "description": "Provide managed server prefix name" - } - }, - "managedVMNamePrefix": { - "type": "string", - "metadata": { - "description": "Provide managed VM prefix name" - } - }, - "numberOfManagedApplicationInstances": { - "type": "int", - "defaultValue": 2, - "minValue": 1, - "maxValue": 20, - "metadata": { - "description": "Number of VMs that have been deployed to host managed application server." - } - }, - "tagsByResource": { - "type": "object", - "defaultValue": {}, - "metadata": { - "description": "${label.tagsLabel}" - } - }, - "wlsDomainName": { - "type": "string", - "defaultValue": "wlsd", - "metadata": { - "description": "Provide Weblogic domain name" - } - }, - "wlsPassword": { - "type": "securestring", - "metadata": { - "description": "Password for your Weblogic domain name" - } - }, - "wlsUserName": { - "type": "string", - "metadata": { - "description": "Username for your Weblogic domain name" - } - } - }, - "variables": { - "name_dbLinkedTemplateName": "_dbTemplate.json", - "name_dbPswlessTemplateName": "_pswlessDbTemplate.json", - "name_dbUpgradeMySQLDriver": "_installJdbcLibsTemplate.json" - }, - "resources": [ - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "pswlessDbTemplate", - "condition": "[parameters('enablePswlessConnection')]", - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_dbPswlessTemplateName')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "adminVMName": { - "value": "[parameters('adminVMName')]" - }, - "databaseType": { - "value": "[parameters('databaseType')]" - }, - "dbGlobalTranPro": { - "value": "[parameters('dbGlobalTranPro')]" - }, - "dbIdentity": { - "value": "[parameters('dbIdentity')]" - }, - "dbUser": { - "value": "[parameters('dbUser')]" - }, - "dsConnectionURL": { - "value": "[parameters('dsConnectionURL')]" - }, - "jdbcDataSourceName": { - "value": "[parameters('jdbcDataSourceName')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "managedServerPrefix": { - "value": "[parameters('managedServerPrefix')]" - }, - "managedVMNamePrefix": { - "value": "[parameters('managedVMNamePrefix')]" - }, - "numberOfManagedApplicationInstances": { - "value": "[parameters('numberOfManagedApplicationInstances')]" - }, - "tagsByResource": { - "value": "[parameters('tagsByResource')]" - }, - "wlsDomainName": { - "value": "[parameters('wlsDomainName')]" - }, - "wlsPassword": { - "value": "[parameters('wlsPassword')]" - }, - "wlsUserName": { - "value": "[parameters('wlsUserName')]" - } - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "upgradeMySQLJdbcDriverTemplate", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "condition": "[and(not(parameters('enablePswlessConnection')), equals(parameters('databaseType'),'mysql'))]", - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_dbUpgradeMySQLDriver')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "adminVMName": { - "value": "[parameters('adminVMName')]" - }, - "databaseType": { - "value": "[parameters('databaseType')]" - }, - "enablePswlessConnection": { - "value": "[parameters('enablePswlessConnection')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "managedServerPrefix": { - "value": "[parameters('managedServerPrefix')]" - }, - "managedVMNamePrefix": { - "value": "[parameters('managedVMNamePrefix')]" - }, - "numberOfManagedApplicationInstances": { - "value": "[parameters('numberOfManagedApplicationInstances')]" - }, - "tagsByResource": { - "value": "[parameters('tagsByResource')]" - }, - "wlsDomainName": { - "value": "[parameters('wlsDomainName')]" - }, - "wlsPassword": { - "value": "[parameters('wlsPassword')]" - }, - "wlsUserName": { - "value": "[parameters('wlsUserName')]" - } - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "passwordDatasourceDeployment", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "condition": "[not(parameters('enablePswlessConnection'))]", - "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', 'upgradeMySQLJdbcDriverTemplate')]" - ], - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_dbLinkedTemplateName')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "adminVMName": { - "value": "[parameters('adminVMName')]" - }, - "databaseType": { - "value": "[parameters('databaseType')]" - }, - "dbGlobalTranPro": { - "value": "[parameters('dbGlobalTranPro')]" - }, - "dbPassword": { - "value": "[parameters('dbPassword')]" - }, - "dbUser": { - "value": "[parameters('dbUser')]" - }, - "dsConnectionURL": { - "value": "[parameters('dsConnectionURL')]" - }, - "enablePswlessConnection": { - "value": "[parameters('enablePswlessConnection')]" - }, - "jdbcDataSourceName": { - "value": "[parameters('jdbcDataSourceName')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "tagsByResource": { - "value": "[parameters('tagsByResource')]" - }, - "wlsPassword": { - "value": "[parameters('wlsPassword')]" - }, - "wlsUserName": { - "value": "[parameters('wlsUserName')]" - } - } - } - } - ], - "outputs": { - "artifactsLocationPassedIn": { - "type": "string", - "value": "[parameters('_artifactsLocation')]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/dnszonesTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/dnszonesTemplate.json deleted file mode 100644 index 9ee842405..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/dnszonesTemplate.json +++ /dev/null @@ -1,239 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - } - }, - "_artifactsLocationSasToken": { - "defaultValue": "", - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - } - }, - "_globalResourceNameSuffix": { - "type": "string", - "metadata": { - "description": "A unique suffix that was specified during the deployment of the solution template." - } - }, - "dnszonesARecordSetNames": { - "type": "array", - "defaultValue": [], - "metadata": { - "description": "An array of A record names. Used to create A records." - } - }, - "dnszonesCNAMEAlias": { - "type": "array", - "metadata": { - "description": "An array of CNAME record alias. Used to create CNAME records." - }, - "defaultValue": [] - }, - "dnszonesCNAMERecordSetNames": { - "type": "array", - "metadata": { - "description": "An array of CNAME record names. Used to create CNAME record set." - }, - "defaultValue": [] - }, - "dnszoneName": { - "defaultValue": "contoso.xyz", - "type": "string", - "metadata": { - "description": "Azure DNS Zone name." - } - }, - "dnszoneLocation": { - "defaultValue": "global", - "type": "string", - "metadata": { - "description": "Location used to create Azure DNS Zone." - } - }, - "hasDNSZones": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "If true, update A records in the existing DNS Zone, otherwise, create a new DNS Zone and ." - } - }, - "location": { - "type": "string", - "metadata": { - "description": "Location for all resources." - } - }, - "resourceGroup": { - "type": "string", - "defaultValue": "[resourceGroup()]", - "metadata": { - "description": "Name of the resource group that has an Azure DNS Zone deployed." - } - }, - "targetResources": { - "type": "array", - "defaultValue": [], - "metadata": { - "description": "References to Azure resources from where the DNS resource value is taken. Each item is corresponding to values of dnszonesARecordSetNames." - } - }, - "tagsByResource": { - "type": "object", - "defaultValue": {}, - "metadata": { - "description": "${label.tagsLabel}" - } - }, - "ttl": { - "type": "int", - "defaultValue": 3600, - "metadata": { - "description": "The TTL (time-to-live) of the records in the record sets." - } - }, - "utcValue": { - "type": "string", - "defaultValue": "[utcNow()]", - "metadata": { - "description": "Current deployment time. Used as a tag in deployment script." - } - } - }, - "variables": { - "name_createDNSZoneLinkedTemplateName": "_createDNSZonesTemplate.json", - "name_dnszoneTempaltesFolder": "_dnszones", - "name_updateDNSZoneLinkedTemplateName": "_updateDNSZonesTemplate.json" - }, - "resources": [ - { - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${cluster.dns.start}", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "type": "Microsoft.Resources/deployments", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [] - } - } - }, - { - "apiVersion": "${azure.apiVersionForDeployment}", - "type": "Microsoft.Resources/deployments", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "createDNSZone", - "condition": "[not(parameters('hasDNSZones'))]", - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/',variables('name_dnszoneTempaltesFolder'),'/', variables('name_createDNSZoneLinkedTemplateName')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "dnszonesARecordSetNames": { - "value": "[parameters('dnszonesARecordSetNames')]" - }, - "dnszonesCNAMEAlias": { - "value": "[parameters('dnszonesCNAMEAlias')]" - }, - "dnszonesCNAMERecordSetNames": { - "value": "[parameters('dnszonesCNAMERecordSetNames')]" - }, - "dnszoneName": { - "value": "[parameters('dnszoneName')]" - }, - "location": { - "value": "[parameters('dnszoneLocation')]" - }, - "targetResources": { - "value": "[parameters('targetResources')]" - }, - "tagsByResource": { - "value": "[parameters('tagsByResource')]" - }, - "ttl": { - "value": "[parameters('ttl')]" - } - } - } - }, - { - "apiVersion": "${azure.apiVersionForDeployment}", - "type": "Microsoft.Resources/deployments", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "name": "updateDNSZone", - "condition": "[parameters('hasDNSZones')]", - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/',variables('name_dnszoneTempaltesFolder'),'/', variables('name_updateDNSZoneLinkedTemplateName')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "_globalResourceNameSuffix": { - "value": "[parameters('_globalResourceNameSuffix')]" - }, - "dnszonesARecordSetNames": { - "value": "[parameters('dnszonesARecordSetNames')]" - }, - "dnszonesCNAMEAlias": { - "value": "[parameters('dnszonesCNAMEAlias')]" - }, - "dnszonesCNAMERecordSetNames": { - "value": "[parameters('dnszonesCNAMERecordSetNames')]" - }, - "dnszoneName": { - "value": "[parameters('dnszoneName')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "resourceGroup": { - "value": "[parameters('resourceGroup')]" - }, - "targetResources": { - "value": "[parameters('targetResources')]" - }, - "tagsByResource": { - "value": "[parameters('tagsByResource')]" - }, - "ttl": { - "value": "[parameters('ttl')]" - }, - "utcValue": { - "value": "[parameters('utcValue')]" - } - } - } - }, - { - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${cluster.dns.end}", - "type": "Microsoft.Resources/deployments", - "tags": "[parameters('tagsByResource')['${identifier.resourcesDeployment}']]", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [] - } - } - } - ], - "outputs": {} -} \ No newline at end of file diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/nsgNestedTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/nsgNestedTemplate.json deleted file mode 100644 index 462b9487d..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/nsgNestedTemplate.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "denyPublicTrafficForAdminServer": { - "type": "bool", - "defaultValue": false - }, - "denyPublicTrafficForManagedServer": { - "type": "bool", - "defaultValue": false - }, - "enableAppGateway": { - "type": "bool", - "defaultValue": false - }, - "networkSecurityGroupName": { - "type": "string", - "metadata": { - "description": "Network Security Group name" - } - } - }, - "variables": { - "const_subnetPrefix": "10.0.0.0/24" - }, - "resources": [ - { - "type": "Microsoft.Network/networkSecurityGroups/securityRules", - "name": "[concat(parameters('networkSecurityGroupName'),'/','WebLogicAdminPortsAllowed')]", - "condition": "[not(parameters('denyPublicTrafficForAdminServer'))]", - "apiVersion": "${azure.apiVersionForNetworkSecurityGroups}", - "properties": { - "protocol": "TCP", - "sourcePortRange": "*", - "destinationAddressPrefix": "*", - "access": "Allow", - "priority": 210, - "direction": "Inbound", - "destinationPortRanges": [ - "7001", - "7002" - ], - "sourceAddressPrefix": "[variables('const_subnetPrefix')]" - } - }, - { - "type": "Microsoft.Network/networkSecurityGroups/securityRules", - "name": "[concat(parameters('networkSecurityGroupName'),'/','WebLogicAdminPortsDenied')]", - "condition": "[parameters('denyPublicTrafficForAdminServer')]", - "apiVersion": "${azure.apiVersionForNetworkSecurityGroups}", - "properties": { - "protocol": "*", - "sourcePortRange": "*", - "destinationAddressPrefix": "*", - "access": "Deny", - "priority": 211, - "direction": "Inbound", - "destinationPortRanges": [ - "7001", - "7002" - ], - "sourceAddressPrefix": "Internet" - } - }, - { - "type": "Microsoft.Network/networkSecurityGroups/securityRules", - "name": "[concat(parameters('networkSecurityGroupName'),'/','WebLogiManagedPortsAllowed')]", - "condition": "[and(not(parameters('denyPublicTrafficForManagedServer')), parameters('enableAppGateway'))]", - "apiVersion": "${azure.apiVersionForNetworkSecurityGroups}", - "properties": { - "protocol": "*", - "sourcePortRange": "*", - "destinationAddressPrefix": "*", - "access": "Deny", - "priority": 220, - "direction": "Inbound", - "destinationPortRanges": [ - "8001" - ], - "sourceAddressPrefix": "[variables('const_subnetPrefix')]" - } - }, - { - "type": "Microsoft.Network/networkSecurityGroups/securityRules", - "name": "[concat(parameters('networkSecurityGroupName'),'/','WebLogiManagedPortsDenied')]", - "condition": "[and(parameters('denyPublicTrafficForManagedServer'), parameters('enableAppGateway'))]", - "apiVersion": "${azure.apiVersionForNetworkSecurityGroups}", - "properties": { - "protocol": "*", - "sourcePortRange": "*", - "destinationAddressPrefix": "*", - "access": "Deny", - "priority": 221, - "direction": "Inbound", - "destinationPortRanges": [ - "8001" - ], - "sourceAddressPrefix": "Internet" - } - } - ] -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/resources/README.md b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/resources/README.md deleted file mode 100644 index 6217014f2..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/resources/README.md +++ /dev/null @@ -1,86 +0,0 @@ - - -# What is this stuff? - -Content that goes into the "Marketplace" tab of the offer. - -See [the Marketplace documentation](https://docs.microsoft.com/en-us/azure/marketplace/cloud-partner-portal/virtual-machine/cpp-marketplace-tab) for details. - -When submitting the offer, use content from [https://github.com/oracle/weblogic-azure/tree/main/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources](this directory), but apply the changes in this file on top. - -## Offer Settings - -Offer Id - -20191007-arm-oraclelinux-wls-cluster - -Publisher ID - -oracle - -Name - -Oracle WebLogic Server Cluster - -## SKU Details - -SKU ID - -20191007-arm-oraclelinux-wls-cluster - -Title - -Oracle WebLogic Server Cluster - -Summary - -Provisions an n-node Oracle WebLogic Server Cluster - -Description - -Provisions an n-node Oracle WebLogic Server cluster on Oracle Linux 9.1, 8.7 and 7.6 - -SKU Type - -Solution template - -Cloud Availability - -Public azure - -Is this a private SKU - -No - -## Marketplace - -Title - -Oracle WebLogic Server Cluster - -Summary - -Provisions an n-node Oracle WebLogic Server Cluster - -Long Summary - -Provisions an n-node Oracle WebLogic Server cluster on Oracle Linux 9.1, 8.7 and 7.6 - -Description - -[description.html](https://raw.githubusercontent.com/oracle/weblogic-azure/main/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/description.html) - -Offer available to Microsoft CSP Reseller channel? * - -No - -Marketing identifier - -weblogic12c-n-cluster - -Preview Subscription Ids - -REDACTED diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/scripts/datasourceConfig-mysql.sh b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/scripts/datasourceConfig-mysql.sh deleted file mode 100644 index a0a0c4f35..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/scripts/datasourceConfig-mysql.sh +++ /dev/null @@ -1,192 +0,0 @@ -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# Description -# This script is to configure datasource at WebLogic cluster domain. - -#Function to output message to StdErr -function echo_stderr () -{ - echo "$@" >&2 -} - -#Function to display usage message -function usage() -{ - echo_stderr "./configDatasource.sh <<< \"\"" -} - -function validateInput() -{ - # parse base64 string - wlsPassword=$(echo "${wlsPassword}" | base64 -d) - jdbcDataSourceName=$(echo "${jdbcDataSourceName}" | base64 -d) - dsConnectionURL=$(echo "${dsConnectionURL}" | base64 -d) - dsPassword=$(echo "${dsPassword}" | base64 -d) - - if [ -z "$oracleHome" ]; - then - echo _stderr "Please provide oracleHome" - exit 1 - fi - - if [ -z "$wlsAdminHost" ]; - then - echo _stderr "Please provide WeblogicServer hostname" - exit 1 - fi - - if [ -z "$wlsAdminPort" ]; - then - echo _stderr "Please provide Weblogic admin port" - exit 1 - fi - - if [ -z "$wlsUserName" ]; - then - echo _stderr "Please provide Weblogic username" - exit 1 - fi - - if [ -z "$wlsPassword" ]; - then - echo _stderr "Please provide Weblogic password" - exit 1 - fi - - if [ -z "$jdbcDataSourceName" ]; - then - echo _stderr "Please provide JDBC datasource name to be configured" - exit 1 - fi - - if [ -z "$dsConnectionURL" ]; - then - echo _stderr "Please provide Azure database of MySQL URL in the format 'jdbc:oracle:thin:@:/'" - exit 1 - fi - - if [ -z "$dsUser" ]; - then - echo _stderr "Please provide Azure database of MySQL user name" - exit 1 - fi - - if [ -z "$dsPassword" ]; - then - echo _stderr "Please provide Azure database of MySQL password" - exit 1 - fi - - if [ -z "$dbGlobalTranPro" ]; - then - echo _stderr "Please provide Global transactions protocol" - exit 1 - fi - - if [ -z "${enablePswlessConnection}" ]; - then - echo _stderr "Please provide enablePswlessConnection to identity if enabling passwordless connection." - exit 1 - fi - - if [ -z "$wlsClusterName" ]; - then - echo _stderr "Please provide Weblogic target cluster name" - exit 1 - fi - - # reset password - if [[ "${enablePswlessConnection,,}" == "true" ]]; then - dsPassword="" - fi -} - -function createJDBCSource_model() -{ - local driverName="com.mysql.jdbc.Driver" - if [[ "${enablePswlessConnection,,}" == "true" ]]; then - driverName="com.mysql.cj.jdbc.Driver" - fi - - echo "Creating JDBC data source with name $jdbcDataSourceName" - cat <${scriptPath}/create_datasource.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -edit("$hostName") -startEdit() -cd('/') -try: - cmo.createJDBCSystemResource('$jdbcDataSourceName') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName') - cmo.setName('$jdbcDataSourceName') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDataSourceParams/$jdbcDataSourceName') - set('JNDINames',jarray.array([String('$jdbcDataSourceName')], String)) - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName') - cmo.setDatasourceType('GENERIC') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDriverParams/$jdbcDataSourceName') - cmo.setUrl('$dsConnectionURL') - cmo.setDriverName('$driverName') - cmo.setPassword('$dsPassword') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCConnectionPoolParams/$jdbcDataSourceName') - cmo.setTestTableName('SQL ISVALID\r\n\r\n\r\n\r\n') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDriverParams/$jdbcDataSourceName/Properties/$jdbcDataSourceName') - cmo.createProperty('user') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDriverParams/$jdbcDataSourceName/Properties/$jdbcDataSourceName/Properties/user') - cmo.setValue('$dsUser') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDataSourceParams/$jdbcDataSourceName') - cmo.setGlobalTransactionsProtocol('${dbGlobalTranPro}') - cd('/JDBCSystemResources/$jdbcDataSourceName') - set('Targets',jarray.array([ObjectName('com.bea:Name=$wlsClusterName,Type=Cluster')], ObjectName)) - save() - resolve() - activate() -except Exception, e: - e.printStackTrace() - dumpStack() - undo('true',defaultAnswer='y') - cancelEdit('y') - destroyEditSession("$hostName",force = true) - raise("$jdbcDataSourceName configuration failed") -destroyEditSession("$hostName",force = true) -disconnect() -EOF -} - -function createTempFolder() -{ - scriptPath="/u01/tmp" - sudo rm -f -r ${scriptPath} - sudo mkdir ${scriptPath} - sudo rm -rf $scriptPath/* -} - -#main - -#read arguments from stdin -read oracleHome wlsAdminHost wlsAdminPort wlsUserName wlsPassword jdbcDataSourceName dsConnectionURL dsUser dsPassword dbGlobalTranPro enablePswlessConnection wlsClusterName - -if [ -z "$wlsClusterName" ]; -then - wlsClusterName="cluster1" -fi - -wlsAdminURL=$wlsAdminHost:$wlsAdminPort -hostName=`hostname` - -createTempFolder -validateInput -createJDBCSource_model - -sudo chown -R oracle:oracle ${scriptPath} -runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST ${scriptPath}/create_datasource.py" - -errorCode=$? -if [ $errorCode -eq 1 ] -then - echo "Exception occurs during DB configuration, please check." - exit 1 -fi - -echo "Cleaning up temporary files..." -rm -f -r ${scriptPath} - - diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/scripts/datasourceConfig-oracle.sh b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/scripts/datasourceConfig-oracle.sh deleted file mode 100644 index fadef340d..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/scripts/datasourceConfig-oracle.sh +++ /dev/null @@ -1,188 +0,0 @@ -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# Description -# This script is to configure datasource at WebLogic cluster domain. - -#Function to output message to StdErr -function echo_stderr () -{ - echo "$@" >&2 -} - -#Function to display usage message -function usage() -{ - echo_stderr "./configDatasource.sh <<< \"\"" -} - -function validateInput() -{ - # parse base64 string - wlsPassword=$(echo "${wlsPassword}" | base64 -d) - jdbcDataSourceName=$(echo "${jdbcDataSourceName}" | base64 -d) - dsConnectionURL=$(echo "${dsConnectionURL}" | base64 -d) - dsPassword=$(echo "${dsPassword}" | base64 -d) - - if [ -z "$oracleHome" ]; - then - echo _stderr "Please provide oracleHome" - exit 1 - fi - - if [ -z "$wlsAdminHost" ]; - then - echo _stderr "Please provide WeblogicServer hostname" - exit 1 - fi - - if [ -z "$wlsAdminPort" ]; - then - echo _stderr "Please provide Weblogic admin port" - exit 1 - fi - - if [ -z "$wlsUserName" ]; - then - echo _stderr "Please provide Weblogic username" - exit 1 - fi - - if [ -z "$wlsPassword" ]; - then - echo _stderr "Please provide Weblogic password" - exit 1 - fi - - if [ -z "$jdbcDataSourceName" ]; - then - echo _stderr "Please provide JDBC datasource name to be configured" - exit 1 - fi - - if [ -z "$dsConnectionURL" ]; - then - echo _stderr "Please provide Oracle Database URL in the format 'jdbc:oracle:thin:@:/'" - exit 1 - fi - - if [ -z "$dsUser" ]; - then - echo _stderr "Please provide Oracle Database user name" - exit 1 - fi - - if [ -z "$dsPassword" ]; - then - echo _stderr "Please provide Oracle Database password" - exit 1 - fi - - if [ -z "$dbGlobalTranPro" ]; - then - echo _stderr "Please provide Global transactions protocol" - exit 1 - fi - - if [ -z "$wlsClusterName" ]; - then - echo _stderr "Please provide Weblogic target cluster name" - exit 1 - fi - - if [ -z "${enablePswlessConnection}" ]; - then - echo _stderr "Please provide enablePswlessConnection to identity if enabling passwordless connection." - exit 1 - fi - - # reset password - if [[ "${enablePswlessConnection,,}" == "true" ]]; then - dsPassword="" - fi -} - -function createJDBCSource_model() -{ -echo "Creating JDBC data source with name $jdbcDataSourceName" -cat <${scriptPath}/create_datasource.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -edit("$hostName") -startEdit() -cd('/') -try: - cmo.createJDBCSystemResource('$jdbcDataSourceName') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName') - cmo.setName('$jdbcDataSourceName') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDataSourceParams/$jdbcDataSourceName') - set('JNDINames',jarray.array([String('$jdbcDataSourceName')], String)) - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName') - cmo.setDatasourceType('GENERIC') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDriverParams/$jdbcDataSourceName') - cmo.setUrl('$dsConnectionURL') - cmo.setDriverName('oracle.jdbc.OracleDriver') - cmo.setPassword('$dsPassword') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCConnectionPoolParams/$jdbcDataSourceName') - cmo.setTestTableName('SQL ISVALID\r\n\r\n\r\n\r\n') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDriverParams/$jdbcDataSourceName/Properties/$jdbcDataSourceName') - cmo.createProperty('user') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDriverParams/$jdbcDataSourceName/Properties/$jdbcDataSourceName/Properties/user') - cmo.setValue('$dsUser') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDataSourceParams/$jdbcDataSourceName') - cmo.setGlobalTransactionsProtocol('${dbGlobalTranPro}') - cd('/JDBCSystemResources/$jdbcDataSourceName') - set('Targets',jarray.array([ObjectName('com.bea:Name=$wlsClusterName,Type=Cluster')], ObjectName)) - save() - resolve() - activate() -except Exception, e: - e.printStackTrace() - dumpStack() - undo('true',defaultAnswer='y') - cancelEdit('y') - destroyEditSession("$hostName",force = true) - raise("$jdbcDataSourceName configuration failed") -destroyEditSession("$hostName",force = true) -disconnect() -EOF -} - -function createTempFolder() -{ - scriptPath="/u01/tmp" - sudo rm -f -r ${scriptPath} - sudo mkdir ${scriptPath} - sudo rm -rf $scriptPath/* -} - -#main - -#read arguments from stdin -read oracleHome wlsAdminHost wlsAdminPort wlsUserName wlsPassword jdbcDataSourceName dsConnectionURL dsUser dsPassword dbGlobalTranPro enablePswlessConnection wlsClusterName - -if [ -z "$wlsClusterName" ]; -then - wlsClusterName="cluster1" -fi - -wlsAdminURL=$wlsAdminHost:$wlsAdminPort -hostName=`hostname` - - -createTempFolder -validateInput -createJDBCSource_model - -sudo chown -R oracle:oracle ${scriptPath} -runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST ${scriptPath}/create_datasource.py" - -errorCode=$? -if [ $errorCode -eq 1 ] -then - echo "Exception occurs during DB configuration, please check." - exit 1 -fi - -echo "Cleaning up temporary files..." -rm -f -r ${scriptPath} - - diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/scripts/datasourceConfig-postgresql.sh b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/scripts/datasourceConfig-postgresql.sh deleted file mode 100644 index 0ab769119..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/scripts/datasourceConfig-postgresql.sh +++ /dev/null @@ -1,186 +0,0 @@ -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# Description -# This script is to configure datasource at WebLogic cluster domain. - -#Function to output message to StdErr -function echo_stderr () -{ - echo "$@" >&2 -} - -#Function to display usage message -function usage() -{ - echo_stderr "./configDatasource.sh <<< \"\"" -} - -function validateInput() -{ - # parse base64 string - wlsPassword=$(echo "${wlsPassword}" | base64 -d) - jdbcDataSourceName=$(echo "${jdbcDataSourceName}" | base64 -d) - dsConnectionURL=$(echo "${dsConnectionURL}" | base64 -d) - dsPassword=$(echo "${dsPassword}" | base64 -d) - - if [ -z "$oracleHome" ]; - then - echo _stderr "Please provide oracleHome" - exit 1 - fi - - if [ -z "$wlsAdminHost" ]; - then - echo _stderr "Please provide WeblogicServer hostname" - exit 1 - fi - - if [ -z "$wlsAdminPort" ]; - then - echo _stderr "Please provide Weblogic admin port" - exit 1 - fi - - if [ -z "$wlsUserName" ]; - then - echo _stderr "Please provide Weblogic username" - exit 1 - fi - - if [ -z "$wlsPassword" ]; - then - echo _stderr "Please provide Weblogic password" - exit 1 - fi - - if [ -z "$jdbcDataSourceName" ]; - then - echo _stderr "Please provide JDBC datasource name to be configured" - exit 1 - fi - - if [ -z "$dsConnectionURL" ]; - then - echo _stderr "Please provide PostgreSQL Database URL in the format 'jdbc:oracle:thin:@:/'" - exit 1 - fi - - if [ -z "$dsUser" ]; - then - echo _stderr "Please provide PostgreSQL Database user name" - exit 1 - fi - - if [ -z "$dsPassword" ]; - then - echo _stderr "Please provide PostgreSQL Database password" - exit 1 - fi - - if [ -z "$dbGlobalTranPro" ]; - then - echo _stderr "Please provide Global transactions protocol" - exit 1 - fi - - if [ -z "$wlsClusterName" ]; - then - echo _stderr "Please provide Weblogic target cluster name" - exit 1 - fi - - if [ -z "${enablePswlessConnection}" ]; - then - echo _stderr "Please provide enablePswlessConnection to identity if enabling passwordless connection." - exit 1 - fi - - # reset password - if [[ "${enablePswlessConnection,,}" == "true" ]]; then - dsPassword="" - fi -} - -function createJDBCSource_model() -{ -echo "Creating JDBC data source with name $jdbcDataSourceName" -cat <${scriptPath}/create_datasource.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -edit("$hostName") -startEdit() -cd('/') -try: - cmo.createJDBCSystemResource('$jdbcDataSourceName') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName') - cmo.setName('$jdbcDataSourceName') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDataSourceParams/$jdbcDataSourceName') - set('JNDINames',jarray.array([String('$jdbcDataSourceName')], String)) - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName') - cmo.setDatasourceType('GENERIC') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDriverParams/$jdbcDataSourceName') - cmo.setUrl('$dsConnectionURL') - cmo.setDriverName('org.postgresql.Driver') - cmo.setPassword('$dsPassword') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCConnectionPoolParams/$jdbcDataSourceName') - cmo.setTestTableName('SQL ISVALID\r\n\r\n\r\n\r\n') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDriverParams/$jdbcDataSourceName/Properties/$jdbcDataSourceName') - cmo.createProperty('user') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDriverParams/$jdbcDataSourceName/Properties/$jdbcDataSourceName/Properties/user') - cmo.setValue('$dsUser') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDataSourceParams/$jdbcDataSourceName') - cmo.setGlobalTransactionsProtocol('${dbGlobalTranPro}') - cd('/JDBCSystemResources/$jdbcDataSourceName') - set('Targets',jarray.array([ObjectName('com.bea:Name=$wlsClusterName,Type=Cluster')], ObjectName)) - save() - resolve() - activate() -except Exception, e: - e.printStackTrace() - dumpStack() - undo('true',defaultAnswer='y') - cancelEdit('y') - destroyEditSession("$hostName",force = true) - raise("$jdbcDataSourceName configuration failed") -destroyEditSession("$hostName",force = true) -disconnect() -EOF -} - -function createTempFolder() -{ - scriptPath="/u01/tmp" - sudo rm -f -r ${scriptPath} - sudo mkdir ${scriptPath} - sudo rm -rf $scriptPath/* -} - -#main - -#read arguments from stdin -read oracleHome wlsAdminHost wlsAdminPort wlsUserName wlsPassword jdbcDataSourceName dsConnectionURL dsUser dsPassword dbGlobalTranPro enablePswlessConnection wlsClusterName - -if [ -z "$wlsClusterName" ]; -then - wlsClusterName="cluster1" -fi - -wlsAdminURL=$wlsAdminHost:$wlsAdminPort -hostName=`hostname` - -createTempFolder -validateInput -createJDBCSource_model - -sudo chown -R oracle:oracle ${scriptPath} -runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST ${scriptPath}/create_datasource.py" - -errorCode=$? -if [ $errorCode -eq 1 ] -then - echo "Exception occurs during DB configuration, please check." - exit 1 -fi - -echo "Cleaning up temporary files..." -rm -f -r ${scriptPath} - diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/scripts/datasourceConfig-sqlserver.sh b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/scripts/datasourceConfig-sqlserver.sh deleted file mode 100644 index b54fe6414..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/scripts/datasourceConfig-sqlserver.sh +++ /dev/null @@ -1,186 +0,0 @@ -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# Description -# This script is to configure datasource at WebLogic cluster domain. - -#Function to output message to StdErr -function echo_stderr () -{ - echo "$@" >&2 -} - -#Function to display usage message -function usage() -{ - echo_stderr "./configDatasource.sh <<< \"\"" -} - -function validateInput() -{ - # parse base64 string - wlsPassword=$(echo "${wlsPassword}" | base64 -d) - jdbcDataSourceName=$(echo "${jdbcDataSourceName}" | base64 -d) - dsConnectionURL=$(echo "${dsConnectionURL}" | base64 -d) - dsPassword=$(echo "${dsPassword}" | base64 -d) - - if [ -z "$oracleHome" ]; - then - echo _stderr "Please provide oracleHome" - exit 1 - fi - - if [ -z "$wlsAdminHost" ]; - then - echo _stderr "Please provide WeblogicServer hostname" - exit 1 - fi - - if [ -z "$wlsAdminPort" ]; - then - echo _stderr "Please provide Weblogic admin port" - exit 1 - fi - - if [ -z "$wlsUserName" ]; - then - echo _stderr "Please provide Weblogic username" - exit 1 - fi - - if [ -z "$wlsPassword" ]; - then - echo _stderr "Please provide Weblogic password" - exit 1 - fi - - if [ -z "$jdbcDataSourceName" ]; - then - echo _stderr "Please provide JDBC datasource name to be configured" - exit 1 - fi - - if [ -z "$dsConnectionURL" ]; - then - echo _stderr "Please provide Azure SQL Database URL in the format 'jdbc:oracle:thin:@:/'" - exit 1 - fi - - if [ -z "$dsUser" ]; - then - echo _stderr "Please provide Azure SQL Database user name" - exit 1 - fi - - if [ -z "$dsPassword" ]; - then - echo _stderr "Please provide Azure SQL Database password" - exit 1 - fi - - if [ -z "$dbGlobalTranPro" ]; - then - echo _stderr "Please provide Global transactions protocol" - exit 1 - fi - - if [ -z "$wlsClusterName" ]; - then - echo _stderr "Please provide Weblogic target cluster name" - exit 1 - fi - - if [ -z "${enablePswlessConnection}" ]; - then - echo _stderr "Please provide enablePswlessConnection to identity if enabling passwordless connection." - exit 1 - fi - - # reset password and user - if [[ "${enablePswlessConnection,,}" == "true" ]]; then - dsPassword="" - dsUser="" - fi -} - -function createJDBCSource_model() -{ -echo "Creating JDBC data source with name $jdbcDataSourceName" -cat <${scriptPath}/create_datasource.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -edit("$hostName") -startEdit() -cd('/') -try: - cmo.createJDBCSystemResource('$jdbcDataSourceName') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName') - cmo.setName('$jdbcDataSourceName') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDataSourceParams/$jdbcDataSourceName') - set('JNDINames',jarray.array([String('$jdbcDataSourceName')], String)) - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName') - cmo.setDatasourceType('GENERIC') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDriverParams/$jdbcDataSourceName') - cmo.setUrl('$dsConnectionURL') - cmo.setDriverName('com.microsoft.sqlserver.jdbc.SQLServerDriver') - cmo.setPassword('$dsPassword') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCConnectionPoolParams/$jdbcDataSourceName') - cmo.setTestTableName('SQL ISVALID\r\n\r\n\r\n\r\n') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDriverParams/$jdbcDataSourceName/Properties/$jdbcDataSourceName') - cmo.createProperty('user') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDriverParams/$jdbcDataSourceName/Properties/$jdbcDataSourceName/Properties/user') - cmo.setValue('$dsUser') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDataSourceParams/$jdbcDataSourceName') - cmo.setGlobalTransactionsProtocol('${dbGlobalTranPro}') - cd('/JDBCSystemResources/$jdbcDataSourceName') - set('Targets',jarray.array([ObjectName('com.bea:Name=$wlsClusterName,Type=Cluster')], ObjectName)) - save() - resolve() - activate() -except Exception, e: - e.printStackTrace() - dumpStack() - undo('true',defaultAnswer='y') - cancelEdit('y') - destroyEditSession("$hostName",force = true) - raise("$jdbcDataSourceName configuration failed") -destroyEditSession("$hostName",force = true) -disconnect() -EOF -} - -function createTempFolder() -{ - scriptPath="/u01/tmp" - sudo rm -f -r ${scriptPath} - sudo mkdir ${scriptPath} - sudo rm -rf $scriptPath/* -} - -#main - -#read arguments from stdin -read oracleHome wlsAdminHost wlsAdminPort wlsUserName wlsPassword jdbcDataSourceName dsConnectionURL dsUser dsPassword dbGlobalTranPro enablePswlessConnection wlsClusterName - -if [ -z "$wlsClusterName" ]; -then - wlsClusterName="cluster1" -fi - -wlsAdminURL=$wlsAdminHost:$wlsAdminPort -hostName=`hostname` - -createTempFolder -validateInput -createJDBCSource_model - -sudo chown -R oracle:oracle ${scriptPath} -runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST ${scriptPath}/create_datasource.py" - -errorCode=$? -if [ $errorCode -eq 1 ] -then - echo "Exception occurs during DB configuration, please check." - exit 1 -fi - -echo "Cleaning up temporary files..." -rm -f -r ${scriptPath} \ No newline at end of file diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/scripts/installJdbcDrivers.sh b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/scripts/installJdbcDrivers.sh deleted file mode 100644 index 186876fe1..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/scripts/installJdbcDrivers.sh +++ /dev/null @@ -1,278 +0,0 @@ -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# Description -# This script is to install jdbc libraries at WebLogic cluster domain. - -# /bin/bash - -#Function to output message to StdErr -function echo_stderr() { - echo "$@" >&2 -} - -#Function to display usage message -function usage() { - echo_stderr "./installJdbcDrivers.sh <<< \"\"" -} - -function validate_input() { - - # parse base64 string - wlsPassword=$(echo "${wlsPassword}" | base64 -d) - - if [ -z "$oracleHome" ]; then - echo _stderr "Please provide oracleHome" - exit 1 - fi - - if [ -z "$domainPath" ]; then - echo _stderr "Please provide domainPath" - exit 1 - fi - - if [ -z "$wlsServerName" ]; then - echo _stderr "Please provide wlsServerName" - exit 1 - fi - - if [ -z "$wlsAdminHost" ]; then - echo _stderr "Please provide wlsAdminHost" - exit 1 - fi - - if [ -z "$wlsAdminPort" ]; then - echo _stderr "Please provide wlsAdminPort" - exit 1 - fi - - if [ -z "$wlsUserName" ]; then - echo _stderr "Please provide wlsUserName" - exit 1 - fi - - if [ -z "$wlsPassword" ]; then - echo _stderr "Please provide wlsPassword" - exit 1 - fi - - if [ -z "$databaseType" ]; then - echo _stderr "Please provide databaseType" - exit 1 - fi - - if [ -z "$enablePswlessConnection" ]; then - echo _stderr "Please provide enablePswlessConnection" - exit 1 - fi -} - -function install_maven() { - local mavenUrl=$(curl -Ls -o /dev/null -w %{url_effective} ${url4MavenInstaller}) - if [ $? != 0 ]; then - echo_stderr "Failed to get maven download url." - fi - curl -m ${curlMaxTime} --retry ${retryMaxAttempt} -fksL "${mavenUrl}" -o ${mvnInstaller} - if [ $? != 0 ]; then - echo_stderr "Failed to download ${mavenUrl}." - fi - - tar xzvf ${mvnInstaller} -C /u01/app - export MAVEN_HOME=$(find /u01/app -maxdepth 1 -type d -name "apache-maven*") - . $oracleHome/oracle_common/common/bin/setWlstEnv.sh # set JAVA_HOME - export PATH=${MAVEN_HOME}/bin:$PATH - - rm ${mvnInstaller} -f - mvn --version - if [ $? != 0 ]; then - echo_stderr "Failed to install maven." - fi -} - -function uninstall_maven() { - sudo rm -f ${MAVEN_HOME} -R -} - -function install_azure_identity_extension() { - local myPomFile=pom.xml - curl -m ${curlMaxTime} --retry ${retryMaxAttempt} -fksL "${gitUrl4AzureIdentityExtensionPomFile}" -o ${myPomFile} - if [ $? != 0 ]; then - echo_stderr "Failed to download ${gitUrl4AzureIdentityExtensionPomFile}." - fi - - echo "download dependencies" - mvn dependency:copy-dependencies -f ${myPomFile} - if [ $? -eq 0 ]; then - ls -l target/dependency/ - - domainBase=$(dirname $domainPath) - - # check if azure identity extension has been installed, if so, remove old version - if [ -d "${domainBase}/azure-libraries/identity" ]; then - sudo rm ${domainBase}/azure-libraries/identity -f -r - sudo rm ${domainBase}/azure-libraries/jackson -f -r - fi - - sudo mkdir -p ${domainBase}/azure-libraries/identity - sudo mkdir -p ${domainBase}/azure-libraries/jackson - # fix JARs conflict issue, put jackson libraries to PRE_CLASSPATH to upgrade the existing libs. - sudo mv target/dependency/jackson-annotations-*.jar ${domainBase}/azure-libraries/jackson - sudo mv target/dependency/jackson-core-*.jar ${domainBase}/azure-libraries/jackson - sudo mv target/dependency/jackson-databind-*.jar ${domainBase}/azure-libraries/jackson - sudo mv target/dependency/jackson-dataformat-xml-*.jar ${domainBase}/azure-libraries/jackson - # Those jars will be appended to CLASSPATH - sudo mv target/dependency/*.jar ${domainBase}/azure-libraries/identity - sudo chown -R oracle:oracle ${domainBase}/azure-libraries - else - echo "Failed to download dependencies for azure-identity-extension" - exit 1 - fi - - rm ${myPomFile} -f - rm target -f -r - if ! grep -q "${domainBase}/azure-libraries/identity/" "${domainPath}/bin/setDomainEnv.sh"; then - sed -i 's;^export DOMAIN_HOME;&\nCLASSPATH="'${domainBase}'/azure-libraries/identity/*:${CLASSPATH}";' ${domainPath}/bin/setDomainEnv.sh - fi - - if ! grep -q "${domainBase}/azure-libraries/jackson/" "${domainPath}/bin/setDomainEnv.sh"; then - sed -i 's;^export DOMAIN_HOME;&\nPRE_CLASSPATH="'${domainBase}'/azure-libraries/jackson/*:${PRE_CLASSPATH}";' ${domainPath}/bin/setDomainEnv.sh - fi -} - -function upgrade_mysql_driver() { - local mysqlPomFile=mysql-pom.xml - curl -m ${curlMaxTime} --retry ${retryMaxAttempt} -fksL "${gitUrl4MySQLDriverPomFile}" -o ${mysqlPomFile} - if [ $? != 0 ]; then - echo_stderr "Failed to download ${gitUrl4MySQLDriverPomFile}." - fi - - echo "download dependencies" - mvn dependency:copy-dependencies -f ${mysqlPomFile} - if [ $? -eq 0 ]; then - ls -l target/dependency/ - - local domainBase=$(dirname $domainPath) - local preClassLibsFolderName=preclasspath-libraries - - # check if the driver has been upgraded, if so, remove old driver - if [ -e ${domainBase}/${preClassLibsFolderName}/mysql-connector-*.jar ]; then - sudo rm ${domainBase}/${preClassLibsFolderName} -f -r - fi - - sudo mkdir ${domainBase}/${preClassLibsFolderName} - sudo mv target/dependency/mysql-connector-*.jar ${domainBase}/${preClassLibsFolderName}/ - sudo chown -R oracle:oracle ${domainBase}/${preClassLibsFolderName} - else - echo "Failed to download mysql driver." - exit 1 - fi - - rm ${mysqlPomFile} -f - rm target -f -r - - if ! grep -q "${domainBase}/preclasspath-libraries/" "${domainPath}/bin/setDomainEnv.sh"; then - sed -i 's;^export DOMAIN_HOME;&\nPRE_CLASSPATH="'${domainBase}'/preclasspath-libraries/*:${PRE_CLASSPATH}";' ${domainPath}/bin/setDomainEnv.sh - fi -} - -#This function to wait for admin server -function wait_for_admin() { - #wait for admin to start - count=1 - CHECK_URL="http://$wlsAdminURL/weblogic/ready" - status=$(curl --insecure -ILs $CHECK_URL | tac | grep -m1 HTTP/1.1 | awk {'print $2'}) - echo "Waiting for admin server to start" - while [[ "$status" != "200" ]]; do - echo "." - count=$((count + 1)) - if [ $count -le 30 ]; then - sleep 1m - else - echo "Error : Maximum attempts exceeded while starting admin server" - exit 1 - fi - status=$(curl --insecure -ILs $CHECK_URL | tac | grep -m1 HTTP/1.1 | awk {'print $2'}) - if [ "$status" == "200" ]; then - echo "Admin Server started succesfully..." - break - fi - done -} - -function restart_admin_service() { - echo "Restart weblogic admin server service" - sudo systemctl stop wls_admin - sudo systemctl start wls_admin - wait_for_admin -} - -function restart_managed_servers() { - echo "Restart managed servers" - cat <${SCRIPT_PWD}/restart-managedServer.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -servers=cmo.getServers() -domainRuntime() -print "Restart the servers which are in RUNNING status" -for server in servers: - bean="/ServerLifeCycleRuntimes/"+server.getName() - serverbean=getMBean(bean) - if (serverbean.getState() in ("RUNNING")) and (server.getName() == '${wlsServerName}'): - try: - print "Stop the Server ",server.getName() - shutdown(server.getName(),server.getType(),ignoreSessions='true',force='true') - print "Start the Server ",server.getName() - start(server.getName(),server.getType()) - break - except: - print "Failed restarting managed server ", server.getName() - dumpStack() -serverConfig() -disconnect() -EOF - . $oracleHome/oracle_common/common/bin/setWlstEnv.sh - java $WLST_ARGS weblogic.WLST ${SCRIPT_PWD}/restart-managedServer.py - - if [[ $? != 0 ]]; then - echo "Error : Fail to restart managed server to configuration external libraries." - exit 1 - fi -} - -#read arguments from stdin -read oracleHome domainPath wlsServerName wlsAdminHost wlsAdminPort wlsUserName wlsPassword databaseType enablePswlessConnection - -export curlMaxTime=120 # seconds -export gitUrl4AzureIdentityExtensionPomFile="https://raw.githubusercontent.com/oracle/weblogic-azure/main/weblogic-azure-aks/src/main/resources/azure-identity-extensions.xml" -export gitUrl4MySQLDriverPomFile="https://raw.githubusercontent.com/oracle/weblogic-azure/main/weblogic-azure-aks/src/main/resources/mysql-connector-java.xml" -export retryMaxAttempt=5 # retry attempt for curl command -export mvnInstaller="apache-maven-bin.tar.gz" - -# 2024-09-11 https://github.com/oracle/weblogic-azure/pull/325 -# Increase maintainability by putting URL behind redirector. As of today -# target is https://dlcdn.apache.org/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.tar.gz -# A better solution would be if Oracle had an employee accessible URL redirector -# service similar to Microsoft's aka.ms. - -export url4MavenInstaller="https://aka.ms/wls-offer-maven-download-url" -export wlsAdminURL=$wlsAdminHost:$wlsAdminPort - -validate_input - -install_maven - -if [ $databaseType == "mysql" ]; then - upgrade_mysql_driver -fi - -if [ "${enablePswlessConnection,,}" == "true" ]; then - if [[ $databaseType == "mysql" || $databaseType == "postgresql" ]]; then - install_azure_identity_extension - fi -fi - -uninstall_maven - -if [ $wlsServerName == "admin" ]; then - restart_admin_service -else - restart_managed_servers -fi diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/scripts/setupApplicationGateway.sh b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/scripts/setupApplicationGateway.sh deleted file mode 100644 index a44b5726e..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/scripts/setupApplicationGateway.sh +++ /dev/null @@ -1,155 +0,0 @@ -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# Description -# This script is to configure Azure application gateway. - -#Function to output message to StdErr -function echo_stderr() -{ - echo "$@" >&2 -} - -#Function to display usage message -function usage() -{ - echo_stderr "./setupApplicationGateway.sh <<< \"\"" -} - -#Function to validate input -function validateInput() -{ - if [ -z "$wlsAdminServerName" ]; - then - echo_stderr "wlsAdminServerName is required. " - fi - - if [[ -z "$wlsUserName" || -z "$wlsPassword" ]] - then - echo_stderr "wlsUserName or wlsPassword is required. " - exit 1 - fi - - if [ -z "$wlsAdminHost" ]; - then - echo_stderr "wlsAdminHost is required. " - fi - - if [ -z "$wlsAdminPort" ]; - then - echo_stderr "wlsAdminPort is required. " - fi - - if [ -z "$oracleHome" ]; - then - echo_stderr "oracleHome is required. " - fi -} - -#Function to setup application gateway -#Set cluster frontend host -#Create channels for managed server -function setupApplicationGateway() -{ - cat <$SCRIPT_PWD/setup-app-gateway.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') - -edit("$wlsAdminServerName") -startEdit() -cd('/') - -cd('/Clusters/cluster1') -cmo.setFrontendHTTPPort($AppGWHttpPort) -cmo.setFrontendHTTPSPort($AppGWHttpsPort) -cmo.setFrontendHost('$AppGWHostName') - -servers=cmo.getServers() -for server in servers: - print "Creating T3 channel Port on managed server: + server.getName()" - serverPath="/Servers/"+server.getName() - cd(serverPath) - create('T3Channel','NetworkAccessPoint') - cd(serverPath+"/NetworkAccessPoints/T3Channel") - set('Protocol','t3') - set('ListenAddress','') - set('ListenPort',$channelPort) - set('PublicAddress', '$AppGWHostName') - set('PublicPort', $channelPort) - set('Enabled','true') - - cd(serverPath) - create('HTTPChannel','NetworkAccessPoint') - cd(serverPath+"/NetworkAccessPoints/HTTPChannel") - set('Protocol','http') - set('ListenAddress','') - set('ListenPort',$channelPort) - set('PublicAddress', '$AppGWHostName') - set('PublicPort', $channelPort) - set('Enabled','true') - -save() -resolve() -activate() -destroyEditSession("$wlsAdminServerName") -disconnect() -EOF - - . $oracleHome/oracle_common/common/bin/setWlstEnv.sh - java $WLST_ARGS weblogic.WLST ${SCRIPT_PWD}/setup-app-gateway.py - - if [[ $? != 0 ]]; then - echo "Error : Fail to cofigure application gateway." - exit 1 - fi - -} - -function restartManagedServers() -{ - echo "Restart managed servers" - cat <${SCRIPT_PWD}/restart-managedServer.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -servers=cmo.getServers() -domainRuntime() -print "Restart the servers which are in RUNNING status" -for server in servers: - bean="/ServerLifeCycleRuntimes/"+server.getName() - serverbean=getMBean(bean) - if (serverbean.getState() in ("RUNNING")) and (server.getName() != '${wlsAdminServerName}'): - try: - print "Stop the Server ",server.getName() - shutdown(server.getName(),server.getType(),ignoreSessions='true',force='true') - print "Start the Server ",server.getName() - start(server.getName(),server.getType()) - except: - print "Failed restarting managed server ", server.getName() - dumpStack() -serverConfig() -disconnect() -EOF - . $oracleHome/oracle_common/common/bin/setWlstEnv.sh - java $WLST_ARGS weblogic.WLST ${SCRIPT_PWD}/restart-managedServer.py - - if [[ $? != 0 ]]; then - echo "Error : Fail to restart managed server." - exit 1 - fi -} - -#main - -SCRIPT_PWD=`pwd` - -#read arguments from stdin -read wlsAdminServerName wlsUserName wlsPassword wlsAdminHost wlsAdminPort AppGWHostName oracleHome - -wlsAdminURL=$wlsAdminHost:$wlsAdminPort - -channelPort=8501 -AppGWHttpPort=80 -AppGWHttpsPort=443 - -validateInput - -setupApplicationGateway - -restartManagedServers \ No newline at end of file diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/scripts/setupClusterDomain.sh b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/scripts/setupClusterDomain.sh deleted file mode 100644 index 397699c27..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/scripts/setupClusterDomain.sh +++ /dev/null @@ -1,1029 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# Description -# This script is to setup and configure WebLogic cluster domain. - - -#Function to output message to StdErr -function echo_stderr () -{ - echo "$@" >&2 -} - -#Function to display usage message -function usage() -{ - echo_stderr "./setupClusterDomain.sh <<< \"\"" -} - -function installUtilities() -{ - echo "Installing zip unzip wget vnc-server rng-tools cifs-utils" - sudo yum install -y zip unzip wget vnc-server rng-tools cifs-utils - - #Setting up rngd utils - attempt=1 - while [[ $attempt -lt 4 ]] - do - echo "Starting rngd service attempt $attempt" - sudo systemctl start rngd - attempt=`expr $attempt + 1` - sudo systemctl status rngd | grep running - if [[ $? == 0 ]]; - then - echo "rngd utility service started successfully" - break - fi - sleep 1m - done -} - -function validateInput() -{ - if [ -z "$wlsDomainName" ]; - then - echo_stderr "wlsDomainName is required. " - fi - - if [[ -z "$wlsUserName" || -z "$wlsPassword" ]] - then - echo_stderr "wlsUserName or wlsPassword is required. " - exit 1 - fi - - if [ -z "$wlsServerName" ]; - then - echo_stderr "wlsServerName is required. " - fi - - if [ -z "$wlsAdminHost" ]; - then - echo_stderr "wlsAdminHost is required. " - fi - - if [ -z "$oracleHome" ]; - then - echo_stderr "oracleHome is required. " - exit 1 - fi - - if [ -z "$storageAccountName" ]; - then - echo_stderr "storageAccountName is required. " - exit 1 - fi - - if [ -z "$storageAccountKey" ]; - then - echo_stderr "storageAccountKey is required. " - exit 1 - fi - - if [ -z "$mountpointPath" ]; - then - echo_stderr "mountpointPath is required. " - exit 1 - fi - - if [ "${isCustomSSLEnabled}" != "true" ]; - then - echo_stderr "Custom SSL value is not provided. Defaulting to false" - isCustomSSLEnabled="false" - else - if [ -z "$customIdentityKeyStoreData" ] || [ -z "$customIdentityKeyStorePassPhrase" ] || - [ -z "$customIdentityKeyStoreType" ] || [ -z "$customTrustKeyStoreData" ] || - [ -z "$customTrustKeyStorePassPhrase" ] || [ -z "$customTrustKeyStoreType" ] || - [ -z "$serverPrivateKeyAlias" ] || [ -z "$serverPrivateKeyPassPhrase" ]; - then - echo "One of the required values for enabling Custom SSL \ - (CustomKeyIdentityKeyStoreData,CustomKeyIdentityKeyStorePassPhrase,CustomKeyIdentityKeyStoreType,CustomKeyTrustKeyStoreData,CustomKeyTrustKeyStorePassPhrase,CustomKeyTrustKeyStoreType) \ - has not been provided." - exit 1 - fi - fi - - if [ -z "$virtualNetworkNewOrExisting" ]; - then - echo_stderr "virtualNetworkNewOrExisting is required. " - exit 1 - fi - - if [ -z "$storageAccountPrivateIp" ]; - then - echo_stderr "storageAccountPrivateIp is required. " - exit 1 - fi -} - -#Function to cleanup all temporary files -function cleanup() -{ - echo "Cleaning up temporary files..." - - rm -rf $DOMAIN_PATH/admin-domain.yaml - rm -rf $DOMAIN_PATH/managed-domain.yaml - rm -rf $DOMAIN_PATH/*.py - rm -rf ${CUSTOM_HOSTNAME_VERIFIER_HOME} - echo "Cleanup completed." -} - -# This function verifies whether certificate is valid and not expired -function verifyCertValidity() -{ - KEYSTORE=$1 - PASSWORD=$2 - CURRENT_DATE=$3 - MIN_CERT_VALIDITY=$4 - KEY_STORE_TYPE=$5 - VALIDITY=$(($CURRENT_DATE + ($MIN_CERT_VALIDITY*24*60*60))) - - echo "Verifying $KEYSTORE is valid at least $MIN_CERT_VALIDITY day from the deployment time" - - if [ $VALIDITY -le $CURRENT_DATE ]; - then - echo "Error : Invalid minimum validity days supplied" - exit 1 - fi - - # Check whether KEYSTORE supplied can be opened for reading - # Redirecting as no need to display the contents - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; keytool -list -v -keystore $KEYSTORE -storepass $PASSWORD -storetype $KEY_STORE_TYPE > /dev/null 2>&1" - if [ $? != 0 ]; - then - echo "Error opening the keystore : $KEYSTORE" - exit 1 - fi - - aliasList=`runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; keytool -list -v -keystore $KEYSTORE -storepass $PASSWORD -storetype $KEY_STORE_TYPE | grep Alias" |awk '{print $3}'` - if [[ -z $aliasList ]]; - then - echo "Error : No alias found in supplied certificate" - exit 1 - fi - - for alias in $aliasList - do - VALIDITY_PERIOD=`runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; keytool -list -v -keystore $KEYSTORE -storepass $PASSWORD -storetype $KEY_STORE_TYPE -alias $alias | grep Valid"` - echo "$KEYSTORE is \"$VALIDITY_PERIOD\"" - CERT_UNTIL_DATE=`echo $VALIDITY_PERIOD | awk -F'until:|\r' '{print $2}'` - CERT_UNTIL_SECONDS=`date -d "$CERT_UNTIL_DATE" +%s` - VALIDITY_REMIANS_SECONDS=`expr $CERT_UNTIL_SECONDS - $VALIDITY` - if [[ $VALIDITY_REMIANS_SECONDS -le 0 ]]; - then - echo_stderr "$KEYSTORE is \"$VALIDITY_PERIOD\"" - echo_stderr "Error : Supplied certificate $KEYSTORE is either expired or expiring soon within $MIN_CERT_VALIDITY day" - exit 1 - fi - done - echo "$KEYSTORE validation is successful" -} - -#Creates weblogic deployment model for cluster domain admin setup -function create_admin_model() -{ - echo "Creating admin domain model" - -cat /dev/null > $DOMAIN_PATH/admin-domain.yaml - - cat <$DOMAIN_PATH/admin-domain.yaml -domainInfo: - AdminUserName: "$wlsUserName" - AdminPassword: "$wlsPassword" - ServerStartMode: prod -topology: - Name: "$wlsDomainName" - AdminServerName: admin - Machine: - '$nmHost': - NodeManager: - ListenAddress: "$nmHost" - ListenPort: $nmPort - NMType : ssl - Cluster: - '$wlsClusterName': - MigrationBasis: 'consensus' - Server: - '$wlsServerName': - ListenPort: $wlsAdminPort - NetworkAccessPoint: - 'adminT3Channel': - ListenAddress: '$wlsAdminHost' - ListenPort: $wlsAdminT3ChannelPort - Protocol: t3 - Enabled: true - ListenPortEnabled: ${isHTTPAdminListenPortEnabled} - RestartDelaySeconds: 10 - ServerStart: - Arguments: '${SERVER_STARTUP_ARGS}' -EOF - - if [ "${isCustomSSLEnabled}" == "true" ]; - then -cat <>$DOMAIN_PATH/admin-domain.yaml - KeyStores: 'CustomIdentityAndCustomTrust' - CustomIdentityKeyStoreFileName: "$customIdentityKeyStoreFileName" - CustomIdentityKeyStoreType: "$customIdentityKeyStoreType" - CustomIdentityKeyStorePassPhraseEncrypted: "$customIdentityKeyStorePassPhrase" - CustomTrustKeyStoreFileName: "$customTrustKeyStoreFileName" - CustomTrustKeyStoreType: "$customTrustKeyStoreType" - CustomTrustKeyStorePassPhraseEncrypted: "$customTrustKeyStorePassPhrase" -EOF - fi - -cat <>$DOMAIN_PATH/admin-domain.yaml - SSL: - ListenPort: $wlsSSLAdminPort - Enabled: true -EOF - - if [ "${isCustomSSLEnabled}" == "true" ]; - then -cat <>$DOMAIN_PATH/admin-domain.yaml - ServerPrivateKeyAlias: "$serverPrivateKeyAlias" - ServerPrivateKeyPassPhraseEncrypted: "$serverPrivateKeyPassPhrase" -EOF - fi - -cat <>$DOMAIN_PATH/admin-domain.yaml - SecurityConfiguration: - NodeManagerUsername: "$wlsUserName" - NodeManagerPasswordEncrypted: "$wlsPassword" -EOF - -hasRemoteAnonymousAttribs="$(containsRemoteAnonymousT3RMIIAttribs)" -echo "hasRemoteAnonymousAttribs: ${hasRemoteAnonymousAttribs}" - -if [ "${hasRemoteAnonymousAttribs}" == "true" ]; -then -echo "adding settings to disable remote anonymous t3/rmi disabled under domain security configuration" -cat <>$DOMAIN_PATH/admin-domain.yaml - RemoteAnonymousRmiiiopEnabled: false - RemoteAnonymousRmit3Enabled: false -EOF -fi -} - -#Creates weblogic deployment model for cluster domain managed server -function create_managed_model() -{ - echo "Creating managed domain model" - cat <$DOMAIN_PATH/managed-domain.yaml -domainInfo: - AdminUserName: "$wlsUserName" - AdminPassword: "$wlsPassword" - ServerStartMode: prod -topology: - Name: "$wlsDomainName" - Machine: - '$nmHost': - NodeManager: - ListenAddress: "$nmHost" - ListenPort: $nmPort - NMType : ssl - Cluster: - '$wlsClusterName': - MigrationBasis: 'consensus' - Server: - '$wlsServerName' : - ListenPort: $wlsManagedPort - Notes: "$wlsServerName managed server" - Cluster: "$wlsClusterName" - Machine: "$nmHost" - ServerStart: - Arguments: '${SERVER_STARTUP_ARGS}' -EOF - -if [ "${isCustomSSLEnabled}" == "true" ]; - then -cat <>$DOMAIN_PATH/managed-domain.yaml - KeyStores: 'CustomIdentityAndCustomTrust' - CustomIdentityKeyStoreFileName: "$customIdentityKeyStoreFileName" - CustomIdentityKeyStoreType: "$customIdentityKeyStoreType" - CustomIdentityKeyStorePassPhraseEncrypted: "$customIdentityKeyStorePassPhrase" - CustomTrustKeyStoreFileName: "$customTrustKeyStoreFileName" - CustomTrustKeyStoreType: "$customTrustKeyStoreType" - CustomTrustKeyStorePassPhraseEncrypted: "$customTrustKeyStorePassPhrase" -EOF - fi - - if [ "${isCustomSSLEnabled}" == "true" ]; - then -cat <>$DOMAIN_PATH/managed-domain.yaml - SSL: - ServerPrivateKeyAlias: "$serverPrivateKeyAlias" - ServerPrivateKeyPassPhraseEncrypted: "$serverPrivateKeyPassPhrase" -EOF - fi - - cat <>$DOMAIN_PATH/managed-domain.yaml - SecurityConfiguration: - NodeManagerUsername: "$wlsUserName" - NodeManagerPasswordEncrypted: "$wlsPassword" -EOF - -hasRemoteAnonymousAttribs="$(containsRemoteAnonymousT3RMIIAttribs)" -echo "hasRemoteAnonymousAttribs: ${hasRemoteAnonymousAttribs}" - - -if [ "${hasRemoteAnonymousAttribs}" == "true" ]; -then -echo "adding settings to disable remote anonymous t3/rmi disabled under domain security configuration" -cat <>$DOMAIN_PATH/managed-domain.yaml - RemoteAnonymousRmiiiopEnabled: false - RemoteAnonymousRmit3Enabled: false -EOF -fi - -} - -#This function to add machine for a given managed server -function create_machine_model() -{ - echo "Creating machine name model for managed server $wlsServerName" - cat <$DOMAIN_PATH/add-machine.py -connect('$wlsUserName','$wlsPassword','$adminWlstURL') -edit("$wlsServerName") -startEdit() -cd('/') -cmo.createMachine('$nmHost') -cd('/Machines/$nmHost/NodeManager/$nmHost') -cmo.setListenPort(int($nmPort)) -cmo.setListenAddress('$nmHost') -cmo.setNMType('ssl') -save() -resolve() -activate() -destroyEditSession("$wlsServerName") -disconnect() -EOF -} - -#This function to add managed serverto admin node -function create_ms_server_model() -{ - echo "Creating managed server $wlsServerName model" - cat <$DOMAIN_PATH/add-server.py - -isCustomSSLEnabled='${isCustomSSLEnabled}' -connect('$wlsUserName','$wlsPassword','$adminWlstURL') -edit("$wlsServerName") -startEdit() -cd('/') -cmo.createServer('$wlsServerName') -cd('/Servers/$wlsServerName') -cmo.setMachine(getMBean('/Machines/$nmHost')) -cmo.setCluster(getMBean('/Clusters/$wlsClusterName')) -cmo.setListenAddress('$nmHost') -cmo.setListenPort(int($wlsManagedPort)) -cmo.setListenPortEnabled(true) - -if isCustomSSLEnabled == 'true' : - cmo.setKeyStores('CustomIdentityAndCustomTrust') - cmo.setCustomIdentityKeyStoreFileName('$customIdentityKeyStoreFileName') - cmo.setCustomIdentityKeyStoreType('$customIdentityKeyStoreType') - set('CustomIdentityKeyStorePassPhrase', '$customIdentityKeyStorePassPhrase') - cmo.setCustomTrustKeyStoreFileName('$customTrustKeyStoreFileName') - cmo.setCustomTrustKeyStoreType('$customTrustKeyStoreType') - set('CustomTrustKeyStorePassPhrase', '$customTrustKeyStorePassPhrase') - -cd('/Servers/$wlsServerName/SSL/$wlsServerName') -cmo.setServerPrivateKeyAlias('$serverPrivateKeyAlias') -set('ServerPrivateKeyPassPhrase', '$serverPrivateKeyPassPhrase') - -cd('/Servers/$wlsServerName//ServerStart/$wlsServerName') -arguments = '${SERVER_STARTUP_ARGS} -Dweblogic.Name=$wlsServerName -Dweblogic.management.server=${SERVER_START_URL}' -oldArgs = cmo.getArguments() -if oldArgs != None: - newArgs = oldArgs + ' ' + arguments -else: - newArgs = arguments -cmo.setArguments(newArgs) -save() -resolve() -activate() -destroyEditSession("$wlsServerName") -nmEnroll('$DOMAIN_PATH/$wlsDomainName','$DOMAIN_PATH/$wlsDomainName/nodemanager') -nmGenBootStartupProps('$wlsServerName') -disconnect() -EOF -} - -#Function to create Admin Only Domain -function create_adminSetup() -{ - echo "Creating Admin Setup" - echo "Creating domain path $DOMAIN_PATH" - - sudo mkdir -p $DOMAIN_PATH - - cd $DOMAIN_PATH - - # WebLogic base images are already having weblogic-deploy, hence no need to download - if [ ! -d "$DOMAIN_PATH/weblogic-deploy" ]; - then - echo "weblogic-deploy tool not found in path $DOMAIN_PATH" - exit 1 - fi - - create_admin_model - sudo chown -R $username:$groupname $DOMAIN_PATH - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; $DOMAIN_PATH/weblogic-deploy/bin/createDomain.sh -oracle_home $oracleHome -domain_parent $DOMAIN_PATH -domain_type WLS -model_file $DOMAIN_PATH/admin-domain.yaml" - if [[ $? != 0 ]]; then - echo "Error : Admin setup failed" - exit 1 - fi - - # For issue https://github.com/wls-eng/arm-oraclelinux-wls/issues/89 - copySerializedSystemIniFileToShare -} - -#Function to setup admin boot properties -function admin_boot_setup() -{ - echo "Creating admin boot properties" - #Create the boot.properties directory - mkdir -p "$DOMAIN_PATH/$wlsDomainName/servers/admin/security" - echo "username=$wlsUserName" > "$DOMAIN_PATH/$wlsDomainName/servers/admin/security/boot.properties" - echo "password=$wlsPassword" >> "$DOMAIN_PATH/$wlsDomainName/servers/admin/security/boot.properties" - sudo chown -R $username:$groupname $DOMAIN_PATH/$wlsDomainName/servers - } - -#This function to wait for admin server -function wait_for_admin() -{ - #wait for admin to start -count=1 -CHECK_URL="http://$wlsAdminURL/weblogic/ready" -status=`curl --insecure -ILs $CHECK_URL | tac | grep -m1 HTTP/1.1 | awk {'print $2'}` -echo "Waiting for admin server to start" -while [[ "$status" != "200" ]] -do - echo "." - count=$((count+1)) - if [ $count -le 30 ]; - then - sleep 1m - else - echo "Error : Maximum attempts exceeded while starting admin server" - exit 1 - fi - status=`curl --insecure -ILs $CHECK_URL | tac | grep -m1 HTTP/1.1 | awk {'print $2'}` - if [ "$status" == "200" ]; - then - echo "Admin Server started succesfully..." - break - fi -done -} - -# Create systemctl service for nodemanager -function create_nodemanager_service() -{ - echo "Setting CrashRecoveryEnabled true at $DOMAIN_PATH/$wlsDomainName/nodemanager/nodemanager.properties" - sed -i.bak -e 's/CrashRecoveryEnabled=false/CrashRecoveryEnabled=true/g' $DOMAIN_PATH/$wlsDomainName/nodemanager/nodemanager.properties - sed -i.bak -e 's/ListenAddress=.*/ListenAddress=/g' $DOMAIN_PATH/$wlsDomainName/nodemanager/nodemanager.properties - -if [ "${isCustomSSLEnabled}" == "true" ]; -then - echo "KeyStores=CustomIdentityAndCustomTrust" >> $DOMAIN_PATH/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomIdentityKeystoreType=${customIdentityKeyStoreType}" >> $DOMAIN_PATH/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomIdentityKeyStoreFileName=${customIdentityKeyStoreFileName}" >> $DOMAIN_PATH/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomIdentityKeyStorePassPhrase=${customIdentityKeyStorePassPhrase}" >> $DOMAIN_PATH/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomIdentityAlias=${serverPrivateKeyAlias}" >> $DOMAIN_PATH/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomIdentityPrivateKeyPassPhrase=${serverPrivateKeyPassPhrase}" >> $DOMAIN_PATH/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomTrustKeystoreType=${customTrustKeyStoreType}" >> $DOMAIN_PATH/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomTrustKeyStoreFileName=${customTrustKeyStoreFileName}" >> $DOMAIN_PATH/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomTrustKeyStorePassPhrase=${customTrustKeyStorePassPhrase}" >> $DOMAIN_PATH/$wlsDomainName/nodemanager/nodemanager.properties -fi - - if [ $? != 0 ]; - then - echo "Warning : Failed in setting option CrashRecoveryEnabled=true. Continuing without the option." - mv $DOMAIN_PATH/nodemanager/nodemanager.properties.bak $DOMAIN_PATH/$wlsDomainName/nodemanager/nodemanager.properties - fi - sudo chown -R $username:$groupname $DOMAIN_PATH/$wlsDomainName/nodemanager/nodemanager.properties* - echo "Creating NodeManager service" - # Added waiting for network-online service and restart service - cat </etc/systemd/system/wls_nodemanager.service - [Unit] -Description=WebLogic nodemanager service -After=network-online.target -Wants=network-online.target - -[Service] -Type=simple -# Note that the following three parameters should be changed to the correct paths -# on your own system -WorkingDirectory=/u01/domains -Environment="JAVA_OPTIONS=${SERVER_STARTUP_ARGS}" -ExecStart=/bin/bash $DOMAIN_PATH/$wlsDomainName/bin/startNodeManager.sh -ExecStop=/bin/bash $DOMAIN_PATH/$wlsDomainName/bin/stopNodeManager.sh -User=oracle -Group=oracle -KillMode=process -LimitNOFILE=65535 -Restart=always -RestartSec=3 - -[Install] -WantedBy=multi-user.target -EOF -} - -# This function to create adminserver service -function create_adminserver_service() -{ -# Added waiting for network-online service and restart service - echo "Creating admin server service" - cat </etc/systemd/system/wls_admin.service -[Unit] -Description=WebLogic Adminserver service -After=network-online.target -Wants=network-online.target - -[Service] -Type=simple -WorkingDirectory=/u01/domains -Environment="JAVA_OPTIONS=${SERVER_STARTUP_ARGS}" -ExecStart=/bin/bash ${startWebLogicScript} -ExecStop=/bin/bash ${stopWebLogicScript} -User=oracle -Group=oracle -KillMode=process -LimitNOFILE=65535 -Restart=always -RestartSec=3 - -[Install] -WantedBy=multi-user.target -EOF -} - -#This function to start managed server -function start_managed() -{ - echo "Starting managed server $wlsServerName" - cat <$DOMAIN_PATH/start-server.py -connect('$wlsUserName','$wlsPassword','$adminWlstURL') -try: - start('$wlsServerName', 'Server') -except: - print "Failed starting managed server $wlsServerName" - dumpStack() -disconnect() -EOF -sudo chown -R $username:$groupname $DOMAIN_PATH -runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST $DOMAIN_PATH/start-server.py" -if [[ $? != 0 ]]; then - echo "Error : Failed in starting managed server $wlsServerName" - exit 1 -fi -} - -# Create managed server setup -function create_managedSetup(){ - echo "Creating Managed Server Setup" - - sudo mkdir -p $DOMAIN_PATH - - cd $DOMAIN_PATH - - # WebLogic base images are already having weblogic-deploy, hence no need to download - if [ ! -d "$DOMAIN_PATH/weblogic-deploy" ]; - then - echo "weblogic-deploy tool not found in path $DOMAIN_PATH" - exit 1 - fi - - echo "Creating managed server model files" - create_managed_model - create_machine_model - create_ms_server_model - - echo "Completed managed server model files" - sudo chown -R $username:$groupname $DOMAIN_PATH - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; $DOMAIN_PATH/weblogic-deploy/bin/createDomain.sh -oracle_home $oracleHome -domain_parent $DOMAIN_PATH -domain_type WLS -model_file $DOMAIN_PATH/managed-domain.yaml" - if [[ $? != 0 ]]; then - echo "Error : Managed setup failed" - exit 1 - fi - wait_for_admin - - # For issue https://github.com/wls-eng/arm-oraclelinux-wls/issues/89 - getSerializedSystemIniFileFromShare - - echo "Adding machine to managed server $wlsServerName" - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST $DOMAIN_PATH/add-machine.py" - if [[ $? != 0 ]]; then - echo "Error : Adding machine for managed server $wlsServerName failed" - exit 1 - fi - echo "Adding managed server $wlsServerName" - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST $DOMAIN_PATH/add-server.py" - if [[ $? != 0 ]]; then - echo "Error : Adding server $wlsServerName failed" - exit 1 - fi -} - -function enabledAndStartNodeManagerService() -{ - sudo systemctl enable wls_nodemanager - sudo systemctl daemon-reload - - attempt=1 - while [[ $attempt -lt 6 ]] - do - echo "Starting nodemanager service attempt $attempt" - sudo systemctl start wls_nodemanager - sleep 1m - attempt=`expr $attempt + 1` - sudo systemctl status wls_nodemanager | grep running - if [[ $? == 0 ]]; - then - echo "wls_nodemanager service started successfully" - break - fi - sleep 3m - done -} - -function enableAndStartAdminServerService() -{ - sudo systemctl enable wls_admin - sudo systemctl daemon-reload - echo "Starting admin server service" - sudo systemctl start wls_admin - -} - -function updateNetworkRules() -{ - # for Oracle Linux 7.3, 7.4, iptable is not running. - if [ -z `command -v firewall-cmd` ]; then - return 0 - fi - - # for Oracle Linux 7.6, open weblogic ports - tag=$1 - if [ ${tag} == 'admin' ]; then - echo "update network rules for admin server" - sudo firewall-cmd --zone=public --add-port=$wlsAdminPort/tcp - sudo firewall-cmd --zone=public --add-port=$wlsSSLAdminPort/tcp - sudo firewall-cmd --zone=public --add-port=$wlsManagedPort/tcp - sudo firewall-cmd --zone=public --add-port=$wlsAdminT3ChannelPort/tcp - sudo firewall-cmd --zone=public --add-port=$nmPort/tcp - else - echo "update network rules for managed server" - sudo firewall-cmd --zone=public --add-port=$wlsManagedPort/tcp - sudo firewall-cmd --zone=public --add-port=$nmPort/tcp - - # open ports for coherence - sudo firewall-cmd --zone=public --add-port=$coherenceListenPort/tcp - sudo firewall-cmd --zone=public --add-port=$coherenceListenPort/udp - sudo firewall-cmd --zone=public --add-port=$coherenceLocalport-$coherenceLocalportAdjust/tcp - sudo firewall-cmd --zone=public --add-port=$coherenceLocalport-$coherenceLocalportAdjust/udp - sudo firewall-cmd --zone=public --add-port=7/tcp - fi - - sudo firewall-cmd --runtime-to-permanent - sudo systemctl restart firewalld -} - -# Mount the Azure file share on all VMs created -function mountFileShare() -{ - echo "Creating mount point" - echo "Mount point: $mountpointPath" - sudo mkdir -p $mountpointPath - if [ ! -d "/etc/smbcredentials" ]; then - sudo mkdir /etc/smbcredentials - fi - if [ ! -f "/etc/smbcredentials/${storageAccountName}.cred" ]; then - echo "Crearing smbcredentials" - echo "username=$storageAccountName >> /etc/smbcredentials/${storageAccountName}.cred" - echo "password=$storageAccountKey >> /etc/smbcredentials/${storageAccountName}.cred" - sudo bash -c "echo "username=$storageAccountName" >> /etc/smbcredentials/${storageAccountName}.cred" - sudo bash -c "echo "password=$storageAccountKey" >> /etc/smbcredentials/${storageAccountName}.cred" - fi - echo "chmod 600 /etc/smbcredentials/${storageAccountName}.cred" - sudo chmod 600 /etc/smbcredentials/${storageAccountName}.cred - echo "//${storageAccountPrivateIp}/wlsshare $mountpointPath cifs nofail,vers=2.1,credentials=/etc/smbcredentials/${storageAccountName}.cred,dir_mode=0777,file_mode=0777,serverino" - sudo bash -c "echo \"//${storageAccountPrivateIp}/wlsshare $mountpointPath cifs nofail,vers=2.1,credentials=/etc/smbcredentials/${storageAccountName}.cred,dir_mode=0777,file_mode=0777,serverino\" >> /etc/fstab" - echo "mount -t cifs //${storageAccountPrivateIp}/wlsshare $mountpointPath -o vers=2.1,credentials=/etc/smbcredentials/${storageAccountName}.cred,dir_mode=0777,file_mode=0777,serverino" - sudo mount -t cifs //${storageAccountPrivateIp}/wlsshare $mountpointPath -o vers=2.1,credentials=/etc/smbcredentials/${storageAccountName}.cred,dir_mode=0777,file_mode=0777,serverino - if [[ $? != 0 ]]; - then - echo "Failed to mount //${storageAccountPrivateIp}/wlsshare $mountpointPath" - exit 1 - fi -} - -function validateSSLKeyStores() -{ - sudo chown -R $username:$groupname $KEYSTORE_PATH - - #validate identity keystore - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; keytool -list -v -keystore $customIdentityKeyStoreFileName -storepass $customIdentityKeyStorePassPhrase -storetype $customIdentityKeyStoreType | grep 'Entry type:' | grep 'PrivateKeyEntry'" - - if [[ $? != 0 ]]; then - echo "Error : Identity Keystore Validation Failed !!" - exit 1 - fi - - # Verify Identity keystore validity period more than MIN_CERT_VALIDITY - verifyCertValidity $customIdentityKeyStoreFileName $customIdentityKeyStorePassPhrase $CURRENT_DATE $MIN_CERT_VALIDITY $customIdentityKeyStoreType - - #validate Trust keystore - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; keytool -list -v -keystore $customTrustKeyStoreFileName -storepass $customTrustKeyStorePassPhrase -storetype $customTrustKeyStoreType | grep 'Entry type:' | grep 'trustedCertEntry'" - - if [[ $? != 0 ]]; then - echo "Error : Trust Keystore Validation Failed !!" - exit 1 - fi - - # Verify Identity keystore validity period more than MIN_CERT_VALIDITY - verifyCertValidity $customTrustKeyStoreFileName $customTrustKeyStorePassPhrase $CURRENT_DATE $MIN_CERT_VALIDITY $customTrustKeyStoreType - - echo "ValidateSSLKeyStores Successfull !!" -} - -function storeCustomSSLCerts() -{ - if [ "${isCustomSSLEnabled}" == "true" ]; - then - - mkdir -p $KEYSTORE_PATH - - echo "Custom SSL is enabled. Storing CertInfo as files..." - customIdentityKeyStoreFileName="$KEYSTORE_PATH/identity.keystore" - customTrustKeyStoreFileName="$KEYSTORE_PATH/trust.keystore" - - customIdentityKeyStoreData=$(echo "$customIdentityKeyStoreData" | base64 --decode) - customIdentityKeyStorePassPhrase=$(echo "$customIdentityKeyStorePassPhrase" | base64 --decode) - customIdentityKeyStoreType=$(echo "$customIdentityKeyStoreType" | base64 --decode) - - customTrustKeyStoreData=$(echo "$customTrustKeyStoreData" | base64 --decode) - customTrustKeyStorePassPhrase=$(echo "$customTrustKeyStorePassPhrase" | base64 --decode) - customTrustKeyStoreType=$(echo "$customTrustKeyStoreType" | base64 --decode) - - serverPrivateKeyAlias=$(echo "$serverPrivateKeyAlias" | base64 --decode) - serverPrivateKeyPassPhrase=$(echo "$serverPrivateKeyPassPhrase" | base64 --decode) - - #decode cert data once again as it would got base64 encoded while storing in azure keyvault - echo "$customIdentityKeyStoreData" | base64 --decode > $customIdentityKeyStoreFileName - echo "$customTrustKeyStoreData" | base64 --decode > $customTrustKeyStoreFileName - - validateSSLKeyStores - - else - echo "Custom SSL is not enabled" - fi -} - -# Copy SerializedSystemIni.dat file from admin server vm to share point -function copySerializedSystemIniFileToShare() -{ - runuser -l oracle -c "cp ${DOMAIN_PATH}/${wlsDomainName}/security/SerializedSystemIni.dat ${mountpointPath}/." - ls -lt ${mountpointPath}/SerializedSystemIni.dat - if [[ $? != 0 ]]; - then - echo "Failed to copy ${DOMAIN_PATH}/${wlsDomainName}/security/SerializedSystemIni.dat" - exit 1 - fi -} - -# Get SerializedSystemIni.dat file from share point to managed server vm -function getSerializedSystemIniFileFromShare() -{ - runuser -l oracle -c "mv ${DOMAIN_PATH}/${wlsDomainName}/security/SerializedSystemIni.dat ${DOMAIN_PATH}/${wlsDomainName}/security/SerializedSystemIni.dat.backup" - runuser -l oracle -c "cp ${mountpointPath}/SerializedSystemIni.dat ${DOMAIN_PATH}/${wlsDomainName}/security/." - ls -lt ${DOMAIN_PATH}/${wlsDomainName}/security/SerializedSystemIni.dat - if [[ $? != 0 ]]; - then - echo "Failed to get ${mountpointPath}/SerializedSystemIni.dat" - exit 1 - fi - runuser -l oracle -c "chmod 640 ${DOMAIN_PATH}/${wlsDomainName}/security/SerializedSystemIni.dat" -} - - -# Create custom stopWebLogic script and add it to wls_admin service -# This script is created as stopWebLogic.sh will not work if non ssl admin listening port 7001 is disabled -# Refer https://github.com/wls-eng/arm-oraclelinux-wls/issues/164 -function createStopWebLogicScript() -{ - -cat <${stopWebLogicScript} -#!/bin/sh -# This is custom script for stopping weblogic server using ADMIN_URL supplied -ADMIN_URL="t3://${wlsAdminURL}" -${DOMAIN_PATH}/${wlsDomainName}/bin/stopWebLogic.sh -EOF - -sudo chown -R $username:$groupname ${stopWebLogicScript} -sudo chmod -R 750 ${stopWebLogicScript} - -} - -#this function set the umask 027 (chmod 740) as required by WebLogic security checks -function setUMaskForSecurityDir() -{ - echo "setting umask 027 (chmod 740) for domain/$wlsServerName security directory" - - if [ -f "$DOMAIN_PATH/$wlsDomainName/servers/$wlsServerName/security/boot.properties" ]; - then - runuser -l oracle -c "chmod 740 $DOMAIN_PATH/$wlsDomainName/servers/$wlsServerName/security/boot.properties" - fi - - if [ -d "$DOMAIN_PATH/$wlsDomainName/servers/$wlsServerName/security" ]; - then - runuser -l oracle -c "chmod 740 $DOMAIN_PATH/$wlsDomainName/servers/$wlsServerName/security" - fi -} - -#this function checks if remote Anonymous T3/RMI Attributes are available as part of domain security configuration -function containsRemoteAnonymousT3RMIIAttribs() -{ - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; $DOMAIN_PATH/weblogic-deploy/bin/modelHelp.sh -oracle_home $oracleHome topology:/SecurityConfiguration | grep RemoteAnonymousRmiiiopEnabled" >> /dev/null - - result1=$? - - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; $DOMAIN_PATH/weblogic-deploy/bin/modelHelp.sh -oracle_home $oracleHome topology:/SecurityConfiguration | grep RemoteAnonymousRmit3Enabled" >> /dev/null - - result2=$? - - if [ $result1 == 0 ] && [ $result2 == 0 ]; then - echo "true" - else - echo "false" - fi -} - - -function generateCustomHostNameVerifier() -{ - mkdir -p ${CUSTOM_HOSTNAME_VERIFIER_HOME} - mkdir -p ${CUSTOM_HOSTNAME_VERIFIER_HOME}/src/main/java - mkdir -p ${CUSTOM_HOSTNAME_VERIFIER_HOME}/src/test/java - cp ${BASE_DIR}/generateCustomHostNameVerifier.sh ${CUSTOM_HOSTNAME_VERIFIER_HOME}/generateCustomHostNameVerifier.sh - cp ${BASE_DIR}/WebLogicCustomHostNameVerifier.java ${CUSTOM_HOSTNAME_VERIFIER_HOME}/src/main/java/WebLogicCustomHostNameVerifier.java - cp ${BASE_DIR}/HostNameValuesTemplate.txt ${CUSTOM_HOSTNAME_VERIFIER_HOME}/src/main/java/HostNameValuesTemplate.txt - cp ${BASE_DIR}/WebLogicCustomHostNameVerifierTest.java ${CUSTOM_HOSTNAME_VERIFIER_HOME}/src/test/java/WebLogicCustomHostNameVerifierTest.java - chown -R $username:$groupname ${CUSTOM_HOSTNAME_VERIFIER_HOME} - chmod +x ${CUSTOM_HOSTNAME_VERIFIER_HOME}/generateCustomHostNameVerifier.sh - - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; ${CUSTOM_HOSTNAME_VERIFIER_HOME}/generateCustomHostNameVerifier.sh ${wlsAdminHost} ${customDNSNameForAdminServer} ${customDNSNameForAdminServer} ${dnsLabelPrefix} ${wlsDomainName} ${location}" -} - -function copyCustomHostNameVerifierJarsToWebLogicClasspath() -{ - runuser -l oracle -c "cp ${CUSTOM_HOSTNAME_VERIFIER_HOME}/output/*.jar $oracleHome/wlserver/server/lib/;" - - echo "Modify WLS CLASSPATH to include hostname verifier jars...." - sed -i 's;^WEBLOGIC_CLASSPATH="${WL_HOME}/server/lib/postgresql.*;&\nWEBLOGIC_CLASSPATH="${WL_HOME}/server/lib/hostnamevalues.jar:${WL_HOME}/server/lib/weblogicustomhostnameverifier.jar:${WEBLOGIC_CLASSPATH}";' $oracleHome/oracle_common/common/bin/commExtEnv.sh - echo "Modified WLS CLASSPATH to include hostname verifier jars." -} - - -function configureCustomHostNameVerifier() -{ - echo "configureCustomHostNameVerifier for domain $wlsDomainName for server $wlsServerName" - cat <$DOMAIN_PATH/configureCustomHostNameVerifier.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -try: - edit("$wlsServerName") - startEdit() - - cd('/Servers/$wlsServerName/SSL/$wlsServerName') - cmo.setHostnameVerifier('com.oracle.azure.weblogic.security.util.WebLogicCustomHostNameVerifier') - cmo.setHostnameVerificationIgnored(false) - cmo.setTwoWaySSLEnabled(false) - cmo.setClientCertificateEnforced(false) - - save() - activate() -except Exception,e: - print e - print "Failed to configureCustomHostNameVerifier for domain $wlsDomainName" - dumpStack() - raise Exception('Failed to configureCustomHostNameVerifier for domain $wlsDomainName') -disconnect() -EOF -sudo chown -R $username:$groupname $DOMAIN_PATH -runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST $DOMAIN_PATH/configureCustomHostNameVerifier.py" -if [[ $? != 0 ]]; then - echo "Error : Failed to configureCustomHostNameVerifier for domain $wlsDomainName" - exit 1 -fi - -} - -function restartAdminServer() -{ - echo "Stopping WebLogic Admin Server..." - systemctl stop wls_admin - sleep 2m - systemctl start wls_admin - echo "Starting WebLogic Admin Server..." -} - -#main script starts here - -CURR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -BASE_DIR="$(readlink -f ${CURR_DIR})" - -# Used for certificate expiry validation -CURRENT_DATE=`date +%s` -# Supplied certificate to have minimum days validity for the deployment -# In this case set for 1 day -MIN_CERT_VALIDITY="1" - -#read arguments from stdin -read wlsDomainName wlsUserName wlsPassword wlsServerName wlsAdminHost oracleHome storageAccountName storageAccountKey mountpointPath isHTTPAdminListenPortEnabled isCustomSSLEnabled customDNSNameForAdminServer dnsLabelPrefix location virtualNetworkNewOrExisting storageAccountPrivateIp customIdentityKeyStoreData customIdentityKeyStorePassPhrase customIdentityKeyStoreType customTrustKeyStoreData customTrustKeyStorePassPhrase customTrustKeyStoreType serverPrivateKeyAlias serverPrivateKeyPassPhrase - -isHTTPAdminListenPortEnabled="${isHTTPAdminListenPortEnabled,,}" -isCustomSSLEnabled="${isCustomSSLEnabled,,}" - -if [ "${isCustomSSLEnabled}" != "true" ]; -then - isCustomSSLEnabled="false" -fi - -validateInput - -coherenceListenPort=7574 -coherenceLocalport=42000 -coherenceLocalportAdjust=42200 -wlsAdminPort=7001 -wlsSSLAdminPort=7002 -wlsAdminT3ChannelPort=7005 -wlsManagedPort=8001 - -DOMAIN_PATH="/u01/domains" -CUSTOM_HOSTNAME_VERIFIER_HOME="/u01/app/custom-hostname-verifier" -startWebLogicScript="${DOMAIN_PATH}/${wlsDomainName}/startWebLogic.sh" -stopWebLogicScript="${DOMAIN_PATH}/${wlsDomainName}/bin/customStopWebLogic.sh" -SERVER_STARTUP_ARGS="-Dlog4j2.formatMsgNoLookups=true" - -wlsAdminURL="$wlsAdminHost:$wlsAdminT3ChannelPort" -SERVER_START_URL="http://$wlsAdminURL" - -KEYSTORE_PATH="${DOMAIN_PATH}/${wlsDomainName}/keystores" - -if [ "${isCustomSSLEnabled}" == "true" ]; -then - SERVER_START_URL="https://$wlsAdminHost:$wlsSSLAdminPort" -fi - -CHECK_URL="http://$wlsAdminURL/weblogic/ready" -adminWlstURL="t3://$wlsAdminURL" - -wlsClusterName="cluster1" -nmHost=`hostname` -nmPort=5556 - -SCRIPT_PWD=`pwd` -username="oracle" -groupname="oracle" - -cleanup - -# Executing this function first just to make sure certificate errors are first caught -storeCustomSSLCerts - -installUtilities -mountFileShare - -if [ $wlsServerName == "admin" ]; -then - updateNetworkRules "admin" - create_adminSetup - createStopWebLogicScript - create_nodemanager_service - admin_boot_setup - generateCustomHostNameVerifier - copyCustomHostNameVerifierJarsToWebLogicClasspath - setUMaskForSecurityDir - create_adminserver_service - enabledAndStartNodeManagerService - enableAndStartAdminServerService - wait_for_admin - configureCustomHostNameVerifier -else - wait_for_admin - updateNetworkRules "managed" - create_managedSetup - generateCustomHostNameVerifier - copyCustomHostNameVerifierJarsToWebLogicClasspath - setUMaskForSecurityDir - create_nodemanager_service - enabledAndStartNodeManagerService - wait_for_admin - configureCustomHostNameVerifier - start_managed -fi - -cleanup diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/scripts/setupCoherence.sh b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/scripts/setupCoherence.sh deleted file mode 100644 index 5e3bcfc77..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/scripts/setupCoherence.sh +++ /dev/null @@ -1,824 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# Description -# This script is to configure Coherence cluster/servers for WebLogic cluster domain. - - -#Function to output message to StdErr -function echo_stderr() { - echo "$@" >&2 -} - -#Function to display usage message -function usage() { - echo_stderr "./setupCoherence.sh <<< \"\"" -} - -function installUtilities() { - echo "Installing zip unzip wget vnc-server rng-tools cifs-utils" - sudo yum install -y zip unzip wget vnc-server rng-tools cifs-utils - - #Setting up rngd utils - attempt=1 - while [[ $attempt -lt 4 ]]; do - echo "Starting rngd service attempt $attempt" - sudo systemctl start rngd - attempt=$(expr $attempt + 1) - sudo systemctl status rngd | grep running - if [[ $? == 0 ]]; then - echo "rngd utility service started successfully" - break - fi - sleep 1m - done -} - -function validateInput() { - if [ -z "$wlsDomainName" ]; then - echo_stderr "wlsDomainName is required. " - fi - - if [[ -z "$wlsUserName" || -z "$wlsPassword" ]]; then - echo_stderr "wlsUserName or wlsPassword is required. " - exit 1 - fi - - if [ -z "$wlsServerName" ]; then - echo_stderr "wlsServerName is required. " - fi - - if [ -z "$adminVMName" ]; then - echo_stderr "adminVMName is required. " - fi - - if [ -z "$oracleHome" ]; then - echo_stderr "oracleHome is required. " - fi - - if [ -z "$wlsDomainPath" ]; then - echo_stderr "wlsDomainPath is required. " - fi - - if [ -z "$storageAccountName" ]; then - echo_stderr "storageAccountName is required. " - fi - - if [ -z "$storageAccountKey" ]; then - echo_stderr "storageAccountKey is required. " - fi - - if [ -z "$mountpointPath" ]; then - echo_stderr "mountpointPath is required. " - fi - - if [ -z "$enableWebLocalStorage" ]; then - echo_stderr "enableWebLocalStorage is required. " - fi - - if [ -z "$serverIndex" ]; then - echo_stderr "serverIndex is required. " - fi - - if [ -z "$managedServerPrefix" ]; then - echo_stderr "managedServerPrefix is required. " - fi - - if [ "${isCustomSSLEnabled}" != "true" ]; - then - echo_stderr "Custom SSL value is not provided. Defaulting to false" - isCustomSSLEnabled="false" - else - if [ -z "$customIdentityKeyStoreData" ] || [ -z "$customIdentityKeyStorePassPhrase" ] || - [ -z "$customIdentityKeyStoreType" ] || [ -z "$customTrustKeyStoreData" ] || - [ -z "$customTrustKeyStorePassPhrase" ] || [ -z "$customTrustKeyStoreType" ] || - [ -z "$serverPrivateKeyAlias" ] || [ -z "$serverPrivateKeyPassPhrase" ]; - then - echo "One of the required values for enabling Custom SSL \ - (CustomKeyIdentityKeyStoreData,CustomKeyIdentityKeyStorePassPhrase,CustomKeyIdentityKeyStoreType,CustomKeyTrustKeyStoreData,CustomKeyTrustKeyStorePassPhrase,CustomKeyTrustKeyStoreType) \ - has not been provided." - exit 1 - fi - fi -} - -# This function verifies whether certificate is valid and not expired -function verifyCertValidity() -{ - KEYSTORE=$1 - PASSWORD=$2 - CURRENT_DATE=$3 - MIN_CERT_VALIDITY=$4 - KEY_STORE_TYPE=$5 - VALIDITY=$(($CURRENT_DATE + ($MIN_CERT_VALIDITY*24*60*60))) - - echo "Verifying $KEYSTORE is valid at least $MIN_CERT_VALIDITY day from the deployment time" - - if [ $VALIDITY -le $CURRENT_DATE ]; - then - echo "Error : Invalid minimum validity days supplied" - exit 1 - fi - - # Check whether KEYSTORE supplied can be opened for reading - # Redirecting as no need to display the contents - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; keytool -list -v -keystore $KEYSTORE -storepass $PASSWORD -storetype $KEY_STORE_TYPE > /dev/null 2>&1" - if [ $? != 0 ]; - then - echo "Error opening the keystore : $KEYSTORE" - exit 1 - fi - - aliasList=`runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; keytool -list -v -keystore $KEYSTORE -storepass $PASSWORD -storetype $KEY_STORE_TYPE | grep Alias" |awk '{print $3}'` - if [[ -z $aliasList ]]; - then - echo "Error : No alias found in supplied certificate" - exit 1 - fi - - for alias in $aliasList - do - VALIDITY_PERIOD=`runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; keytool -list -v -keystore $KEYSTORE -storepass $PASSWORD -storetype $KEY_STORE_TYPE -alias $alias | grep Valid"` - echo "$KEYSTORE is \"$VALIDITY_PERIOD\"" - CERT_UNTIL_DATE=`echo $VALIDITY_PERIOD | awk -F'until:|\r' '{print $2}'` - CERT_UNTIL_SECONDS=`date -d "$CERT_UNTIL_DATE" +%s` - VALIDITY_REMIANS_SECONDS=`expr $CERT_UNTIL_SECONDS - $VALIDITY` - if [[ $VALIDITY_REMIANS_SECONDS -le 0 ]]; - then - echo "Error : Supplied certificate is either expired or expiring soon within $MIN_CERT_VALIDITY day" - exit 1 - fi - done - echo "$KEYSTORE validation is successful" -} - -#run on admin server -#create coherence cluster -#associate cluster1 with the coherence cluster -#create cluter storage1 and enable local storage -#associate storage1 with the coherence cluster -function createCoherenceCluster() { - cat <$wlsDomainPath/configure-coherence-cluster.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -try: - edit() - startEdit(60000,60000,'true') - cd('/') - cmo.createCoherenceClusterSystemResource('${coherenceClusterName}') - Thread.sleep(100) - - cd('/CoherenceClusterSystemResources/${coherenceClusterName}/CoherenceClusterResource/${coherenceClusterName}/CoherenceClusterParams/${coherenceClusterName}') - cmo.setClusteringMode('unicast') - cmo.setClusterListenPort(${coherenceListenPort}) - - cd('/') - cmo.createCluster('${storageClusterName}') - Thread.sleep(100) - - cd('/Clusters/${storageClusterName}') - cmo.setClusterMessagingMode('unicast') - cmo.setCoherenceClusterSystemResource(getMBean('/CoherenceClusterSystemResources/${coherenceClusterName}')) - - cd('/Clusters/${clientClusterName}') - cmo.setCoherenceClusterSystemResource(getMBean('/CoherenceClusterSystemResources/${coherenceClusterName}')) - - cd('/CoherenceClusterSystemResources/${coherenceClusterName}') - cmo.addTarget(getMBean('/Clusters/${storageClusterName}')) - cmo.addTarget(getMBean('/Clusters/${clientClusterName}')) - - cd('/Clusters/${storageClusterName}/CoherenceTier/${storageClusterName}') - cmo.setCoherenceWebLocalStorageEnabled(${enableWebLocalStorage}) - cmo.setLocalStorageEnabled(true) - - cd('/Clusters/${clientClusterName}/CoherenceTier/${clientClusterName}') - cmo.setLocalStorageEnabled(false) - - save() - activate() -except: - print e - dumpStack() - stopEdit('y') - sys.exit(1) - -disconnect() -sys.exit(0) -EOF - - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST $wlsDomainPath/configure-coherence-cluster.py" - if [[ $? != 0 ]]; then - echo "Error : Create coherence cluster ${coherenceClusterName} failed" - exit 1 - fi -} - -#Creates weblogic deployment model for cluster domain managed server -function create_managed_model() { - echo "Creating admin domain model" - cat <$wlsDomainPath/managed-domain.yaml -domainInfo: - AdminUserName: "$wlsUserName" - AdminPassword: "$wlsPassword" - ServerStartMode: prod -topology: - Name: "$wlsDomainName" - Machine: - '$nmHost': - NodeManager: - ListenAddress: "$nmHost" - ListenPort: $nmPort - NMType : ssl - Cluster: - '$storageClusterName': - MigrationBasis: 'database' - Server: - '$wlsServerName' : - ListenPort: $storageListenPort - Notes: "$wlsServerName managed server" - Cluster: "$storageClusterName" - Machine: "$nmHost" - ServerStart: - Arguments: '${SERVER_STARTUP_ARGS}' -EOF - - if [ "${isCustomSSLEnabled}" == "true" ]; - then -cat <>$wlsDomainPath/managed-domain.yaml - KeyStores: 'CustomIdentityAndCustomTrust' - CustomIdentityKeyStoreFileName: "$customIdentityKeyStoreFileName" - CustomIdentityKeyStoreType: "$customIdentityKeyStoreType" - CustomIdentityKeyStorePassPhraseEncrypted: "$customIdentityKeyStorePassPhrase" - CustomTrustKeyStoreFileName: "$customTrustKeyStoreFileName" - CustomTrustKeyStoreType: "$customTrustKeyStoreType" - CustomTrustKeyStorePassPhraseEncrypted: "$customTrustKeyStorePassPhrase" -EOF - fi - -cat <>$wlsDomainPath/managed-domain.yaml - SSL: - HostnameVerificationIgnored: true - HostnameVerifier: 'None' -EOF - - if [ "${isCustomSSLEnabled}" == "true" ]; - then -cat <>$wlsDomainPath/managed-domain.yaml - ServerPrivateKeyAlias: "$serverPrivateKeyAlias" - ServerPrivateKeyPassPhraseEncrypted: "$serverPrivateKeyPassPhrase" -EOF - fi - -cat <>$wlsDomainPath/managed-domain.yaml - SecurityConfiguration: - NodeManagerUsername: "$wlsUserName" - NodeManagerPasswordEncrypted: "$wlsPassword" -EOF -} - -#This function to add machine for a given managed server -function create_machine_model() { - echo "Creating machine name model for managed server $wlsServerName" - cat <$wlsDomainPath/add-machine.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -edit("$wlsServerName") -startEdit(60000,60000,'true') -cd('/') -cmo.createMachine('$nmHost') -Thread.sleep(100) -cd('/Machines/$nmHost/NodeManager/$nmHost') -cmo.setListenPort(int($nmPort)) -cmo.setListenAddress('$nmHost') -cmo.setNMType('ssl') -save() -resolve() -activate() -destroyEditSession("$wlsServerName") -disconnect() -EOF -} - -#This function to add managed serverto admin node -function create_ms_server_model() { - echo "Creating managed server $wlsServerName model" - cat <$wlsDomainPath/add-server.py - -isCustomSSLEnabled='${isCustomSSLEnabled}' -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -edit("$wlsServerName") -startEdit(60000,60000,'true') -cd('/') -cmo.createServer('$wlsServerName') -Thread.sleep(100) -cd('/Servers/$wlsServerName') -cmo.setMachine(getMBean('/Machines/$nmHost')) -cmo.setCluster(getMBean('/Clusters/$storageClusterName')) -cmo.setListenAddress('$nmHost') -cmo.setListenPort(int($storageListenPort)) -cmo.setListenPortEnabled(true) - -if isCustomSSLEnabled == 'true' : - cmo.setKeyStores('CustomIdentityAndCustomTrust') - cmo.setCustomIdentityKeyStoreFileName('$customIdentityKeyStoreFileName') - cmo.setCustomIdentityKeyStoreType('$customIdentityKeyStoreType') - set('CustomIdentityKeyStorePassPhrase', '$customIdentityKeyStorePassPhrase') - cmo.setCustomTrustKeyStoreFileName('$customTrustKeyStoreFileName') - cmo.setCustomTrustKeyStoreType('$customTrustKeyStoreType') - set('CustomTrustKeyStorePassPhrase', '$customTrustKeyStorePassPhrase') - -cd('/Servers/$wlsServerName/SSL/$wlsServerName') -cmo.setServerPrivateKeyAlias('$serverPrivateKeyAlias') -set('ServerPrivateKeyPassPhrase', '$serverPrivateKeyPassPhrase') -cmo.setHostnameVerificationIgnored(true) - -cd('/Servers/$wlsServerName/ServerStart/$wlsServerName') -arguments = '${SERVER_STARTUP_ARGS} -Dweblogic.Name=$wlsServerName -Dweblogic.management.server=http://$wlsAdminURL ${wlsCoherenceArgs}' -oldArgs = cmo.getArguments() -if oldArgs != None: - newArgs = oldArgs + ' ' + arguments -else: - newArgs = arguments -cmo.setArguments(newArgs) -save() -resolve() -activate() -destroyEditSession("$wlsServerName") -nmEnroll('$wlsDomainPath/$wlsDomainName','$wlsDomainPath/$wlsDomainName/nodemanager') -nmGenBootStartupProps('$wlsServerName') -disconnect() -EOF -} - -#This function to check admin server status -function wait_for_admin() { - #check admin server status - count=1 - CHECK_URL="http://$wlsAdminURL/weblogic/ready" - status=$(curl --insecure -ILs $CHECK_URL | tac | grep -m1 HTTP/1.1 | awk {'print $2'}) - echo "Check admin server status" - while [[ "$status" != "200" ]]; do - echo "." - count=$((count + 1)) - if [ $count -le 30 ]; then - sleep 1m - else - echo "Error : Maximum attempts exceeded while checking admin server status" - exit 1 - fi - status=$(curl --insecure -ILs $CHECK_URL | tac | grep -m1 HTTP/1.1 | awk {'print $2'}) - if [ "$status" == "200" ]; then - echo "WebLogic Server is running..." - break - fi - done -} - -# Create systemctl service for nodemanager -function createNodeManagerService() { - echo "Setting CrashRecoveryEnabled true at $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties" - sed -i.bak -e 's/CrashRecoveryEnabled=false/CrashRecoveryEnabled=true/g' $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - if [ $? != 0 ]; then - echo "Warning : Failed in setting option CrashRecoveryEnabled=true. Continuing without the option." - mv $wlsDomainPath/nodemanager/nodemanager.properties.bak $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - fi - - if [ "${isCustomSSLEnabled}" == "true" ]; - then - echo "KeyStores=CustomIdentityAndCustomTrust" >> $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomIdentityKeystoreType=${customIdentityKeyStoreType}" >> $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomIdentityKeyStoreFileName=${customIdentityKeyStoreFileName}" >> $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomIdentityKeyStorePassPhrase=${customIdentityKeyStorePassPhrase}" >> $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomIdentityAlias=${serverPrivateKeyAlias}" >> $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomIdentityPrivateKeyPassPhrase=${serverPrivateKeyPassPhrase}" >> $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomTrustKeystoreType=${customTrustKeyStoreType}" >> $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomTrustKeyStoreFileName=${customTrustKeyStoreFileName}" >> $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomTrustKeyStorePassPhrase=${customTrustKeyStorePassPhrase}" >> $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - fi - - sudo chown -R $username:$groupname $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties* - echo "Creating NodeManager service" - # Added waiting for network-online service and restart service - cat </etc/systemd/system/wls_nodemanager.service -[Unit] -Description=WebLogic nodemanager service -After=network-online.target -Wants=network-online.target - -[Service] -Type=simple -# Note that the following three parameters should be changed to the correct paths -# on your own system -WorkingDirectory=/u01/domains -Environment="JAVA_OPTIONS=${SERVER_STARTUP_ARGS}" -ExecStart=/bin/bash $wlsDomainPath/$wlsDomainName/bin/startNodeManager.sh -ExecStop=/bin/bash $wlsDomainPath/$wlsDomainName/bin/stopNodeManager.sh -User=oracle -Group=oracle -KillMode=process -LimitNOFILE=65535 -Restart=always -RestartSec=3 - -[Install] -WantedBy=multi-user.target -EOF -} - -#This function to start managed server -function startManagedServer() { - echo "Starting managed server $wlsServerName" - cat <$wlsDomainPath/start-server.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -try: - start('$wlsServerName', 'Server') -except: - print "Failed starting managed server $wlsServerName" - dumpStack() -disconnect() -EOF - sudo chown -R $username:$groupname $wlsDomainPath - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST $wlsDomainPath/start-server.py" - if [[ $? != 0 ]]; then - echo "Error : Failed in starting managed server $wlsServerName" - exit 1 - fi -} - -function restartManagedServers() { - echo "Restart managed servers" - cat <$wlsDomainPath/restart-managedServer.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -servers=cmo.getServers() -try: - edit("$nmHost") - startEdit(60000,60000,'true') - for server in servers: - if (server.getCluster()!=None and server.getCluster().getName()=='${clientClusterName}'): - cd('/Servers/'+server.getName()+'//ServerStart/'+server.getName()) - arguments = cmo.getArguments() - arguments = arguments + ' ' + '${wlsCoherenceArgs}' - cmo.setArguments(arguments) - save() - activate() -except Exception, e: - e.printStackTrace() - dumpStack() - undo('true',defaultAnswer='y') - cancelEdit('y') - destroyEditSession("$nmHost",force = true) - raise("Set coherence port range failed") - -domainRuntime() -print "Restart the servers which are in RUNNING status" -for server in servers: - bean="/ServerLifeCycleRuntimes/"+server.getName() - serverbean=getMBean(bean) - if (server.getCluster()!=None and server.getCluster().getName()=='${clientClusterName}' and serverbean.getState() in ("RUNNING")): - try: - print "Stop the Server ",server.getName() - shutdown(server.getName(),server.getType(),ignoreSessions='true',force='true') - print "Start the Server ",server.getName() - start(server.getName(),server.getType()) - except: - print "Failed restarting managed server ", server.getName() - dumpStack() -serverConfig() -disconnect() -EOF - sudo chown -R $username:$groupname $wlsDomainPath - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST $wlsDomainPath/restart-managedServer.py" - - if [[ $? != 0 ]]; then - echo "Error : Fail to restart managed server to sync up coherence configuration." - exit 1 - fi -} - -# Create managed server setup -function createManagedSetup() { - echo "Creating Managed Server Setup" - cd $wlsDomainPath - - # WebLogic base images are already having weblogic-deploy, hence no need to download - if [ ! -d "$wlsDomainPath/weblogic-deploy" ]; - then - echo "weblogic-deploy tool not found in path $wlsDomainPath" - exit 1 - fi - - echo "Creating managed server model files" - create_managed_model - create_machine_model - create_ms_server_model - echo "Completed managed server model files" - sudo chown -R $username:$groupname $wlsDomainPath - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; $wlsDomainPath/weblogic-deploy/bin/createDomain.sh -oracle_home $oracleHome -domain_parent $wlsDomainPath -domain_type WLS -model_file $wlsDomainPath/managed-domain.yaml" - if [[ $? != 0 ]]; then - echo "Error : Managed setup failed" - exit 1 - fi - wait_for_admin - - # For issue https://github.com/wls-eng/arm-oraclelinux-wls/issues/89 - getSerializedSystemIniFileFromShare - - echo "Adding machine to managed server $wlsServerName" - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST $wlsDomainPath/add-machine.py" - if [[ $? != 0 ]]; then - echo "Error : Adding machine for managed server $wlsServerName failed" - exit 1 - fi - echo "Adding managed server $wlsServerName" - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST $wlsDomainPath/add-server.py" - if [[ $? != 0 ]]; then - echo "Error : Adding server $wlsServerName failed" - exit 1 - fi -} - -function enabledAndStartNodeManagerService() { - sudo systemctl enable wls_nodemanager - sudo systemctl daemon-reload - attempt=1 - while [[ $attempt -lt 6 ]]; do - echo "Starting nodemanager service attempt $attempt" - sudo systemctl start wls_nodemanager - attempt=$(expr $attempt + 1) - sudo systemctl status wls_nodemanager | grep running - if [[ $? == 0 ]]; then - echo "wls_nodemanager service started successfully" - break - fi - sleep 3m - done -} - -function cleanup() { - echo "Cleaning up temporary files..." - rm -rf $wlsDomainPath/managed-domain.yaml - rm -rf $wlsDomainPath/*.py - rm -rf ${CUSTOM_HOSTNAME_VERIFIER_HOME} - echo "Cleanup completed." -} - -function openManagedServerPorts() { - # for Oracle Linux 7.3, 7.4, iptable is not running. - if [ -z $(command -v firewall-cmd) ]; then - return 0 - fi - - # for Oracle Linux 7.6, open weblogic ports - echo "update network rules for managed server" - sudo firewall-cmd --zone=public --add-port=$coherenceListenPort/tcp - sudo firewall-cmd --zone=public --add-port=$coherenceListenPort/udp - sudo firewall-cmd --zone=public --add-port=$storageListenPort/tcp - - sudo firewall-cmd --zone=public --add-port=$coherenceLocalport-$coherenceLocalportAdjust/tcp - sudo firewall-cmd --zone=public --add-port=$coherenceLocalport-$coherenceLocalportAdjust/udp - # Coherence TcpRing/IpMonitor port 7 - sudo firewall-cmd --zone=public --add-port=7/tcp - sudo firewall-cmd --zone=public --add-port=$nmPort/tcp - - sudo firewall-cmd --runtime-to-permanent - sudo systemctl restart firewalld -} - -# Mount the Azure file share on all VMs created -function mountFileShare() { - echo "Creating mount point" - echo "Mount point: $mountpointPath" - sudo mkdir -p $mountpointPath - if [ ! -d "/etc/smbcredentials" ]; then - sudo mkdir /etc/smbcredentials - fi - if [ ! -f "/etc/smbcredentials/${storageAccountName}.cred" ]; then - echo "Crearing smbcredentials" - echo "username=$storageAccountName >> /etc/smbcredentials/${storageAccountName}.cred" - echo "password=$storageAccountKey >> /etc/smbcredentials/${storageAccountName}.cred" - sudo bash -c "echo "username=$storageAccountName" >> /etc/smbcredentials/${storageAccountName}.cred" - sudo bash -c "echo "password=$storageAccountKey" >> /etc/smbcredentials/${storageAccountName}.cred" - fi - echo "chmod 600 /etc/smbcredentials/${storageAccountName}.cred" - sudo chmod 600 /etc/smbcredentials/${storageAccountName}.cred - echo "//${storageAccountName}.file.core.windows.net/wlsshare $mountpointPath cifs nofail,vers=2.1,credentials=/etc/smbcredentials/${storageAccountName}.cred,dir_mode=0777,file_mode=0777,serverino" - sudo bash -c "echo \"//${storageAccountName}.file.core.windows.net/wlsshare $mountpointPath cifs nofail,vers=2.1,credentials=/etc/smbcredentials/${storageAccountName}.cred,dir_mode=0777,file_mode=0777,serverino\" >> /etc/fstab" - echo "mount -t cifs //${storageAccountName}.file.core.windows.net/wlsshare $mountpointPath -o vers=2.1,credentials=/etc/smbcredentials/${storageAccountName}.cred,dir_mode=0777,file_mode=0777,serverino" - sudo mount -t cifs //${storageAccountName}.file.core.windows.net/wlsshare $mountpointPath -o vers=2.1,credentials=/etc/smbcredentials/${storageAccountName}.cred,dir_mode=0777,file_mode=0777,serverino - if [[ $? != 0 ]]; then - echo "Failed to mount //${storageAccountName}.file.core.windows.net/wlsshare $mountpointPath" - exit 1 - fi -} - -# Get SerializedSystemIni.dat file from share point to managed server vm -function getSerializedSystemIniFileFromShare() { - runuser -l oracle -c "mv ${wlsDomainPath}/${wlsDomainName}/security/SerializedSystemIni.dat ${wlsDomainPath}/${wlsDomainName}/security/SerializedSystemIni.dat.backup" - runuser -l oracle -c "cp ${mountpointPath}/SerializedSystemIni.dat ${wlsDomainPath}/${wlsDomainName}/security/." - ls -lt ${wlsDomainPath}/${wlsDomainName}/security/SerializedSystemIni.dat - if [[ $? != 0 ]]; then - echo "Failed to get ${mountpointPath}/SerializedSystemIni.dat" - exit 1 - fi - runuser -l oracle -c "chmod 640 ${wlsDomainPath}/${wlsDomainName}/security/SerializedSystemIni.dat" -} - -function validateSSLKeyStores() -{ - sudo chown -R $username:$groupname $KEYSTORE_PATH - - #validate identity keystore - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; keytool -list -v -keystore $customIdentityKeyStoreFileName -storepass $customIdentityKeyStorePassPhrase -storetype $customIdentityKeyStoreType | grep 'Entry type:' | grep 'PrivateKeyEntry'" - - if [[ $? != 0 ]]; then - echo "Error : Identity Keystore Validation Failed !!" - exit 1 - fi - - # Verify Identity keystore validity period more than MIN_CERT_VALIDITY - verifyCertValidity $customIdentityKeyStoreFileName $customIdentityKeyStorePassPhrase $CURRENT_DATE $MIN_CERT_VALIDITY $customIdentityKeyStoreType - - #validate Trust keystore - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; keytool -list -v -keystore $customTrustKeyStoreFileName -storepass $customTrustKeyStorePassPhrase -storetype $customTrustKeyStoreType | grep 'Entry type:' | grep 'trustedCertEntry'" - - if [[ $? != 0 ]]; then - echo "Error : Trust Keystore Validation Failed !!" - exit 1 - fi - - # Verify Identity keystore validity period more than MIN_CERT_VALIDITY - verifyCertValidity $customTrustKeyStoreFileName $customTrustKeyStorePassPhrase $CURRENT_DATE $MIN_CERT_VALIDITY $customTrustKeyStoreType - - echo "ValidateSSLKeyStores Successfull !!" -} - -function storeCustomSSLCerts() -{ - if [ "${isCustomSSLEnabled}" == "true" ]; - then - - mkdir -p $KEYSTORE_PATH - - echo "Custom SSL is enabled. Storing CertInfo as files..." - customIdentityKeyStoreFileName="$KEYSTORE_PATH/identity.keystore" - customTrustKeyStoreFileName="$KEYSTORE_PATH/trust.keystore" - - if [ "${addnodeFlag}" == "false" ]; - then - echo "decode cert data once again as it would get base64 encoded while storing in azure keyvault" - customIdentityKeyStoreData=$(echo "$customIdentityKeyStoreData" | base64 --decode) - customTrustKeyStoreData=$(echo "$customTrustKeyStoreData" | base64 --decode) - fi - - echo "$customIdentityKeyStoreData" | base64 --decode > $customIdentityKeyStoreFileName - echo "$customTrustKeyStoreData" | base64 --decode > $customTrustKeyStoreFileName - - customIdentityKeyStorePassPhrase=$(echo "$customIdentityKeyStorePassPhrase" | base64 --decode) - customIdentityKeyStoreType=$(echo "$customIdentityKeyStoreType" | base64 --decode) - customTrustKeyStorePassPhrase=$(echo "$customTrustKeyStorePassPhrase" | base64 --decode) - customTrustKeyStoreType=$(echo "$customTrustKeyStoreType" | base64 --decode) - serverPrivateKeyAlias=$(echo "$serverPrivateKeyAlias" | base64 --decode) - serverPrivateKeyPassPhrase=$(echo "$serverPrivateKeyPassPhrase" | base64 --decode) - - validateSSLKeyStores - - else - echo "Custom SSL is not enabled" - fi -} - -function generateCustomHostNameVerifier() -{ - mkdir -p ${CUSTOM_HOSTNAME_VERIFIER_HOME} - mkdir -p ${CUSTOM_HOSTNAME_VERIFIER_HOME}/src/main/java - mkdir -p ${CUSTOM_HOSTNAME_VERIFIER_HOME}/src/test/java - cp ${BASE_DIR}/generateCustomHostNameVerifier.sh ${CUSTOM_HOSTNAME_VERIFIER_HOME}/generateCustomHostNameVerifier.sh - cp ${BASE_DIR}/WebLogicCustomHostNameVerifier.java ${CUSTOM_HOSTNAME_VERIFIER_HOME}/src/main/java/WebLogicCustomHostNameVerifier.java - cp ${BASE_DIR}/HostNameValuesTemplate.txt ${CUSTOM_HOSTNAME_VERIFIER_HOME}/src/main/java/HostNameValuesTemplate.txt - cp ${BASE_DIR}/WebLogicCustomHostNameVerifierTest.java ${CUSTOM_HOSTNAME_VERIFIER_HOME}/src/test/java/WebLogicCustomHostNameVerifierTest.java - chown -R $username:$groupname ${CUSTOM_HOSTNAME_VERIFIER_HOME} - chmod +x ${CUSTOM_HOSTNAME_VERIFIER_HOME}/generateCustomHostNameVerifier.sh - - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; ${CUSTOM_HOSTNAME_VERIFIER_HOME}/generateCustomHostNameVerifier.sh ${adminVMName} ${customDNSNameForAdminServer} ${customDNSNameForAdminServer} ${dnsLabelPrefix} ${wlsDomainName} ${location}" -} - -function copyCustomHostNameVerifierJarsToWebLogicClasspath() -{ - runuser -l oracle -c "cp ${CUSTOM_HOSTNAME_VERIFIER_HOME}/output/*.jar $oracleHome/wlserver/server/lib/;" - - echo "Modify WLS CLASSPATH to include hostname verifier jars...." - sed -i 's;^WEBLOGIC_CLASSPATH="${WL_HOME}/server/lib/postgresql.*;&\nWEBLOGIC_CLASSPATH="${WL_HOME}/server/lib/hostnamevalues.jar:${WL_HOME}/server/lib/weblogicustomhostnameverifier.jar:${WEBLOGIC_CLASSPATH}";' $oracleHome/oracle_common/common/bin/commExtEnv.sh - echo "Modified WLS CLASSPATH to include hostname verifier jars." -} - - -function configureCustomHostNameVerifier() -{ - echo "configureCustomHostNameVerifier for domain $wlsDomainName for server $wlsServerName" - cat <$DOMAIN_PATH/configureCustomHostNameVerifier.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -try: - edit("$wlsServerName") - startEdit() - - cd('/Servers/$wlsServerName/SSL/$wlsServerName') - cmo.setHostnameVerifier('com.oracle.azure.weblogic.security.util.WebLogicCustomHostNameVerifier') - cmo.setHostnameVerificationIgnored(false) - cmo.setTwoWaySSLEnabled(false) - cmo.setClientCertificateEnforced(false) - - save() - activate() -except Exception,e: - print e - print "Failed to configureCustomHostNameVerifier for domain $wlsDomainName" - dumpStack() - raise Exception('Failed to configureCustomHostNameVerifier for domain $wlsDomainName') -disconnect() -EOF -sudo chown -R $username:$groupname $DOMAIN_PATH -runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST $DOMAIN_PATH/configureCustomHostNameVerifier.py" -if [[ $? != 0 ]]; then - echo "Error : Failed to configureCustomHostNameVerifier for domain $wlsDomainName" - exit 1 -fi - -} - -# main script starts from here - -SCRIPT_PWD=$(pwd) -CURR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -BASE_DIR="$(readlink -f ${CURR_DIR})" - -# Used for certificate expiry validation -CURRENT_DATE=`date +%s` -# Supplied certificate to have minimum days validity for the deployment -MIN_CERT_VALIDITY="1" - -read wlsDomainName wlsUserName wlsPassword adminVMName oracleHome wlsDomainPath storageAccountName storageAccountKey mountpointPath enableWebLocalStorage managedServerPrefix serverIndex customDNSNameForAdminServer dnsLabelPrefix location addnodeFlag isCustomSSLEnabled customIdentityKeyStoreData customIdentityKeyStorePassPhrase customIdentityKeyStoreType customTrustKeyStoreData customTrustKeyStorePassPhrase customTrustKeyStoreType serverPrivateKeyAlias serverPrivateKeyPassPhrase - -echo "$wlsDomainName $wlsUserName $wlsPassword $adminVMName $oracleHome $wlsDomainPath $storageAccountName $storageAccountKey $mountpointPath $enableWebLocalStorage $managedServerPrefix $serverIndex $customDNSNameForAdminServer $dnsLabelPrefix $location $addnodeFlag $isCustomSSLEnabled $customIdentityKeyStoreData $customIdentityKeyStorePassPhrase $customIdentityKeyStoreType $customTrustKeyStoreData $customTrustKeyStorePassPhrase $customTrustKeyStoreType $serverPrivateKeyAlias $serverPrivateKeyPassPhrase" - -isCustomSSLEnabled="${isCustomSSLEnabled,,}" - -if [ "${isCustomSSLEnabled}" != "true" ]; -then - isCustomSSLEnabled="false" -fi - -wlsAdminT3ChannelPort=7005 -wlsAdminURL="${adminVMName}:${wlsAdminT3ChannelPort}" -coherenceClusterName="myCoherence" -coherenceListenPort=7574 -coherenceLocalport=42000 -coherenceLocalportAdjust=42200 -clientClusterName="cluster1" -CUSTOM_HOSTNAME_VERIFIER_HOME="/u01/app/custom-hostname-verifier" -groupname="oracle" -thisHost=$(hostname) -nmHost=$(hostname) -nmPort=5556 -storageClusterName="storage1" -storageListenPort=7501 -username="oracle" -wlsAdminServerName="admin" -wlsCoherenceArgs="-Dcoherence.localport=$coherenceLocalport -Dcoherence.localport.adjust=$coherenceLocalportAdjust" -KEYSTORE_PATH="${wlsDomainPath}/${wlsDomainName}/keystores" -SERVER_STARTUP_ARGS="-Dlog4j2.formatMsgNoLookups=true" - -if [ -z "$addnodeFlag" ]; -then - addnodeFlag="false" -fi - -addnodeFlag="${addnodeFlag,,}" - -if [ ${serverIndex} -eq 0 ]; then - wlsServerName="admin" -else - wlsServerName="${managedServerPrefix}${serverIndex}" -fi - -validateInput -cleanup - -# Executing this function first just to make sure certificate errors are first caught -storeCustomSSLCerts - -if [ "$wlsServerName" == "${wlsAdminServerName}" ]; then - createCoherenceCluster - restartManagedServers -else - installUtilities - mountFileShare - openManagedServerPorts - createManagedSetup - generateCustomHostNameVerifier - copyCustomHostNameVerifierJarsToWebLogicClasspath - createNodeManagerService - enabledAndStartNodeManagerService - configureCustomHostNameVerifier - startManagedServer -fi - -cleanup diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/scripts/updateDNSZones.sh b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/scripts/updateDNSZones.sh deleted file mode 100644 index 78f21e8a2..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/scripts/updateDNSZones.sh +++ /dev/null @@ -1,108 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Description -# This script updates the Azure DNS Zones used for configuring DNS for WebLogic Admin Server and Azure Application Gateway. - -# Inputs: -# RESOURCE_GROUP_NAME -# DNS_ZONE_NAME -# DNS_RECORDSET_NAMES -# DNS_TARGET_RESOURCES -# DNS_RECORD_NAMES_LENGTH -# DNS_TARGET_RESOURCES_LENGTH -# DNS_RECORD_TTL -# DNS_CNAME_RECORDSET_NAMES -# DNS_CNAME_ALIAS -# DNS_CNAME_RECORDSET_LENGTH -# DNS_CNAME_ALIAS_LENGTH -# MANAGED_IDENTITY_ID - -if [[ ${DNS_RECORD_NAMES_LENGTH} != ${DNS_TARGET_RESOURCES_LENGTH} ]]; then - echo "Error: number of A record set names is not equal to that of target resources." - exit 1 -fi - -if [[ ${DNS_CNAME_RECORDSET_LENGTH} != ${DNS_CNAME_ALIAS_LENGTH} ]]; then - echo "Error: number of CNAME record set names is not equal to that of alias." - exit 1 -fi - -# check if the zone exist -az network dns zone show -g ${RESOURCE_GROUP_NAME} -n ${DNS_ZONE_NAME} - -# query name server for testing -nsforTest=$(az network dns record-set ns show -g ${RESOURCE_GROUP_NAME} -z ${DNS_ZONE_NAME} -n @ --query "nsRecords"[0].nsdname -o tsv) -echo name server: ${nsforTest} - -if [ ${DNS_RECORD_NAMES_LENGTH} -gt 0 ]; then - recordSetNamesArr=$(echo $DNS_RECORDSET_NAMES | tr "," "\n") - targetResourcesArr=$(echo $DNS_TARGET_RESOURCES | tr "," "\n") - - index=0 - for record in $recordSetNamesArr; do - count=0 - for target in $targetResourcesArr; do - if [ $count -eq $index ]; then - echo Create A record with name: $record, target IP: $target - az network dns record-set a create \ - -g ${RESOURCE_GROUP_NAME} \ - -z ${DNS_ZONE_NAME} \ - -n ${record} \ - --target-resource ${target} \ - --ttl ${DNS_RECORD_TTL} - - nslookup ${record}.${DNS_ZONE_NAME} ${nsforTest} - if [ $? -eq 1 ];then - echo Error: failed to create record with name: $record, target Id: $target - exit 1 - fi - fi - - count=$((count + 1)) - done - - index=$((index + 1)) - done -fi - -if [ ${DNS_CNAME_RECORDSET_LENGTH} -gt 0 ];then - cnameRecordSetArr=$(echo $DNS_CNAME_RECORDSET_NAMES | tr "," "\n") - cnameRecordAliasArr=$(echo $DNS_CNAME_ALIAS | tr "," "\n") - - index=0 - for record in $cnameRecordSetArr; do - count=0 - for target in $cnameRecordAliasArr; do - if [ $count -eq $index ]; then - echo Create CNAME record with name: $record, alias: $target - az network dns record-set cname create \ - -g ${RESOURCE_GROUP_NAME} \ - -z ${DNS_ZONE_NAME} \ - -n ${record} \ - --ttl ${DNS_RECORD_TTL} - - az network dns record-set cname set-record \ - -g ${RESOURCE_GROUP_NAME} \ - -z ${DNS_ZONE_NAME} \ - --cname ${target} \ - --record-set-name ${record} - - nslookup ${record}.${DNS_ZONE_NAME} ${nsforTest} - if [ $? -eq 1 ];then - echo Error: failed to create CNAME record with name: $record, alia: $target - exit 1 - fi - fi - - count=$((count + 1)) - done - - index=$((index + 1)) - done -fi - -# delete user assigned managed identity - -az identity delete --ids ${MANAGED_IDENTITY_ID} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/cli-scripts/custom-dns-alias-cli.sh b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/cli-scripts/custom-dns-alias-cli.sh deleted file mode 100644 index ca0968fd3..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/cli-scripts/custom-dns-alias-cli.sh +++ /dev/null @@ -1,331 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# Description -# This script is to configure custom DNS alias for Weblogic Server Administration Console and Application Gateway. -# It supports two scenarios: -# * If you have an Azure DNS Zone, create DNS alias for admin console and application gateway on the existing DNS Zone. -# * If you don’t have an Azure DNS Zone, create the DNS Zone in the same resource group of WebLogic cluster, and create DNS alias for admin console and application gateway. - -# Initialize -script="${BASH_SOURCE[0]}" -scriptDir="$(cd "$(dirname "${script}")" && pwd)" - -function usage() { - cat < \\ - --admin-vm-name adminVM \\ - --admin-console-label admin \\ - --artifact-location \\ - --location eastus \\ - --zone-name contoso.com \\ - --gateway-label application \\ - --zone-resource-group haiche-dns-test1 - - 2. Configure DNS alias on a new DNS Zone - ./custom-dns-alias-cli.sh \\ - --resource-group \\ - --admin-vm-name adminVM \\ - --admin-console-label admin \\ - --artifact-location \\ - --location eastus \\ - --zone-name contoso.com \\ - --gateway-label application - -EOF -} - -function validateInput() { - if [ -z "${resourceGroup}" ]; then - echo "Option --resource-group is required." - exit 1 - fi - if [ -z "${artifactLocation}" ]; then - echo "Option --artifact-location is required." - exit 1 - fi - - templateURL="${artifactLocation}nestedtemplates/dnszonesTemplate.json" - if [ -z "${templateURL}" ]; then - echo "Option --artifact-location is required." - exit 1 - else - if curl --output /dev/null --silent --head --fail "${templateURL}"; then - echo "ARM Tempalte exists: $templateURL" - else - echo "ARM Tempalte does not exist: $templateURL" - exit 1 - fi - fi - if [ -z "${zoneName}" ]; then - echo "Option --zone-name is required." - exit 1 - fi - if [ -z "${adminVMName}" ]; then - echo "Option --admin-vm-name is required." - exit 1 - fi - if [ -z "${adminLabel}" ]; then - echo "Option --admin-console-label is required." - exit 1 - fi - - if [ -n "${gatewayLabel}" ]; then - enableGateWay=true - fi - - if [ -n "${zoneResourceGroup}" ]; then - hasDNSZone=true - fi -} - -function queryAdminIPId() { - az extension add --name resource-graph; - - nicId=$(az graph query -q "Resources - | where type =~ 'microsoft.compute/virtualmachines' - | where name=~ '${adminVMName}' - | where resourceGroup =~ '${resourceGroup}' - | extend nics=array_length(properties.networkProfile.networkInterfaces) - | mv-expand nic=properties.networkProfile.networkInterfaces - | where nics == 1 or nic.properties.primary =~ 'true' or isempty(nic) - | project nicId = tostring(nic.id)" -o tsv) - - if [ -z "${nicId}" ]; then - echo "Please make sure admin VM '${adminVMName}' exists in resource group '${resourceGroup}'. " - exit 1 - fi - - adminIPId=$(az graph query -q "Resources - | where type =~ 'microsoft.network/networkinterfaces' - | where id=~ '${nicId}' - | extend ipConfigsCount=array_length(properties.ipConfigurations) - | mv-expand ipconfig=properties.ipConfigurations - | where ipConfigsCount == 1 or ipconfig.properties.primary =~ 'true' - | project publicIpId = tostring(ipconfig.properties.publicIPAddress.id)" -o tsv) - - if [ -z "${adminIPId}" ]; then - echo "Can not query public IP of admin VM. Please make sure admin VM '${adminVMName}' exists in resource group '${resourceGroup}'. " - exit 1 - fi -} - -function queryAppgatewayAlias() { - gatewayIPId=$(az graph query -q "Resources - | where type =~ 'microsoft.network/applicationGateways' - | where name=~ 'myAppGateway' - | where resourceGroup =~ '${resourceGroup}' - | extend ipConfigsCount=array_length(properties.frontendIPConfigurations) - | mv-expand ipconfig=properties.frontendIPConfigurations - | where ipConfigsCount == 1 or ipconfig.properties.primary =~ 'true' - | project publicIpId = tostring(ipconfig.properties.publicIPAddress.id)" -o tsv) - - if [ -z "${gatewayIPId}" ]; then - echo "Can not query public IP of gateway. Please make sure Application Gateway is enabled in resource group '${resourceGroup}'. " - exit 1 - fi - - gatewayAlias=$(az network public-ip show \ - --id ${gatewayIPId} \ - --query dnsSettings.fqdn -o tsv) -} - -function generateParameterFile() { - parametersPath=parameters.json - cat <${scriptDir}/${parametersPath} -{ - "\$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "value": "${artifactLocation}" - }, - "_artifactsLocationSasToken": { - "value": "" - }, - "dnszonesARecordSetNames": { - "value": [ - "$adminLabel" - ] - }, -EOF - - if [ "${enableGateWay}" == "true" ]; then - echo "${enableGateWay} ....." - cat <>${scriptDir}/${parametersPath} - "dnszonesCNAMEAlias": { - "value": [ - "${gatewayAlias}" - ] - }, - "dnszonesCNAMERecordSetNames": { - "value": [ - "${gatewayLabel}" - ] - }, -EOF - else - cat <>${scriptDir}/${parametersPath} - "dnszonesCNAMEAlias": { - "value": [ - ] - }, - "dnszonesCNAMERecordSetNames": { - "value": [ - ] - }, -EOF - fi - - cat <>${scriptDir}/${parametersPath} - "dnszoneName": { - "value": "${zoneName}" - }, - "hasDNSZones": { - "value": ${hasDNSZone} - }, - "location": { - "value": "${location}" - }, - "resourceGroup": { - "value": "${zoneResourceGroup}" - }, - "targetResources": { - "value": [ - "${adminIPId}" - ] - } - } -} -EOF -} - -function invoke() { - # validate the template - az deployment group validate --verbose \ - --resource-group ${resourceGroup} \ - --parameters @${scriptDir}/${parametersPath} \ - --template-uri ${templateURL} - - # invoke the template - az deployment group create --verbose \ - --resource-group ${resourceGroup} \ - --parameters @${scriptDir}/${parametersPath} \ - --template-uri ${templateURL} \ - --name "configure-custom-dns-alias-$(date +"%s")" - - # exit if error happens - if [ $? -eq 1 ]; then - exit 1 - fi -} - -function cleanup() { - if test -f "${scriptDir}/${parametersPath}"; then - rm -f ${scriptDir}/${parametersPath} - fi -} - -function printSummary() { - echo "" - echo "" - echo " -DONE! - " - if [ "${hasDNSZone}" == "false" ]; then - nameServers=$(az network dns zone show -g ${resourceGroup} --name ${zoneName} --query nameServers) - echo " -Action required: - Complete Azure DNS delegation to make the alias accessible. - Reference: https://aka.ms/dns-domain-delegatio - Name servers: - ${nameServers} - " - fi - - echo " -Custom DNS alias: - Resource group: ${resourceGroup} - WebLogic Server Administration Console URL: http://${adminLabel}.${zoneName}:7001/console - WebLogic Server Administration Console secured URL: https://${adminLabel}.${zoneName}:7002/console - " - - if [ "${enableGateWay}" == "true" ]; then - echo " - Application Gateway URL: http://${gatewayLabel}.${zoneName} - Application Gateway secured URL: https://${gatewayLabel}.${zoneName} -" - fi -} - -# main script start from here -# default value -enableGateWay=false -hasDNSZone=false - -# Transform long options to short ones -for arg in "$@"; do - shift - case "$arg" in - "--help") set -- "$@" "-h" ;; - "--resource-group") set -- "$@" "-g" ;; - "--artifact-location") set -- "$@" "-f" ;; - "--zone-name") set -- "$@" "-z" ;; - "--admin-vm-name") set -- "$@" "-m" ;; - "--admin-console-label") set -- "$@" "-c" ;; - "--gateway-label") set -- "$@" "-w" ;; - "--zone-resource-group") set -- "$@" "-r" ;; - "--location") set -- "$@" "-l" ;; - "--"*) - set -- usage - exit 2 - ;; - *) set -- "$@" "$arg" ;; - esac -done - -# Parse short options -OPTIND=1 -while getopts "hg:f:z:m:c:w:r:i:l:" opt; do - case "$opt" in - "g") resourceGroup="$OPTARG" ;; - "f") artifactLocation="$OPTARG" ;; - "h") - usage - exit 0 - ;; - "z") zoneName="$OPTARG" ;; - "m") adminVMName="$OPTARG" ;; - "c") adminLabel="$OPTARG" ;; - "w") gatewayLabel="$OPTARG" ;; - "r") zoneResourceGroup="$OPTARG" ;; - "l") location="$OPTARG" ;; - esac -done -shift $(expr $OPTIND - 1) - -validateInput -cleanup -queryAdminIPId -if [ ${enableGateWay} ]; then - queryAppgatewayAlias -fi -generateParameterFile -invoke -cleanup -printSummary diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/deletenode/pom.xml b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/deletenode/pom.xml deleted file mode 100644 index 41a7455d0..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/deletenode/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - 4.0.0 - - - com.oracle.weblogic.azure - weblogic-azure-vm - 1.0.0 - ../../pom.xml - - - com.oracle.weblogic.azure - arm-oraclelinux-wls-cluster-deletenode - ${version.arm-oraclelinux-wls-cluster-deletenode} - - jar - ${project.artifactId} - - - -TestParameter '@{"SampleName"="deletenode/src/main";"RawRepoPath"="${artifactsLocationBase}/arm-oraclelinux-wls-cluster/"}' - ${project.basedir}/../../.. - false - false - - - - - - - diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/deletenode/src/main/arm/deletenodedeploy.parameters.json b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/deletenode/src/main/arm/deletenodedeploy.parameters.json deleted file mode 100644 index 1955ad99d..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/deletenode/src/main/arm/deletenodedeploy.parameters.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "adminVMName": { - "value": "GEN-UNIQUE" - }, - "deletingManagedServerNames": { - "value": "GEN-SSH-PUB-KEY" - }, - "deletingManagedServerMachineNames": { - "value": "GEN-UNIQUE" - }, - "wlsUserName": { - "value": "GEN-UNIQUE" - }, - "wlsPassword": { - "value": "GEN-UNIQUE" - }, - "wlsForceShutDown": { - "value": "GEN-UNIQUE" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/deletenode/src/main/arm/mainTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/deletenode/src/main/arm/mainTemplate.json deleted file mode 100644 index bab15a8b0..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/deletenode/src/main/arm/mainTemplate.json +++ /dev/null @@ -1,152 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - }, - "defaultValue": "${artifactsLocationBase}/arm-oraclelinux-wls-cluster/deletenode/src/main/" - }, - "_artifactsLocationSasToken": { - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - }, - "defaultValue": "" - }, - "adminVMName": { - "type": "string", - "defaultValue": "adminVM", - "metadata": { - "description": "Admin Server hosting VM name." - } - }, - "deletingManagedServerNames": { - "type": "array", - "metadata": { - "description": "Names of managed servers to be deleted, comma delimited." - } - }, - "deletingManagedServerMachineNames": { - "type": "array", - "metadata": { - "description": "Vitual Machine names of managed servers to be deleted, comma delimited." - } - }, - "wlsUserName": { - "type": "string", - "metadata": { - "description": "Username for your Weblogic domain name" - } - }, - "wlsPassword": { - "type": "securestring", - "metadata": { - "description": "Password for your Weblogic domain name" - } - }, - "wlsForceShutDown": { - "type": "string", - "defaultValue": "true", - "allowedValues": [ - "true", - "false" - ], - "metadata": { - "description": "Will force to shut down managed server if the tag set to true." - } - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]", - "metadata": { - "description": "Location for all resources." - } - } - }, - "variables": { - "const_wlsAdminPort": "7001", - "const_wlsHome": "/u01/app/wls/install/oracle/middleware/oracle_home", - "name_scriptDeleteNode": "deletenode.sh" - }, - "functions": [ - { - "namespace": "array", - "members": { - "join": { - "parameters": [ - { - "name": "items", - "type": "array" - } - ], - "output": { - "type": "string", - "value": "[replace(replace(replace(string(parameters('items')), '[\"', ''), '\"]', ''), '\",\"', ',')]" - } - } - } - } - ], - "resources": [ - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${cluster.deletenode.start}", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines/extensions", - "name": "[concat(parameters('adminVMName'),'/newuserscript')]", - "location": "[parameters('location')]", - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.0", - "autoUpgradeMinorVersion": true, - "settings": { - "fileUris": [ - "[uri(parameters('_artifactsLocation'), concat('scripts/', variables('name_scriptDeleteNode'), parameters('_artifactsLocationSasToken')))]" - ] - }, - "protectedSettings": { - "commandToExecute": "[concat('sh',' ', variables('name_scriptDeleteNode'), ' <<< \"', parameters('wlsUserName'),' ',parameters('wlsPassword'),' ',array.join(parameters('deletingManagedServerNames')),' ',array.join(parameters('deletingManagedServerMachineNames')),' ', parameters('wlsForceShutDown'), ' ', parameters('adminVMName'), ' ',variables('const_wlsAdminPort'),' ',variables('const_wlsHome'),'\"')]" - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${cluster.deletenode.end}", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - } - ], - "outputs": { - "commandsToDeleteAzureResource": { - "type": "string", - "value": "[concat('export resourceGroup=', resourceGroup().name,';', 'export deleteingIDs=\"\";export managedServerMachineNames=$(echo ',array.join(parameters('deletingManagedServerMachineNames')),' | tr \",\" \"\\n\");','az extension add --name resource-graph;','for machine in $managedServerMachineNames;do vmId=$(az graph query -q \"Resources | where type =~ ','\\','\"microsoft.compute/virtualmachines\\\" | where name=~ \\\"${machine}\\\" | where resourceGroup =~ \\\"${resourceGroup}\\\" | project vmid = tolower(id)\" --query data[0].vmid -o tsv); nicId=$(az graph query -q \"Resources | where type =~ \\\"microsoft.compute/virtualmachines\\\" | where name=~ \\\"${machine}\\\" | where resourceGroup =~ \\\"${resourceGroup}\\\" | extend nics=array_length(properties.networkProfile.networkInterfaces) | mv-expand nic=properties.networkProfile.networkInterfaces | where nics == 1 or nic.properties.primary =~ \\\"true\\\" or isempty(nic) | project nicId = tostring(nic.id)\" --query data[0].nicId -o tsv);ipId=$(az graph query -q \"Resources | where type =~ \\\"microsoft.network/networkinterfaces\\\" | where id=~ \\\"${nicId}\\\" | extend ipConfigsCount=array_length(properties.ipConfigurations) | mv-expand ipconfig=properties.ipConfigurations | where ipConfigsCount == 1 or ipconfig.properties.primary =~ \\\"true\\\" | project publicIpId = tostring(ipconfig.properties.publicIPAddress.id)\" --query data[0].publicIpId -o tsv);osDiskId=$(az graph query -q \"Resources | where type =~ \\\"microsoft.compute/virtualmachines\\\" | where name=~ \\\"${machine}\\\" | where resourceGroup =~ \\\"${resourceGroup}\\\" | project osDiskId = tostring(properties.storageProfile.osDisk.managedDisk.id)\" --query data[0].osDiskId -o tsv);deleteingIDs=$(echo $deleteingIDs ${vmId} ${nicId} ${ipId} ${osDiskId});done;echo \"List resource Ids to be deleted: \";echo ${deleteingIDs} | tr \" \" \"\\n\";echo -n \"Are you sure to delete these resources (y/n)?\";read answer;if [[ \"$answer\" != \"${answer#[Yy]}\" && -n \"${deleteingIDs}\" ]]; then echo \"Deleting managed resources...Please do not stop.\";az resource delete --verbose --ids ${deleteingIDs};fi',';','echo \"Check if application gateway has deployed...\"; appGateway=$(az resource list -g ${resourceGroup} -n myAppGateway --resource-type Microsoft.Network/applicationGateways | grep \"myAppGateway\");if [ -n \"${appGateway}\" ];then for machine in $managedServerMachineNames;do backendAddresses=$(az network application-gateway address-pool list -g ${resourceGroup} --gateway-name myAppGateway --query [0].backendAddresses | grep \"fqdn\"); if [ $? == 0 ]; then beAddArr=$(echo \"$backendAddresses\" | sed \"s/ //g\" | tr \",\" \"\\n\");index=0;len=0;for item in $beAddArr;do ret=$(echo $item | grep \"$machine\");if [ -z \"$ret\" ];then index=$((index+1));len=$((len+1)); else len=$((len+1));break; fi done; if [[ ${index} -lt ${len} ]]; then echo \"Removing $machine from application gateway, please do not stop.\"; az network application-gateway address-pool update -g ${resourceGroup} --gateway-name myAppGateway --name myGatewayBackendPool --remove backendAddresses ${index};fi;fi; done; fi')]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/deletenode/src/main/scripts/deletenode-cli.sh b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/deletenode/src/main/scripts/deletenode-cli.sh deleted file mode 100644 index 298f4f626..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/deletenode/src/main/scripts/deletenode-cli.sh +++ /dev/null @@ -1,148 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# Description -# This script deletes managed nodes from an existing WebLogic Cluster and removes related Azure resources. -# It removes Azure resources including: -# * Virtual Machines that host deleting managed servers. -# * Data disks attached to the Virtual Machines -# * OS disks attached to the Virtual Machines -# * Network Interfaces added to the Virtual Machines -# * Public IPs added to the Virtual Machines -# -# The following pre-requisites must be handled prior to running this script: -# * Azure WebLogic application has deployed, WebLogic Cluster has an Admin Server. -# * The WebLogic Cluster has as least one managed nodes -# * Azure CLI is installed -# * Azure CLI has authorized to manage Azure resources -# - -# Initialize -script="${BASH_SOURCE[0]}" -scriptDir="$( cd "$( dirname "${script}" )" && pwd )" - -function usage { - echo usage: ${script} -g resource-group [-f template-file] [-u template-url] -p paramter-file [-s silent-mode] [-h] - echo " -g Azure Resource Group of the Vitural Machines that host deleting manages servers, must be specified." - echo " -f Path of ARM template to delete nodes, must be specified -f option or -u option." - echo " -u URL of ARM template, must be specified -f option or -u option." - echo " -p Path of ARM parameter, must be specified. " - echo " -s Execute the script in silent mode. The script will input y automatically for the prompt." - echo " -h Help" - exit $1 -} - -silent=false - -# -# Parse the command line options -# -while getopts "shg:f:u:p:" opt; do - case $opt in - g) resourceGroup="${OPTARG}" - ;; - f) templateFile="${OPTARG}" - ;; - u) templateURL="${OPTARG}" - ;; - p) parametersFile="${OPTARG}" - ;; - s) silent=true - ;; - h) usage 0 - ;; - *) usage 1 - ;; - esac -done - - -function initialize { - validateErrors=false - - if [ -z "${resourceGroup}" ]; then - echo "You must use the -g option to specify resource group." >&2 - validateErrors=true - fi - - if [[ -z "${templateFile}" && -z "${templateURL}" ]]; then - echo "You must use the -f option or -u option to specify tempalte path." >&2 - validateErrors=true - fi - - if [ -n "${templateFile}" ]; then - if [ ! -f ${templateFile} ]; then - echo "Unable to locate the template ${templateFile}" >&2 - validateErrors=true - fi - fi - - if [ -z "${parametersFile}" ]; then - echo "You must use the -p option to specify the path of ARM parameters." >&2 - validateErrors=true - else - if [ ! -f ${parametersFile} ]; then - echo "Unable to locate the parameter ${parametersFile}" >&2 - validateErrors=true - fi - fi - - if [ ${validateErrors} == true ]; then - usage 1 - fi -} - -function removeManagedNodes { - # validate template - templateArgument="-u ${templateURL}" - if [ -n "${templateFile}" ];then - templateArgument="-f ${templateFile}" - fi - - az deployment group validate \ - -g ${resourceGroup} \ - ${templateArgument} \ - -p @${parametersFile} \ - --no-prompt - - if [ $? -ne 0 ]; then - echo "Error happens on template or parameters." - exit 1 - fi - - # delete nodes from weblogic cluster - commandsToDeleteAzureResource=$(az deployment group create --verbose -g ${resourceGroup} ${templateArgument} -p @${parametersFile} -n ${deploymentName} --no-prompt --query properties.outputs.commandsToDeleteAzureResource.value) - if [ $? -ne 0 ]; then - echo "Error happens on template deployment." - exit 1 - fi - - # delete azure resources of the nodes - commandsToDeleteAzureResource=$(echo "${commandsToDeleteAzureResource}" | sed "s/\\\\\"/\"/g" | sed "s/\\\\n/n/g" | sed "s/\\\\\"/\"/g") - commandsToDeleteAzureResource=$(echo ${commandsToDeleteAzureResource:1:${#commandsToDeleteAzureResource}-2}) - cat <remove-azure-resource.sh -${commandsToDeleteAzureResource} -EOF - - chmod ugo+x ./remove-azure-resource.sh - if [ $silent == true ];then - echo "y" | ./remove-azure-resource.sh - else ./remove-azure-resource.sh - fi - - if [ $? -eq 0 ]; then - echo "" - echo "" - echo "Complete!" - fi - - rm -f ./remove-azure-resource.sh -} - - - -deploymentName="deletenode-$(date +"%s")" - -initialize -removeManagedNodes diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/deletenode/src/main/scripts/deletenode.sh b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/deletenode/src/main/scripts/deletenode.sh deleted file mode 100644 index f27f78975..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/deletenode/src/main/scripts/deletenode.sh +++ /dev/null @@ -1,215 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# Description -# This script deletes managed nodes from an existing WebLogic Cluster and removes related Azure resources. - -#Function to output message to StdErr -function echo_stderr () -{ - echo "$@" >&2 -} - -#Function to display usage message -function usage() -{ - echo_stderr "./deletenode.sh <<< \"\"" -} - -function validateInput() -{ - if [[ -z "$wlsUserName" || -z "$wlsPassword" ]] - then - echo_stderr "wlsUserName or wlsPassword is required. " - exit 1 - fi - - if [ -z "$managedServerNames" ]; - then - echo_stderr "managedServerNames is required. " - fi - - if [ -z "$managedVMNames" ]; - then - echo_stderr "managedVMNames is required. " - fi - - if [ -z "$wlsForceShutDown" ]; - then - echo_stderr "wlsForceShutDown is required. " - fi - - if [ -z "$wlsAdminHost" ]; - then - echo_stderr "wlsAdminHost is required. " - fi - - if [ -z "$wlsAdminPort" ]; - then - echo_stderr "wlsAdminPort is required. " - fi - - if [ -z "$oracleHome" ]; - then - echo_stderr "oracleHome is required. " - fi -} - -#Function to cleanup all temporary files -function cleanup() -{ - echo "Cleaning up temporary files..." - rm -f -r ${scriptPath} - echo "Cleanup completed." -} - -#This function to delete machine for a given managed server -function delete_machine_model() -{ - echo "Deleting managed server name model for $managedServerNames" - cat <${scriptPath}/delete-server.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -try: - edit() - startEdit() -EOF - -arrServerNames=$(echo $managedServerNames | tr "," "\n") -for server in $arrServerNames -do - echo "deleting name model for $server" - cat <>${scriptPath}/delete-server.py - shutdown('$server', 'Server',ignoreSessions='true',force='$wlsForceShutDown') - editService.getConfigurationManager().removeReferencesToBean(getMBean('/MigratableTargets/$server (migratable)')) - cd('/') - cmo.destroyMigratableTarget(getMBean('/MigratableTargets/$server (migratable)')) - cd('/Servers/$server') - cmo.setCluster(None) - cmo.setMachine(None) - editService.getConfigurationManager().removeReferencesToBean(getMBean('/Servers/$server')) - cd('/') - cmo.destroyServer(getMBean('/Servers/$server')) -EOF -done - -cat <>${scriptPath}/delete-server.py - save() - activate() -except: - stopEdit('y') - sys.exit(1) - -disconnect() -EOF -} - -#This function to delete managed server to admin node -function delete_ms_server_model() -{ - echo "Deleting managed server machine name model for $managedVMNames" - cat <${scriptPath}/delete-machine.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -try: - edit() - startEdit() -EOF - - arrServerMachineNames=$(echo $managedVMNames | tr "," "\n") - for machine in $arrServerMachineNames - do - echo "deleting name model for $machine" - cat <>${scriptPath}/delete-machine.py - editService.getConfigurationManager().removeReferencesToBean(getMBean('/Machines/$machine')) - cmo.destroyMachine(getMBean('/Machines/$machine')) -EOF - done - - cat <>${scriptPath}/delete-machine.py - save() - activate() -except: - stopEdit('y') - sys.exit(1) - -disconnect() -EOF -} - -#This function to check admin server status -function wait_for_admin() -{ - #check admin server status - count=1 - CHECK_URL="http://$wlsAdminURL/weblogic/ready" - status=`curl --insecure -ILs $CHECK_URL | tac | grep -m1 HTTP/1.1 | awk {'print $2'}` - echo "Check admin server status" - while [[ "$status" != "200" ]] - do - echo "." - count=$((count+1)) - if [ $count -le 30 ]; - then - sleep 1m - else - echo "Error : Maximum attempts exceeded while checking admin server status" - exit 1 - fi - status=`curl --insecure -ILs $CHECK_URL | tac | grep -m1 HTTP/1.1 | awk {'print $2'}` - if [ "$status" == "200" ]; - then - echo "WebLogic Server is running..." - break - fi - done -} - -function delete_managed_server() -{ - echo "Start to delete managed server $managedServerNames" - sudo chown -R oracle:oracle ${scriptPath} - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST ${scriptPath}/delete-server.py" - if [[ $? != 0 ]]; then - echo "Error : Deleting server $managedServerNames failed" - exit 1 - fi - echo "Complete deleting managed server $managedServerNames" - - echo "Start to delete managed server machine $managedServerNames" - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST ${scriptPath}/delete-machine.py" - if [[ $? != 0 ]]; then - echo "Error : Deleting machine for managed server $managedServerNames failed" - exit 1 - fi - echo "Complete deleting managed server machine $managedServerNames" -} - -function createTempFolder() -{ - scriptPath="/u01/tmp" - sudo rm -f -r ${scriptPath} - sudo mkdir ${scriptPath} - sudo rm -rf $scriptPath/* -} - -#main script starts here - -#read arguments from stdin -read wlsUserName wlsPassword managedServerNames managedVMNames wlsForceShutDown wlsAdminHost wlsAdminPort oracleHome - -wlsAdminURL=$wlsAdminHost:$wlsAdminPort -hostName=`hostname` - -createTempFolder - -validateInput - -wait_for_admin - -delete_machine_model - -delete_ms_server_model - -delete_managed_server - -cleanup diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/pom.xml b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/pom.xml deleted file mode 100644 index 055d38a5e..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/pom.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - 4.0.0 - - - com.oracle.weblogic.azure - weblogic-azure-vm - 1.0.0 - ../pom.xml - - - com.oracle.weblogic.azure - arm-oraclelinux-wls-cluster-root - pom - 1.0.10 - ${project.artifactId} - - - - https://github.com/oracle/weblogic-azure/tree/main/weblogic-azure-vm/arm-oraclelinux-wls-cluster - - - scm:git:git@github.com:wls-eng/arm-oraclelinux-wls.git - scm:git:git@github.com:wls-eng/arm-oraclelinux-wls-cluster.git - https://github.com/oracle/weblogic-azure/tree/main/weblogic-azure-vm/arm-oraclelinux-wls-cluster - HEAD - - - - - Universal Permissive License Version 1.0 - http://oss.oracle.com/licenses/upl - repo - - - - - ${project.basedir}/../.. - - - - addnode - addnode-coherence - deletenode - arm-oraclelinux-wls-cluster - - - diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/src/main/resources/marketing-artifacts/partner-center.html b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/src/main/resources/marketing-artifacts/partner-center.html deleted file mode 100644 index 48e081a92..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/src/main/resources/marketing-artifacts/partner-center.html +++ /dev/null @@ -1,49 +0,0 @@ -

    Name

    -

    Oracle WebLogic Server Cluster on Azure VMs

    -

    Search results summary

    -

    Provisions an n-node Oracle WebLogic Server cluster on Azure VMs.

    -

    Short description

    -

    Provisions an n-node Oracle WebLogic Server cluster on Azure VMs. Supports integration with Azure App Gateway, databases, and -Coherence.

    -

    Description

    -

    Oracle WebLogic Server (WLS) is an industry-leading Java runtime powering some of the most mission-critical enterprise applications - across the globe. This solution automates most boilerplate steps to provision a WLS cluster on Azure VMs. Once initial - provisioning is complete, you are completely free to customize deployments further. The solution is jointly developed by Oracle and - Microsoft.

    -

    WLS Enterprise Edition versions supported include 12.2.1.4, and 14.1.1.0.

    -

    The following resources are automatically provisioned by the offer.

    -
      -
    • Oracle Linux or Red Hat Enterprise Linux (RHEL) VMs (you can choose the number of VMs - all instances will have private -IP addresses by default)
    • -
    • Configured cluster consisting of WebLogic Managed Server instances on each VM (ORACLE_HOME is -/u01/app/wls/install/oracle/middleware/oracle_home)
    • -
    • Admin Server on one of the VMs
    • -
    • WLS Domain with default name wlsd (domain path is /u01/domains/wlsd/)
    • -
    • Oracle JDK on each VM (JAVA_HOME is /u01/app/jdk/jdk-${version})
    • -
    • Azure App Gateway instance with a public IP address (the backend pool will be set to VMs running Managed Servers) - optional
    • -
    • In addition to drivers that come standard with WLS, most recent supported PostgreSQL and Microsoft SQL JDBC drivers (drivers stored in -/u01/app/wls/install/oracle/middleware/oracle_home/wlserver/server/lib/)
    • -
    • Configured data source connection (Oracle DB, Azure SQL, Azure MySQL, Azure PostgreSQL) - optional
    • -
    • VMs with private IP addresses to run data tier Managed Coherence cache servers - optional
    • -
    • Azure Availability Set for the VMs
    • -
    • Virtual network and subnet (alternatively, you can deploy to an existing virtual network)
    • -
    • Network security group
    • -
    • OS disks attached to VMs
    • -
    -

    This offer is Bring-Your-Own-License. It assumes you have already procured the appropriate licenses with Oracle and are properly -licensed to run offers in Microsoft Azure.

    -

    Oracle and Microsoft also provide basic step-by-step instructions on getting started with WLS and Azure VMs without automated -provisioning.

    -

    Oracle and Microsoft provide similar solutions targeting WLS on the Azure Kubernetes Service (AKS) in addition to a single WLS -Admin Server instance on an Azure VM. These options are linked in the Learn more section below.

    -

    You can reach out to the engineering team developing these offers by clicking the CONTACT ME button on -the marketplace WebLogic on Azure overview page. Program managers, architects and engineers will get in touch and can -assist you for free with your Azure migration.

    -

    Links

    - diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/deploy-webapp.sh b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/deploy-webapp.sh deleted file mode 100644 index 0088bcfc5..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/deploy-webapp.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# Description -# This script is to test application deployment on WebLogic cluster domain. - -# Verifying admin server is accessible - -read wlsUserName wlspassword adminVMDNS adminPort - -CURL_REQD_PARMS="--user ${wlsUserName}:${wlspassword} -H X-Requested-By:MyClient -H Accept:application/json -s -v" -CURL_RETRY_PARMS="--connect-timeout 60 --max-time 180 --retry 10 --retry-delay 30 --retry-max-time 180 --retry-connrefused" - -echo "curl ${CURL_REQD_PARMS} ${CURL_RETRY_PARMS} -H Content-Type:multipart/form-data \ --H "weblogic.edit.session: default" \ --F \"model={ - name: 'weblogic-cafe', - targets: [ { identity: [ 'clusters', 'cluster1' ] } ] -}\" \ --F \"sourcePath=@weblogic-on-azure/javaee/weblogic-cafe/target/weblogic-cafe.war\" \ --X Prefer:respond-async \ --X POST http://${adminVMDNS}:${adminPort}/management/weblogic/latest/edit/appDeployments" - -# Deploy webapp to weblogic server -curl ${CURL_REQD_PARMS} ${CURL_RETRY_PARMS} -H Content-Type:multipart/form-data \ --H "weblogic.edit.session: default" \ --F "model={ - name: 'weblogic-cafe', - targets: [ { identity: [ 'clusters', 'cluster1' ] } ] -}" \ --F "sourcePath=@weblogic-on-azure/javaee/weblogic-cafe/target/weblogic-cafe.war" \ --H "Prefer:respond-async" \ --X POST http://${adminVMDNS}:${adminPort}/management/weblogic/latest/edit/appDeployments > out - -echo "Deployment response received" -cat out - -attempt=0 -while [ $attempt -le 10 ] -do - curl ${CURL_REQD_PARMS} ${CURL_RETRY_PARMS} \ - -X GET -i "http://${adminVMDNS}:${adminPort}/management/weblogic/latest/domainRuntime/deploymentManager/deploymentProgressObjects/weblogic-cafe?links=none" > out - echo "Checking deployment operation is completed" - cat out | grep "\"state\": \"STATE_COMPLETED\"" - if [ $? == 0 ]; then - echo "Deployment operation is completed" - cat out - break - fi - attempt=$((attempt+1)) - sleep 10s -done - -echo "Verifying the deployed application status" -sleep 1m - -attempt=0 -while [ $attempt -le 5 ] -do - echo "curl ${CURL_REQD_PARMS} ${CURL_RETRY_PARMS} -H weblogic.edit.session: default -H Content-Type:application/json -d {target='cluster1'} -X POST -i http://${adminVMDNS}:${adminPort}/management/weblogic/latest/domainRuntime/deploymentManager/appDeploymentRuntimes/weblogic-cafe/getState" - curl ${CURL_REQD_PARMS} ${CURL_RETRY_PARMS} -H Content-Type:application/json \ - -H "weblogic.edit.session: default" \ - -d "{target='cluster1'}" \ - -X POST -i "http://${adminVMDNS}:${adminPort}/management/weblogic/latest/domainRuntime/deploymentManager/appDeploymentRuntimes/weblogic-cafe/getState" > out - - echo "Deployment state received" - cat out - cat out | grep "\"return\": \"STATE_ACTIVE\"" - if [ $? == 0 ]; then - echo "Application is deployed successfully and in active state" - exit 0 - elif [[ $? != 0 ]] && [[ $attempt -ge 5 ]]; then - echo "Application deployment is unsuccessful" - exit 1 - fi - - cat out | grep "\"return\": \"STATE_PREPARED\"" - if [[ $? == 0 ]]; then - # Ideally this is not required but noticed only for 122130 OL7.4 it is required - echo "Starting the service explicitly" - echo "curl ${CURL_REQD_PARMS} ${CURL_RETRY_PARMS} -H weblogic.edit.session: default -H Content-Type:application/json -d {} -X POST -i http://${adminVMDNS}:${adminPort}/management/weblogic/latest/domainRuntime/deploymentManager/appDeploymentRuntimes/weblogic-cafe/start" - curl ${CURL_REQD_PARMS} ${CURL_RETRY_PARMS} -H Content-Type:application/json \ - -H "weblogic.edit.session: default" \ - -d "{}" \ - -X POST -i "http://${adminVMDNS}:${adminPort}/management/weblogic/latest/domainRuntime/deploymentManager/appDeploymentRuntimes/weblogic-cafe/start" - fi - - attempt=$((attempt+1)) - sleep 1m -done diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/gen-parameters-ag.sh b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/gen-parameters-ag.sh deleted file mode 100644 index 56828c842..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/gen-parameters-ag.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# Description -# This script is to generate test parameters for Appgateway testing. - -#read arguments from stdin -read parametersPath repoPath testbranchName keyVaultName keyVaultResourceGroup keyVaultSSLCertDataSecretName keyVaultSSLCertPasswordSecretName - -cat < ${parametersPath} -{ - "\$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "value": "https://raw.githubusercontent.com/${repoPath}/${testbranchName}/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/" - }, - "_artifactsLocationSasToken": { - "value": "" - }, - "adminPasswordOrKey": { - "value": "GEN-UNIQUE" - }, - "adminUsername": { - "value": "GEN-UNIQUE" - }, - "enableAppGateway": { - "value": true - }, - "enableDB": { - "value": false - }, - "numberOfInstances": { - "value": 4 - }, - "vmSize": { - "value": "Standard_B2ms" - }, - "wlsPassword": { - "value": "GEN-UNIQUE" - }, - "wlsUserName": { - "value": "GEN-UNIQUE" - } - } -} -EOF diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/gen-parameters-coherence.sh b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/gen-parameters-coherence.sh deleted file mode 100644 index c14d462b9..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/gen-parameters-coherence.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# Description -# This script is to generate test parameters for coherence testing. - -#read arguments from stdin -read parametersPath repoPath testbranchName - -cat <${parametersPath} -{ - "\$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "value": "https://raw.githubusercontent.com/${repoPath}/${testbranchName}/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/" - }, - "_artifactsLocationSasToken": { - "value": "" - }, - "adminPasswordOrKey": { - "value": "GEN-UNIQUE" - }, - "adminUsername": { - "value": "GEN-UNIQUE" - }, - "adminVMNamePrefix": { - "value": "GEN-UNIQUE" - }, - "enableCoherence": { - "value": true - }, - "vmSize": { - "value": "Standard_B2ms" - }, - "wlsPassword": { - "value": "GEN-UNIQUE" - }, - "wlsUserName": { - "value": "GEN-UNIQUE" - } - } -} -EOF diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/gen-parameters-db-ag.sh b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/gen-parameters-db-ag.sh deleted file mode 100644 index 601695bef..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/gen-parameters-db-ag.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# Description -# This script is to generate test parameters for database datasource and Appgateway testing. - -#read arguments from stdin -read parametersPath repoPath testbranchName - -cat < ${parametersPath} -{ - "\$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "value": "https://raw.githubusercontent.com/${repoPath}/${testbranchName}/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/" - }, - "_artifactsLocationSasToken": { - "value": "" - }, - "adminPasswordOrKey": { - "value": "GEN-UNIQUE" - }, - "adminUsername": { - "value": "GEN-UNIQUE" - }, - "databaseType": { - "value": "postgresql" - }, - "dbPassword": { - "value": "GEN-UNIQUE" - }, - "dbUser": { - "value": "GEN-UNIQUE" - }, - "dsConnectionURL": { - "value": "GEN-UNIQUE" - }, - "enableAppGateway": { - "value": true - }, - "enableDB": { - "value": true - }, - "jdbcDataSourceName": { - "value": "jdbc/postgresql" - }, - "numberOfInstances": { - "value": 4 - }, - "vmSize": { - "value": "Standard_B2ms" - }, - "wlsPassword": { - "value": "GEN-UNIQUE" - }, - "wlsUserName": { - "value": "GEN-UNIQUE" - } - } -} -EOF diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/gen-parameters-db.sh b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/gen-parameters-db.sh deleted file mode 100644 index a55de38f1..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/gen-parameters-db.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# Description -# This script is to generate test parameters for database datasource testing. - -#read arguments from stdin -read parametersPath repoPath testbranchName - -cat < ${parametersPath} -{ - "\$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "value": "https://raw.githubusercontent.com/${repoPath}/${testbranchName}/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/" - }, - "_artifactsLocationSasToken": { - "value": "" - }, - "adminPasswordOrKey": { - "value": "GEN-UNIQUE" - }, - "adminUsername": { - "value": "GEN-UNIQUE" - }, - "databaseType": { - "value": "postgresql" - }, - "dbPassword": { - "value": "GEN-UNIQUE" - }, - "dbUser": { - "value": "GEN-UNIQUE" - }, - "dsConnectionURL": { - "value": "GEN-UNIQUE" - }, - "enableAppGateway": { - "value": false - }, - "enableDB": { - "value": true - }, - "jdbcDataSourceName": { - "value": "jdbc/postgresql" - }, - "numberOfInstances": { - "value": 4 - }, - "vmSize": { - "value": "Standard_B2ms" - }, - "wlsPassword": { - "value": "GEN-UNIQUE" - }, - "wlsUserName": { - "value": "GEN-UNIQUE" - } - } -} -EOF diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/gen-parameters-deploy-addnode-coherence.sh b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/gen-parameters-deploy-addnode-coherence.sh deleted file mode 100644 index cd51e709d..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/gen-parameters-deploy-addnode-coherence.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# Description -# This script is to generate test parameters with value for deploying addnode template - -#read arguments from stdin -read parametersPath adminPasswordOrKey adminVMName adminUsername numberOfExistingCacheNodes skuUrnVersion storageAccountName wlsDomainName location wlsusername wlspassword repoPath testbranchName managedServerPrefix - -cat < ${parametersPath} -{ - "adminPasswordOrKey":{ - "value": "${adminPasswordOrKey}" - }, - "adminVMName": { - "value": "${adminVMName}" - }, - "adminUsername": { - "value": "${adminUsername}" - }, - "numberOfExistingCacheNodes": { - "value": ${numberOfExistingCacheNodes} - }, - "numberOfNewCacheNodes": { - "value": 1 - }, - "location": { - "value": "${location}" - }, - "skuUrnVersion": { - "value": "${skuUrnVersion}" - }, - "storageAccountName": { - "value": "${storageAccountName}" - }, - "wlsDomainName": { - "value": "${wlsDomainName}" - }, - "vmSize": { - "value": "Standard_B2ms" - }, - "wlsPassword": { - "value": "${wlsPassword}" - }, - "wlsUserName": { - "value": "${wlsUserName}" - }, - "_artifactsLocation":{ - "value": "https://raw.githubusercontent.com/${repoPath}/${testbranchName}/weblogic-azure-vm/arm-oraclelinux-wls-cluster/addnode-coherence/src/main/" - }, - "managedServerPrefix": { - "value": "${managedServerPrefix}" - } - } -EOF diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/gen-parameters-deploy-addnode.sh b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/gen-parameters-deploy-addnode.sh deleted file mode 100644 index 0d542f880..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/gen-parameters-deploy-addnode.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# Description -# This script is to generate test parameters with value for deploying addnode template - -#read arguments from stdin -read parametersPath adminPasswordOrKey adminURL adminUsername numberOfExistingNodes skuUrnVersion storageAccountName wlsDomainName location wlsusername wlspassword repoPath testbranchName managedServerPrefix - -# do not include admin node. -numberOfExistingNodes=$((numberOfExistingNodes - 1)) - -cat < ${parametersPath} -{ - "adminPasswordOrKey":{ - "value": "${adminPasswordOrKey}" - }, - "adminURL": { - "value": "${adminURL}" - }, - "adminUsername": { - "value": "${adminUsername}" - }, - "enableCoherence": { - "value": true - }, - "numberOfExistingNodes": { - "value": ${numberOfExistingNodes} - }, - "numberOfNewNodes": { - "value": 1 - }, - "location": { - "value": "${location}" - }, - "skuUrnVersion": { - "value": "${skuUrnVersion}" - }, - "storageAccountName": { - "value": "${storageAccountName}" - }, - "vmSize": { - "value": "Standard_B2ms" - }, - "wlsDomainName": { - "value": "${wlsDomainName}" - }, - "wlsPassword": { - "value": "${wlsPassword}" - }, - "wlsUserName": { - "value": "${wlsUserName}" - }, - "_artifactsLocation":{ - "value": "https://raw.githubusercontent.com/${repoPath}/${testbranchName}/weblogic-azure-vm/arm-oraclelinux-wls-cluster/addnode/src/main/" - }, - "managedServerPrefix": { - "value": "${managedServerPrefix}" - } - } -EOF diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/gen-parameters-deploy-deletenode.sh b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/gen-parameters-deploy-deletenode.sh deleted file mode 100644 index 92526df4e..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/gen-parameters-deploy-deletenode.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# Description -# Generate parameters with value for deploying delete-node template. - -#read arguments from stdin -read parametersPath adminVMName location wlsusername wlspassword repoPath testbranchName managedServerPrefix - -cat < ${parametersPath} -{ - "adminVMName":{ - "value": "${adminVMName}" - }, - "deletingManagedServerNames": { - "value": ["${managedServerPrefix}2","${managedServerPrefix}Storage2"] - }, - "deletingManagedServerMachineNames": { - "value": ["${managedServerPrefix}VM2","${managedServerPrefix}StorageVM2"] - }, - "location": { - "value": "${location}" - }, - "wlsPassword": { - "value": "${wlsPassword}" - }, - "wlsUserName": { - "value": "${wlsUserName}" - }, - "_artifactsLocation":{ - "value": "https://raw.githubusercontent.com/${repoPath}/${testbranchName}/weblogic-azure-vm/arm-oraclelinux-wls-cluster/deletenode/src/main/" - } - } -EOF diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/gen-parameters-deploy.sh b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/gen-parameters-deploy.sh deleted file mode 100644 index 4893f2c2e..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/gen-parameters-deploy.sh +++ /dev/null @@ -1,171 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# Description -# This script is to generate general test parameters for testing. - -#read arguments from stdin -read parametersPath repoPath testbranchName location adminPasswordOrKey wlsUserName wlsDomainName skuUrnVersion dbName dbServerName dbPassword dbUser wlsPassword - -cat < ${parametersPath} -{ - "\$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "value": "https://raw.githubusercontent.com/${repoPath}/${testbranchName}/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/" - }, - "_artifactsLocationSasToken": { - "value": "" - }, - "location": { - "value": "${location}" - }, - "adminPasswordOrKey": { - "value": "${adminPasswordOrKey}" - }, - "adminUsername": { - "value": "weblogic" - }, - "appGatewayCertificateOption": { - "value": "generateCert" - }, - "authenticationType": { - "value": "password" - }, - "enableDB": { - "value": true - }, - "databaseType": { - "value": "postgresql" - }, - "dsConnectionURL": { - "value": "jdbc:postgresql://${dbServerName}.postgres.database.azure.com:5432/${dbName}?sslmode=require" - }, - "dbGlobalTranPro": { - "value": "EmulateTwoPhaseCommit" - }, - "dbPassword": { - "value": "${dbPassword}" - }, - "dbUser": { - "value": "${dbUser}" - }, - "enableAppGateway": { - "value": true - }, - "enableCoherence": { - "value": true - }, - "enableCoherenceWebLocalStorage": { - "value": true - }, - "enableCookieBasedAffinity": { - "value": true - }, - "enableDNSConfiguration": { - "value": false - }, - "enablePswlessConnection": { - "value": false - }, - "hasDNSZones": { - "value": false - }, - "jdbcDataSourceName": { - "value": "jdbc/WebLogicCafeDB" - }, - "numberOfCoherenceCacheInstances": { - "value": 1 - }, - "numberOfInstances": { - "value": 4 - }, - "skuUrnVersion": { - "value": "${skuUrnVersion}" - }, - "virtualNetworkNewOrExisting": { - "value": "new" - }, - "addressPrefixes": { - "value": [ - "172.16.6.0/23" - ] - }, - "subnetPrefix": { - "value": "172.16.7.0/28" - }, - "subnetPrefixForAppGateway": { - "value": "172.16.6.0/24" - }, - "vmSize": { - "value": "Standard_B1ms" - }, - "vmSizeSelectForCoherence": { - "value": "Standard_B1ms" - }, - "wlsDomainName": { - "value": "${wlsDomainName}" - }, - "wlsPassword": { - "value": "${wlsPassword}" - }, - "wlsUserName": { - "value": "${wlsUserName}" - }, - "enableCustomSSL": { - "value": false - }, - "tagsByResource": { - "value": { - "Microsoft.Network/applicationGateways": { - "Owner": "test" - }, - "Microsoft.Compute/availabilitySets": { - "Owner": "test" - }, - "Microsoft.Resources/deploymentScripts": { - "Owner": "test" - }, - "Microsoft.Network/dnszones": { - "Owner": "test" - }, - "Microsoft.KeyVault/vaults": { - "Owner": "test" - }, - "Microsoft.ManagedIdentity/userAssignedIdentities": { - "Owner": "test" - }, - "Microsoft resources deployment": { - "Owner": "test" - }, - "Microsoft.Network/networkInterfaces": { - "Owner": "test" - }, - "Microsoft.Network/networkSecurityGroups": { - "Owner": "test" - }, - "Microsoft.Network/privateEndpoints": { - "Owner": "test" - }, - "Microsoft.Network/publicIPAddresses": { - "Owner": "test" - }, - "Microsoft.Storage/storageAccounts": { - "Owner": "test" - }, - "Microsoft.Compute/virtualMachines": { - "Owner": "test" - }, - "Virtual machine extension": { - "Owner": "test" - }, - "Microsoft.Network/virtualNetworks": { - "Owner": "test" - } - } - } -} -} -EOF diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/gen-parameters.sh b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/gen-parameters.sh deleted file mode 100644 index 4f337d880..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/gen-parameters.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# Description -# This script is to generate general test parameters for testing. - -#read arguments from stdin -read parametersPath repoPath testbranchName - -cat < ${parametersPath} -{ - "\$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "value": "https://raw.githubusercontent.com/${repoPath}/${testbranchName}/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/" - }, - "_artifactsLocationSasToken": { - "value": "" - }, - "adminPasswordOrKey": { - "value": "GEN-UNIQUE" - }, - "adminUsername": { - "value": "GEN-UNIQUE" - }, - "enableAppGateway": { - "value": false - }, - "enableDB": { - "value": false - }, - "numberOfInstances": { - "value": 4 - }, - "vmSize": { - "value": "Standard_B2ms" - }, - "wlsPassword": { - "value": "GEN-UNIQUE" - }, - "wlsUserName": { - "value": "GEN-UNIQUE" - } - } -} -EOF diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/verify-admin-services.sh b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/verify-admin-services.sh deleted file mode 100644 index c73d12501..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/verify-admin-services.sh +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# Description -# This script is to test system services created on Azure VM. - - -# Verify the service using systemctl status -function verifyServiceStatus() -{ - serviceName=$1 - systemctl status $serviceName | grep "active (running)" - if [[ $? != 0 ]]; then - echo "$serviceName is not in active (running) state" - exit 1 - fi - echo "$serviceName is active (running)" -} - -#Verify the service using systemctl is-active -function verifyServiceActive() -{ - serviceName=$1 - state=$(systemctl is-active $serviceName) - if [[ $state == "active" ]]; then - echo "$serviceName is active" - else - echo "$serviceName is not active" - exit 1 - fi -} - -# Pass the services to be checked based on admin/managed servers -# For admin server : rngd wls_admin wls_nodemanager -# For managed server : rngd wls_nodemanager - -servicesList="rngd wls_admin wls_nodemanager" - -for service in $servicesList -do - verifyServiceStatus $service - verifyServiceActive $service -done - -exit 0 diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/verify-deployments.sh b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/verify-deployments.sh deleted file mode 100644 index 3a5c8c9e1..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/verify-deployments.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# Description -# This scipt is to deploy the Azure deployments based on test parameters created. - -#read arguments from stdin -read prefix location template repoPath testbranchName scriptsDir - -groupName=${prefix}-preflight -certDataName=certData -certPasswordName=certPassword - -# create Azure resources for preflight testing -az group create --verbose --name $groupName --location ${location} - -# generate parameters for testing differnt cases -parametersList=() -# parameters for cluster -bash ${scriptsDir}/gen-parameters.sh <<< "${scriptsDir}/parameters.json $repoPath $testbranchName" -parametersList+=(${scriptsDir}/parameters.json) - -# parameters for cluster+db -bash ${scriptsDir}/gen-parameters-db.sh <<< "${scriptsDir}/parameters-db.json $repoPath $testbranchName" -parametersList+=(${scriptsDir}/parameters-db.json) - -# parameters for cluster+coherence -bash ${scriptsDir}/gen-parameters-coherence.sh <<< "${scriptsDir}/parameters-coherence.json $repoPath $testbranchName" -parametersList+=(${scriptsDir}/parameters-coherence.json) - -# parameters for cluster+ag -bash ${scriptsDir}/gen-parameters-ag.sh <<< "${scriptsDir}/parameters-ag.json $repoPath $testbranchName" -parametersList+=(${scriptsDir}/parameters-ag.json) - -# parameters for cluster+db+ag -bash ${scriptsDir}/gen-parameters-db-ag.sh <<< "${scriptsDir}/parameters-db-ag.json $repoPath $testbranchName" -parametersList+=(${scriptsDir}/parameters-db-ag.json) - -# run preflight tests -success=true -for parameters in "${parametersList[@]}"; -do - echo "Validating deployment for ${parameters}" - az deployment group validate -g ${groupName} -f ${template} -p @${parameters} --no-prompt - if [[ $? != 0 ]]; then - echo "deployment validation for ${parameters} failed!" - success=false - fi -done - -# release Azure resources -az group delete --yes --no-wait --verbose --name $groupName - -if [[ $success == "false" ]]; then - exit 1 -else - exit 0 -fi diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/verify-node-services.sh b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/verify-node-services.sh deleted file mode 100644 index 3bac327da..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/verify-node-services.sh +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# Description -# This script is to test system services created on Azure VM. - - -# Verify the service using systemctl status -function verifyServiceStatus() -{ - serviceName=$1 - systemctl status $serviceName | grep "active (running)" - if [[ $? != 0 ]]; then - echo "$serviceName is not in active (running) state" - exit 1 - fi - echo "$serviceName is active (running)" -} - -#Verify the service using systemctl is-active -function verifyServiceActive() -{ - serviceName=$1 - state=$(systemctl is-active $serviceName) - if [[ $state == "active" ]]; then - echo "$serviceName is active" - else - echo "$serviceName is not active" - exit 1 - fi -} - -# Pass the services to be checked based on admin/managed servers -# For admin server : rngd wls_admin wls_nodemanager -# For managed server : rngd wls_nodemanager - -servicesList="rngd wls_nodemanager" - -for service in $servicesList -do - verifyServiceStatus $service - verifyServiceActive $service -done - -exit 0 diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/verify-servers-lifecycle.sh b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/verify-servers-lifecycle.sh deleted file mode 100644 index 6c1cbaa50..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/verify-servers-lifecycle.sh +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# Description -# This script is to test WebLogic cluster domain managed servers lifecycle. - -read wlsUserName wlspassword adminPublicIP adminPort managedServers - -CURL_REQD_PARMS="-s -v --user ${wlsUserName}:${wlspassword} -H X-Requested-By:MyClient -H Content-Type:application/json -H Accept:application/json" -CURL_RETRY_PARMS="--connect-timeout 60 --max-time 180 --retry 10 --retry-delay 30 --retry-max-time 180 --retry-connrefused " -# Shutdown the server and verify whether it is in SHUTDOWN state -# Restart the managed server -for managedServer in $managedServers -do - echo "Shut down managed server : $managedServer" - attempt=0 - while [ $attempt -le 5 ] - do - echo "Attempt to shutdown $attempt" - echo curl ${CURL_REQD_PARMS} -X POST -i "http://${adminPublicIP}:${adminPort}/management/weblogic/latest/domainRuntime/serverLifeCycleRuntimes/$managedServer/forceShutdown" --data "{}" - curl ${CURL_REQD_PARMS} -X POST -i "http://${adminPublicIP}:${adminPort}/management/weblogic/latest/domainRuntime/serverLifeCycleRuntimes/$managedServer/forceShutdown" --data "{}" > out - echo "Response received for shutdown REST command" - cat out - echo "Attempt to verify shutdown $attempt" - echo curl ${CURL_REQD_PARMS} ${CURL_RETRY_PARMS} -X GET -i "http://${adminPublicIP}:${adminPort}/management/weblogic/latest/domainRuntime/serverLifeCycleRuntimes/${managedServer}?links=none" - curl ${CURL_REQD_PARMS} ${CURL_RETRY_PARMS} -X GET -i "http://${adminPublicIP}:${adminPort}/management/weblogic/latest/domainRuntime/serverLifeCycleRuntimes/${managedServer}?links=none" > out - echo "Recevied response for shutdown verification" - cat out - cat out | grep "\"state\": \"SHUTDOWN\"" - if [ $? == 0 ]; then - echo "$managedServer managed server is in SHUTDOWN state as expected" - break - elif [[ $? != 0 ]] && [[ $attempt -ge 5 ]]; then - echo "$managedServer managed server is not in SHUTDOWN state after multiple attempts" - exit 1 - fi - attempt=$((attempt+1)) - sleep 30s - done - - echo "Starting managed server $managedServer" - attempt=0 - while [ $attempt -le 5 ] - do - echo "Attempt to starting server $attempt" - echo curl ${CURL_REQD_PARMS} -X POST -i "http://${adminPublicIP}:${adminPort}/management/weblogic/latest/domainRuntime/serverLifeCycleRuntimes/$managedServer/start" --data "{}" - curl ${CURL_REQD_PARMS} -X POST -i "http://${adminPublicIP}:${adminPort}/management/weblogic/latest/domainRuntime/serverLifeCycleRuntimes/$managedServer/start" --data "{}" > out - echo "Response received for start REST command" - cat out - - echo "Attempt to verify start $attempt" - echo curl ${CURL_REQD_PARMS} ${CURL_RETRY_PARMS} -X GET -i "http://${adminPublicIP}:${adminPort}/management/weblogic/latest/domainRuntime/serverLifeCycleRuntimes/${managedServer}?links=none" - curl ${CURL_REQD_PARMS} ${CURL_RETRY_PARMS} -X GET -i "http://${adminPublicIP}:${adminPort}/management/weblogic/latest/domainRuntime/serverLifeCycleRuntimes/${managedServer}?links=none" > out - echo "Recevied response for start verification" - cat out - cat out | grep "\"state\": \"RUNNING\"" - if [ $? == 0 ]; then - echo "$managedServer managed server is in RUNNING state as expected" - break - elif [[ $retVal != 0 ]] && [[ $attempt -ge 5 ]]; then - echo "$managedServer managed server is not in RUNNING state after multiple attempts" - exit 1 - fi - attempt=$((attempt+1)) - sleep 1m - done -done -exit 0 diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/verify-webapp-deployment.sh b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/verify-webapp-deployment.sh deleted file mode 100644 index cf648f81f..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/verify-webapp-deployment.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# Description -# This script is to test webapp application deployed on WebLogic cluster domain. - -# Verifying webapp deployment -read appGatewayURL - -CURL_RETRY_PARMS="--connect-timeout 60 --max-time 180 --retry 10 --retry-delay 30 --retry-max-time 180 --retry-connrefused" - -echo "Verifying WebLogic Cafe is deployed as expected" -curl --verbose ${appGatewayURL}weblogic-cafe/rest/coffees -response=$(curl ${CURL_RETRY_PARMS} --write-out '%{http_code}' --silent --output /dev/null ${appGatewayURL}weblogic-cafe/rest/coffees) -echo "$response" -if [ "$response" -ne 200 ]; then - echo "WebLogic Cafe is not accessible" - exit 1 -else - echo "WebLogic Cafe is accessible" -fi -exit 0 diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/verify-wls-access.sh b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/verify-wls-access.sh deleted file mode 100644 index 4ff452b00..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/verify-wls-access.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# Description -# This script is to test WebLogic admin, console and managed servers access. - -# Verifying admin server is accessible - -#read arguments from stdin -read adminPublicIP adminPort wlsUserName wlspassword managedServers - -CURL_PARMS="--connect-timeout 60 --max-time 180 --retry 10 --retry-delay 30 --retry-max-time 180 --retry-connrefused" - -echo "Verifying http://${adminPublicIP}:${adminPort}/weblogic/ready" -curl ${CURL_PARMS} http://${adminPublicIP}:${adminPort}/weblogic/ready - -if [[ $? != 0 ]]; then - echo "Failed : WebLogic admin server is not accessible" - exit 1 -else - echo "WebLogic admin server is accessible" -fi - -# Verifying whether admin console is accessible -echo "Checking WebLogic admin console is acessible" -curl ${CURL_PARMS} http://${adminPublicIP}:${adminPort}/console/ -if [[ $? != 0 ]]; then - echo "WebLogic admin console is not accessible" - exit 1 -else - echo "WebLogic admin console is accessible" - exit 0 -fi - - -#Verifying whether managed servers are up/running -for managedServer in $managedServers -do - echo "Verifying managed server : $managedServer" - curl ${CURL_PARMS} --user $wlsUserName:$wlspassword -X GET -H 'X-Requested-By: MyClient' -H 'Content-Type: application/json' -H 'Accept: application/json' -i "http://${adminPublicIP}:${adminPort}/management/weblogic/latest/domainRuntime/serverRuntimes/$managedServer" | grep "\"state\": \"RUNNING\"" - if [ $? == 0 ]; then - echo "$managedServer managed server is in RUNNING state" - else - echo "$managedServer managed server is not in RUNNING state" - exit 1 - fi -done -exit 0 diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/README.md b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/README.md deleted file mode 100644 index 8908bae6a..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/README.md +++ /dev/null @@ -1,12 +0,0 @@ - - -## WebLogic Server (with N-Node Dynamic Cluster) on Microsoft Azure - Marketplace Offerings - -This git repository is used to maintain the Azure Resource Management (ARM) templates and other scripts -used for the implementation of WebLogic Server (with N-Node Dynamic Cluster) on Microsoft Azure. - -For WebLogic Server running in the Azure Virtual Machines documentation, please refer to the [README documentation](https://github.com/oracle/weblogic-azure/weblogic-azure-vm/arm-oraclelinux-wls/README.md). - diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/addnode-coherence/pom.xml b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/addnode-coherence/pom.xml deleted file mode 100644 index b42449fdd..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/addnode-coherence/pom.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - 4.0.0 - - - com.oracle.weblogic.azure - weblogic-azure-vm - 1.0.0 - ../../pom.xml - - - com.oracle.weblogic.azure - arm-oraclelinux-wls-dynamic-cluster-addnode-coherence - ${version.arm-oraclelinux-wls-dynamic-cluster-addnode-coherence} - - jar - ${project.artifactId} - - - -TestParameter '@{"SampleName"="addnode-coherence/src/main";"RawRepoPath"="${artifactsLocationBase}/arm-oraclelinux-wls-dynamic-cluster/"}' - ${project.basedir}/../../.. - false - false - - - - - - - diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/addnode-coherence/src/main/arm/addnodedeploy.parameters.json b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/addnode-coherence/src/main/arm/addnodedeploy.parameters.json deleted file mode 100644 index a35fc0391..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/addnode-coherence/src/main/arm/addnodedeploy.parameters.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "adminPasswordOrKey": { - "value": "GEN-SSH-PUB-KEY" - }, - "adminUsername": { - "value": "GEN-UNIQUE" - }, - "adminVMName": { - "value": "GEN-UNIQUE" - }, - "dnsLabelPrefix": { - "value": "GEN-UNIQUE" - }, - "numberOfExistingCacheNodes": { - "value": 1 - }, - "numberOfNewCacheNodes": { - "value": 1 - }, - "skuUrnVersion": { - "value": "GEN-UNIQUE" - }, - "storageAccountName": { - "value": "GEN-UNIQUE" - }, - "usePreviewImage": { - "value": "GEN-UNIQUE" - }, - "vmSize": { - "value": "GEN-UNIQUE" - }, - "wlsDomainName": { - "value": "GEN-UNIQUE" - }, - "wlsPassword": { - "value": "GEN-UNIQUE" - }, - "wlsUserName": { - "value": "GEN-UNIQUE" - } - } -} \ No newline at end of file diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/addnode-coherence/src/main/arm/mainTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/addnode-coherence/src/main/arm/mainTemplate.json deleted file mode 100644 index f24a984a6..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/addnode-coherence/src/main/arm/mainTemplate.json +++ /dev/null @@ -1,468 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - }, - "defaultValue": "${artifactsLocationBase}/arm-oraclelinux-wls-dynamic-cluster/addnode-coherence/src/main/" - }, - "_artifactsLocationSasToken": { - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - }, - "defaultValue": "" - }, - "adminPasswordOrKey": { - "type": "securestring", - "metadata": { - "description": "SSH Key or password for the Virtual Machine. SSH key is recommended." - } - }, - "adminUsername": { - "type": "string", - "defaultValue": "weblogic", - "metadata": { - "description": "User name for the Virtual Machine." - } - }, - "adminVMName": { - "defaultValue": "adminVM", - "type": "string", - "metadata": { - "description": "Admin Server hosting VM name." - } - }, - "authenticationType": { - "type": "string", - "defaultValue": "password", - "allowedValues": [ - "sshPublicKey", - "password" - ], - "metadata": { - "description": "Type of authentication to use on the Virtual Machine. SSH key is recommended." - } - }, - "dnsLabelPrefix": { - "type": "string", - "defaultValue": "wls", - "metadata": { - "description": "Unique DNS Name for the Public IP used to access the Virtual Machine." - } - }, - "elkSettings": { - "type": "object", - "defaultValue": { - "enable": false, - "elasticsearchEndpoint": "null", - "elasticsearchPassword": "null", - "elasticsearchUserName": "null", - "logIndex": "null", - "logsToIntegrate": [ "HTTPAccessLog", "ServerLog", "DomainLog", "DataSourceLog", "StandardErrorAndOutput", "NodeManagerLog" ] - }, - "metadata": { - "description": "If enable is true, must specify all the properties of elkSettings. logsToIntegrate must be value of an array." - } - }, - "enableCoherenceWebLocalStorage": { - "defaultValue": true, - "type": "bool", - "metadata": { - "description": "Specifies whether Local Storage is enabled for the Coherence*Web cluster tier." - } - }, - "guidValue": { - "type": "string", - "defaultValue": "[newGuid()]" - }, - "location": { - "type": "string", - "metadata": { - "description": "Location for all resources." - } - }, - "managedServerPrefix": { - "type": "string", - "defaultValue": "msp", - "metadata": { - "description": "Provide managed server prefix name" - } - }, - "numberOfExistingCacheNodes": { - "type": "int", - "defaultValue": 1, - "minValue": 1, - "maxValue": 20, - "metadata": { - "description": "Number of existing Coherence cache servers, used to name new Virtual Machines and new Managed Server for cache." - } - }, - "numberOfNewCacheNodes": { - "type": "int", - "defaultValue": 1, - "minValue": 1, - "maxValue": 20, - "metadata": { - "description": "Number of new Coherence cahce servers, used to create Virtual Machines and Managed Server for cache." - } - }, - "skuUrnVersion": { - "type": "string", - "defaultValue": "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest", - "allowedValues": [ - "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest", - "owls-141100-jdk11-ol87;Oracle:weblogic-141100-jdk11-ol87:owls-141100-jdk11-ol87;latest", - "owls-141100-jdk8-ol91;Oracle:weblogic-141100-jdk8-ol91:owls-141100-jdk8-ol91;latest", - "owls-141100-jdk8-ol87;Oracle:weblogic-141100-jdk8-ol87:owls-141100-jdk8-ol87;latest", - "owls-122140-jdk8-ol91;Oracle:weblogic-122140-jdk8-ol91:owls-122140-jdk8-ol91;latest", - "owls-122140-jdk8-ol87;Oracle:weblogic-122140-jdk8-ol87:owls-122140-jdk8-ol87;latest", - "owls-122140-jdk8-ol76;Oracle:weblogic-122140-jdk8-ol76:owls-122140-jdk8-ol7;latest", - "owls-141100-jdk8-ol76;Oracle:weblogic-141100-jdk8-ol76:owls-141100-jdk8-ol7;latest", - "owls-141100-jdk11-ol76;Oracle:weblogic-141100-jdk11-ol76:owls-141100-jdk11-ol7;latest", - "owls-141100-jdk11-rhel87;Oracle:weblogic-141100-jdk11-rhel87:owls-141100-jdk11-rhel87;latest", - "owls-141100-jdk8-rhel87;Oracle:weblogic-141100-jdk8-rhel87:owls-141100-jdk8-rhel87;latest", - "owls-122140-jdk8-rhel87;Oracle:weblogic-122140-jdk8-rhel87:owls-122140-jdk8-rhel87;latest", - "owls-122140-jdk8-rhel76;Oracle:weblogic-122140-jdk8-rhel76:owls-122140-jdk8-rhel76;latest", - "owls-141100-jdk8-rhel76;Oracle:weblogic-141100-jdk8-rhel76:owls-141100-jdk8-rhel76;latest", - "owls-141100-jdk11-rhel76;Oracle:weblogic-141100-jdk11-rhel76:owls-141100-jdk11-rhel76;latest" - ], - "metadata": { - "description": "The Oracle Linux image with Weblogic and Java preinstalled. Semicolon separated string of Sku, URN, and Version" - } - }, - "storageAccountName": { - "type": "string", - "metadata": { - "description": "Name of storage account. One storage account can store 20 vitual machines with 2 VHDs of 500 IOPS." - } - }, - "usePreviewImage": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "Bool value, if it's set to true, will deploy with preview weblogic image." - } - }, - "vmSize": { - "defaultValue": "Standard_A3", - "type": "string", - "metadata": { - "description": "Select appropriate VM Size for Coherence" - } - }, - "virtualNetworkName": { - "type": "string", - "defaultValue": "wls-vnet", - "metadata": { - "description": "Name of the existing or new VNET" - } - }, - "virtualNetworkResourceGroupName": { - "type": "string", - "defaultValue": "[resourceGroup().name]", - "metadata": { - "description": "Resource group of Virtual network" - } - }, - "subnetName": { - "type": "string", - "defaultValue": "wls-subnet", - "metadata": { - "description": "Name of the existing or new Subnet" - } - }, - "wlsDomainName": { - "type": "string", - "defaultValue": "wlsd", - "metadata": { - "description": "Provide Weblogic domain name" - } - }, - "wlsPassword": { - "type": "securestring", - "metadata": { - "description": "Password for your Weblogic domain name" - } - }, - "wlsUserName": { - "defaultValue": "weblogic", - "type": "string", - "metadata": { - "description": "Username for your Weblogic domain name" - } - }, - "enableDNSConfiguration": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "Boolean value indicating, if DNS Zone Configuration is enabled or not" - } - }, - "customDNSNameForAdminServer": { - "type": "string", - "defaultValue": "none", - "metadata": { - "description": "Custom DNS Name for WebLogic Admin Server" - } - }, - "customSSLSettings": { - "type": "object", - "defaultValue": { - "enable": false, - "customIdentityKeyStoreBase64String": "null", - "customIdentityKeyStorePassPhrase": "null", - "customIdentityKeyStoreType": "null", - "customTrustKeyStoreBase64String": "null", - "customTrustKeyStorePassPhrase": "null", - "customTrustKeyStoreType": "null", - "privateKeyAlias":"null", - "privateKeyPassPhrase":"null" - }, - "metadata": { - "description": "If enable is true, must specify all customSSLSettings configured in WebLogic Admin Server. customIdentityKeyStoreBase64String & customTrustKeyStoreBase64String are the custom identity & trust keystore data repectively, i.e., contents of identity.jks, trust.jks keystore files in base64 encoding. Similarly, all other custom ssl settings are also required to configure SSL settings" - } - } - }, - "variables": { - "const_cacheServerIndexOffset": "[add(parameters('numberOfExistingCacheNodes'), 1)]", - "const_hyphen": "-", - "const_imageOffer": "[concat('weblogic',variables('const_hyphen'), split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[1],variables('const_hyphen'),split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[2],variables('const_hyphen'),split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[3],if(parameters('usePreviewImage'),'-preview',''))]", - "const_imagePublisher": "oracle", - "const_linuxConfiguration": { - "disablePasswordAuthentication": true, - "ssh": { - "publicKeys": [ - { - "path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]", - "keyData": "[parameters('adminPasswordOrKey')]" - } - ] - } - }, - "const_mountPointPath": "[concat('/mnt/', variables('name_share'))]", - "const_publicIPAddressType": "Dynamic", - "const_vmSize": "[parameters('vmSize')]", - "const_wlsDomainPath": "/u01/domains", - "const_wlsHome": "/u01/app/wls/install/oracle/middleware/oracle_home", - "name_linuxImageOfferSKU": "[first(split(parameters('skuUrnVersion'), ';'))]", - "name_linuxImageVersion": "[last(split(parameters('skuUrnVersion'),';'))]", - "name_nic": "_NIC", - "name_publicIPAddress": "_PublicIP", - "name_scriptCoherenceFile": "setupCoherence.sh", - "name_scriptELKConfiguration": "elkIntegrationForConfiguredCluster.sh", - "name_share": "wlsshare", - "name_subnet": "[parameters('subnetName')]", - "name_virtualNetwork": "[parameters('virtualNetworkName')]", - "name_vmMachine": "[concat(parameters('managedServerPrefix'),'StorageVM')]", - "name_wlsServerPrefix": "[concat(parameters('managedServerPrefix'),'Storage')]", - "ref_subnet": "[resourceId(parameters('virtualNetworkResourceGroupName'), 'Microsoft.Network/virtualNetworks/subnets', variables('name_virtualNetwork'), variables('name_subnet'))]", - "name_customHostnameGeneratorscriptFile": "generateCustomHostNameVerifier.sh", - "name_customHostnameVerifierJavaFile": "src/main/java/WebLogicCustomHostNameVerifier.java", - "name_customHostnameValuesTemplate": "src/main/java/HostNameValuesTemplate.txt", - "name_customHostnameVerifierTest" : "src/test/java/WebLogicCustomHostNameVerifierTest.java" - }, - "functions": [ - { - "namespace": "array", - "members": { - "join": { - "parameters": [ - { - "name": "items", - "type": "array" - } - ], - "output": { - "type": "string", - "value": "[replace(replace(replace(string(parameters('items')), '[\"', ''), '\"]', ''), '\",\"', ',')]" - } - } - } - } - ], - "resources": [ - { - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${dynamic.addnode.coherence.start}", - "type": "Microsoft.Resources/deployments", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "apiVersion": "${azure.apiVersionForPublicIPAddresses}", - "type": "Microsoft.Network/publicIPAddresses", - "name": "[concat(variables('name_vmMachine'),copyIndex(variables('const_cacheServerIndexOffset')),variables('name_publicIPAddress'))]", - "location": "[parameters('location')]", - "copy": { - "name": "publicIPLoop", - "count": "[parameters('numberOfNewCacheNodes')]" - }, - "properties": { - "publicIPAllocationMethod": "[variables('const_publicIPAddressType')]", - "dnsSettings": { - "domainNameLabel": "[concat(toLower(parameters('dnsLabelPrefix')),copyindex(variables('const_cacheServerIndexOffset')),'-',take(replace(parameters('guidValue'),'-',''),10),'-',toLower(parameters('wlsDomainName')))]" - } - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualNetworks}", - "type": "Microsoft.Network/virtualNetworks/subnets", - "name": "[concat(variables('name_virtualNetwork'), '/', variables('name_subnet'))]", - "condition": "[and(empty(variables('name_virtualNetwork')), empty(variables('name_subnet')))]" - }, - { - "apiVersion": "${azure.apiVersionForNetworkInterfaces}", - "type": "Microsoft.Network/networkInterfaces", - "name": "[concat(variables('name_vmMachine'), copyIndex(variables('const_cacheServerIndexOffset')), variables('name_nic'))]", - "location": "[parameters('location')]", - "copy": { - "name": "nicLoop", - "count": "[parameters('numberOfNewCacheNodes')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.Network/publicIPAddresses/', concat(variables('name_vmMachine'),copyIndex(variables('const_cacheServerIndexOffset')),variables('name_publicIPAddress')))]" - ], - "properties": { - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses',concat(variables('name_vmMachine'),copyIndex(variables('const_cacheServerIndexOffset')),variables('name_publicIPAddress')))]" - }, - "subnet": { - "id": "[variables('ref_subnet')]" - } - } - } - ], - "dnsSettings": { - "internalDnsNameLabel": "[concat(variables('name_vmMachine'), copyIndex(variables('const_cacheServerIndexOffset')))]" - } - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines", - "name": "[concat(variables('name_vmMachine'), copyIndex(variables('const_cacheServerIndexOffset')))]", - "location": "[parameters('location')]", - "copy": { - "name": "virtualMachineLoop", - "count": "[parameters('numberOfNewCacheNodes')]" - }, - "dependsOn": [ - "nicLoop" - ], - "properties": { - "hardwareProfile": { - "vmSize": "[variables('const_vmSize')]" - }, - "osProfile": { - "computerName": "[concat(variables('name_vmMachine'), copyIndex(variables('const_cacheServerIndexOffset')))]", - "adminUsername": "[parameters('adminUsername')]", - "adminPassword": "[parameters('adminPasswordOrKey')]", - "linuxConfiguration": "[if(equals(parameters('authenticationType'), 'password'), json('null'), variables('const_linuxConfiguration'))]" - }, - "storageProfile": { - "imageReference": { - "publisher": "[variables('const_imagePublisher')]", - "offer": "[variables('const_imageOffer')]", - "sku": "[variables('name_linuxImageOfferSKU')]", - "version": "[variables('name_linuxImageVersion')]" - }, - "osDisk": { - "createOption": "FromImage", - "managedDisk": { - "storageAccountType": "Standard_LRS" - } - } - }, - "networkProfile": { - "networkInterfaces": [ - { - "id": "[resourceId('Microsoft.Network/networkInterfaces',concat(variables('name_vmMachine'), copyIndex(variables('const_cacheServerIndexOffset')), variables('name_nic')))]" - } - ] - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": true, - "storageUri": "[reference(resourceId('Microsoft.Storage/storageAccounts/', parameters('storageAccountName')), '${azure.apiVersionForStorage}').primaryEndpoints.blob]" - } - } - }, - "plan": { - "name": "[variables('name_linuxImageOfferSKU')]", - "publisher": "[variables('const_imagePublisher')]", - "product": "[variables('const_imageOffer')]" - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines/extensions", - "name": "[concat(variables('name_vmMachine'), copyIndex(variables('const_cacheServerIndexOffset')),'/newuserscript')]", - "location": "[parameters('location')]", - "copy": { - "name": "virtualMachineExtensionLoop", - "count": "[parameters('numberOfNewCacheNodes')]" - }, - "dependsOn": [ - "virtualMachineLoop" - ], - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.0", - "autoUpgradeMinorVersion": true, - "settings": { - "fileUris": [ - "[uri(parameters('_artifactsLocation'), concat('../../../arm-oraclelinux-wls-dynamic-cluster/src/main/scripts/', variables('name_scriptCoherenceFile'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocation'), concat('../../../arm-oraclelinux-wls-dynamic-cluster/src/main/scripts/', variables('name_scriptELKConfiguration'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocation'), concat('../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameGeneratorscriptFile'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocation'), concat('../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameVerifierJavaFile'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocation'), concat('../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameValuesTemplate'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocation'), concat('../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameVerifierTest'), parameters('_artifactsLocationSasToken')))]" - ] - }, - "protectedSettings": { - "commandToExecute": "[concat('sh',' ',variables('name_scriptCoherenceFile'), ' <<< \"', parameters('wlsDomainName'),' ',parameters('wlsUserName'),' ',parameters('wlsPassword'),' ',parameters('adminVMName'),' ',variables('const_wlsHome'),' ',variables('const_wlsDomainPath'),' ', parameters('storageAccountName'), ' ', listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName')), '${azure.apiVersionForStorage}').keys[0].value,' ', variables('const_mountPointPath'),' ', parameters('enableCoherenceWebLocalStorage'),' ',parameters('elkSettings').enable, ' ',parameters('elkSettings').elasticsearchEndpoint,' ', parameters('elkSettings').elasticsearchUserName,' ', parameters('elkSettings').elasticsearchPassword, ' ', array.join(parameters('elkSettings').logsToIntegrate), ' ',parameters('elkSettings').logIndex, ' ',variables('name_wlsServerPrefix'),' ',copyIndex(variables('const_cacheServerIndexOffset')),' ',if(parameters('enableDNSConfiguration'),parameters('customDNSNameForAdminServer'),parameters('adminVMName')),' ',parameters('dnsLabelPrefix'),' ',parameters('location'),' ',parameters('customSSLSettings').enable,' ',if(parameters('customSSLSettings').enable,base64(parameters('customSSLSettings').customIdentityKeyStoreBase64String), 'null'),' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').customIdentityKeyStorePassPhrase, 'null'),' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').customIdentityKeyStoreType, 'null'),' ',if(parameters('customSSLSettings').enable,base64(parameters('customSSLSettings').customTrustKeyStoreBase64String), 'null'),' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').customTrustKeyStorePassPhrase, 'null'),' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').customTrustKeyStoreType, 'null'),' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').privateKeyAlias, 'null'),' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').privateKeyPassPhrase, 'null'),'\"')]" - } - } - }, - { - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${dynamic.addnode.coherence.end}", - "type": "Microsoft.Resources/deployments", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - } - ], - "outputs": { - "artifactsLocationPassedIn": { - "type": "string", - "value": "[parameters('_artifactsLocation')]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/addnode/pom.xml b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/addnode/pom.xml deleted file mode 100644 index a91a5e9d7..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/addnode/pom.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - 4.0.0 - - - com.oracle.weblogic.azure - weblogic-azure-vm - 1.0.0 - ../../pom.xml - - - com.oracle.weblogic.azure - arm-oraclelinux-wls-dynamic-cluster-addnode - ${version.arm-oraclelinux-wls-dynamic-cluster-addnode} - - jar - ${project.artifactId} - - - -TestParameter '@{"SampleName"="addnode/src/main";"RawRepoPath"="${artifactsLocationBase}/arm-oraclelinux-wls-dynamic-cluster/"}' - ${project.basedir}/../../.. - false - false - - - - - - - diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/addnode/src/main/arm/addNodeToDynamicClusterdeploy.parameters.json b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/addnode/src/main/arm/addNodeToDynamicClusterdeploy.parameters.json deleted file mode 100644 index 79ce55a28..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/addnode/src/main/arm/addNodeToDynamicClusterdeploy.parameters.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "value":"GEN-UNIQUE" - }, - "aadsSettings": { - "value": { - "enable": true, - "publicIP": "GEN-UNIQUE", - "serverHost": "GEN-UNIQUE", - "certificateBase64String": "GEN-UNIQUE" - } - }, - "adminPasswordOrKey": { - "value": "GEN-SSH-PUB-KEY" - }, - "adminURL": { - "value": "GEN-UNIQUE" - }, - "adminUsername": { - "value": "GEN-UNIQUE" - }, - "dnsLabelPrefix": { - "value": "GEN-UNIQUE" - }, - "location": { - "value": "GEN-UNIQUE" - }, - "managedServerPrefix": { - "value": "GEN-UNIQUE" - }, - "numberOfExistingNodes": { - "value": "GEN-UNIQUE" - }, - "numberOfNewNodes": { - "value": "GEN-UNIQUE" - }, - "skuUrnVersion": { - "value": "GEN-UNIQUE" - }, - "storageAccountName": { - "value": "GEN-UNIQUE" - }, - "usePreviewImage": { - "value": "GEN-UNIQUE" - }, - "vmSize": { - "value": "GEN-UNIQUE" - }, - "wlsDomainName": { - "value": "GEN-UNIQUE" - }, - "wlsUserName": { - "value": "GEN-UNIQUE" - }, - "wlsPassword": { - "value": "GEN-UNIQUE" - }, - "customSSLSettings": { - "value": { - "enable": false, - "customIdentityKeyStoreBase64String": "GEN-UNIQUE", - "customIdentityKeyStorePassPhrase": "GEN-UNIQUE", - "customIdentityKeyStoreType": "GEN-UNIQUE", - "customTrustKeyStoreBase64String": "GEN-UNIQUE", - "customTrustKeyStorePassPhrase": "GEN-UNIQUE", - "customTrustKeyStoreType": "GEN-UNIQUE", - "privateKeyAlias": "GEN-UNIQUE", - "privateKeyPassPhrase": "GEN-UNIQUE" - } - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/addnode/src/main/arm/mainTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/addnode/src/main/arm/mainTemplate.json deleted file mode 100644 index 94a0f995b..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/addnode/src/main/arm/mainTemplate.json +++ /dev/null @@ -1,490 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - }, - "defaultValue": "${artifactsLocationBase}/arm-oraclelinux-wls-dynamic-cluster/addnode/src/main/" - }, - "_artifactsLocationSasToken": { - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - }, - "defaultValue": "" - }, - "aadsSettings": { - "type": "object", - "defaultValue": { - "enable": false, - "publicIP": "null", - "serverHost": "null", - "certificateBase64String": "null" - }, - "metadata": { - "description": "If enable is true, must specify all aadSettings. publicIP is the Azure Active Directory LDAP server public IP address. serverHost is the LDAP server host. certificateBase64String is based64 string of LADP client certificate that will be imported to trust store of WebLogic Server to enable SSL connection of AD provider." - } - }, - "adminPasswordOrKey": { - "type": "securestring", - "metadata": { - "description": "SSH Key or password for the Virtual Machine. SSH key is recommended." - } - }, - "adminURL": { - "type": "string", - "metadata": { - "description": "Provide admin URL with vm0_public_ip:7001" - } - }, - "adminVMName": { - "type": "string", - "defaultValue": "adminVM", - "metadata": { - "description": "Provide admin VM Name ex: adminVM" - } - }, - "adminUsername": { - "type": "string", - "defaultValue": "weblogic", - "metadata": { - "description": "User name for the Virtual Machine." - } - }, - "authenticationType": { - "type": "string", - "defaultValue": "password", - "allowedValues": [ - "sshPublicKey", - "password" - ], - "metadata": { - "description": "Type of authentication to use on the Virtual Machine. SSH key is recommended." - } - }, - "dnsLabelPrefix": { - "type": "string", - "defaultValue": "wls", - "metadata": { - "description": "Unique DNS Name for the Public IP used to access the Virtual Machine." - } - }, - "dynamicClusterSize": { - "defaultValue": 2, - "type": "int", - "metadata": { - "description": "Initial Number of Managed Servers that will be configured in the Dynamic Cluster" - } - }, - "elkSettings": { - "type": "object", - "defaultValue": { - "enable": false, - "elasticsearchEndpoint": "null", - "elasticsearchPassword": "null", - "elasticsearchUserName": "null", - "logIndex": "null", - "logsToIntegrate": [ "HTTPAccessLog", "ServerLog", "DomainLog", "DataSourceLog", "StandardErrorAndOutput", "NodeManagerLog" ] - }, - "metadata": { - "description": "If enable is true, must specify all the properties of elkSettings. logsToIntegrate must be value of an array." - } - }, - "guidValue": { - "type": "string", - "defaultValue": "[newGuid()]" - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]", - "metadata": { - "description": "Location for all resources." - } - }, - "managedServerPrefix": { - "type": "string", - "defaultValue": "msp", - "metadata": { - "description": "Provide managed server prefix" - } - }, - "maxDynamicClusterSize": { - "defaultValue": 10, - "type": "int", - "metadata": { - "description": "Maximum number of Managed Servers allowed to be configured in the Dynamic Cluster." - } - }, - "numberOfExistingNodes": { - "type": "int", - "minValue": 1, - "maxValue": 20, - "metadata": { - "description": "The number of existing vitural machines that host aplication managed servers, used to generate new virtual machine name." - } - }, - "numberOfNewNodes": { - "type": "int", - "defaultValue": 1, - "minValue": 1, - "maxValue": 20, - "metadata": { - "description": "The number of new machine to add." - } - }, - "skuUrnVersion": { - "type": "string", - "defaultValue": "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest", - "allowedValues": [ - "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest", - "owls-141100-jdk11-ol87;Oracle:weblogic-141100-jdk11-ol87:owls-141100-jdk11-ol87;latest", - "owls-141100-jdk8-ol91;Oracle:weblogic-141100-jdk8-ol91:owls-141100-jdk8-ol91;latest", - "owls-141100-jdk8-ol87;Oracle:weblogic-141100-jdk8-ol87:owls-141100-jdk8-ol87;latest", - "owls-122140-jdk8-ol91;Oracle:weblogic-122140-jdk8-ol91:owls-122140-jdk8-ol91;latest", - "owls-122140-jdk8-ol87;Oracle:weblogic-122140-jdk8-ol87:owls-122140-jdk8-ol87;latest", - "owls-122140-jdk8-ol76;Oracle:weblogic-122140-jdk8-ol76:owls-122140-jdk8-ol7;latest", - "owls-141100-jdk8-ol76;Oracle:weblogic-141100-jdk8-ol76:owls-141100-jdk8-ol7;latest", - "owls-141100-jdk11-ol76;Oracle:weblogic-141100-jdk11-ol76:owls-141100-jdk11-ol7;latest", - "owls-141100-jdk11-rhel87;Oracle:weblogic-141100-jdk11-rhel87:owls-141100-jdk11-rhel87;latest", - "owls-141100-jdk8-rhel87;Oracle:weblogic-141100-jdk8-rhel87:owls-141100-jdk8-rhel87;latest", - "owls-122140-jdk8-rhel87;Oracle:weblogic-122140-jdk8-rhel87:owls-122140-jdk8-rhel87;latest", - "owls-122140-jdk8-rhel76;Oracle:weblogic-122140-jdk8-rhel76:owls-122140-jdk8-rhel76;latest", - "owls-141100-jdk8-rhel76;Oracle:weblogic-141100-jdk8-rhel76:owls-141100-jdk8-rhel76;latest", - "owls-141100-jdk11-rhel76;Oracle:weblogic-141100-jdk11-rhel76:owls-141100-jdk11-rhel76;latest" - ], - "metadata": { - "description": "The Oracle Linux image with Weblogic and Java preinstalled. Semicolon separated string of Sku, URN, and Version" - } - }, - "storageAccountName": { - "type": "string", - "metadata": { - "description": "Name of storage account. One storage account can store 20 vitual machines with 2 VHDs of 500 IOPS." - } - }, - "usePreviewImage": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "Bool value, if it's set to true, will deploy with preview weblogic image." - } - }, - "vmSize": { - "type": "string", - "defaultValue": "Standard_A3", - "metadata": { - "description": "Select appropriate VM Size as per requirement" - } - }, - "virtualNetworkName": { - "type": "string", - "defaultValue": "wls-vnet", - "metadata": { - "description": "Name of the existing or new VNET" - } - }, - "virtualNetworkResourceGroupName": { - "type": "string", - "defaultValue": "[resourceGroup().name]", - "metadata": { - "description": "Resource group of Virtual network" - } - }, - "subnetName": { - "type": "string", - "defaultValue": "wls-subnet", - "metadata": { - "description": "Name of the existing or new Subnet" - } - }, - "wlsDomainName": { - "type": "string", - "defaultValue": "wlsd", - "metadata": { - "description": "Provide existing running Weblogic domain name" - } - }, - "wlsUserName": { - "type": "string", - "metadata": { - "description": "Username for your Weblogic domain name" - } - }, - "wlsPassword": { - "type": "securestring", - "metadata": { - "description": "Password for your Weblogic domain name" - } - }, - "enableDNSConfiguration": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "Boolean value indicating, if DNS Zone Configuration is enabled or not" - } - }, - "customDNSNameForAdminServer": { - "type": "string", - "defaultValue": "none", - "metadata": { - "description": "Custom DNS Name for WebLogic Admin Server" - } - }, - "customSSLSettings": { - "type": "object", - "defaultValue": { - "enable": false, - "customIdentityKeyStoreBase64String": "null", - "customIdentityKeyStorePassPhrase": "null", - "customIdentityKeyStoreType": "null", - "customTrustKeyStoreBase64String": "null", - "customTrustKeyStorePassPhrase": "null", - "customTrustKeyStoreType": "null", - "privateKeyAlias":"null", - "privateKeyPassPhrase":"null" - }, - "metadata": { - "description": "If enable is true, must specify all customSSLSettings. customIdentityKeyStoreBase64String & customTrustKeyStoreBase64String are the custom identity & trust keystore data repectively, i.e., contents of identity.jks, trust.jks keystore files in base64 encoding. Similarly, all other custom ssl settings are also required to configure SSL settings" - } - } - }, - "variables": { - "const_appNodeMachineOffset": "[add(parameters('numberOfExistingNodes'), 1)]", - "const_hyphen": "-", - "const_imageOffer": "[concat('weblogic',variables('const_hyphen'), split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[1],variables('const_hyphen'),split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[2],variables('const_hyphen'),split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[3],if(parameters('usePreviewImage'),'-preview',''))]", - "const_imagePublisher": "oracle", - "const_linuxConfiguration": { - "disablePasswordAuthentication": true, - "ssh": { - "publicKeys": [ - { - "path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]", - "keyData": "[parameters('adminPasswordOrKey')]" - } - ] - } - }, - "const_managedVMPrefix": "[concat(parameters('managedServerPrefix'),'VM')]", - "const_mountPointPath": "[concat('/mnt/', variables('name_share'))]", - "const_publicIPAddressType": "Dynamic", - "const_vmSize": "[parameters('vmSize')]", - "const_wlsHome": "/u01/app/wls/install/oracle/middleware/oracle_home", - "const_wlsDomainPath": "/u01/domains", - "name_linuxImageOfferSKU": "[first(split(parameters('skuUrnVersion'), ';'))]", - "name_linuxImageVersion": "[last(split(parameters('skuUrnVersion'),';'))]", - "name_nic": "_NIC", - "name_publicIPAddress": "_PublicIP", - "name_scriptELKConfiguration": "elkIntegrationForDynamicCluster.sh", - "name_scriptFile": "addNodeToDynamicCluster.sh", - "name_share": "wlsshare", - "name_subnet": "[parameters('subnetName')]", - "name_virtualNetwork": "[parameters('virtualNetworkName')]", - "name_vmMachine": "[concat(parameters('managedServerPrefix'),'VM')]", - "ref_subnet": "[resourceId(parameters('virtualNetworkResourceGroupName'), 'Microsoft.Network/virtualNetworks/subnets', variables('name_virtualNetwork'), variables('name_subnet'))]", - "name_customHostnameGeneratorscriptFile": "generateCustomHostNameVerifier.sh", - "name_customHostnameVerifierJavaFile": "src/main/java/WebLogicCustomHostNameVerifier.java", - "name_customHostnameValuesTemplate": "src/main/java/HostNameValuesTemplate.txt", - "name_customHostnameVerifierTest" : "src/test/java/WebLogicCustomHostNameVerifierTest.java" - }, - "functions": [ - { - "namespace": "array", - "members": { - "join": { - "parameters": [ - { - "name": "items", - "type": "array" - } - ], - "output": { - "type": "string", - "value": "[replace(replace(replace(string(parameters('items')), '[\"', ''), '\"]', ''), '\",\"', ',')]" - } - } - } - } - ], - "resources": [ - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${dynamic.addnode.start}", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [] - } - } - }, - { - "apiVersion": "${azure.apiVersionForPublicIPAddresses}", - "type": "Microsoft.Network/publicIPAddresses", - "name": "[concat(variables('name_vmMachine'),copyIndex(variables('const_appNodeMachineOffset')),variables('name_publicIPAddress'))]", - "location": "[parameters('location')]", - "copy": { - "name": "publicIPLoop", - "count": "[parameters('numberOfNewNodes')]" - }, - "properties": { - "publicIPAllocationMethod": "[variables('const_publicIPAddressType')]", - "dnsSettings": { - "domainNameLabel": "[concat(toLower(parameters('dnsLabelPrefix')),copyindex(),'-',take(replace(parameters('guidValue'),'-',''),10),'-',toLower(parameters('wlsDomainName')))]" - } - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualNetworks}", - "type": "Microsoft.Network/virtualNetworks/subnets", - "name": "[concat(variables('name_virtualNetwork'), '/', variables('name_subnet'))]", - "condition": "[and(empty(variables('name_virtualNetwork')), empty(variables('name_subnet')))]" - }, - { - "apiVersion": "${azure.apiVersionForNetworkInterfaces}", - "type": "Microsoft.Network/networkInterfaces", - "name": "[concat(variables('name_vmMachine'),copyIndex(variables('const_appNodeMachineOffset')), variables('name_nic'))]", - "location": "[parameters('location')]", - "copy": { - "name": "nicLoop", - "count": "[parameters('numberOfNewNodes')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.Network/publicIPAddresses/', concat(variables('name_vmMachine'),copyIndex(variables('const_appNodeMachineOffset')),variables('name_publicIPAddress')))]" - ], - "properties": { - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses',concat(variables('name_vmMachine'),copyIndex(variables('const_appNodeMachineOffset')),variables('name_publicIPAddress')))]" - }, - "subnet": { - "id": "[variables('ref_subnet')]" - } - } - } - ], - "dnsSettings": { - "internalDnsNameLabel": "[concat(variables('name_vmMachine'), copyIndex(variables('const_appNodeMachineOffset')))]" - } - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines", - "name": "[concat(variables('name_vmMachine'), copyIndex(variables('const_appNodeMachineOffset')))]", - "location": "[parameters('location')]", - "copy": { - "name": "virtualMachineLoop", - "count": "[parameters('numberOfNewNodes')]" - }, - "dependsOn": [ - "nicLoop" - ], - "properties": { - "hardwareProfile": { - "vmSize": "[variables('const_vmSize')]" - }, - "osProfile": { - "computerName": "[concat(variables('name_vmMachine'), copyIndex(variables('const_appNodeMachineOffset')))]", - "adminUsername": "[parameters('adminUsername')]", - "adminPassword": "[parameters('adminPasswordOrKey')]", - "linuxConfiguration": "[if(equals(parameters('authenticationType'), 'password'), json('null'), variables('const_linuxConfiguration'))]" - }, - "storageProfile": { - "imageReference": { - "publisher": "[variables('const_imagePublisher')]", - "offer": "[variables('const_imageOffer')]", - "sku": "[variables('name_linuxImageOfferSKU')]", - "version": "[variables('name_linuxImageVersion')]" - }, - "osDisk": { - "createOption": "FromImage", - "managedDisk": { - "storageAccountType": "Standard_LRS" - } - } - }, - "networkProfile": { - "networkInterfaces": [ - { - "id": "[resourceId('Microsoft.Network/networkInterfaces',concat(variables('name_vmMachine'), copyIndex(variables('const_appNodeMachineOffset')), variables('name_nic')))]" - } - ] - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": true, - "storageUri": "[reference(resourceId('Microsoft.Storage/storageAccounts/', parameters('storageAccountName')), '${azure.apiVersionForStorage}').primaryEndpoints.blob]" - } - } - }, - "plan": { - "name": "[variables('name_linuxImageOfferSKU')]", - "publisher": "[variables('const_imagePublisher')]", - "product": "[variables('const_imageOffer')]" - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines/extensions", - "name": "[concat(variables('name_vmMachine'), copyIndex(variables('const_appNodeMachineOffset')), '/newuserscript')]", - "location": "[parameters('location')]", - "copy": { - "name": "virtualMachineExtensionLoop", - "count": "[parameters('numberOfNewNodes')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/', concat(variables('name_vmMachine'), copyIndex(variables('const_appNodeMachineOffset'))))]" - ], - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.0", - "autoUpgradeMinorVersion": true, - "settings": { - "fileUris": [ - "[uri(parameters('_artifactsLocation'), concat('scripts/', variables('name_scriptFile'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocation'), concat('../../../arm-oraclelinux-wls-dynamic-cluster/src/main/scripts/', variables('name_scriptELKConfiguration'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocation'), concat('../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameGeneratorscriptFile'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocation'), concat('../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameVerifierJavaFile'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocation'), concat('../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameValuesTemplate'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocation'), concat('../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameVerifierTest'), parameters('_artifactsLocationSasToken')))]" - ] - }, - "protectedSettings": { - "commandToExecute": "[concat('sh',' ',variables('name_scriptFile'),' <<< \"',parameters('wlsDomainName'),' ',parameters('wlsUserName'),' ',parameters('wlsPassword'),' ',parameters('managedServerPrefix'),' ',copyIndex(variables('const_appNodeMachineOffset')),' ', parameters('adminURL'),' ',parameters('adminVMName'),' ',variables('const_wlsHome'),' ',variables('const_wlsDomainPath'),' ', parameters('dynamicClusterSize'),' ', variables('const_managedVMPrefix'),' ',parameters('storageAccountName'), ' ', listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName')), '${azure.apiVersionForStorage}').keys[0].value,' ', variables('const_mountPointPath'),' ', if(parameters('aadsSettings').enable, parameters('aadsSettings').certificateBase64String, 'null'),' ',if(parameters('aadsSettings').enable, parameters('aadsSettings').publicIP, 'null'),' ', if(parameters('aadsSettings').enable, parameters('aadsSettings').serverHost, 'null'),' ',parameters('elkSettings').enable,' ', parameters('elkSettings').elasticsearchEndpoint,' ', parameters('elkSettings').elasticsearchUserName,' ', parameters('elkSettings').elasticsearchPassword,' ', array.join(parameters('elkSettings').logsToIntegrate), ' ', parameters('elkSettings').logIndex, ' ', parameters('maxDynamicClusterSize'),' ',if(parameters('enableDNSConfiguration'),parameters('customDNSNameForAdminServer'),parameters('adminVMName')),' ',parameters('dnsLabelPrefix'),' ',parameters('location'),' ',parameters('customSSLSettings').enable,' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').customIdentityKeyStoreBase64String, 'null'),' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').customIdentityKeyStorePassPhrase, 'null'),' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').customIdentityKeyStoreType, 'null'),' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').customTrustKeyStoreBase64String, 'null'),' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').customTrustKeyStorePassPhrase, 'null'),' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').customTrustKeyStoreType, 'null'),' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').privateKeyAlias, 'null'),' ',if(parameters('customSSLSettings').enable,parameters('customSSLSettings').privateKeyPassPhrase, 'null'),'\"')]" - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${dynamic.addnode.end}", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [] - } - } - } - ], - "outputs": { - "wlsDomainLocation": { - "type": "string", - "value": "[concat('/u01/domains/', parameters('wlsDomainName'))]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/addnode/src/main/scripts/addNodeToDynamicCluster.sh b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/addnode/src/main/scripts/addNodeToDynamicCluster.sh deleted file mode 100644 index 3dbb23897..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/addnode/src/main/scripts/addNodeToDynamicCluster.sh +++ /dev/null @@ -1,724 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# -#Function to output message to StdErr -function echo_stderr () -{ - echo "$@" >&2 -} - -#Function to display usage message -function usage() -{ - echo_stderr "./addnode.sh <<< \"\"" -} - -function installUtilities() -{ - echo "Installing zip unzip wget vnc-server rng-tools cifs-utils" - sudo yum install -y zip unzip wget vnc-server rng-tools cifs-utils - - #Setting up rngd utils - attempt=1 - while [[ $attempt -lt 4 ]] - do - echo "Starting rngd service attempt $attempt" - sudo systemctl start rngd - attempt=`expr $attempt + 1` - sudo systemctl status rngd | grep running - if [[ $? == 0 ]]; - then - echo "rngd utility service started successfully" - break - fi - sleep 1m - done -} - -function validateInput() -{ - if [ -z "$wlsDomainName" ]; - then - echo_stderr "wlsDomainName is required. " - fi - - if [[ -z "$wlsUserName" || -z "$wlsPassword" ]] - then - echo_stderr "wlsUserName or wlsPassword is required. " - exit 1 - fi - - if [ -z "$managedServerPrefix" ]; - then - echo_stderr "managedServerPrefix is required. " - fi - - if [ -z "$serverIndex" ]; - then - echo_stderr "serverIndex is required. " - fi - - if [ -z "$wlsAdminURL" ]; - then - echo_stderr "wlsAdminURL is required. " - fi - - if [ -z "$oracleHome" ]; then - echo_stderr "oracleHome is required. " - fi - - if [ -z "$wlsDomainPath" ]; then - echo_stderr "wlsDomainPath is required. " - fi - - if [ -z "$dynamicClusterSize" ]; - then - echo_stderr "dynamicClusterSize is required. " - fi - - if [ -z "$vmNamePrefix" ]; - then - echo_stderr "vmNamePrefix is required. " - fi - - if [ -z "$storageAccountName" ]; then - echo_stderr "storageAccountName is required. " - fi - - if [ -z "$storageAccountKey" ]; then - echo_stderr "storageAccountKey is required. " - fi - - if [ -z "$mountpointPath" ]; then - echo_stderr "mountpointPath is required. " - fi - - if [[ -z "$wlsADSSLCer" || -z "$wlsLDAPPublicIP" || -z "$adServerHost" ]]; then - echo_stderr "wlsADSSLCer, wlsLDAPPublicIP and adServerHost are required. " - exit 1 - fi - - if [[ "$wlsADSSLCer" != "null" && "$wlsLDAPPublicIP" != "null" && "$adServerHost" != "null" ]]; then - enableAAD="true" - fi - - if [ -z "$enableELK" ]; then - echo_stderr "enableELK is required. " - fi - - if [ -z "$elasticURI" ]; then - echo_stderr "elasticURI is required. " - fi - - if [ -z "$elasticUserName" ]; then - echo_stderr "elasticUserName is required. " - fi - - if [ -z "$elasticPassword" ]; then - echo_stderr "elasticPassword is required. " - fi - - if [ -z "$logsToIntegrate" ]; then - echo_stderr "logsToIntegrate is required. " - fi - - if [ -z "$logIndex" ]; then - echo_stderr "logIndex is required. " - fi - - if [ -z "$maxDynamicClusterSize" ]; then - echo_stderr "maxDynamicClusterSize is required. " - fi - - if [ ! -z "$isCustomSSLEnabled" == "true" ]; - then - if [[ -z "$customIdentityKeyStoreBase64String" || -z "$customIdentityKeyStorePassPhrase" || -z "$customIdentityKeyStoreType" || - -z "$customTrustKeyStoreBase64String" || -z "$customTrustKeyStorePassPhrase" || -z "$customTrustKeyStoreType" || - -z "$privateKeyAlias" || -z "$privateKeyPassPhrase" ]] - then - echo_stderr "customIdentityKeyStoreBase64String, customIdentityKeyStorePassPhrase, customIdentityKeyStoreType, customTrustKeyStoreBase64String, customTrustKeyStorePassPhrase, customTrustKeyStoreType, privateKeyAlias and privateKeyPassPhrase are required. " - exit 1 - fi - fi -} - -#Function to cleanup all temporary files -function cleanup() -{ - echo "Cleaning up temporary files..." - - rm -rf $wlsDomainPath/managed-domain.yaml - rm -rf $wlsDomainPath/weblogic-deploy.zip - rm -rf $wlsDomainPath/weblogic-deploy - rm -rf $wlsDomainPath/*.py - rm -rf ${CUSTOM_HOSTNAME_VERIFIER_HOME} - echo "Cleanup completed." -} - -#Creates weblogic deployment model for managed server domain -function create_managed_server_domain() -{ - echo "Creating managed server domain" - cat <$wlsDomainPath/managed-domain.yaml -domainInfo: - AdminUserName: "$wlsUserName" - AdminPassword: "$wlsPassword" - ServerStartMode: prod -topology: - Name: "$wlsDomainName" - Machine: - '$machineName': - NodeManager: - ListenAddress: "$nmHost" - ListenPort: $nmPort - NMType : ssl - Cluster: - '$wlsClusterName': - MigrationBasis: 'consensus' - DynamicServers: - ServerTemplate: '${dynamicServerTemplate}' - DynamicClusterSize: ${dynamicClusterSize} - MaxDynamicClusterSize: ${maxDynamicClusterSize} - CalculatedListenPorts: true - CalculatedMachineNames: true - ServerNamePrefix: "${managedServerPrefix}" - MachineNameMatchExpression: "machine-${vmNamePrefix}*" - ServerTemplate: - '${dynamicServerTemplate}' : - ListenPort: ${wlsManagedPort} - Cluster: '${wlsClusterName}' - ServerStart: - Arguments: '${SERVER_STARTUP_ARGS}' - SSL: - HostnameVerificationIgnored: true - HostnameVerifier: 'None' -EOF - - if [ "${isCustomSSLEnabled}" == "true" ]; - then -cat <>$DOMAIN_PATH/managed-domain.yaml - ServerPrivateKeyAlias: "$serverPrivateKeyAlias" - ServerPrivateKeyPassPhraseEncrypted: "$serverPrivateKeyPassPhrase" -EOF - fi - - if [ "${isCustomSSLEnabled}" == "true" ]; - then -cat <>$DOMAIN_PATH/managed-domain.yaml - KeyStores: 'CustomIdentityAndCustomTrust' - CustomIdentityKeyStoreFileName: "$customIdentityKeyStoreFileName" - CustomIdentityKeyStoreType: "$customIdentityKeyStoreType" - CustomIdentityKeyStorePassPhraseEncrypted: "$customIdentityKeyStorePassPhrase" - CustomTrustKeyStoreFileName: "$customTrustKeyStoreFileName" - CustomTrustKeyStoreType: "$customTrustKeyStoreType" - CustomTrustKeyStorePassPhraseEncrypted: "$customTrustKeyStorePassPhrase" -EOF - fi - -cat <>$DOMAIN_PATH/managed-domain.yaml - SecurityConfiguration: - NodeManagerUsername: "$wlsUserName" - NodeManagerPasswordEncrypted: "$wlsPassword" -EOF -} - -#This function create py Script to create Machine on the Domain -function createMachinePyScript() -{ - echo "Creating machine name model: $machineName" - cat <$wlsDomainPath/add-machine.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -shutdown('$wlsClusterName', 'Cluster') -edit("$machineName") -startEdit() -cd('/') -cmo.createMachine('$machineName') -cd('/Machines/$machineName/NodeManager/$machineName') -cmo.setListenPort(int($nmPort)) -cmo.setListenAddress('$nmHost') -cmo.setNMType('ssl') -save() -resolve() -activate() -destroyEditSession("$machineName") -disconnect() -EOF -} - - -#This function creates py Script to enroll Node Manager to the Domain -function createEnrollServerPyScript() -{ - echo "Creating managed server model" - cat <$wlsDomainPath/enroll-server.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -nmEnroll('$wlsDomainPath/$wlsDomainName','$wlsDomainPath/$wlsDomainName/nodemanager') -disconnect() -EOF -} - -#This function to wait for admin server -function wait_for_admin() -{ - #wait for admin to start -count=1 -CHECK_URL="http://$wlsAdminURL/weblogic/ready" -status=`curl --insecure -ILs $CHECK_URL | tac | grep -m1 HTTP/1.1 | awk {'print $2'}` -while [[ "$status" != "200" ]] -do - echo "Waiting for admin server to start" - count=$((count+1)) - if [ $count -le 30 ]; - then - sleep 1m - else - echo "Error : Maximum attempts exceeded while starting admin server" - exit 1 - fi - status=`curl --insecure -ILs $CHECK_URL | tac | grep -m1 HTTP/1.1 | awk {'print $2'}` - if [ "$status" == "200" ]; - then - echo "Admin Server started succesfully..." - break - fi -done -} - -#This function to start managed server -function start_cluster() -{ - echo "Starting Cluster $wlsClusterName" - cat <$wlsDomainPath/start-server.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -try: - start('$wlsClusterName', 'Cluster') -except: - print "Failed starting Cluster $wlsClusterName" - dumpStack() -disconnect() -EOF -sudo chown -R $username:$groupname $wlsDomainPath -runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST $wlsDomainPath/start-server.py" -if [[ $? != 0 ]]; then - echo "Error : Failed in starting cluster" - exit 1 -fi -} - -#Function to start nodemanager -function start_nm() -{ - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; \"$wlsDomainPath/$wlsDomainName/bin/startNodeManager.sh\" &" - sleep 1m -} - -function create_managedSetup(){ - - echo "Creating Managed Server Setup" - echo "Creating domain path /u01/domains" - echo "Downloading weblogic-deploy-tool" - cd $wlsDomainPath - wget -q $WEBLOGIC_DEPLOY_TOOL - if [[ $? != 0 ]]; then - echo "Error : Downloading weblogic-deploy-tool failed" - exit 1 - fi - sudo unzip -o weblogic-deploy.zip -d $wlsDomainPath - echo "Creating managed server model files" - - create_managed_server_domain - - createMachinePyScript - - createEnrollServerPyScript - - echo "Completed managed server model files" - sudo chown -R $username:$groupname $wlsDomainPath - - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; $wlsDomainPath/weblogic-deploy/bin/createDomain.sh -oracle_home ${oracleHome} -domain_parent $wlsDomainPath -domain_type WLS -model_file $wlsDomainPath/managed-domain.yaml" - - if [[ $? != 0 ]]; then - echo "Error : Managed setup failed" - exit 1 - fi - - wait_for_admin - - # For issue https://github.com/wls-eng/arm-oraclelinux-wls/issues/89 - getSerializedSystemIniFileFromShare - - echo "Adding Machine $machineName" - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST $wlsDomainPath/add-machine.py" - if [[ $? != 0 ]]; then - echo "Error : Adding machine $machineName failed" - exit 1 - fi - - echo "Enrolling Domain for Machine $machineName" - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST $wlsDomainPath/enroll-server.py" - if [[ $? != 0 ]]; then - echo "Error : Enrolling machine $machineName failed" - exit 1 - fi -} - -# Create systemctl service for nodemanager -function create_nodemanager_service() -{ - echo "Creating services for Nodemanager" - echo "Setting CrashRecoveryEnabled true at $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties" - sed -i.bak -e 's/CrashRecoveryEnabled=false/CrashRecoveryEnabled=true/g' $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - if [ $? != 0 ]; - then - echo "Warning : Failed in setting option CrashRecoveryEnabled=true. Continuing without the option." - mv $wlsDomainPath/nodemanager/nodemanager.properties.bak $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - fi - - if [ "${isCustomSSLEnabled}" == "true" ]; - then - echo "KeyStores=CustomIdentityAndCustomTrust" >> $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomIdentityKeystoreType=${customIdentityKeyStoreType}" >> $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomIdentityKeyStoreFileName=${customSSLIdentityKeyStoreFile}" >> $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomIdentityKeyStorePassPhrase=${customIdentityKeyStorePassPhrase}" >> $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomIdentityAlias=${privateKeyAlias}" >> $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomIdentityPrivateKeyPassPhrase=${privateKeyPassPhrase}" >> $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomTrustKeystoreType=${customTrustKeyStoreType}" >> $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomTrustKeyStoreFileName=${customSSLTrustKeyStoreFile}" >> $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomTrustKeyStorePassPhrase=${customTrustKeyStorePassPhrase}" >> $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - - fi - - sudo chown -R $username:$groupname $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties* - echo "Creating NodeManager service" - cat </etc/systemd/system/wls_nodemanager.service - [Unit] -Description=WebLogic nodemanager service - -[Service] -Type=simple -# Note that the following three parameters should be changed to the correct paths -# on your own system -WorkingDirectory=/u01/domains -Environment="JAVA_OPTIONS=${SERVER_STARTUP_ARGS}" -ExecStart=/bin/bash $wlsDomainPath/$wlsDomainName/bin/startNodeManager.sh -ExecStop=/bin/bash $wlsDomainPath/$wlsDomainName/bin/stopNodeManager.sh -User=oracle -Group=oracle -KillMode=process -LimitNOFILE=65535 - -[Install] -WantedBy=multi-user.target -EOF -echo "Created service for Nodemanager" -} - -function enabledAndStartNodeManagerService() -{ - sudo systemctl enable wls_nodemanager - sudo systemctl daemon-reload - echo "Starting nodemanager service" - sudo systemctl start wls_nodemanager -} - -function updateNetworkRules() -{ - # for Oracle Linux 7.3, 7.4, iptable is not running. - if [ -z `command -v firewall-cmd` ]; then - return 0 - fi - - # for Oracle Linux 7.6, open weblogic ports - tag=$1 - if [ ${tag} == 'admin' ]; then - echo "update network rules for admin server" - sudo firewall-cmd --zone=public --add-port=$wlsAdminPort/tcp - sudo firewall-cmd --zone=public --add-port=$wlsSSLAdminPort/tcp - sudo firewall-cmd --zone=public --add-port=$wlsManagedPort/tcp - sudo firewall-cmd --zone=public --add-port=$nmPort/tcp - else - echo "update network rules for managed server" - sudo firewall-cmd --zone=public --add-port=$wlsManagedPort/tcp - sudo firewall-cmd --zone=public --add-port=$nmPort/tcp - fi - - sudo firewall-cmd --runtime-to-permanent - sudo systemctl restart firewalld -} - -# Mount the Azure file share on all VMs created -function mountFileShare() -{ - echo "Creating mount point" - echo "Mount point: $mountpointPath" - sudo mkdir -p $mountpointPath - if [ ! -d "/etc/smbcredentials" ]; then - sudo mkdir /etc/smbcredentials - fi - if [ ! -f "/etc/smbcredentials/${storageAccountName}.cred" ]; then - echo "Crearing smbcredentials" - echo "username=$storageAccountName >> /etc/smbcredentials/${storageAccountName}.cred" - echo "password=$storageAccountKey >> /etc/smbcredentials/${storageAccountName}.cred" - sudo bash -c "echo "username=$storageAccountName" >> /etc/smbcredentials/${storageAccountName}.cred" - sudo bash -c "echo "password=$storageAccountKey" >> /etc/smbcredentials/${storageAccountName}.cred" - fi - echo "chmod 600 /etc/smbcredentials/${storageAccountName}.cred" - sudo chmod 600 /etc/smbcredentials/${storageAccountName}.cred - echo "//${storageAccountName}.file.core.windows.net/wlsshare $mountpointPath cifs nofail,vers=2.1,credentials=/etc/smbcredentials/${storageAccountName}.cred,dir_mode=0777,file_mode=0777,serverino" - sudo bash -c "echo \"//${storageAccountName}.file.core.windows.net/wlsshare $mountpointPath cifs nofail,vers=2.1,credentials=/etc/smbcredentials/${storageAccountName}.cred,dir_mode=0777,file_mode=0777,serverino\" >> /etc/fstab" - echo "mount -t cifs //${storageAccountName}.file.core.windows.net/wlsshare $mountpointPath -o vers=2.1,credentials=/etc/smbcredentials/${storageAccountName}.cred,dir_mode=0777,file_mode=0777,serverino" - sudo mount -t cifs //${storageAccountName}.file.core.windows.net/wlsshare $mountpointPath -o vers=2.1,credentials=/etc/smbcredentials/${storageAccountName}.cred,dir_mode=0777,file_mode=0777,serverino - if [[ $? != 0 ]]; - then - echo "Failed to mount //${storageAccountName}.file.core.windows.net/wlsshare $mountpointPath" - exit 1 - fi -} - -# Get SerializedSystemIni.dat file from share point to managed server vm -function getSerializedSystemIniFileFromShare() -{ - runuser -l oracle -c "mv ${wlsDomainPath}/${wlsDomainName}/security/SerializedSystemIni.dat ${wlsDomainPath}/${wlsDomainName}/security/SerializedSystemIni.dat.backup" - runuser -l oracle -c "cp ${mountpointPath}/SerializedSystemIni.dat ${wlsDomainPath}/${wlsDomainName}/security/." - ls -lt ${wlsDomainPath}/${wlsDomainName}/security/SerializedSystemIni.dat - if [[ $? != 0 ]]; - then - echo "Failed to get ${mountpointPath}/SerializedSystemIni.dat" - exit 1 - fi - runuser -l oracle -c "chmod 640 ${wlsDomainPath}/${wlsDomainName}/security/SerializedSystemIni.dat" -} - -function mapLDAPHostWithPublicIP() -{ - echo "map LDAP host with pubilc IP" - - # remove existing ip address for the same host - sudo sed -i '/${adServerHost}/d' /etc/hosts - sudo echo "${wlsLDAPPublicIP} ${adServerHost}" >> /etc/hosts -} - -function parseLDAPCertificate() -{ - echo "create key store" - cer_begin=0 - cer_size=${#wlsADSSLCer} - cer_line_len=64 - mkdir ${SCRIPT_PWD}/security - touch ${SCRIPT_PWD}/security/AzureADLDAPCerBase64String.txt - while [ ${cer_begin} -lt ${cer_size} ] - do - cer_sub=${wlsADSSLCer:$cer_begin:$cer_line_len} - echo ${cer_sub} >> ${SCRIPT_PWD}/security/AzureADLDAPCerBase64String.txt - cer_begin=$((cer_begin+$cer_line_len)) - done - - openssl base64 -d -in ${SCRIPT_PWD}/security/AzureADLDAPCerBase64String.txt -out ${SCRIPT_PWD}/security/AzureADTrust.cer - addsCertificate=${SCRIPT_PWD}/security/AzureADTrust.cer -} - -function importAADCertificate() -{ - # import the key to java security - . $oracleHome/oracle_common/common/bin/setWlstEnv.sh - # For Entra ID failure: exception happens when importing certificate to JDK 11.0.7 - # ISSUE: https://github.com/wls-eng/arm-oraclelinux-wls/issues/109 - # JRE was removed since JDK 11. - java_version=$(java -version 2>&1 | sed -n ';s/.* version "\(.*\)\.\(.*\)\..*"/\1\2/p;') - if [ ${java_version:0:3} -ge 110 ]; - then - java_cacerts_path=${JAVA_HOME}/lib/security/cacerts - else - java_cacerts_path=${JAVA_HOME}/jre/lib/security/cacerts - fi - - # remove existing certificate. - queryAADTrust=$(${JAVA_HOME}/bin/keytool -list -keystore ${java_cacerts_path} -storepass changeit | grep "aadtrust") - if [ -n "${queryAADTrust}" ]; - then - sudo ${JAVA_HOME}/bin/keytool -delete -alias aadtrust -keystore ${java_cacerts_path} -storepass changeit - fi - - sudo ${JAVA_HOME}/bin/keytool -noprompt -import -alias aadtrust -file ${addsCertificate} -keystore ${java_cacerts_path} -storepass changeit -} - -function importAADCertificateIntoWLSCustomTrustKeyStore() -{ - if [ "${isCustomSSLEnabled,,}" == "true" ]; - then - # set java home - . $oracleHome/oracle_common/common/bin/setWlstEnv.sh - - #validate Trust keystore - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; keytool -list -v -keystore $customSSLTrustKeyStoreFile -storepass $customTrustKeyStorePassPhrase -storetype $customTrustKeyStoreType | grep 'Entry type:' | grep 'trustedCertEntry'" - - if [[ $? != 0 ]]; then - echo "Error : Trust Keystore Validation Failed !!" - exit 1 - fi - - # For SSL enabled causes Entra ID failure #225 - # ISSUE: https://github.com/wls-eng/arm-oraclelinux-wls/issues/225 - - echo "Importing Entra ID Certificate into WLS Custom Trust Key Store: " - - sudo ${JAVA_HOME}/bin/keytool -noprompt -import -trustcacerts -keystore {KEYSTORE_PATH}/trust.keystore -storepass ${customTrustKeyStorePassPhrase} -alias aadtrust -file ${addsCertificate} -storetype ${customTrustKeyStoreType} - else - echo "customSSL not enabled. Not required to configure Entra ID for WebLogic Custom SSL" - fi -} - -function validateSSLKeyStores() -{ - sudo chown -R $username:$groupname $KEYSTORE_PATH - - #validate identity keystore - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; keytool -list -v -keystore $customSSLIdentityKeyStoreFile -storepass $customIdentityKeyStorePassPhrase -storetype $customIdentityKeyStoreType | grep 'Entry type:' | grep 'PrivateKeyEntry'" - - if [[ $? != 0 ]]; then - echo "Error : Identity Keystore Validation Failed !!" - exit 1 - fi - - #validate Trust keystore - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; keytool -list -v -keystore $customSSLTrustKeyStoreFile -storepass $customTrustKeyStorePassPhrase -storetype $customTrustKeyStoreType | grep 'Entry type:' | grep 'trustedCertEntry'" - - if [[ $? != 0 ]]; then - echo "Error : Trust Keystore Validation Failed !!" - exit 1 - fi - - echo "ValidateSSLKeyStores Successfull !!" -} - -function parseAndSaveCustomSSLKeyStoreData() -{ - echo "create key stores for custom ssl settings" - - mkdir -p ${KEYSTORE_PATH} - touch ${KEYSTORE_PATH}/identityKeyStoreCerBase64String.txt - - echo "$customIdentityKeyStoreBase64String" > ${KEYSTORE_PATH}/identityKeyStoreCerBase64String.txt - cat ${KEYSTORE_PATH}/identityKeyStoreCerBase64String.txt | base64 -d > ${KEYSTORE_PATH}/identity.keystore - customSSLIdentityKeyStoreFile=${KEYSTORE_PATH}/identity.keystore - customIdentityKeyStorePassPhrase="$(echo $customIdentityKeyStorePassPhrase | base64 --decode)" - - rm -rf ${KEYSTORE_PATH}/identityKeyStoreCerBase64String.txt - - mkdir -p ${KEYSTORE_PATH} - touch ${KEYSTORE_PATH}/trustKeyStoreCerBase64String.txt - - echo "$customTrustKeyStoreBase64String" > ${KEYSTORE_PATH}/trustKeyStoreCerBase64String.txt - cat ${KEYSTORE_PATH}/trustKeyStoreCerBase64String.txt | base64 -d > ${KEYSTORE_PATH}/trust.keystore - customSSLTrustKeyStoreFile=${KEYSTORE_PATH}/trust.keystore - customTrustKeyStorePassPhrase="$(echo $customTrustKeyStorePassPhrase | base64 --decode)" - - rm -rf ${KEYSTORE_PATH}/trustKeyStoreCerBase64String.txt - - privateKeyAlias="$(echo $privateKeyAlias | base64 --decode)" - privateKeyPassPhrase="$(echo $privateKeyPassPhrase | base64 --decode)" -} - -function generateCustomHostNameVerifier() -{ - mkdir -p ${CUSTOM_HOSTNAME_VERIFIER_HOME} - mkdir -p ${CUSTOM_HOSTNAME_VERIFIER_HOME}/src/main/java - mkdir -p ${CUSTOM_HOSTNAME_VERIFIER_HOME}/src/test/java - cp ${BASE_DIR}/generateCustomHostNameVerifier.sh ${CUSTOM_HOSTNAME_VERIFIER_HOME}/generateCustomHostNameVerifier.sh - cp ${BASE_DIR}/WebLogicCustomHostNameVerifier.java ${CUSTOM_HOSTNAME_VERIFIER_HOME}/src/main/java/WebLogicCustomHostNameVerifier.java - cp ${BASE_DIR}/HostNameValuesTemplate.txt ${CUSTOM_HOSTNAME_VERIFIER_HOME}/src/main/java/HostNameValuesTemplate.txt - cp ${BASE_DIR}/WebLogicCustomHostNameVerifierTest.java ${CUSTOM_HOSTNAME_VERIFIER_HOME}/src/test/java/WebLogicCustomHostNameVerifierTest.java - chown -R $username:$groupname ${CUSTOM_HOSTNAME_VERIFIER_HOME} - chmod +x ${CUSTOM_HOSTNAME_VERIFIER_HOME}/generateCustomHostNameVerifier.sh - - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; ${CUSTOM_HOSTNAME_VERIFIER_HOME}/generateCustomHostNameVerifier.sh ${adminVMName} ${customDNSNameForAdminServer} ${customDNSNameForAdminServer} ${dnsLabelPrefix} ${wlsDomainName} ${location}" -} - -function copyCustomHostNameVerifierJarsToWebLogicClasspath() -{ - runuser -l oracle -c "cp ${CUSTOM_HOSTNAME_VERIFIER_HOME}/output/*.jar $oracleHome/wlserver/server/lib/;" - - echo "Modify WLS CLASSPATH to include hostname verifier jars...." - sed -i 's;^WEBLOGIC_CLASSPATH="${WL_HOME}/server/lib/postgresql.*;&\nWEBLOGIC_CLASSPATH="${WL_HOME}/server/lib/hostnamevalues.jar:${WL_HOME}/server/lib/weblogicustomhostnameverifier.jar:${WEBLOGIC_CLASSPATH}";' $oracleHome/oracle_common/common/bin/commExtEnv.sh - echo "Modified WLS CLASSPATH to include hostname verifier jars." -} - - -#main script starts here - -SCRIPT_PWD=`pwd` -CURR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -BASE_DIR="$(readlink -f ${CURR_DIR})" - -read wlsDomainName wlsUserName wlsPassword managedServerPrefix serverIndex wlsAdminURL adminVMName oracleHome wlsDomainPath dynamicClusterSize vmNamePrefix storageAccountName storageAccountKey mountpointPath wlsADSSLCer wlsLDAPPublicIP adServerHost enableELK elasticURI elasticUserName elasticPassword logsToIntegrate logIndex maxDynamicClusterSize customDNSNameForAdminServer dnsLabelPrefix location isCustomSSLEnabled customIdentityKeyStoreBase64String customIdentityKeyStorePassPhrase customIdentityKeyStoreType customTrustKeyStoreBase64String customTrustKeyStorePassPhrase customTrustKeyStoreType privateKeyAlias privateKeyPassPhrase - -isCustomSSLEnabled="${isCustomSSLEnabled,,}" - -enableAAD="false" - -validateInput - -nmHost=`hostname` -nmPort=5556 -wlsAdminPort=7001 -wlsSSLAdminPort=7002 -wlsManagedPort=8001 -wlsClusterName="cluster1" -dynamicServerTemplate="myServerTemplate" -machineNamePrefix="machine" -machineName="$machineNamePrefix-$nmHost" -WEBLOGIC_DEPLOY_TOOL=https://github.com/oracle/weblogic-deploy-tooling/releases/download/weblogic-deploy-tooling-1.8.1/weblogic-deploy.zip -username="oracle" -groupname="oracle" -KEYSTORE_PATH="$wlsDomainPath/$wlsDomainName/keystores" -SERVER_STARTUP_ARGS="-Dlog4j2.formatMsgNoLookups=true" -CUSTOM_HOSTNAME_VERIFIER_HOME="/u01/app/custom-hostname-verifier" - -cleanup -installUtilities -mountFileShare -updateNetworkRules "managed" - -if [ "$isCustomSSLEnabled" == "true" ];then - parseAndSaveCustomSSLKeyStoreData -fi - - -if [ "$enableAAD" == "true" ];then - mapLDAPHostWithPublicIP - parseLDAPCertificate - importAADCertificate - importAADCertificateIntoWLSCustomTrustKeyStore -fi - -create_managedSetup -generateCustomHostNameVerifier -copyCustomHostNameVerifierJarsToWebLogicClasspath -create_nodemanager_service -enabledAndStartNodeManagerService -configureCustomHostNameVerifier -start_cluster - -echo "enable ELK? ${enableELK}" -if [[ "${enableELK,,}" == "true" ]];then - echo "Set up ELK..." - ${SCRIPT_PWD}/elkIntegrationForDynamicCluster.sh \ - ${oracleHome} \ - ${wlsAdminURL} \ - ${managedServerPrefix} \ - ${wlsUserName} \ - ${wlsPassword} \ - "admin" \ - ${elasticURI} \ - ${elasticUserName} \ - ${elasticPassword} \ - ${wlsDomainName} \ - ${wlsDomainPath}/${wlsDomainName} \ - ${logsToIntegrate} \ - ${serverIndex} \ - ${logIndex} \ - ${maxDynamicClusterSize} -fi - -cleanup diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/pom.xml b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/pom.xml deleted file mode 100644 index 0d8940bc9..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/pom.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - 4.0.0 - - - com.oracle.weblogic.azure - weblogic-azure-vm - 1.0.0 - ../../pom.xml - - - com.oracle.weblogic.azure - arm-oraclelinux-wls-dynamic-cluster - ${version.arm-oraclelinux-wls-dynamic-cluster} - jar - ${project.artifactId} - - - ${project.basedir}/../../.. - false - false - - - - - - diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/createUiDefinition.json b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/createUiDefinition.json deleted file mode 100644 index d77265927..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/createUiDefinition.json +++ /dev/null @@ -1,1493 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/0.1.2-preview/CreateUIDefinition.MultiVm.json#", - "handler": "Microsoft.Azure.CreateUIDef", - "version": "0.1.2-preview", - "parameters": { - "config": { - "basics": { - "resourceGroup": { - "allowExisting": true - } - } - }, - "basics": [ - { - "name": "skuUrnVersion", - "type": "Microsoft.Common.DropDown", - "label": "Oracle WebLogic Image", - "defaultValue": "WebLogic Server 14.1.1.0.0 and JDK 11 on Oracle Linux 9.1", - "toolTip": "Choose Oracle WebLogic image, which is provided by Oracle, with Java and WebLogic preinstalled.", - "constraints": { - "allowedValues": [ - { - "label": "WebLogic Server 14.1.1.0.0 and JDK 11 on Oracle Linux 9.1", - "value": "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest" - }, - { - "label": "WebLogic Server 14.1.1.0.0 and JDK 11 on Oracle Linux 8.7", - "value": "owls-141100-jdk11-ol87;Oracle:weblogic-141100-jdk11-ol87:owls-141100-jdk11-ol87;latest" - }, - { - "label": "WebLogic Server 14.1.1.0.0 and JDK 8 on Oracle Linux 9.1", - "value": "owls-141100-jdk8-ol91;Oracle:weblogic-141100-jdk8-ol91:owls-141100-jdk8-ol91;latest" - }, - { - "label": "WebLogic Server 14.1.1.0.0 and JDK 8 on Oracle Linux 8.7", - "value": "owls-141100-jdk8-ol87;Oracle:weblogic-141100-jdk8-ol87:owls-141100-jdk8-ol87;latest" - }, - { - "label": "WebLogic Server 12.2.1.4.0 and JDK 8 on Oracle Linux 9.1", - "value": "owls-122140-jdk8-ol91;Oracle:weblogic-122140-jdk8-ol91:owls-122140-jdk8-ol91;latest" - }, - { - "label": "WebLogic Server 12.2.1.4.0 and JDK 8 on Oracle Linux 8.7", - "value": "owls-122140-jdk8-ol87;Oracle:weblogic-122140-jdk8-ol87:owls-122140-jdk8-ol87;latest" - }, - { - "label": "WebLogic Server 12.2.1.4.0 and JDK8 on Oracle Linux 7.6", - "value": "owls-122140-jdk8-ol76;Oracle:weblogic-122140-jdk8-ol76:owls-122140-jdk8-ol7;latest" - }, - { - "label": "WebLogic Server 14.1.1.0.0 and JDK8 on Oracle Linux 7.6", - "value": "owls-141100-jdk8-ol76;Oracle:weblogic-141100-jdk8-ol76:owls-141100-jdk8-ol7;latest" - }, - { - "label": "WebLogic Server 14.1.1.0.0 and JDK11 on Oracle Linux 7.6", - "value": "owls-141100-jdk11-ol76;Oracle:weblogic-141100-jdk11-ol76:owls-141100-jdk11-ol7;latest" - }, - { - "label": "WebLogic Server 14.1.1.0.0 and JDK11 on Red Hat Enterprise Linux 8.7", - "value": "owls-141100-jdk11-rhel87;Oracle:weblogic-141100-jdk11-rhel87:owls-141100-jdk11-rhel87;latest" - }, - { - "label": "WebLogic Server 14.1.1.0.0 and JDK8 on Red Hat Enterprise Linux 8.7", - "value": "owls-141100-jdk8-rhel87;Oracle:weblogic-141100-jdk8-rhel87:owls-141100-jdk8-rhel87;latest" - }, - { - "label": "WebLogic Server 12.2.1.4.0 and JDK8 on Red Hat Enterprise Linux 8.7", - "value": "owls-122140-jdk8-rhel87;Oracle:weblogic-122140-jdk8-rhel87:owls-122140-jdk8-rhel87;latest" - } - ], - "required": true - }, - "visible": true - }, - { - "name": "vmSizeSelect", - "type": "Microsoft.Compute.SizeSelector", - "label": "Virtual machine size", - "toolTip": "The size of virtual machine to provision.", - "recommendedSizes": [ - "Standard_A1", - "Standard_A2", - "Standard_A3", - "Standard_A4", - "Standard_B1ms" - ], - "constraints": { - "excludedSizes": [ - "Standard_B1ls", - "Standard_A0", - "Basic_A0", - "Standard_B1s", - ${azure.armBased.vmSize.list} - ] - }, - "osPlatform": "Linux", - "count": "1", - "visible": true - }, - { - "name": "invalidVMSizeInfo", - "type": "Microsoft.Common.InfoBox", - "visible": "[contains(basics('vmSizeSelect'),'p')]", - "options": { - "icon": "Error", - "text": "The VM size you selected includes the feature letter 'p', indicating it uses ARM CPUs. ARM platform is not supported. Please select a different VM size. For more information, refer to the Azure virtual machine sizes naming conventions." - } - }, - { - "name": "basicsRequired", - "type": "Microsoft.Common.Section", - "label": "Credentials for Virtual Machines and WebLogic", - "elements": [ - { - "name": "adminUsername", - "type": "Microsoft.Common.TextBox", - "label": "Username for admin account of VMs", - "defaultValue": "weblogic", - "toolTip": "Use only letters and numbers", - "constraints": { - "required": true, - "validations": [ - { - "regex": "^[a-z0-9A-Z]{1,30}$", - "message": "The value must be 1-30 characters long and must only contain letters and numbers." - }, - { - "isValid": "[not(contains(basics('vmSizeSelect'),'p'))]", - "message": "ARM platform is not supported. Please select a different VM size." - } - ] - }, - "visible": true - }, - { - "name": "adminPasswordOrKey", - "type": "Microsoft.Compute.CredentialsCombo", - "label": { - "authenticationType": "Authentication type", - "password": "Password", - "confirmPassword": "Confirm password", - "sshPublicKey": "SSH public key" - }, - "toolTip": { - "authenticationType": "Use username and password or SSH public key for authentication to the VM", - "password": "Password for admin account of VMs", - "sshPublicKey": "SSH key for admin account of VMs" - }, - "constraints": { - "required": true, - "customPasswordRegex": "^((?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])|(?=.*[0-9])(?=.*[a-z])(?=.*[!@#$%^&*])|(?=.*[0-9])(?=.*[A-Z])(?=.*[!@#$%^&*])|(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*])).{12,72}$", - "customValidationMessage": "Password must be at least 12 characters long and have 3 out of the following: one number, one lower case, one upper case, or one special character" - }, - "options": { - "hideConfirmation": false, - "hidePassword": false - }, - "osPlatform": "Linux", - "visible": true - }, - { - "name": "wlsUserName", - "type": "Microsoft.Common.TextBox", - "label": "Username for WebLogic Administrator", - "defaultValue": "weblogic", - "toolTip": "Use only letters and numbers", - "constraints": { - "required": true, - "regex": "^[a-z0-9A-Z]{1,30}$", - "validationMessage": "The value must be 1-30 characters long and must only contain letters and numbers." - }, - "visible": true - }, - { - "name": "wlsPassword", - "type": "Microsoft.Common.PasswordBox", - "label": { - "password": "Password for WebLogic Administrator", - "confirmPassword": "Confirm password" - }, - "toolTip": "Password for WebLogic Administrator", - "constraints": { - "required": true, - "regex": "^(?=.*[A-Z])(?=.*[a-z])(?=.*\\d)[A-Za-z\\d]{12,}$", - "validationMessage": "The password must contain at least 12 characters, with at least 1 uppercase letter, 1 lowercase letter and 1 number, and special characters are not allowed." - }, - "options": { - "hideConfirmation": false - }, - "visible": true - }, - { - "name": "dynamicClusterSize", - "type": "Microsoft.Common.TextBox", - "label": "Initial Dynamic Cluster Size", - "defaultValue": "3", - "toolTip": "Initial Number of Managed Servers that will be configured in the Dynamic Cluster", - "constraints": { - "required": true, - "regex": "^(2|3|4|5|6|7|8|9|10){1,2}$", - "validationMessage": "Initial Number of Managed Servers that will be configured in the Dynamic Cluster" - }, - "visible": true - }, - { - "name": "maxDynamicClusterSize", - "type": "Microsoft.Common.TextBox", - "label": "Maximum Dynamic Cluster Size", - "defaultValue": "8", - "toolTip": "Maximum Number of Managed Servers allowed to be configured in the Dynamic Cluster", - "constraints": { - "required": true, - "regex": "^(2|3|4|5|6|7|8|9|10){1,2}$", - "validationMessage": "Maximum Number of Managed Servers allowed to be configured in the Dynamic Cluster" - }, - "visible": true - } - ], - "visible": true - }, - { - "name": "basicsOptional", - "type": "Microsoft.Common.Section", - "label": "Optional Basic Configuration", - "elements": [ - { - "name": "basicsOptionalAcceptDefaults", - "type": "Microsoft.Common.OptionsGroup", - "label": "Accept defaults for optional configuration?", - "defaultValue": "Yes", - "toolTip": "Select 'No' to edit optional basic configuration.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": "false" - }, - { - "label": "No", - "value": "true" - } - ], - "required": true - } - }, - { - "name": "managedServerPrefix", - "type": "Microsoft.Common.TextBox", - "label": "Managed Server Prefix", - "toolTip": "The string to prepend to the name of the managed server. Must start with letters and not have a run of more than eight digits.", - "defaultValue": "msp", - "constraints": { - "required": true, - "regex": "^[a-z0-9A-Z]{3,20}$", - "validationMessage": "The prefix must be between 3 and 20 characters long and contain letters, numbers only." - }, - "visible": "[bool(basics('basicsOptional').basicsOptionalAcceptDefaults)]" - }, - { - "name": "wlsDomainName", - "type": "Microsoft.Common.TextBox", - "label": "WebLogic Domain Name", - "toolTip": "The name of the WebLogic Domain to create.", - "defaultValue": "clusterDomain", - "constraints": { - "required": true, - "regex": "^[a-z0-9A-Z]{3,20}$", - "validationMessage": "The Domain Name must be between 3 and 20 characters long and contain letters, numbers only." - }, - "visible": "[bool(basics('basicsOptional').basicsOptionalAcceptDefaults)]" - }, - { - "name": "enableAdminHTTPListenPort", - "type": "Microsoft.Common.OptionsGroup", - "label": "Enable HTTP listen port on WebLogic Administration Server?", - "defaultValue": "Yes", - "toolTip": "Select 'No' to disable HTTP listen port on WebLogic Administration Server.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": true - }, - { - "label": "No", - "value": false - } - ], - "required": true - }, - "visible": "[bool(basics('basicsOptional').basicsOptionalAcceptDefaults)]" - }, - { - "name": "useSystemAssignedManagedIdentity", - "label": "Cause a system assigned managed identity to be created for the VM(s).", - "type": "Microsoft.Common.OptionsGroup", - "toolTip": "System assigned managed identities enable credential-free secure access to many Azure resources from this VM.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": true - }, - { - "label": "No", - "value": false - } - ], - "required": true - }, - "defaultValue": "Yes", - "visible": "[bool(basics('basicsOptional').basicsOptionalAcceptDefaults)]" - } - ], - "visible": true - }, - { - "name": "howToReportIssues", - "type": "Microsoft.Common.Section", - "label": "Report issues, get help, and share feedback", - "elements": [ - { - "name": "help", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "See the documentation for this offer.", - "link": { - "label": "Offer documentation", - "uri": "https://aka.ms/wls-vm-docs" - } - } - }, - { - "name": "howToReportIssueText", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "If you encounter problems during the deployment of Oracle WebLogic Server, report them here.", - "link": { - "label": "Issue tracker", - "uri": "https://aka.ms/arm-oraclelinux-wls-issues?version=${project.version}" - } - } - }, - { - "name": "howToJoinSlack", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "If you want to interact directly with the Oracle WebLogic community, join the public Slack channel named 'oracle-weblogic'.", - "link": { - "label": "Join Slack", - "uri": "https://aka.ms/arm-oraclelinux-wls-slack" - } - } - }, - { - "name": "survey", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "To get free help with Azure migration from the development team, fill out this survey.", - "link": { - "label": "Take survey", - "uri": "https://aka.ms/wls-on-azure-survey" - } - } - } - ], - "visible": true - } - ], - "steps": [ - { - "name": "section_sslConfiguration", - "type": "Microsoft.Common.Section", - "label": "TLS/SSL Configuration", - "elements": [ - { - "name": "sslConfigurationText", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "Selecting 'Yes' here will cause the template to provision WebLogic Administration Console on HTTPS (Secure) port, with your own TLS/SSL certificate.", - "link": { - "label": "Learn more", - "uri": "https://aka.ms/arm-oraclelinux-wls-ssl-config" - } - } - }, - { - "name": "enableCustomSSL", - "type": "Microsoft.Common.OptionsGroup", - "label": "Configure WebLogic Administration Console on HTTPS (Secure) port, with your own TLS/SSL certificate?", - "defaultValue": "No", - "toolTip": "Select 'Yes' to configure WebLogic Administration Console on HTTPS (Secure) port with your own TLS/SSL certificate.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": true - }, - { - "label": "No", - "value": false - } - ], - "required": false - } - }, - { - "name": "uploadedCustomSSLSettings", - "type": "Microsoft.Common.Section", - "visible": "[steps('section_sslConfiguration').enableCustomSSL]", - "label": "TLS/SSL Configuration Settings", - "elements": [ - { - "name": "sslKeystoreInfo0", - "type": "Microsoft.Common.InfoBox", - "visible": "true", - "options": { - "icon": "Info", - "text": "You must provide different files for identity and trust KeyStores. Select here for more details.", - "uri": "https://aka.ms/arm-oraclelinux-wls-ssl-configuration" - } - }, - { - "name": "uploadedCustomIdentityKeyStoreData", - "type": "Microsoft.Common.FileUpload", - "label": "Identity KeyStore Data file(.jks,.p12)", - "toolTip": "Identity KeyStore for TLS/SSL configuration", - "constraints": { - "required": true, - "accept": ".jks,.p12" - }, - "options": { - "multiple": false, - "uploadMode": "file", - "openMode": "binary" - }, - "visible": true - }, - { - "name": "uploadedCustomIdentityKeyStorePassphrase", - "type": "Microsoft.Common.PasswordBox", - "label": { - "password": "Password", - "confirmPassword": "Confirm password" - }, - "toolTip": " The passphrase for the Identity KeyStore", - "constraints": { - "required": true, - "regex": "^.{6,}$", - "validationMessage": "Keypass must be at least 6 characters long." - }, - "options": { - "hideConfirmation": false - }, - "visible": true - }, - { - "name": "uploadedCustomIdentityKeyStoreType", - "type": "Microsoft.Common.DropDown", - "visible": "true", - "label": "The Identity KeyStore type (JKS,PKCS12)", - "defaultValue": "JKS", - "toolTip": "One of the supported KeyStore types", - "constraints": { - "allowedValues": [ - { - "label": "JKS", - "value": "JKS" - }, - { - "label": "PKCS12", - "value": "PKCS12" - } - ], - "required": true - } - }, - { - "name": "uploadedPrivateKeyAlias", - "type": "Microsoft.Common.TextBox", - "visible": "true", - "label": "The alias of the server's private key within the Identity KeyStore", - "defaultValue": "", - "toolTip": "Use only letters and numbers", - "constraints": { - "required": true, - "regex": "^[a-z0-9A-Z]{1,30}$", - "validationMessage": "The value must be 1-30 characters long and must only contain letters and numbers." - } - }, - { - "name": "uploadedPrivateKeyPassPhrase", - "type": "Microsoft.Common.PasswordBox", - "visible": "true", - "label": { - "password": "The passphrase for the server's private key within the Identity KeyStore", - "confirmPassword": "Confirm passphrase" - }, - "toolTip": "Use only letters and numbers", - "constraints": { - "required": true, - "regex": "^.{6,}$", - "validationMessage": "Keypass must be at least 6 characters long." - }, - "options": { - "hideConfirmation": false - } - }, - { - "name": "uploadedCustomTrustKeyStoreData", - "type": "Microsoft.Common.FileUpload", - "label": "Trust KeyStore Data file(.jks,.p12)", - "toolTip": "Trust KeyStore for TLS/SSL configuration.", - "constraints": { - "required": true, - "accept": ".jks,.p12" - }, - "options": { - "multiple": false, - "uploadMode": "file", - "openMode": "binary" - }, - "visible": true - }, - { - "name": "uploadedCustomTrustKeyStorePassPhrase", - "type": "Microsoft.Common.PasswordBox", - "label": { - "password": "Password", - "confirmPassword": "Confirm password" - }, - "toolTip": " The passphrase for the Trust KeyStore", - "constraints": { - "required": true, - "regex": "^.{6,}$", - "validationMessage": "Keypass must be at least 6 characters long." - }, - "options": { - "hideConfirmation": false - }, - "visible": true - }, - { - "name": "uploadedCustomTrustKeyStoreType", - "type": "Microsoft.Common.DropDown", - "visible": "true", - "label": "The Trust KeyStore type (JKS,PKCS12)", - "defaultValue": "JKS", - "toolTip": "One of the supported KeyStore types", - "constraints": { - "allowedValues": [ - { - "label": "JKS", - "value": "JKS" - }, - { - "label": "PKCS12", - "value": "PKCS12" - } - ], - "required": true - } - } - ] - } - ] - }, - { - "name": "section_ohs", - "type": "Microsoft.Common.Section", - "label": "Oracle HTTP Server Load Balancer", - "elements": [ - { - "name": "connectToOHSext", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "Selecting 'Yes' here will cause the template to provision an Azure Oracle HTTP Server, set up a public IP, and configuration with WebLogic cluster address. Further configuration may be necessary after deployment.", - "link": { - "label": "Learn more", - "uri": "https://docs.oracle.com/en/middleware/fusion-middleware/web-tier/12.2.1.4/index.html" - } - } - }, - { - "name": "enableOHS", - "type": "Microsoft.Common.OptionsGroup", - "label": "Connect to Oracle HTTP Server?", - "defaultValue": "No", - "toolTip": "Select 'Yes' to cause an Azure Oracle HTTP Server to be created as the load balancer for the cluster.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": true - }, - { - "label": "No", - "value": false - } - ], - "required": false - } - }, - { - "name": "sslText", - "type": "Microsoft.Common.TextBlock", - "visible": "[steps('section_ohs').enableOHS]", - "options": { - "text": "Oracle HTTP Server integration requires a TLS/SSL certificate to enable TLS/SSL termination. End-to-end TLS/SSL encryption is not supported by the template.", - "link": { - "label": "Learn more", - "uri": "https://aka.ms/arm-oraclelinux-wls-dynamic-cluster-ohs" - } - } - }, - { - "name": "ohsSkuUrnVersion", - "type": "Microsoft.Common.DropDown", - "label": "Oracle HTTP Server image", - "defaultValue": "OHS 12.2.1.4.0 and JDK8 on Oracle Linux 7.6", - "toolTip": "Choose Oracle HTTP Server image, which is provided by Oracle, with Java and HTTP Server preinstalled.", - "constraints": { - "allowedValues": [ - { - "label": "OHS 12.2.1.4.0 and JDK8 on Oracle Linux 7.3", - "value": "ohs-122140-jdk8-ol73;ohs-122140-jdk8-ol73;latest" - }, - { - "label": "OHS 12.2.1.4.0 and JDK8 on Oracle Linux 7.4", - "value": "ohs-122140-jdk8-ol74;ohs-122140-jdk8-ol74;latest" - }, - { - "label": "OHS 12.2.1.4.0 and JDK8 on Oracle Linux 7.6", - "value": "ohs-122140-jdk8-ol76;ohs-122140-jdk8-ol76;latest" - } - ] - }, - "visible": "[steps('section_ohs').enableOHS]" - }, - { - "name": "ohsDomainName", - "type": "Microsoft.Common.TextBox", - "label": "Oracle HTTP Server Domain name", - "defaultValue": "ohsStandaloneDomain", - "toolTip": "Oracle HTTP Server Domain Name", - "constraints": { - "required": true, - "regex": "^[a-z0-9A-Z.\\-_()]{0,89}([a-z0-9A-Z\\-_()]{1}){1,2}$", - "validationMessage": "[if(greater(length(steps('section_ohs').ohsDomainName), 90),'Must be less than 90 characters.', 'Value only allows alphanumeric characters, periods, underscores, hyphens and parenthesis and cannot end in a period.')]" - }, - "visible": "[steps('section_ohs').enableOHS]" - }, - { - "name": "ohsComponentName", - "type": "Microsoft.Common.TextBox", - "label": "Oracle HTTP Server Component name", - "defaultValue": "ohs_component", - "toolTip": "Oracle HTTP Server Component name", - "constraints": { - "required": true, - "regex": "^[a-z0-9A-Z.\\-_()]{0,89}([a-z0-9A-Z\\-_()]{1}){1,2}$", - "validationMessage": "[if(greater(length(steps('section_ohs').ohsDomainName), 90),'Must be less than 90 characters.', 'Value only allows alphanumeric characters, periods, underscores, hyphens and parenthesis and cannot end in a period.')]" - }, - "visible": "[steps('section_ohs').enableOHS]" - }, - { - "name": "ohsNMUser", - "type": "Microsoft.Common.TextBox", - "label": "Oracle HTTP Server NodeManager username", - "defaultValue": "", - "toolTip": "Oracle HTTP Server NodeManager username", - "constraints": { - "required": true, - "regex": "^[a-z0-9A-Z.\\-_()]{0,89}([a-z0-9A-Z\\-_()]{1}){1,2}$", - "validationMessage": "[if(greater(length(steps('section_ohs').ohsDomainName), 90),'Must be less than 90 characters.', 'Value only allows alphanumeric characters, periods, underscores, hyphens and parenthesis and cannot end in a period.')]" - }, - "visible": "[steps('section_ohs').enableOHS]" - }, - { - "name": "ohsNMPassword", - "type": "Microsoft.Common.PasswordBox", - "label": { - "password": "Oracle HTTP Server NodeManager Password", - "confirmPassword": "Confirm password" - }, - "toolTip": "Oracle HTTP Server NodeManager password", - "constraints": { - "required": true, - "regex": "^(?=.*[A-Z])(?=.*[a-z])(?=.*\\d)[A-Za-z\\d]{12,}$", - "validationMessage": "The password must contain at least 12 characters, with at least 1 uppercase letter, 1 lowercase letter and 1 number, and special characters are not allowed." - }, - "options": { - "hideConfirmation": false - }, - "visible": "[steps('section_ohs').enableOHS]" - }, - { - "name": "ohshttpPort", - "type": "Microsoft.Common.TextBox", - "label": "Oracle HTTP Server HTTP port", - "defaultValue": "7777", - "toolTip": "Oracle HTTP Server HTTP port", - "constraints": { - "required": true, - "regex": "^[0-9]{2,5}$", - "validationMessage": "[if(greater(length(steps('section_ohs').ohshttpPort), 90),'Resource group names only allow up to 90 characters.', 'Resource group names only allow alphanumeric characters, periods, underscores, hyphens and parenthesis and cannot end in a period.')]" - }, - "visible": "[steps('section_ohs').enableOHS]" - }, - { - "name": "ohshttpsPort", - "type": "Microsoft.Common.TextBox", - "label": "Oracle HTTP Server HTTPS port", - "defaultValue": "4444", - "toolTip": "Oracle HTTP Server HTTPS port", - "constraints": { - "required": true, - "regex": "^[0-9]{2,5}$", - "validationMessage": "[if(greater(length(steps('section_ohs').ohshttpsPort), 90),'Resource group names only allow up to 90 characters.', 'Resource group names only allow alphanumeric characters, periods, underscores, hyphens and parenthesis and cannot end in a period.')]" - }, - "visible": "[steps('section_ohs').enableOHS]" - }, - { - "name": "oracleVaultPswd", - "type": "Microsoft.Common.PasswordBox", - "label": { - "password": "Oracle Vault Password", - "confirmPassword": "Confirm password" - }, - "toolTip": "The password to configure SSL store Oracle Vault", - "constraints": { - "required": true, - "regex": "^(?=.*[A-Z])(?=.*[a-z])(?=.*\\d)[A-Za-z\\d]{12,}$", - "validationMessage": "The password must contain at least 12 characters, with at least 1 uppercase letter, 1 lowercase letter and 1 number, and special characters are not allowed." - }, - "options": { - "hideConfirmation": false - }, - "visible": "[steps('section_ohs').enableOHS]" - }, - { - "name": "uploadedCustomSSLSettings", - "type": "Microsoft.Common.Section", - "visible": "[steps('section_ohs').enableOHS]", - "label": "TLS/SSL Configuration Settings", - "elements": [ - { - "name": "uploadedKeyStoreData", - "type": "Microsoft.Common.FileUpload", - "label": "TLS/SSL certificate Data file(.jks,.p12)", - "toolTip": "KeyStore for TLS/SSL configuration", - "constraints": { - "required": true, - "accept": ".jks,.p12" - }, - "options": { - "multiple": false, - "uploadMode": "file", - "openMode": "binary" - }, - "visible": true - }, - { - "name": "uploadedKeyStorePassword", - "type": "Microsoft.Common.PasswordBox", - "label": { - "password": "Password", - "confirmPassword": "Confirm password" - }, - "toolTip": " The password for the TLS/SSL certificate Data", - "constraints": { - "required": true, - "regex": "^.{6,}$", - "validationMessage": "Keypass must be at least 6 characters long." - }, - "options": { - "hideConfirmation": false - }, - "visible": true - }, - { - "name": "uploadedKeyStoreType", - "type": "Microsoft.Common.DropDown", - "visible": "true", - "label": "Type of the certificate format(JKS,PKCS12)", - "defaultValue": "JKS", - "toolTip": "One of the supported KeyStore types", - "constraints": { - "allowedValues": [ - { - "label": "JKS", - "value": "JKS" - }, - { - "label": "PKCS12", - "value": "PKCS12" - } - ], - "required": true - } - } - ] - } - ], - "visible": true - }, - { - "name": "section_networkingConfiguration", - "type": "Microsoft.Common.Section", - "label": "Networking", - "elements": [ - { - "name": "denyPublicTrafficForAdminServer", - "type": "Microsoft.Common.OptionsGroup", - "label": "Deny public traffic for admin server?", - "visible": "[equals(steps('section_networkingConfiguration').virtualNetwork.newOrExisting, 'new')]", - "defaultValue": "No", - "toolTip": "Select 'Yes' to deny public traffic for admin server. Configuration here for port 7001 and 7002 has a higher priority than above.", - "constraints": { - "allowedValues": [ - { - "label": "No", - "value": false - }, - { - "label": "Yes", - "value": true - } - ], - "required": true - } - }, - { - "name": "denyPublicTrafficForManagedServer", - "type": "Microsoft.Common.OptionsGroup", - "visible": "[and(steps('section_ohs').enableOHS, equals(steps('section_networkingConfiguration').virtualNetwork.newOrExisting, 'new'))]", - "label": "Deny public traffic for managed server?", - "defaultValue": "Yes", - "toolTip": "Select 'Yes' to deny public traffic for managed server. Configuration here for port 8002 ~ 8001 + 'node number' has a higher priority than the 'Ports and port ranges to expose' in basic blade.", - "constraints": { - "allowedValues": [ - { - "label": "No", - "value": false - }, - { - "label": "Yes", - "value": true - } - ], - "required": true - } - }, - { - "name": "vnetInfo", - "type": "Microsoft.Common.InfoBox", - "options": { - "icon": "Info", - "text": "When creating a new virtual network, the subnet's address prefix is calculated automatically based on the virtual
    network's address prefix. When using an existing virtual network, a minimum virtual network size of /28 and a
    minimum subnet size of /29 are required. Additionally, the subnet must have adequate available addresses for the
    server setup. Oracle HTTP Server will be created in this subnet if enabled." - } - }, - { - "name": "virtualNetwork", - "type": "Microsoft.Network.VirtualNetworkCombo", - "label": { - "virtualNetwork": "Virtual network", - "subnets": "Subnets" - }, - "toolTip": { - "virtualNetwork": "Name of the virtual network", - "subnets": "Subnets for the virtual network" - }, - "defaultValue": { - "name": "[concat('wlsdcluster-vnet-',take(guid(), 8))]", - "addressPrefixSize": "/28" - }, - "constraints": { - "minAddressPrefixSize": "/28" - }, - "subnets": { - "subnet1": { - "label": "Subnet for WebLogic (OHS will be also created in this subnet if enabled)", - "defaultValue": { - "name": "wls-subnet", - "addressPrefixSize": "/28" - }, - "constraints": { - "minAddressPrefixSize": "/29", - "minAddressCount": "[if(bool(steps('section_ohs').enableOHS), add(int(basics('basicsRequired').maxDynamicClusterSize), 2), add(int(basics('basicsRequired').maxDynamicClusterSize), 1))]", - "requireContiguousAddresses": false - } - } - } - }, - { - "name": "dnsConfigurationText", - "type": "Microsoft.Common.TextBlock", - "visible": "[equals(steps('section_networkingConfiguration').virtualNetwork.newOrExisting, 'new')]", - "options": { - "text": "Selecting 'Yes' here will cause the template to provision Load Balancer and Oracle WebLogic Administration Console using custom DNS Name (example: console.contoso.com)", - "link": { - "label": "Learn more", - "uri": "https://aka.ms/arm-oraclelinux-wls-dns" - } - } - }, - { - "name": "enableCustomDNS", - "type": "Microsoft.Common.OptionsGroup", - "visible": "[equals(steps('section_networkingConfiguration').virtualNetwork.newOrExisting, 'new')]", - "label": "Configure Custom DNS Alias?", - "defaultValue": "No", - "toolTip": "Select 'Yes' to configure Custom DNS Alias.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": true - }, - { - "label": "No", - "value": false - } - ], - "required": false - } - }, - { - "name": "dnsLabelPrefix", - "type": "Microsoft.Common.TextBox", - "label": "DNS Label Prefix", - "toolTip": "The string to prepend to the DNS label.", - "defaultValue": "wls", - "constraints": { - "required": true, - "regex": "^[a-z0-9A-Z]{3,10}$", - "validationMessage": "The prefix must be between 3 and 10 characters long and contain letters, numbers only." - }, - "visible": "[bool(steps('section_networkingConfiguration').enableCustomDNS)]" - }, - { - "name": "portsToExpose", - "label": "Ports and port ranges to expose (N or N-N, comma separated)", - "type": "Microsoft.Common.TextBox", - "toolTip": "Ports and port ranges to expose (N or N-N, comma separated)", - "defaultValue": "80,443,7001-9000", - "constraints": { - "required": true, - "regex": "^(((([0-9]+-[0-9]+)|([0-9]+))[,]?)+[^,]){1,1000}$", - "validationMessage": "Only numbers, hyphen separated ranges of numbers, separated by commas" - }, - "visible": "[bool(steps('section_networkingConfiguration').enableCustomDNS)]" - }, - { - "name": "customDNSSettings", - "type": "Microsoft.Common.Section", - "label": "DNS Configuration Settings", - "visible": "[bool(steps('section_networkingConfiguration').enableCustomDNS)]", - "elements": [ - { - "name": "bringDNSZone", - "type": "Microsoft.Common.OptionsGroup", - "label": "Use an existing Azure DNS Zone", - "defaultValue": "No", - "toolTip": "Select 'Yes' to configure Custom DNS Alias based on an existing Azure DNS Zone. Select 'No' to create an Azure DNS Zone and Custom DNS Alias.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": true - }, - { - "label": "No", - "value": false - } - ] - } - }, - { - "name": "createDNSZoneText", - "type": "Microsoft.Common.InfoBox", - "visible": "[not(bool(steps('section_networkingConfiguration').customDNSSettings.bringDNSZone))]", - "options": { - "icon": "Info", - "text": "You must perform DNS Domain Delegation at your DNS Registry after deployment.", - "uri": "https://aka.ms/dns-domain-delegation" - } - }, - { - "name": "infoDNSIndentity", - "type": "Microsoft.Common.InfoBox", - "visible": "[bool(steps('section_networkingConfiguration').customDNSSettings.bringDNSZone)]", - "options": { - "icon": "Info", - "text": "This option will add/update records in your Azure DNS Zone. The Azure identity deploying this feature must have one of the following two sets of Azure role-based access control roles:
  • Contributor and User Access Administrator of the current subscription.
  • Owner of the current subscription.
  • " - } - }, - { - "name": "dnszoneName", - "type": "Microsoft.Common.TextBox", - "label": "DNS Zone Name", - "defaultValue": "", - "toolTip": "Use only letters and numbers and periods to separate Domains", - "constraints": { - "required": true, - "regex": "^([0-9a-zA-Z_-]{1,63}\\.){1,33}[0-9a-zA-Z_-]{1,63}$", - "validationMessage": "There must be between 2 and 34 labels. For example, \"contoso.com\" has 2 labels. Each label must contain between 1 and 63 characters. Each label must only contain letters, numbers, underscores, and dashes." - } - }, - { - "name": "dnsZoneResourceGroup", - "type": "Microsoft.Common.TextBox", - "label": "Name of the resource group contains the DNS Zone in current subscription", - "defaultValue": "", - "toolTip": "Name of the resource group contains the DNS Zone in current subscription", - "constraints": { - "required": true, - "regex": "^[a-z0-9A-Z.\\-_()]{0,89}([a-z0-9A-Z\\-_()]{1})$", - "validationMessage": "[if(greater(length(steps('section_networkingConfiguration').existingDNSZonesSettings.dnsZoneResourceGroup), 90),'Resource group names only allow up to 90 characters.', 'Resource group names only allow alphanumeric characters, periods, underscores, hyphens and parenthesis and cannot end in a period.')]" - }, - "visible": "[steps('section_networkingConfiguration').customDNSSettings.bringDNSZone]" - }, - { - "name": "dnszoneAdminConsoleLabel", - "type": "Microsoft.Common.TextBox", - "label": "Label for Oracle WebLogic Administration Console", - "defaultValue": "admin", - "toolTip": "Specify a label to generate subdomain of Oracle WebLogic Administration Console", - "constraints": { - "required": true, - "validations": [ - { - "regex": "^([0-9a-zA-Z_-]{1,63}\\.){0,33}[0-9a-zA-Z_-]{1,63}$", - "message": "Each label must contain between 1 and 63 characters. Each label must only contain letters, numbers, underscores, and dashes." - }, - { - "isValid": "[less(sub(length(concat(steps('section_networkingConfiguration').customDNSSettings.dnszoneAdminConsoleLabel,'.',steps('section_networkingConfiguration').customDNSSettings.dnszoneName)),length(replace(concat(steps('section_networkingConfiguration').customDNSSettings.dnszoneAdminConsoleLabel,'.',steps('section_networkingConfiguration').customDNSSettings.dnszoneName), '.', ''))),34)]", - "message": "Subdomain must be between 2 and 34 labels. For example, \"admin.contoso.com\" has 3 labels." - } - ] - } - }, - { - "name": "dnszoneLoadBalancerLabel", - "type": "Microsoft.Common.TextBox", - "label": "Label for Load Balancer", - "defaultValue": "www", - "toolTip": "Specify a label to generate subdomain of Load Balancer", - "constraints": { - "required": true, - "validations": [ - { - "regex": "^([0-9a-zA-Z_-]{1,63}\\.){0,33}[0-9a-zA-Z_-]{1,63}$", - "message": "Each label must contain between 1 and 63 characters. Each label must only contain letters, numbers, underscores, and dashes." - }, - { - "isValid": "[less(sub(length(concat(if(empty(steps('section_networkingConfiguration').customDNSSettings.dnszoneLoadBalancerLabel), '', steps('section_networkingConfiguration').customDNSSettings.dnszoneLoadBalancerLabel),'.',steps('section_networkingConfiguration').customDNSSettings.dnszoneName)),length(replace(concat(if(empty(steps('section_networkingConfiguration').customDNSSettings.dnszoneLoadBalancerLabel), '', steps('section_networkingConfiguration').customDNSSettings.dnszoneLoadBalancerLabel),'.',steps('section_networkingConfiguration').customDNSSettings.dnszoneName), '.', ''))),34)]", - "message": "Subdomain must be between 2 and 34 labels. For example, \"applications.contoso.com\" has 3 labels." - } - ] - }, - "visible": "[and(bool(steps('section_ohs').enableOHS), bool(steps('section_networkingConfiguration').enableCustomDNS))]" - } - ] - } - ] - }, - { - "name": "section_database", - "type": "Microsoft.Common.Section", - "label": "Database", - "subLabel": { - "preValidation": "Configure integrations to Azure services", - "postValidation": "Done" - }, - "bladeTitle": "Service Integrations", - "elements": [ - { - "name": "aboutDatabase", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "Selecting 'Yes' here and providing the configuration will cause the template to configure the WebLogic Server to connect to the desired pre-existing database. The database must be network accessible to the VNET and subnets created by the template." - } - }, - { - "name": "enableDB", - "type": "Microsoft.Common.OptionsGroup", - "label": "Connect to database?", - "defaultValue": "No", - "toolTip": "Select 'Yes' and provide required info to configure the connection to a database.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": "true" - }, - { - "label": "No", - "value": "false" - } - ], - "required": true - } - }, - { - "name": "databaseConnectionInfo", - "type": "Microsoft.Common.Section", - "label": "Connection settings", - "elements": [ - { - "name": "databaseType", - "type": "Microsoft.Common.DropDown", - "label": "Choose database type", - "toolTip": "Choose database type", - "defaultValue": "Oracle database", - "constraints": { - "allowedValues": [ - { - "label": "PostgreSQL (Supports passwordless connection)", - "value": "postgresql" - }, - { - "label": "Oracle database", - "value": "oracle" - }, - { - "label": "Microsoft SQL Server (Supports passwordless connection)", - "value": "sqlserver" - }, - { - "label": "MySQL (Supports passwordless connection)", - "value": "mysql" - } - ], - "required": true - }, - "visible": true - }, - { - "name": "mysqlJDBCDriverInfo", - "type": "Microsoft.Common.InfoBox", - "visible": "[and(bool(steps('section_database').enableDB),equals(steps('section_database').databaseConnectionInfo.databaseType, 'mysql'))]", - "options": { - "icon": "Info", - "text": "To support passwordless connection and various functionalities, the offer will upgrade the
    Oracle WebLogic Server MySQL driver with recent MySQL Connector Java driver." - } - }, - { - "name": "jdbcDataSourceName", - "type": "Microsoft.Common.TextBox", - "label": "JNDI Name", - "toolTip": "The JNDI name for the database JDBC connection", - "defaultValue": "", - "constraints": { - "required": true, - "validations": [ - { - "regex": "^[a-z0-9A-Z/]{1,30}$", - "message": "The value must be 1-30 characters long and must only contain letters, numbers, and slashes (/)." - } - ] - }, - "visible": true - }, - { - "name": "dsConnectionURL", - "type": "Microsoft.Common.TextBox", - "label": "DataSource Connection String", - "toolTip": "The JDBC connection string for the database", - "defaultValue": "", - "constraints": { - "required": true, - "validations": [ - { - "regex": "^jdbc:.*$", - "message": "A valid JDBC URL must start with 'jdbc:'." - }, - { - "isValid": "[startsWith(steps('section_database').databaseConnectionInfo.dsConnectionURL, concat('jdbc:', steps('section_database').databaseConnectionInfo.databaseType))]", - "message": "A valid JDBC URL for the chosen database type must be provided." - }, - { - "isValid": "[if(and(bool(steps('section_database').databaseConnectionInfo.enablePswlessConnection), equals(steps('section_database').databaseConnectionInfo.databaseType, 'mysql')), and(not(contains(steps('section_database').databaseConnectionInfo.dsConnectionURL, 'defaultAuthenticationPlugin')),not(contains(steps('section_database').databaseConnectionInfo.dsConnectionURL, 'authenticationPlugins')), not(contains(steps('section_database').databaseConnectionInfo.dsConnectionURL, 'azure.clientId'))), 'true')]", - "message": "The offer will append defaultAuthenticationPlugin, authenticationPlugins with Azure provided plugins, and append azure.clientId with your managed identity client ID automatically, please do not specify them in your connection string." - }, - { - "isValid": "[if(and(bool(steps('section_database').databaseConnectionInfo.enablePswlessConnection), equals(steps('section_database').databaseConnectionInfo.databaseType, 'postgresql')), and(not(contains(steps('section_database').databaseConnectionInfo.dsConnectionURL, 'authenticationPluginClassName')),not(contains(steps('section_database').databaseConnectionInfo.dsConnectionURL, 'azure.clientId'))), 'true')]", - "message": "The offer will append authenticationPluginClassName with Azure provided plugins, and append azure.clientId with your managed identity client ID automatically, please do not specify them in your connection string." - }, - { - "isValid": "[if(and(bool(steps('section_database').databaseConnectionInfo.enablePswlessConnection), equals(steps('section_database').databaseConnectionInfo.databaseType, 'sqlserver')), and(not(contains(steps('section_database').databaseConnectionInfo.dsConnectionURL, 'authentication=ActiveDirectoryMSI')),not(contains(steps('section_database').databaseConnectionInfo.dsConnectionURL, 'msiClientId'))), 'true')]", - "message": "The offer will append authentication with ActiveDirectoryMSI, and append msiClientId with your managed identity client ID automatically, please do not specify them in your connection string." - }, - { - "isValid": "[if(and(bool(steps('section_database').databaseConnectionInfo.enablePswlessConnection0),equals(steps('section_database').databaseConnectionInfo.databaseType, 'sqlserver')), greater(length(steps('section_database').databaseConnectionInfo.dbIdentity.userAssignedIdentities),0), bool('true'))]", - "message": "You must select at least one managed identity that has access to your database." - } - ] - }, - "visible": true - }, - { - "name": "dbGlobalTranPro", - "type": "Microsoft.Common.DropDown", - "label": "Global transactions protocol", - "defaultValue": "OnePhaseCommit", - "multiLine": true, - "toolTip": "Determines the transaction protocol (global transaction processing behavior) for the data source.", - "constraints": { - "allowedValues": [ - { - "label": "TwoPhaseCommit", - "description": "Standard XA transaction processing. Requires an XA driver.", - "value": "TwoPhaseCommit" - }, - { - "label": "LoggingLastResource", - "description": "A performance enhancement for one non-XA resource.", - "value": "LoggingLastResource" - }, - { - "label": "EmulateTwoPhaseCommit", - "description": "Enables one non-XA resource to participate in a global transaction, but has some risk to data.", - "value": "EmulateTwoPhaseCommit" - }, - { - "label": "OnePhaseCommit", - "description": "One-phase XA transaction processing using a non-XA driver. This is the default setting.", - "value": "OnePhaseCommit" - }, - { - "label": "None", - "description": "Support for local transactions only.", - "value": "None" - } - ], - "required": true - }, - "visible": true - }, - { - "name": "enablePswlessConnection0", - "type": "Microsoft.Common.CheckBox", - "label": "Use passwordless datasource connection", - "toolTip": "Use passwordless datasource connection.", - "visible": "[and(bool(steps('section_database').enableDB),equals(steps('section_database').databaseConnectionInfo.databaseType, 'sqlserver'))]" - }, - { - "name": "dbUser", - "type": "Microsoft.Common.TextBox", - "label": "Database username", - "toolTip": "Use only letters and numbers", - "defaultValue": "", - "constraints": { - "required": true, - "validations": [ - { - "regex": "^(?!\\-)([a-z0-9A-Z@\\-]{1,128})([^\\-])$", - "message": "The value must be 1-128 characters long and must only contain letters, numbers, hyphen(-) and the at sign, no hyphen allowed at the beginning and the end of database username." - }, - { - "isValid": "[if(bool(steps('section_database').databaseConnectionInfo.enablePswlessConnection), greater(length(steps('section_database').databaseConnectionInfo.dbIdentity.userAssignedIdentities),0), bool('true'))]", - "message": "You must select at least one managed identity that has access to your database." - } - ] - }, - "visible": "[and(bool(steps('section_database').enableDB), not(and(steps('section_database').databaseConnectionInfo.enablePswlessConnection0, equals(steps('section_database').databaseConnectionInfo.databaseType, 'sqlserver'))))]" - }, - { - "name": "enablePswlessConnection", - "type": "Microsoft.Common.CheckBox", - "label": "Use passwordless datasource connection", - "toolTip": "Use passwordless datasource connection.", - "visible": "[and(bool(steps('section_database').enableDB),or(equals(steps('section_database').databaseConnectionInfo.databaseType, 'mysql'),equals(steps('section_database').databaseConnectionInfo.databaseType, 'postgresql')))]" - }, - { - "name": "dbPassword", - "type": "Microsoft.Common.PasswordBox", - "label": { - "password": "Database Password", - "confirmPassword": "Confirm password" - }, - "toolTip": "Database Password", - "constraints": { - "required": true, - "regex": "^((?=.*[0-9])(?=.*[a-zA-Z!@#$%^&*])).{5,128}$", - "validationMessage": "The password must be between 5 and 128 characters long and have at least one number." - }, - "options": { - "hideConfirmation": false - }, - "visible": "[and(bool(steps('section_database').enableDB), not(or(steps('section_database').databaseConnectionInfo.enablePswlessConnection, steps('section_database').databaseConnectionInfo.enablePswlessConnection0)))]" - }, - { - "name": "dbIdentity", - "type": "Microsoft.ManagedIdentity.IdentitySelector", - "label": "Connect database with Managed Identity", - "toolTip": { - "userAssignedIdentity": "Select a user assigned identity that has access to your database. For how to create a database user for your managed identity, see https://aka.ms/javaee-db-identity." - }, - "defaultValue": { - "systemAssignedIdentity": "Off" - }, - "options": { - "hideSystemAssignedIdentity": true, - "hideUserAssignedIdentity": false - }, - "visible": "[and(bool(steps('section_database').enableDB), or(steps('section_database').databaseConnectionInfo.enablePswlessConnection, steps('section_database').databaseConnectionInfo.enablePswlessConnection0))]" - } - ], - "visible": "[bool(steps('section_database').enableDB)]" - } - ] - }, - { - "name": "section_coherence", - "label": "Coherence", - "subLabel": { - "preValidation": "Configure Coherence.", - "postValidation": "Done" - }, - "bladeTitle": "Coherence", - "elements": [ - { - "name": "aboutCoherence", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "Selecting 'Yes' here and providing the configuration will cause the template to create a Coherence cluster, the WebLogic Domain will create a data tier configured with Managed Coherence cache servers.", - "link": { - "label": "Learn more", - "uri": "https://aka.ms/arm-oraclelinux-wls-coherence" - } - } - }, - { - "name": "enableCoherence", - "type": "Microsoft.Common.OptionsGroup", - "label": "Use Coherence cache?", - "defaultValue": "No", - "toolTip": "Select 'Yes' and provide required info to configure Coherence cluster.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": "true" - }, - { - "label": "No", - "value": "false" - } - ], - "required": true - } - }, - { - "name": "coherenceInfo", - "type": "Microsoft.Common.Section", - "label": "Coherence settings", - "elements": [ - { - "name": "coherenceVMSizeSelect", - "type": "Microsoft.Compute.SizeSelector", - "label": "Coherence virtual machine size", - "toolTip": "The size of virtual machine for Coherence cache servers.", - "recommendedSizes": [ - "[basics('vmSizeSelect')]" - ], - "constraints": { - "excludedSizes": [ - "Standard_B1ls", - "Standard_A0", - "Basic_A0", - "Standard_B1s" - ] - }, - "osPlatform": "Linux", - "count": "1", - "visible": true - }, - { - "name": "numberOfCoherenceStorageInstances", - "type": "Microsoft.Common.TextBox", - "label": "Number of Coherence cache servers", - "toolTip": "Number of Coherence cache instances, used to create virtual machines and WebLogic Managed Server.", - "defaultValue": "1", - "constraints": { - "required": true, - "regex": "^[0-9]+$", - "validationMessage": "The value must be a valid number." - } - }, - { - "name": "enableCoherenceWebLocalStorage", - "type": "Microsoft.Common.OptionsGroup", - "label": "Coherence Web Local Storage Enabled", - "defaultValue": "Yes", - "toolTip": "Specifies whether Local Storage is enabled for the Coherence*Web cluster tier", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": "true" - }, - { - "label": "No", - "value": "false" - } - ], - "required": true - } - } - ], - "visible": "[bool(steps('section_coherence').enableCoherence)]" - } - ] - } - ], - "outputs": { - "Location": "[location()]", - "adminPasswordOrKey": "[if(equals(basics('basicsRequired').adminPasswordOrKey.authenticationType, 'password'), basics('basicsRequired').adminPasswordOrKey.password, basics('basicsRequired').adminPasswordOrKey.sshPublicKey)]", - "adminUsername": "[basics('basicsRequired').adminUsername]", - "addressPrefixes": "[steps('section_networkingConfiguration').virtualNetwork.addressPrefixes]", - "authenticationType": "[basics('basicsRequired').adminPasswordOrKey.authenticationType]", - "databaseType": "[steps('section_database').databaseConnectionInfo.databaseType]", - "denyPublicTrafficForAdminServer": "[steps('section_networkingConfiguration').denyPublicTrafficForAdminServer]", - "denyPublicTrafficForManagedServer": "[steps('section_networkingConfiguration').denyPublicTrafficForManagedServer]", - "dbIdentity": "[steps('section_database').databaseConnectionInfo.dbIdentity]", - "dnsLabelPrefix": "[steps('section_networkingConfiguration').dnsLabelPrefix]", - "dsConnectionURL": "[steps('section_database').databaseConnectionInfo.dsConnectionURL]", - "dnszoneName": "[steps('section_networkingConfiguration').customDNSSettings.dnszoneName]", - "dnszoneResourceGroup": "[steps('section_networkingConfiguration').customDNSSettings.dnsZoneResourceGroup]", - "dnszoneAdminConsoleLabel": "[steps('section_networkingConfiguration').customDNSSettings.dnszoneAdminConsoleLabel]", - "dnszoneLoadBalancerLabel": "[steps('section_networkingConfiguration').customDNSSettings.dnszoneLoadBalancerLabel]", - "dbGlobalTranPro": "[steps('section_database').databaseConnectionInfo.dbGlobalTranPro]", - "dbPassword": "[steps('section_database').databaseConnectionInfo.dbPassword]", - "dbUser": "[steps('section_database').databaseConnectionInfo.dbUser]", - "dynamicClusterSize": "[int(basics('basicsRequired').dynamicClusterSize)]", - "enableCoherence": "[bool(steps('section_coherence').enableCoherence)]", - "enableCoherenceWebLocalStorage": "[bool(if(bool(steps('section_coherence').enableCoherence),steps('section_coherence').coherenceInfo.enableCoherenceWebLocalStorage,'false'))]", - "enableDB": "[bool(steps('section_database').enableDB)]", - "enableCustomDNS": "[bool(steps('section_networkingConfiguration').enableCustomDNS)]", - "enableCustomSSL": "[bool(steps('section_sslConfiguration').enableCustomSSL)]", - "enableOHS": "[bool(steps('section_ohs').enableOHS)]", - "enablePswlessConnection": "[or(bool(steps('section_database').databaseConnectionInfo.enablePswlessConnection), bool(steps('section_database').databaseConnectionInfo.enablePswlessConnection0))]", - "hasDNSZones": "[bool(if(bool(steps('section_networkingConfiguration').enableCustomDNS), steps('section_networkingConfiguration').customDNSSettings.bringDNSZone, 'false'))]", - "jdbcDataSourceName": "[steps('section_database').databaseConnectionInfo.jdbcDataSourceName]", - "managedServerPrefix": "[basics('basicsOptional').managedServerPrefix]", - "maxDynamicClusterSize": "[int(basics('basicsRequired').maxDynamicClusterSize)]", - "numberOfCoherenceCacheInstances": "[int(if(bool(steps('section_coherence').enableCoherence),steps('section_coherence').coherenceInfo.numberOfCoherenceStorageInstances,'1'))]", - "portsToExpose": "[steps('section_networkingConfiguration').portsToExpose]", - "skuUrnVersion": "[basics('skuUrnVersion')]", - "useSystemAssignedManagedIdentity": "[basics('basicsOptional').useSystemAssignedManagedIdentity]", - "vmSize": "[basics('vmSizeSelect')]", - "vmSizeSelectForCoherence": "[steps('section_coherence').coherenceInfo.coherenceVMSizeSelect]", - "wlsDomainName": "[basics('basicsOptional').wlsDomainName]", - "wlsPassword": "[basics('basicsRequired').wlsPassword]", - "wlsUserName": "[basics('basicsRequired').wlsUserName]", - "ohsSkuUrnVersion": "[steps('section_ohs').ohsSkuUrnVersion]", - "ohsDomainName": "[steps('section_ohs').ohsDomainName]", - "ohsComponentName": "[steps('section_ohs').ohsComponentName]", - "ohsNMUser": "[steps('section_ohs').ohsNMUser]", - "ohsNMPassword": "[steps('section_ohs').ohsNMPassword]", - "ohshttpPort": "[steps('section_ohs').ohshttpPort]", - "ohshttpsPort": "[steps('section_ohs').ohshttpsPort]", - "oracleVaultPswd": "[steps('section_ohs').oracleVaultPswd]", - "enableHTTPAdminListenPort": "[basics('basicsOptional').enableAdminHTTPListenPort]", - "subnetName": "[steps('section_networkingConfiguration').virtualNetwork.subnets.subnet1.name]", - "subnetPrefix": "[steps('section_networkingConfiguration').virtualNetwork.subnets.subnet1.addressPrefix]", - "uploadedCustomIdentityKeyStoreData": "[steps('section_sslConfiguration').uploadedCustomSSLSettings.uploadedCustomIdentityKeyStoreData]", - "uploadedCustomIdentityKeyStorePassphrase": "[steps('section_sslConfiguration').uploadedCustomSSLSettings.uploadedCustomIdentityKeyStorePassphrase]", - "uploadedCustomIdentityKeyStoreType": "[steps('section_sslConfiguration').uploadedCustomSSLSettings.uploadedCustomIdentityKeyStoreType]", - "uploadedCustomTrustKeyStoreData": "[steps('section_sslConfiguration').uploadedCustomSSLSettings.uploadedCustomTrustKeyStoreData]", - "uploadedCustomTrustKeyStorePassPhrase": "[steps('section_sslConfiguration').uploadedCustomSSLSettings.uploadedCustomTrustKeyStorePassPhrase]", - "uploadedCustomTrustKeyStoreType": "[steps('section_sslConfiguration').uploadedCustomSSLSettings.uploadedCustomTrustKeyStoreType]", - "uploadedPrivateKeyAlias": "[steps('section_sslConfiguration').uploadedCustomSSLSettings.uploadedPrivateKeyAlias]", - "uploadedPrivateKeyPassPhrase": "[steps('section_sslConfiguration').uploadedCustomSSLSettings.uploadedPrivateKeyPassPhrase]", - "uploadedKeyStoreData": "[steps('section_ohs').uploadedCustomSSLSettings.uploadedKeyStoreData]", - "uploadedKeyStorePassword": "[steps('section_ohs').uploadedCustomSSLSettings.uploadedKeyStorePassword]", - "uploadedKeyStoreType": "[steps('section_ohs').uploadedCustomSSLSettings.uploadedKeyStoreType]", - "virtualNetworkName": "[steps('section_networkingConfiguration').virtualNetwork.name]", - "virtualNetworkResourceGroupName": "[steps('section_networkingConfiguration').virtualNetwork.resourceGroup]", - "virtualNetworkNewOrExisting": "[steps('section_networkingConfiguration').virtualNetwork.newOrExisting]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/dynamic_clusterdeploy.parameters.json b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/dynamic_clusterdeploy.parameters.json deleted file mode 100644 index 6624b9dd4..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/dynamic_clusterdeploy.parameters.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "adminUsername": { - "value": "GEN-UNIQUE" - }, - "adminPasswordOrKey": { - "value": "GEN-SSH-PUB-KEY" - }, - "dnsLabelPrefix": { - "value": "GEN-UNIQUE" - }, - "acceptOTNLicenseAgreement": { - "value": "GEN-UNIQUE" - }, - "otnAccountUsername": { - "value": "GEN-UNIQUE" - }, - "otnAccountPassword": { - "value": "GEN-UNIQUE" - }, - "wlsDomainName": { - "value": "GEN-UNIQUE" - }, - "wlsUserName": { - "value": "GEN-UNIQUE" - }, - "wlsPassword": { - "value": "GEN-UNIQUE" - }, - "adminVMName": { - "value": "GEN-UNIQUE" - }, - "managedServerPrefix":{ - "value": "GEN-UNIQUE" - }, - "maxDynamicClusterSize":{ - "value": "GEN-UNIQUE" - }, - "dynamicClusterSize":{ - "value": "GEN-UNIQUE" - }, - "vmSize":{ - "value": "GEN-UNIQUE" - } - - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/mainTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/mainTemplate.json deleted file mode 100644 index a70fdeb8b..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/mainTemplate.json +++ /dev/null @@ -1,1330 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - }, - "defaultValue": "[deployment().properties.templateLink.uri]" - }, - "_artifactsLocationSasToken": { - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - }, - "defaultValue": "" - }, - "adminPasswordOrKey": { - "type": "securestring", - "metadata": { - "description": "SSH Key or password for the Virtual Machine. SSH key is recommended." - } - }, - "adminUsername": { - "defaultValue": "weblogic", - "type": "string", - "metadata": { - "description": "User name for the Virtual Machine." - } - }, - "adminVMNamePrefix": { - "defaultValue": "admin", - "type": "string", - "metadata": { - "description": "Admin Server hosting VM name prefix." - } - }, - "authenticationType": { - "type": "string", - "defaultValue": "password", - "allowedValues": [ - "sshPublicKey", - "password" - ], - "metadata": { - "description": "Type of authentication to use on the Virtual Machine. SSH key is recommended." - } - }, - "databaseType": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "One of the supported database types" - } - }, - "dbGlobalTranPro": { - "defaultValue": "OnePhaseCommit", - "type": "string", - "metadata": { - "description": "Determines the transaction protocol (global transaction processing behavior) for the data source." - } - }, - "dbIdentity": { - "defaultValue": {}, - "type": "object", - "metadata": { - "description": "Managed identity that has access to the data source." - } - }, - "dbPassword": { - "defaultValue": "", - "type": "securestring", - "metadata": { - "description": "Password for Database" - } - }, - "dbUser": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "Userid of Database" - } - }, - "denyPublicTrafficForAdminServer": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "Set 'true' to deny public inbound traffic for the admin server." - } - }, - "denyPublicTrafficForManagedServer": { - "type": "bool", - "defaultValue": true - }, - "dnsLabelPrefix": { - "defaultValue": "wls", - "type": "string", - "metadata": { - "description": "Unique DNS Name for the Public IP used to access the Virtual Machine." - } - }, - "dnszoneName": { - "defaultValue": "contoso.xyz", - "type": "string", - "metadata": { - "description": "Azure DNS Zone name." - } - }, - "dnszoneResourceGroup": { - "type": "string", - "defaultValue": "[resourceGroup().name]", - "metadata": { - "description": "Name of the resource group containing the Azure DNS Zone." - } - }, - "dnszoneAdminConsoleLabel": { - "type": "string", - "defaultValue": "console", - "metadata": { - "description": "Specify a label used to generate subdomain of Oracle WebLogic Administration Console. The final subdomain name will be label.dnszoneName, e.g. console.contoso.xyz" - } - }, - "dnszoneLoadBalancerLabel": { - "type": "string", - "defaultValue": "applications", - "metadata": { - "description": "Specify a label used to generate subdomain of Application Gateway. The final subdomain name will be label.dnszoneName, e.g. applications.contoso.xyz" - } - }, - "dsConnectionURL": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "JDBC Connection String" - } - }, - "dynamicClusterSize": { - "defaultValue": 2, - "type": "int", - "metadata": { - "description": "Initial Number of Managed Servers that will be configured in the Dynamic Cluster" - } - }, - "enableCoherence": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "If true, create Coherence cluster with data tier for cache." - } - }, - "enableCustomDNS": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "If true, use the supplied parameters to configure custome DNS." - } - }, - "enableCoherenceWebLocalStorage": { - "defaultValue": true, - "type": "bool", - "metadata": { - "description": "Specifies whether Local Storage is enabled for the Coherence*Web cluster tier." - } - }, - "enableDB": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "If true, use the supplied parameters to connect the cluster to a pre-provisioned database." - } - }, - "enableOHS": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "Bool value, if it's set to true, it will setup OHS and configures for WebLogic Server cluster" - } - }, - "enablePswlessConnection": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "True to enable passwordless JDBC connection." - } - }, - "guidValue": { - "type": "string", - "defaultValue": "[newGuid()]", - "metadata": { - "description": "A unique value to ensure the generated names are unique." - } - }, - "hasDNSZones": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "If true, the template will update records to the existing DNS Zone. If false, the template will create a new DNS Zone." - } - }, - "jdbcDataSourceName": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "JNDI Name for JDBC Datasource" - } - }, - "uploadedCustomIdentityKeyStoreData": { - "type": "securestring", - "metadata": { - "description": "Custom Identity KeyStore Data" - }, - "defaultValue": "" - }, - "uploadedCustomIdentityKeyStorePassphrase": { - "type": "securestring", - "metadata": { - "description": "Custom Identity KeyStore Passphrase" - }, - "defaultValue": "" - }, - "uploadedCustomIdentityKeyStoreType": { - "type": "string", - "metadata": { - "description": "Weblogic Custom Identity Keystore Type" - }, - "defaultValue": "JKS" - }, - "uploadedCustomTrustKeyStoreData": { - "type": "securestring", - "metadata": { - "description": "Custom Trust KeyStore Data" - }, - "defaultValue": "" - }, - "uploadedCustomTrustKeyStorePassPhrase": { - "type": "securestring", - "metadata": { - "description": "Custom Trust KeyStore PassPhrase" - }, - "defaultValue": "" - }, - "uploadedCustomTrustKeyStoreType": { - "type": "string", - "metadata": { - "description": "Weblogic Custom Trust Keystore Type" - }, - "defaultValue": "JKS" - }, - "uploadedPrivateKeyAlias": { - "type": "string", - "metadata": { - "description": "Alias of the private key" - }, - "defaultValue": "privateKeyAlias" - }, - "uploadedPrivateKeyPassPhrase": { - "type": "securestring", - "metadata": { - "description": "Password of the private key" - }, - "defaultValue": "" - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]", - "metadata": { - "description": "Location for all resources." - } - }, - "managedServerPrefix": { - "defaultValue": "msp", - "type": "string", - "metadata": { - "description": "Provide managed server prefix names" - } - }, - "maxDynamicClusterSize": { - "defaultValue": 10, - "type": "int", - "metadata": { - "description": "Maximum Number of Managed Servers allowed to be configured in the Dynamic Cluster" - } - }, - "numberOfCoherenceCacheInstances": { - "defaultValue": 1, - "type": "int", - "minValue": 1, - "maxValue": 10, - "metadata": { - "description": "Number of Coherence cache instances, used to create virtual machines and Managed Server." - } - }, - "ohsComponentName": { - "defaultValue": "ohs_azure", - "type": "string", - "metadata": { - "description": "Provide OHS component name" - } - }, - "ohsDomainName": { - "defaultValue": "ohsStandaloneDomain", - "type": "string", - "metadata": { - "description": "Provide OHS domain name" - } - }, - "ohsNMPassword": { - "defaultValue": "", - "type": "securestring", - "metadata": { - "description": "Password for OHS NodeManager" - } - }, - "ohsNMUser": { - "defaultValue": "weblogic", - "type": "string", - "metadata": { - "description": "Provide OHS NodeManager user name" - } - }, - "ohsSkuUrnVersion": { - "type": "string", - "defaultValue": "ohs-122140-jdk8-ol76;ohs-122140-jdk8-ol76;latest", - "allowedValues": [ - "ohs-122140-jdk8-ol76;ohs-122140-jdk8-ol76;latest", - "ohs-122140-jdk8-ol74;ohs-122140-jdk8-ol74;latest", - "ohs-122140-jdk8-ol73;ohs-122140-jdk8-ol73;latest" - ], - "metadata": { - "description": "The Oracle Linux image with OHS and Java preinstalled. Semicolon separated string of Sku, URN, and Version" - } - }, - "ohsVMNamePrefix": { - "defaultValue": "ohs", - "type": "string", - "metadata": { - "description": "OHS Server hosting VM name." - } - }, - "ohshttpPort": { - "defaultValue": "7777", - "type": "string", - "metadata": { - "description": "Provide OHS HTTP port" - } - }, - "ohshttpsPort": { - "defaultValue": "4444", - "type": "string", - "metadata": { - "description": "Provide OHS HTTPS port" - } - }, - "oracleVaultPswd": { - "defaultValue": "", - "type": "securestring", - "metadata": { - "description": "Password for Oracle Vault required for OHS" - } - }, - "portsToExpose": { - "defaultValue": "80,443,7001-9000", - "type": "string", - "metadata": { - "description": "Ports and port ranges to expose" - } - }, - "skuUrnVersion": { - "type": "string", - "defaultValue": "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest", - "allowedValues": [ - "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest", - "owls-141100-jdk11-ol87;Oracle:weblogic-141100-jdk11-ol87:owls-141100-jdk11-ol87;latest", - "owls-141100-jdk8-ol91;Oracle:weblogic-141100-jdk8-ol91:owls-141100-jdk8-ol91;latest", - "owls-141100-jdk8-ol87;Oracle:weblogic-141100-jdk8-ol87:owls-141100-jdk8-ol87;latest", - "owls-122140-jdk8-ol91;Oracle:weblogic-122140-jdk8-ol91:owls-122140-jdk8-ol91;latest", - "owls-122140-jdk8-ol87;Oracle:weblogic-122140-jdk8-ol87:owls-122140-jdk8-ol87;latest", - "owls-122140-jdk8-ol76;Oracle:weblogic-122140-jdk8-ol76:owls-122140-jdk8-ol7;latest", - "owls-141100-jdk8-ol76;Oracle:weblogic-141100-jdk8-ol76:owls-141100-jdk8-ol7;latest", - "owls-141100-jdk11-ol76;Oracle:weblogic-141100-jdk11-ol76:owls-141100-jdk11-ol7;latest", - "owls-141100-jdk11-rhel87;Oracle:weblogic-141100-jdk11-rhel87:owls-141100-jdk11-rhel87;latest", - "owls-141100-jdk8-rhel87;Oracle:weblogic-141100-jdk8-rhel87:owls-141100-jdk8-rhel87;latest", - "owls-122140-jdk8-rhel87;Oracle:weblogic-122140-jdk8-rhel87:owls-122140-jdk8-rhel87;latest", - "owls-122140-jdk8-rhel76;Oracle:weblogic-122140-jdk8-rhel76:owls-122140-jdk8-rhel76;latest", - "owls-141100-jdk8-rhel76;Oracle:weblogic-141100-jdk8-rhel76:owls-141100-jdk8-rhel76;latest", - "owls-141100-jdk11-rhel76;Oracle:weblogic-141100-jdk11-rhel76:owls-141100-jdk11-rhel76;latest" - ], - "metadata": { - "description": "The Oracle Linux image with Weblogic and Java preinstalled. Semicolon separated string of Sku, URN, and Version" - } - }, - "usePreviewImage": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "Bool value, if it's set to true, will deploy with preview weblogic image." - } - }, - "useSystemAssignedManagedIdentity": { - "type": "bool", - "defaultValue": true, - "metadata": { - "description": "Bool value, if it's set to true, a system assigned managed identity will to be created for the VM(s)" - } - }, - "uploadedKeyStoreData": { - "defaultValue": "", - "type": "securestring", - "metadata": { - "description": "SSL Certificate Data for OHS" - } - }, - "uploadedKeyStorePassword": { - "defaultValue": "[newGuid()]", - "type": "securestring", - "metadata": { - "description": "Password of the SSL Certificate Data for OHS" - } - }, - "uploadedKeyStoreType": { - "defaultValue": "PKCS12", - "type": "string", - "metadata": { - "description": "SSL Certificate Data type" - } - }, - "vmSize": { - "defaultValue": "Standard_A2_v2", - "type": "string", - "metadata": { - "description": "Select appropriate VM Size as per requirement" - } - }, - "vmSizeSelectForCoherence": { - "defaultValue": "Standard_A2_v2", - "type": "string", - "metadata": { - "description": "Select appropriate VM Size for Coherence" - } - }, - "virtualNetworkNewOrExisting": { - "type": "string", - "defaultValue": "new", - "allowedValues": [ - "new", - "existing" - ], - "metadata": { - "description": "Specify whether to create a new or existing virtual network for the VM." - } - }, - "virtualNetworkName": { - "type": "string", - "defaultValue": "[concat('wlsdcluster-vnet-', uniqueString(utcNow()))]", - "metadata": { - "description": "Name of the existing or new VNET" - } - }, - "virtualNetworkResourceGroupName": { - "type": "string", - "defaultValue": "[resourceGroup().name]", - "metadata": { - "description": "Resource group of Virtual network" - } - }, - "addressPrefixes": { - "type": "array", - "defaultValue": [ - "10.0.0.0/16" - ], - "metadata": { - "description": "Address prefix of the VNET." - } - }, - "subnetName": { - "type": "string", - "defaultValue": "wls-subnet", - "metadata": { - "description": "Name of the existing or new Subnet" - } - }, - "subnetPrefix": { - "type": "string", - "defaultValue": "10.0.0.0/24", - "metadata": { - "description": "Address prefix of the subnet" - } - }, - "wlsDomainName": { - "defaultValue": "wlsd", - "type": "string", - "metadata": { - "description": "Provide Weblogic domain name" - } - }, - "wlsPassword": { - "type": "securestring", - "metadata": { - "description": "Password for your Weblogic domain name" - } - }, - "wlsUserName": { - "defaultValue": "weblogic", - "type": "string", - "metadata": { - "description": "Username for your Weblogic domain name" - } - }, - "enableHTTPAdminListenPort": { - "defaultValue": true, - "type": "bool", - "metadata": { - "description": "Boolean value indicating, if WebLogic Admin Server HTTP Listen Port is enabled or not" - } - }, - "enableCustomSSL": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "Boolean value indicating, if custom SSL is enabled or not" - } - } - }, - "variables": { - "const_globalResourceNameSuffix": "[uniqueString(parameters('guidValue'))]", - "name_adminVM": "[concat(parameters('adminVMNamePrefix'), variables('const_globalResourceNameSuffix'), 'VM')]", - "name_clusterCustomSSLTemplate": "clusterCustomSSLLinkedTemplate", - "name_clusterCustomSSLLinkedTemplateName": "clusterCustomSSLTemplate.json", - "name_clusterLinkedTemplateName": "clusterTemplate.json", - "name_clusterTemplate": "clusterLinkedTemplate", - "name_coherenceTemplateName": "coherenceTemplate.json", - "name_dbLinkedTemplateName": "dbTemplate.json", - "name_dnszonesLinkedTemplateName": "dnszonesTemplate.json", - "name_managedVMNamePrefix": "[concat(parameters('managedServerPrefix'), variables('const_globalResourceNameSuffix'))]", - "name_networkSecurityGroup": "[concat(parameters('dnsLabelPrefix'), '-nsg-', variables('const_globalResourceNameSuffix'))]", - "name_nsgLinkedTemplateName": "nsgNestedTemplate.json", - "name_ohsLinkedTemplateName": "ohsNestedTemplate.json", - "name_ohsVMName": "[concat(parameters('ohsVMNamePrefix'), variables('const_globalResourceNameSuffix'), 'VM')]", - "ref_clusterTemplate": "[concat('cluster',if(parameters('enableCustomSSL'),'CustomSSL',''),'LinkedTemplate')]" - }, - "resources": [ - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${dynamic.start}", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "[variables('name_clusterTemplate')]", - "condition": "[not(parameters('enableCustomSSL'))]", - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_clusterLinkedTemplateName')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "_globalResourceNameSuffix": { - "value": "[variables('const_globalResourceNameSuffix')]" - }, - "adminPasswordOrKey": { - "value": "[parameters('adminPasswordOrKey')]" - }, - "adminUsername": { - "value": "[parameters('adminUsername')]" - }, - "adminVMName": { - "value": "[variables('name_adminVM')]" - }, - "authenticationType": { - "value": "[parameters('authenticationType')]" - }, - "addressPrefixes": { - "value": "[parameters('addressPrefixes')]" - }, - "dnsLabelPrefix": { - "value": "[parameters('dnsLabelPrefix')]" - }, - "dynamicClusterSize": { - "value": "[parameters('dynamicClusterSize')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "managedServerPrefix": { - "value": "[parameters('managedServerPrefix')]" - }, - "managedVMPrefix": { - "value": "[variables('name_managedVMNamePrefix')]" - }, - "maxDynamicClusterSize": { - "value": "[parameters('maxDynamicClusterSize')]" - }, - "nsgName": { - "value": "[variables('name_networkSecurityGroup')]" - }, - "portsToExpose": { - "value": "[parameters('portsToExpose')]" - }, - "skuUrnVersion": { - "value": "[parameters('skuUrnVersion')]" - }, - "subnetName": { - "value": "[parameters('subnetName')]" - }, - "subnetPrefix": { - "value": "[parameters('subnetPrefix')]" - }, - "usePreviewImage": { - "value": "[parameters('usePreviewImage')]" - }, - "useSystemAssignedManagedIdentity": { - "value": "[parameters('useSystemAssignedManagedIdentity')]" - }, - "vmSize": { - "value": "[parameters('vmSize')]" - }, - "virtualNetworkNewOrExisting": { - "value": "[parameters('virtualNetworkNewOrExisting')]" - }, - "virtualNetworkName": { - "value": "[parameters('virtualNetworkName')]" - }, - "virtualNetworkResourceGroupName": { - "value": "[parameters('virtualNetworkResourceGroupName')]" - }, - "wlsDomainName": { - "value": "[parameters('wlsDomainName')]" - }, - "wlsPassword": { - "value": "[parameters('wlsPassword')]" - }, - "wlsUserName": { - "value": "[parameters('wlsUserName')]" - }, - "enableHTTPAdminListenPort": { - "value": "[parameters('enableHTTPAdminListenPort')]" - }, - "enableDNSConfiguration": { - "value": "[parameters('enableCustomDNS')]" - }, - "customDNSNameForAdminServer": { - "value": "[if(parameters('enableCustomDNS'), format('{0}.{1}', parameters('dnszoneAdminConsoleLabel'),parameters('dnszoneName')),'')]" - } - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "[variables('name_clusterCustomSSLTemplate')]", - "condition": "[parameters('enableCustomSSL')]", - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_clusterCustomSSLLinkedTemplateName')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "_globalResourceNameSuffix": { - "value": "[variables('const_globalResourceNameSuffix')]" - }, - "adminPasswordOrKey": { - "value": "[parameters('adminPasswordOrKey')]" - }, - "adminUsername": { - "value": "[parameters('adminUsername')]" - }, - "adminVMName": { - "value": "[variables('name_adminVM')]" - }, - "authenticationType": { - "value": "[parameters('authenticationType')]" - }, - "addressPrefixes": { - "value": "[parameters('addressPrefixes')]" - }, - "dnsLabelPrefix": { - "value": "[parameters('dnsLabelPrefix')]" - }, - "dynamicClusterSize": { - "value": "[parameters('dynamicClusterSize')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "managedServerPrefix": { - "value": "[parameters('managedServerPrefix')]" - }, - "managedVMPrefix": { - "value": "[variables('name_managedVMNamePrefix')]" - }, - "maxDynamicClusterSize": { - "value": "[parameters('maxDynamicClusterSize')]" - }, - "nsgName": { - "value": "[variables('name_networkSecurityGroup')]" - }, - "portsToExpose": { - "value": "[parameters('portsToExpose')]" - }, - "skuUrnVersion": { - "value": "[parameters('skuUrnVersion')]" - }, - "subnetName": { - "value": "[parameters('subnetName')]" - }, - "subnetPrefix": { - "value": "[parameters('subnetPrefix')]" - }, - "usePreviewImage": { - "value": "[parameters('usePreviewImage')]" - }, - "useSystemAssignedManagedIdentity": { - "value": "[parameters('useSystemAssignedManagedIdentity')]" - }, - "vmSize": { - "value": "[parameters('vmSize')]" - }, - "virtualNetworkNewOrExisting": { - "value": "[parameters('virtualNetworkNewOrExisting')]" - }, - "virtualNetworkName": { - "value": "[parameters('virtualNetworkName')]" - }, - "virtualNetworkResourceGroupName": { - "value": "[parameters('virtualNetworkResourceGroupName')]" - }, - "wlsDomainName": { - "value": "[parameters('wlsDomainName')]" - }, - "wlsPassword": { - "value": "[parameters('wlsPassword')]" - }, - "wlsUserName": { - "value": "[parameters('wlsUserName')]" - }, - "enableHTTPAdminListenPort": { - "value": "[parameters('enableHTTPAdminListenPort')]" - }, - "enableDNSConfiguration": { - "value": "[parameters('enableCustomDNS')]" - }, - "customDNSNameForAdminServer": { - "value": "[if(parameters('enableCustomDNS'), format('{0}.{1}', parameters('dnszoneAdminConsoleLabel'),parameters('dnszoneName')),'')]" - }, - "enableCustomSSL": { - "value": "[parameters('enableCustomSSL')]" - }, - "sslCustomIdentityKeyStoreData": { - "value": "[parameters('uploadedCustomIdentityKeyStoreData')]" - }, - "sslCustomIdentityKeyStorePassPhrase": { - "value": "[parameters('uploadedCustomIdentityKeyStorePassphrase')]" - }, - "sslCustomIdentityKeyStoreType": { - "value": "[parameters('uploadedCustomIdentityKeyStoreType')]" - }, - "sslCustomTrustKeyStoreData": { - "value": "[parameters('uploadedCustomTrustKeyStoreData')]" - }, - "sslCustomTrustKeyStorePassPhrase": { - "value": "[parameters('uploadedCustomTrustKeyStorePassPhrase')]" - }, - "sslCustomTrustKeyStoreType": { - "value": "[parameters('uploadedCustomTrustKeyStoreType')]" - }, - "sslPrivateKeyAlias": { - "value": "[parameters('uploadedPrivateKeyAlias')]" - }, - "sslPrivateKeyPassPhrase": { - "value": "[parameters('uploadedPrivateKeyPassPhrase')]" - } - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'new')]", - "name": "networkSecurityLinkedTemplate", - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_nsgLinkedTemplateName')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "denyPublicTrafficForAdminServer": { - "value": "[parameters('denyPublicTrafficForAdminServer')]" - }, - "denyPublicTrafficForManagedServer": { - "value": "[parameters('denyPublicTrafficForManagedServer')]" - }, - "enableOHS": { - "value": "[parameters('enableOHS')]" - }, - "networkSecurityGroupName": { - "value": "[variables('name_networkSecurityGroup')]" - } - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', variables('ref_clusterTemplate'))]", - "[resourceId('Microsoft.Resources/deployments', 'ohsLinkedTemplate')]" - ] - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "dbLinkedTemplate", - "condition": "[parameters('enableDB')]", - "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', variables('ref_clusterTemplate'))]" - ], - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_dbLinkedTemplateName')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "adminVMName": { - "value": "[variables('name_adminVM')]" - }, - "databaseType": { - "value": "[parameters('databaseType')]" - }, - "dbGlobalTranPro": { - "value": "[parameters('dbGlobalTranPro')]" - }, - "dbIdentity": { - "value": "[parameters('dbIdentity')]" - }, - "dbPassword": { - "value": "[parameters('dbPassword')]" - }, - "dbUser": { - "value": "[parameters('dbUser')]" - }, - "dsConnectionURL": { - "value": "[parameters('dsConnectionURL')]" - }, - "enablePswlessConnection": { - "value": "[parameters('enablePswlessConnection')]" - }, - "jdbcDataSourceName": { - "value": "[parameters('jdbcDataSourceName')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "managedServerPrefix": { - "value": "[parameters('managedServerPrefix')]" - }, - "managedVMNamePrefix": { - "value": "[variables('name_managedVMNamePrefix')]" - }, - "numberOfManagedApplicationInstances": { - "value": "[parameters('dynamicClusterSize')]" - }, - "wlsPassword": { - "value": "[parameters('wlsPassword')]" - }, - "wlsUserName": { - "value": "[parameters('wlsUserName')]" - } - } - } - }, - { - "name": "coherenceTemplate", - "type": "Microsoft.Resources/deployments", - "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', 'dbLinkedTemplate')]" - ], - "apiVersion": "${azure.apiVersionForDeployment}", - "condition": "[and(parameters('enableCoherence'),not(parameters('enableCustomSSL')))]", - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_coherenceTemplateName')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "_globalResourceNameSuffix": { - "value": "[variables('const_globalResourceNameSuffix')]" - }, - "adminPasswordOrKey": { - "value": "[parameters('adminPasswordOrKey')]" - }, - "adminUsername": { - "value": "[parameters('adminUsername')]" - }, - "authenticationType": { - "value": "[parameters('authenticationType')]" - }, - "adminVMName": { - "value": "[variables('name_adminVM')]" - }, - "dnsLabelPrefix": { - "value": "[parameters('dnsLabelPrefix')]" - }, - "enableCoherenceWebLocalStorage": { - "value": "[parameters('enableCoherenceWebLocalStorage')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "managedServerPrefix": { - "value": "[parameters('managedServerPrefix')]" - }, - "managedVMNamePrefix": { - "value": "[variables('name_managedVMNamePrefix')]" - }, - "numberOfCoherenceCacheInstances": { - "value": "[parameters('numberOfCoherenceCacheInstances')]" - }, - "skuUrnVersion": { - "value": "[parameters('skuUrnVersion')]" - }, - "subnetName": { - "value": "[parameters('subnetName')]" - }, - "storageAccountName": { - "value": "[reference(variables('ref_clusterTemplate'), '${azure.apiVersionForDeployment}').outputs.storageAccountName.value]" - }, - "usePreviewImage": { - "value": "[parameters('usePreviewImage')]" - }, - "vmSizeSelectForCoherence": { - "value": "[parameters('vmSizeSelectForCoherence')]" - }, - "virtualNetworkResourceGroupName": { - "value": "[parameters('virtualNetworkResourceGroupName')]" - }, - "virtualNetworkName": { - "value": "[parameters('virtualNetworkName')]" - }, - "wlsDomainName": { - "value": "[parameters('wlsDomainName')]" - }, - "wlsPassword": { - "value": "[parameters('wlsPassword')]" - }, - "wlsUserName": { - "value": "[parameters('wlsUserName')]" - }, - "enableCustomSSL": { - "value": "[parameters('enableCustomSSL')]" - }, - "enableDNSConfiguration": { - "value": "[parameters('enableCustomDNS')]" - }, - "customDNSNameForAdminServer": { - "value": "[if(parameters('enableCustomDNS'), format('{0}.{1}', parameters('dnszoneAdminConsoleLabel'),parameters('dnszoneName')),'')]" - } - } - } - }, - { - "name": "coherenceTemplateWithCustomSSL", - "type": "Microsoft.Resources/deployments", - "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', 'dbLinkedTemplate')]" - ], - "apiVersion": "${azure.apiVersionForDeployment}", - "condition": "[and(parameters('enableCoherence'),parameters('enableCustomSSL'))]", - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_coherenceTemplateName')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "_globalResourceNameSuffix": { - "value": "[variables('const_globalResourceNameSuffix')]" - }, - "adminPasswordOrKey": { - "value": "[parameters('adminPasswordOrKey')]" - }, - "adminUsername": { - "value": "[parameters('adminUsername')]" - }, - "authenticationType": { - "value": "[parameters('authenticationType')]" - }, - "adminVMName": { - "value": "[variables('name_adminVM')]" - }, - "dnsLabelPrefix": { - "value": "[parameters('dnsLabelPrefix')]" - }, - "enableCoherenceWebLocalStorage": { - "value": "[parameters('enableCoherenceWebLocalStorage')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "managedServerPrefix": { - "value": "[parameters('managedServerPrefix')]" - }, - "managedVMNamePrefix": { - "value": "[variables('name_managedVMNamePrefix')]" - }, - "numberOfCoherenceCacheInstances": { - "value": "[parameters('numberOfCoherenceCacheInstances')]" - }, - "skuUrnVersion": { - "value": "[parameters('skuUrnVersion')]" - }, - "storageAccountName": { - "value": "[reference(variables('ref_clusterTemplate'), '${azure.apiVersionForDeployment}').outputs.storageAccountName.value]" - }, - "usePreviewImage": { - "value": "[parameters('usePreviewImage')]" - }, - "subnetName": { - "value": "[parameters('subnetName')]" - }, - "virtualNetworkResourceGroupName": { - "value": "[parameters('virtualNetworkResourceGroupName')]" - }, - "virtualNetworkName": { - "value": "[parameters('virtualNetworkName')]" - }, - "vmSizeSelectForCoherence": { - "value": "[parameters('vmSizeSelectForCoherence')]" - }, - "wlsDomainName": { - "value": "[parameters('wlsDomainName')]" - }, - "wlsPassword": { - "value": "[parameters('wlsPassword')]" - }, - "wlsUserName": { - "value": "[parameters('wlsUserName')]" - }, - "enableDNSConfiguration": { - "value": "[parameters('enableCustomDNS')]" - }, - "customDNSNameForAdminServer": { - "value": "[if(parameters('enableCustomDNS'), format('{0}.{1}', parameters('dnszoneAdminConsoleLabel'),parameters('dnszoneName')),'')]" - }, - "enableCustomSSL": { - "value": "[parameters('enableCustomSSL')]" - }, - "sslCustomIdentityKeyStoreData": { - "value": "[parameters('uploadedCustomIdentityKeyStoreData')]" - }, - "sslCustomIdentityKeyStorePassPhrase": { - "value": "[parameters('uploadedCustomIdentityKeyStorePassphrase')]" - }, - "sslCustomIdentityKeyStoreType": { - "value": "[parameters('uploadedCustomIdentityKeyStoreType')]" - }, - "sslCustomTrustKeyStoreData": { - "value": "[parameters('uploadedCustomTrustKeyStoreData')]" - }, - "sslCustomTrustKeyStorePassPhrase": { - "value": "[parameters('uploadedCustomTrustKeyStorePassPhrase')]" - }, - "sslCustomTrustKeyStoreType": { - "value": "[parameters('uploadedCustomTrustKeyStoreType')]" - }, - "sslPrivateKeyAlias": { - "value": "[parameters('uploadedPrivateKeyAlias')]" - }, - "sslPrivateKeyPassPhrase": { - "value": "[parameters('uploadedPrivateKeyPassPhrase')]" - } - } - } - }, - { - "name": "ohsLinkedTemplate", - "type": "Microsoft.Resources/deployments", - "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', variables('ref_clusterTemplate'))]", - "[resourceId('Microsoft.Resources/deployments', 'coherenceTemplate')]", - "[resourceId('Microsoft.Resources/deployments', 'coherenceTemplateWithCustomSSL')]" - ], - "apiVersion": "${azure.apiVersionForDeployment}", - "condition": "[parameters('enableOHS')]", - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_ohsLinkedTemplateName')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "adminUsername": { - "value": "[parameters('adminUsername')]" - }, - "adminPasswordOrKey": { - "value": "[parameters('adminPasswordOrKey')]" - }, - "authenticationType": { - "value": "[parameters('authenticationType')]" - }, - "dnsLabelPrefix": { - "value": "[parameters('dnsLabelPrefix')]" - }, - "storageAccountName": { - "value": "[reference(variables('ref_clusterTemplate'),'${azure.apiVersionForDeployment}').outputs.storageAccountName.value]" - }, - "subnetName": { - "value": "[parameters('subnetName')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "nsgName": { - "value": "[variables('name_networkSecurityGroup')]" - }, - "ohsComponentName": { - "value": "[parameters('ohsComponentName')]" - }, - "ohsDomainName": { - "value": "[parameters('ohsDomainName')]" - }, - "ohsNMPassword": { - "value": "[parameters('ohsNMPassword')]" - }, - "ohsNMUser": { - "value": "[parameters('ohsNMUser')]" - }, - "ohsSkuUrnVersion": { - "value": "[parameters('ohsSkuUrnVersion')]" - }, - "ohsVMName": { - "value": "[variables('name_ohsVMName')]" - }, - "ohshttpPort": { - "value": "[parameters('ohshttpPort')]" - }, - "ohshttpsPort": { - "value": "[parameters('ohshttpsPort')]" - }, - "ohsSSLKeystoreData": { - "value": "[parameters('uploadedKeyStoreData')]" - }, - "ohsSSLKeystorePassword": { - "value": "[parameters('uploadedKeyStorePassword')]" - }, - "oracleVaultPswd": { - "value": "[parameters('oracleVaultPswd')]" - }, - "virtualNetworkNewOrExisting": { - "value": "[parameters('virtualNetworkNewOrExisting')]" - }, - "virtualNetworkResourceGroupName": { - "value": "[parameters('virtualNetworkResourceGroupName')]" - }, - "virtualNetworkName": { - "value": "[reference(variables('ref_clusterTemplate'),'${azure.apiVersionForDeployment}').outputs.virtualNetworkName.value]" - }, - "vmSize": { - "value": "[parameters('vmSize')]" - }, - "adminRestMgmtURL": { - "value": "[reference(variables('ref_clusterTemplate'),'${azure.apiVersionForDeployment}').outputs.adminRestMgmtURL.value]" - }, - "wlsPassword": { - "value": "[parameters('wlsPassword')]" - }, - "wlsUserName": { - "value": "[parameters('wlsUserName')]" - }, - "keyType": { - "value": "[parameters('uploadedKeyStoreType')]" - } - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "dnszonesLinkedTemplate", - "condition": "[parameters('enableCustomDNS')]", - "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', 'ohsLinkedTemplate')]" - ], - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_dnszonesLinkedTemplateName')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "_globalResourceNameSuffix": { - "value": "[variables('const_globalResourceNameSuffix')]" - }, - "dnszonesARecordSetNames": { - "value": "[if(parameters('enableOHS'), createArray(parameters('dnszoneAdminConsoleLabel'),parameters('dnszoneLoadBalancerLabel')), createArray(parameters('dnszoneAdminConsoleLabel')))]" - }, - "dnszoneName": { - "value": "[parameters('dnszoneName')]" - }, - "hasDNSZones": { - "value": "[parameters('hasDNSZones')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "resourceGroup": { - "value": "[parameters('dnszoneResourceGroup')]" - }, - "targetResources": { - "value": "[if(parameters('enableOHS'), createArray(reference(variables('ref_clusterTemplate'), '${azure.apiVersionForDeployment}').outputs._adminPublicIPId.value, reference('ohsLinkedTemplate', '${azure.apiVersionForDeployment}').outputs._ohsPublicIP.value), createArray(reference(variables('ref_clusterTemplate'), '${azure.apiVersionForDeployment}').outputs._adminPublicIPId.value))]" - } - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${dynamic.end}", - "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', variables('ref_clusterTemplate'))]", - "[resourceId('Microsoft.Resources/deployments', 'dbLinkedTemplate')]", - "[resourceId('Microsoft.Resources/deployments', 'coherenceTemplate')]", - "[resourceId('Microsoft.Resources/deployments', 'coherenceTemplateWithCustomSSL')]", - "[resourceId('Microsoft.Resources/deployments', 'ohsLinkedTemplate')]", - "[resourceId('Microsoft.Resources/deployments', 'dnszonesLinkedTemplate')]", - "[resourceId('Microsoft.Resources/deployments', 'networkSecurityLinkedTemplate')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [] - } - } - } - ], - "outputs": { - "adminVMName": { - "type": "string", - "value": "[variables('name_adminVM')]" - }, - "managedServerVMNamePrefix": { - "type": "string", - "value": "[concat(variables('name_managedVMNamePrefix'), 'VM')]" - }, - "wlsDomainLocation": { - "type": "string", - "value": "[reference(variables('ref_clusterTemplate'),'${azure.apiVersionForDeployment}').outputs.wlsDomainLocation.value]" - }, - "adminHostName": { - "type": "string", - "value": "[reference(variables('ref_clusterTemplate'),'${azure.apiVersionForDeployment}').outputs.adminHostName.value]" - }, - "adminConsole": { - "type": "string", - "value": "[if(parameters('enableCustomDNS'), uri(format('http://{0}.{1}:7001/console/',parameters('dnszoneAdminConsoleLabel'),parameters('dnszoneName')), ''),reference(variables('ref_clusterTemplate'),'${azure.apiVersionForDeployment}').outputs.adminConsole.value)]" - }, - "adminSecuredConsole": { - "type": "string", - "value": "[if(parameters('enableCustomDNS'), uri(format('https://{0}.{1}:7002/console',parameters('dnszoneAdminConsoleLabel'),parameters('dnszoneName')), ''),reference(variables('ref_clusterTemplate'),'${azure.apiVersionForDeployment}').outputs.adminSecuredConsole.value)]" - }, - "ohsVMName": { - "type": "string", - "value": "[variables('name_ohsVMName')]" - }, - "ohsAccessURL": { - "type": "string", - "condition": "[parameters('enableOHS')]", - "value": "[if(parameters('enableCustomDNS'), uri(format('http://{0}.{1}:{2}',parameters('dnszoneLoadBalancerLabel'),parameters('dnszoneName'), parameters('ohshttpPort')),''),reference('ohsLinkedTemplate', '${azure.apiVersionForDeployment}').outputs.ohsAccessURL.value)]" - }, - "ohsSecureAccessURL": { - "type": "string", - "condition": "[parameters('enableOHS')]", - "value": "[if(parameters('enableCustomDNS'), uri(format('https://{0}.{1}:{2}',parameters('dnszoneLoadBalancerLabel'),parameters('dnszoneName'),parameters('ohshttpsPort')),''), reference('ohsLinkedTemplate', '${azure.apiVersionForDeployment}').outputs.ohsSecureAccessURL.value)]" - } - } -} \ No newline at end of file diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/metadata.json b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/metadata.json deleted file mode 100644 index 7acf53cd7..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/metadata.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "$schema": "https://aka.ms/azure-quickstart-templates-metadata-schema#", - "type": "QuickStart", - "itemDisplayName": "Creating Weblogic Admin Domain on Oracle Linux VM with pre-installed Weblogic Server", - "icon": "oracle-linux", - "description": "This template allows you to create Weblogic Dynamic Cluster Domain on Oracle Linux VM with pre-installed Weblogic Server. This will deploy a A3 size VM in the resource group location and return the FQDN of the VM.", - "summary": "This template takes a minimum amount of parameters and creates Weblogic Dynamic Cluster Domain, using the latest patched version.", - "githubUsername": "wls-eng", - "dateUpdated": "2019-08-01" -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/_appendUserManagedIdentity.json b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/_appendUserManagedIdentity.json deleted file mode 100644 index ba47748a4..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/_appendUserManagedIdentity.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "vmName": { - "type": "string" - }, - "existingIdentities": { - "type": "object" - }, - "newIdentities": { - "type": "object" - }, - "location": { - "type": "string" - } - }, - "resources": [ - { - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines", - "name": "[parameters('vmName')]", - "location": "[parameters('location')]", - "identity": { - "type": "userAssigned", - "userAssignedIdentities": "[union(parameters('existingIdentities'),parameters('newIdentities'))]" - } - } - ] -} \ No newline at end of file diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/_dbTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/_dbTemplate.json deleted file mode 100644 index 0bd5719af..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/_dbTemplate.json +++ /dev/null @@ -1,244 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - } - }, - "_artifactsLocationDbTemplate": { - "defaultValue": "[if(contains(parameters('_artifactsLocation'), 'githubusercontent'), parameters('_artifactsLocation'), deployment().properties.templateLink.uri)]", - "type": "string", - "metadata": { - "description": "If we are deploying from the command line, use the passed in _artifactsLocation, otherwise use the default." - } - }, - "_artifactsLocationSasToken": { - "defaultValue": "", - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - } - }, - "adminVMName": { - "defaultValue": "adminVM", - "type": "string", - "metadata": { - "description": "Admin Server hosting VM name." - } - }, - "databaseType": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "One of the supported database types" - } - }, - "dbGlobalTranPro": { - "defaultValue": "OnePhaseCommit", - "type": "string", - "metadata": { - "description": "Determines the transaction protocol (global transaction processing behavior) for the data source." - } - }, - "dbPassword": { - "defaultValue": "[newGuid()]", - "type": "securestring", - "metadata": { - "description": "Password for Database" - } - }, - "dbUser": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "Userid of Database" - } - }, - "dsConnectionURL": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "JDBC Connection String" - } - }, - "enablePswlessConnection": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "True to enable passwordless connection." - } - }, - "jdbcDataSourceName": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "JNDI Name for JDBC Datasource" - } - }, - "location": { - "type": "string", - "metadata": { - "description": "Location for all resources." - } - }, - "wlsUserName": { - "defaultValue": "weblogic", - "type": "string", - "metadata": { - "description": "Username for your Weblogic domain name" - } - }, - "wlsPassword": { - "type": "securestring", - "metadata": { - "description": "Password for your Weblogic domain name" - } - } - }, - "variables": { - "const_wlsAdminPort": "7005", - "const_wlsHome": "/u01/app/wls/install/oracle/middleware/oracle_home", - "name_scriptFilePrefix": "datasourceConfig-", - "name_scriptFileSuffix-sqlserver": "sqlserver.sh", - "name_scriptFileSuffix-oracle": "oracle.sh", - "name_scriptFileSuffix-postgresql": "postgresql.sh", - "name_scriptFileSuffix-mysql": "mysql.sh" - }, - "resources": [ - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${dynamic.database.start}", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines/extensions", - "name": "[concat(parameters('adminVMName'),'/newuserscript')]", - "location": "[parameters('location')]", - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.0", - "autoUpgradeMinorVersion": true, - "settings": { - "fileUris": [ - "[uri(parameters('_artifactsLocationDbTemplate'), concat('../scripts/', variables('name_scriptFilePrefix'), variables('name_scriptFileSuffix-sqlserver'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationDbTemplate'), concat('../scripts/', variables('name_scriptFilePrefix'), variables('name_scriptFileSuffix-oracle'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationDbTemplate'), concat('../scripts/', variables('name_scriptFilePrefix'), variables('name_scriptFileSuffix-postgresql'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationDbTemplate'), concat('../scripts/', variables('name_scriptFilePrefix'), variables('name_scriptFileSuffix-mysql'), parameters('_artifactsLocationSasToken')))]" - ] - }, - "protectedSettings": { - "commandToExecute": "[concat('sh',' ',variables('name_scriptFilePrefix'),parameters('databaseType'),'.sh <<< \"',variables('const_wlsHome'),' ',parameters('adminVMName'),' ',variables('const_wlsAdminPort'),' ',parameters('wlsUserName'),' ',base64(parameters('wlsPassword')),' ',base64(parameters('jdbcDataSourceName')),' ',base64(parameters('dsConnectionURL')),' ',parameters('dbUser'),' ',base64(parameters('dbPassword')),' ',parameters('dbGlobalTranPro'),' ', parameters('enablePswlessConnection'),'\"')]" - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${dynamic.database.end}", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${database.oracle}", - "condition": "[if(contains(parameters('databaseType'), 'oracle'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${database.postgresql}", - "condition": "[if(contains(parameters('databaseType'), 'postgresql'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${database.mysql}", - "condition": "[if(contains(parameters('databaseType'), 'mysql'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${database.sqlserver}", - "condition": "[if(contains(parameters('databaseType'), 'sqlserver'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - } - ], - "outputs": { - "artifactsLocationPassedIn": { - "type": "string", - "value": "[parameters('_artifactsLocation')]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/_dnszones/_createDNSZonesTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/_dnszones/_createDNSZonesTemplate.json deleted file mode 100644 index 35316550f..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/_dnszones/_createDNSZonesTemplate.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "dnszonesARecordSetNames": { - "type": "array", - "metadata": { - "description": "An array of A record names. Used to create A record set." - } - }, - "dnszonesCNAMEAlias": { - "type": "array", - "metadata": { - "description": "An array of CNAME record alias. Used to create CNAME records." - } - }, - "dnszonesCNAMERecordSetNames": { - "type": "array", - "metadata": { - "description": "An array of CNAME record names. Used to create CNAME record set." - } - }, - "dnszoneName": { - "type": "string", - "metadata": { - "description": "Azure DNS Zone name." - } - }, - "location": { - "type": "string", - "metadata": { - "description": "Location for all resources." - } - }, - "targetResources": { - "type": "array", - "metadata": { - "description": "References to Azure resources from where the DNS resource value is taken. Each item is corresponding to values of dnszonesARecordSetNames." - } - }, - "ttl": { - "type": "int", - "defaultValue": 3600, - "metadata": { - "description": "The TTL (time-to-live) of the records in the record sets." - } - } - }, - "variables": { - // Tempalte validation fails on record name expression 'parameters('arrayValue')[copyIndex]' if the array is empty, though the deployment will be skipped. - // Concat a sample array if an array is empty, and do not deploy the sample record. - "const_dnszonesARecordSetNames": "[concat(parameters('dnszonesARecordSetNames'), variables('const_sampleValuetoPassValidation'))]", - "const_dnszonesCNAMERecordSetNames": "[concat(parameters('dnszonesCNAMERecordSetNames'),variables('const_sampleValuetoPassValidation'))]", - "const_hasARecords": "[greater(length(parameters('dnszonesARecordSetNames')),0)]", - "const_hasCNAMERecords": "[greater(length(parameters('dnszonesCNAMERecordSetNames')), 0)]", - "const_sampleValuetoPassValidation": [ - "test" - ] - }, - "resources": [ - { - "type": "Microsoft.Network/dnszones", - "apiVersion": "${azure.apiVersionForDNSZone}", - "name": "[parameters('dnszoneName')]", - "location": "[parameters('location')]", - "properties": { - "zoneType": "Public" - } - }, - { - "type": "Microsoft.Network/dnszones/A", - "apiVersion": "${azure.apiVersionForDNSZone}", - "condition": "[variables('const_hasARecords')]", - "name": "[concat(parameters('dnszoneName'), '/', variables('const_dnszonesARecordSetNames')[copyIndex()])]", - "copy": { - "name": "dnszonesALoop", - "count": "[length(parameters('dnszonesARecordSetNames'))]" - }, - "dependsOn": [ - "[resourceId('Microsoft.Network/dnszones', parameters('dnszoneName'))]" - ], - "properties": { - "TTL": "[parameters('ttl')]", - "targetResource": { - "id": "[parameters('targetResources')[copyIndex()]]" - } - } - }, - { - "type": "Microsoft.Network/dnszones/CNAME", - "apiVersion": "${azure.apiVersionForDNSZone}", - "condition": "[variables('const_hasCNAMERecords')]", - "name": "[concat(parameters('dnszoneName'),'/', variables('const_dnszonesCNAMERecordSetNames')[copyIndex()])]", - "location": "[parameters('location')]", - "copy": { - "name": "dnszonesCNAMELoop", - "count": "[length(parameters('dnszonesCNAMERecordSetNames'))]" - }, - "dependsOn": [ - "dnszonesALoop" - ], - "properties": { - "TTL": "[parameters('ttl')]", - "CNAMERecord": { - "cname": "[parameters('dnszonesCNAMEAlias')[copyIndex()]]" - } - } - } - ], - "outputs": { - "dnszonesName": { - "type": "string", - "value": "[parameters('dnszoneName')]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/_dnszones/_uamiAndRoleAssignment.json b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/_dnszones/_uamiAndRoleAssignment.json deleted file mode 100644 index c8d6c3eeb..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/_dnszones/_uamiAndRoleAssignment.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "location": { - "type": "string" - }, - "uamiName": { - "type": "string" - } - }, - "functions": [], - "variables": { - "const_roleDefinitionIdOfContributor": "b24988ac-6180-42a0-ab88-20f7382dd24c", - "name_deploymentScriptContributorRoleAssignmentName": "[guid(format('{0}{1}Deployment Script', resourceGroup().id, parameters('uamiName')))]" - }, - "resources": [ - { - "type": "Microsoft.ManagedIdentity/userAssignedIdentities", - "apiVersion": "${azure.apiVersionForIdentity}", - "name": "[parameters('uamiName')]", - "location": "[parameters('location')]" - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "[variables('name_deploymentScriptContributorRoleAssignmentName')]", - "subscriptionId": "[subscription().subscriptionId]", - "location": "[parameters('location')]", - "properties": { - "expressionEvaluationOptions": { - "scope": "inner" - }, - "mode": "Incremental", - "parameters": { - "roleDefinition": { - "value": "[variables('const_roleDefinitionIdOfContributor')]" - }, - "principalId": { - "value": "[reference(resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', parameters('uamiName'))).principalId]" - } - }, - "template": { - "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "roleDefinition": { - "type": "string", - "defaultValue": "" - }, - "principalId": { - "type": "string", - "defaultValue": "" - } - }, - "functions": [], - "variables": { - "name_roleAssignmentName": "[guid(format('{0}{1}Role assignment in subscription scope', subscription().id, parameters('principalId')))]" - }, - "resources": [ - { - "type": "Microsoft.Authorization/roleAssignments", - "apiVersion": "${azure.apiVersionForRoleAssignment}", - "name": "[variables('name_roleAssignmentName')]", - "properties": { - "description": "Assign subscription scope role to User Assigned Managed Identity ", - "principalId": "[parameters('principalId')]", - "principalType": "ServicePrincipal", - "roleDefinitionId": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinition'))]" - } - } - ], - "outputs": { - "roleId": { - "type": "string", - "value": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinition'))]" - } - } - } - } - } - ], - "outputs": { - "uamiIdForDeploymentScript": { - "type": "string", - "value": "[resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', parameters('uamiName'))]" - } - } - } diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/_dnszones/_updateDNSZonesTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/_dnszones/_updateDNSZonesTemplate.json deleted file mode 100644 index b03e9d1c1..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/_dnszones/_updateDNSZonesTemplate.json +++ /dev/null @@ -1,208 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - } - }, - "_artifactsLocationDNSZonesTemplate": { - "defaultValue": "[if(contains(parameters('_artifactsLocation'), 'githubusercontent'), concat(parameters('_artifactsLocation'),'nestedtemplates/'), deployment().properties.templateLink.uri)]", - "type": "string", - "metadata": { - "description": "If we are deploying from the command line, use the passed in _artifactsLocation, otherwise use the default." - } - }, - "_artifactsLocationSasToken": { - "defaultValue": "", - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - } - }, - "_globalResourceNameSuffix": { - "type": "string", - "metadata": { - "description": "A suffix to be appended to all resources created by this template." - } - }, - "dnszonesARecordSetNames": { - "type": "array", - "metadata": { - "description": "An array of A record names. Used to create A records." - } - }, - "dnszonesCNAMEAlias": { - "type": "array", - "metadata": { - "description": "An array of CNAME record alias. Used to create CNAME records." - } - }, - "dnszonesCNAMERecordSetNames": { - "type": "array", - "metadata": { - "description": "An array of CNAME record names. Used to create CNAME record set." - } - }, - "dnszoneName": { - "type": "string", - "metadata": { - "description": "Azure DNS Zone name." - } - }, - "location": { - "type": "string", - "metadata": { - "description": "Location for all resources." - } - }, - "resourceGroup": { - "type": "string", - "metadata": { - "description": "Name of the resource group that has an Azure DNS Zone deployed." - } - }, - "targetResources": { - "type": "array", - "metadata": { - "description": "References to Azure resources from where the DNS resource value is taken. Each item is corresponding to values of dnszonesARecordSetNames." - } - }, - "ttl": { - "type": "int", - "defaultValue": 3600, - "metadata": { - "description": "The TTL (time-to-live) of the records in the record sets." - } - }, - "utcValue": { - "type": "string", - "defaultValue": "[utcNow()]", - "metadata": { - "description": "Current deployment time. Used as a tag in deployment script." - } - } - }, - "functions": [ - { - "namespace": "array", - "members": { - "join": { - "parameters": [ - { - "name": "items", - "type": "array" - } - ], - "output": { - "type": "string", - "value": "[replace(replace(replace(string(parameters('items')), '[\"', ''), '\"]', ''), '\",\"', ',')]" - } - } - } - } - ], - "variables": { - "name_deploymentScriptUserDefinedManagedIdentity": "wls-vm-dns-user-defined-managed-itentity", - "name_scriptDNSConfiguration": "updateDNSZones.sh", - "name_templateUAMIDeployment": "_uamiAndRoleAssignment.json" - }, - "resources": [ - { - "type": "Microsoft.Resources/deployments", - "name": "uamiDeployment", - "apiVersion": "${azure.apiVersionForDeployment}", - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/_dnszones/', variables('name_templateUAMIDeployment')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "location": { - "value": "[parameters('location')]" - }, - "uamiName": { - "value": "[variables('name_deploymentScriptUserDefinedManagedIdentity')]" - } - } - } - }, - { - "type": "Microsoft.Resources/deploymentScripts", - "apiVersion": "${azure.apiVersionForDeploymentScript}", - "name": "[concat('script-create-dns-records-', parameters('_globalResourceNameSuffix'))]", - "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', 'uamiDeployment')]" - ], - "location": "[parameters('location')]", - "identity": { - "type": "UserAssigned", - "userAssignedIdentities": { - "[resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', variables('name_deploymentScriptUserDefinedManagedIdentity'))]": {} - } - }, - "kind": "AzureCLI", - "properties": { - "forceUpdateTag": "[parameters('utcValue')]", - "AzCliVersion": "${azure.cli.version}", - "timeout": "PT30M", - "environmentVariables": [ - { - "name": "DNS_CNAME_ALIAS", - "value": "[array.join(parameters('dnszonesCNAMEAlias'))]" - }, - { - "name": "DNS_CNAME_ALIAS_LENGTH", - "value": "[length(parameters('dnszonesCNAMEAlias'))]" - }, - { - "name": "DNS_CNAME_RECORDSET_LENGTH", - "value": "[length(parameters('dnszonesCNAMERecordSetNames'))]" - }, - { - "name": "DNS_CNAME_RECORDSET_NAMES", - "value": "[array.join(parameters('dnszonesCNAMERecordSetNames'))]" - }, - { - "name": "DNS_RECORDSET_NAMES", - "value": "[array.join(parameters('dnszonesARecordSetNames'))]" - }, - { - "name": "DNS_RECORD_NAMES_LENGTH", - "value": "[length(parameters('dnszonesARecordSetNames'))]" - }, - { - "name": "DNS_TARGET_RESOURCES_LENGTH", - "value": "[length(parameters('targetResources'))]" - }, - { - "name": "DNS_TARGET_RESOURCES", - "value": "[array.join(parameters('targetResources'))]" - }, - { - "name": "DNS_RECORD_TTL", - "value": "[parameters('ttl')]" - }, - { - "name": "DNS_ZONE_NAME", - "value": "[parameters('dnszoneName')]" - }, - { - "name": "MANAGED_IDENTITY_ID", - "value": "[resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', variables('name_deploymentScriptUserDefinedManagedIdentity'))]" - }, - { - "name": "RESOURCE_GROUP_NAME", - "value": "[parameters('resourceGroup')]" - } - ], - "primaryScriptUri": "[uri(parameters('_artifactsLocationDNSZonesTemplate'), concat('../../scripts/', variables('name_scriptDNSConfiguration'), parameters('_artifactsLocationSasToken')))]", - "cleanupPreference": "OnSuccess", - "retentionInterval": "P1D" - } - } - ] -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/_installJdbcLibsTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/_installJdbcLibsTemplate.json deleted file mode 100644 index 225b5242b..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/_installJdbcLibsTemplate.json +++ /dev/null @@ -1,127 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - } - }, - "_artifactsLocationInstallJdbcLibsTemplate": { - "defaultValue": "[if(contains(parameters('_artifactsLocation'), 'githubusercontent'), parameters('_artifactsLocation'), deployment().properties.templateLink.uri)]", - "type": "string", - "metadata": { - "description": "If we are deploying from the command line, use the passed in _artifactsLocation, otherwise use the default." - } - }, - "_artifactsLocationSasToken": { - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - }, - "defaultValue": "" - }, - "adminVMName": { - "type": "string", - "defaultValue": "adminVM", - "metadata": { - "description": "Admin Server hosting VM name." - } - }, - "databaseType": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "One of the supported database types" - } - }, - "enablePswlessConnection": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "True to enable passwordless connection." - } - }, - "location": { - "type": "string", - "metadata": { - "description": "Location for all resources." - } - }, - "managedServerPrefix": { - "type": "string", - "defaultValue": "msp", - "metadata": { - "description": "Provide managed server prefix name" - } - }, - "managedVMNamePrefix": { - "type": "string", - "metadata": { - "description": "Managed Server hosting VM name prefix." - } - }, - "numberOfManagedApplicationInstances": { - "type": "int", - "defaultValue": 2, - "minValue": 1, - "maxValue": 20, - "metadata": { - "description": "Number of VMs that have been deployed to host managed application server." - } - }, - "wlsDomainName": { - "type": "string", - "defaultValue": "wlsd", - "metadata": { - "description": "Provide Weblogic domain name" - } - }, - "wlsPassword": { - "type": "securestring", - "metadata": { - "description": "Password for your Weblogic domain name" - } - }, - "wlsUserName": { - "type": "string", - "metadata": { - "description": "Username for your Weblogic domain name" - } - } - }, - "variables": { - "const_managedVMPrefix": "[concat(parameters('managedVMNamePrefix'),'VM')]", - "const_wlsAdminPort": "7005", - "const_wlsDomainPath": "[concat('/u01/domains/', parameters('wlsDomainName'))]", - "const_wlsHome": "/u01/app/wls/install/oracle/middleware/oracle_home", - "name_scriptInstallJdbcLibs": "installJdbcDrivers.sh" - }, - "resources": [ - { - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines/extensions", - "name": "[concat(variables('const_managedVMPrefix'), copyIndex(1),'/newuserscript')]", - "location": "[parameters('location')]", - "copy": { - "name": "appVirtualMachineExtensionLoop", - "count": "[parameters('numberOfManagedApplicationInstances')]" - }, - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.0", - "autoUpgradeMinorVersion": true, - "settings": { - "fileUris": [ - "[uri(parameters('_artifactsLocationInstallJdbcLibsTemplate'), concat('../scripts/', variables('name_scriptInstallJdbcLibs'), parameters('_artifactsLocationSasToken')))]" - ] - }, - "protectedSettings": { - "commandToExecute": "[concat('sh',' ',variables('name_scriptInstallJdbcLibs'),' <<< \"',variables('const_wlsHome'),' ',variables('const_wlsDomainPath'),' ',parameters('managedServerPrefix'), copyIndex(1), ' ', parameters('adminVMName'), ' ',variables('const_wlsAdminPort'),' ',parameters('wlsUserName'),' ',base64(parameters('wlsPassword')),' ',parameters('databaseType'),' ',parameters('enablePswlessConnection'), '\"')]" - } - } - } - ] -} \ No newline at end of file diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/_pswlessDbTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/_pswlessDbTemplate.json deleted file mode 100644 index eecb2a38c..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/_pswlessDbTemplate.json +++ /dev/null @@ -1,322 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - } - }, - "_artifactsLocationSasToken": { - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - }, - "defaultValue": "" - }, - "adminVMName": { - "type": "string", - "defaultValue": "adminVM", - "metadata": { - "description": "Admin Server hosting VM name." - } - }, - "databaseType": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "One of the supported database types" - } - }, - "dbGlobalTranPro": { - "defaultValue": "OnePhaseCommit", - "type": "string", - "metadata": { - "description": "Determines the transaction protocol (global transaction processing behavior) for the data source." - } - }, - "dbIdentity": { - "defaultValue": {}, - "type": "object", - "metadata": { - "description": "Managed identity that has access to the data source." - } - }, - "dbUser": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "Userid of Database" - } - }, - "dsConnectionURL": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "JDBC Connection String" - } - }, - "jdbcDataSourceName": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "JNDI Name for JDBC Datasource" - } - }, - "location": { - "type": "string", - "metadata": { - "description": "Location for all resources." - } - }, - "managedServerPrefix": { - "type": "string", - "defaultValue": "msp", - "metadata": { - "description": "Provide managed server prefix name" - } - }, - "managedVMNamePrefix": { - "type": "string", - "metadata": { - "description": "Provide managed VM name prefix" - } - }, - "numberOfManagedApplicationInstances": { - "type": "int", - "defaultValue": 2, - "minValue": 1, - "maxValue": 20, - "metadata": { - "description": "Number of VMs that have been deployed to host managed application server." - } - }, - "wlsDomainName": { - "type": "string", - "defaultValue": "wlsd", - "metadata": { - "description": "Provide Weblogic domain name" - } - }, - "wlsPassword": { - "type": "securestring", - "metadata": { - "description": "Password for your Weblogic domain name" - } - }, - "wlsUserName": { - "type": "string", - "metadata": { - "description": "Username for your Weblogic domain name" - } - } - }, - "variables": { - "const_connectionString": "[if(and(equals(parameters('databaseType'),'sqlserver'), equals(last(parameters('dsConnectionURL')),';')), take(parameters('dsConnectionURL'), add(length(parameters('dsConnectionURL')),-1)),parameters('dsConnectionURL'))]", - "const_identityAPIVersion": "${azure.apiVersionForIdentity}", - "const_managedVMPrefix": "[concat(parameters('managedVMNamePrefix'), 'VM')]", - "const_msiDefaultUser": "msiUser", - "name_appendIdentityTemplate": "_appendUserManagedIdentity.json", - "name_installJdbcLibsTemplate": "_installJdbcLibsTemplate.json", - "name_dbTemplate": "_dbTemplate.json", - "array_azureJdbcPlugins": { - "mysql": "defaultAuthenticationPlugin=com.azure.identity.extensions.jdbc.mysql.AzureMysqlAuthenticationPlugin&authenticationPlugins=com.azure.identity.extensions.jdbc.mysql.AzureMysqlAuthenticationPlugin", - "postgresql": "authenticationPluginClassName=com.azure.identity.extensions.jdbc.postgresql.AzurePostgresqlAuthenticationPlugin", - "sqlserver": "authentication=ActiveDirectoryMSI" - }, - "array_urlJoiner": { - "mysql": "[if(contains(variables('const_connectionString'), '?'), '&', '?')]", - "postgresql": "[if(contains(variables('const_connectionString'), '?'), '&', '?')]", - "sqlserver": ";" - }, - "array_paramJoiner": { - "mysql": "&", - "postgresql": "&", - "sqlserver": ";" - }, - "array_msiClientId": { - "mysql": "azure.clientId", - "postgresql": "azure.clientId", - "sqlserver": "msiClientId" - }, - "obj_dbIdentity": { - "[items(parameters('dbIdentity').userAssignedIdentities)[0].key]": {} - }, - "obj_empty": {} - }, - "resources": [ - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${dynamic.pswless.database.start}", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "[concat('assignDbIdentityTo',variables('const_managedVMPrefix'), copyIndex(1))]", - "copy": { - "name": "virtualMachineIdentityLoop", - "count": "[parameters('numberOfManagedApplicationInstances')]" - }, - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_appendIdentityTemplate')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "vmName": { - "value": "[concat(variables('const_managedVMPrefix'), copyIndex(1))]" - }, - "newIdentities": { - "value": "[variables('obj_dbIdentity')]" - }, - "existingIdentities": { - "value": "[if(equals(reference(resourceId('Microsoft.Compute/virtualMachines',concat(variables('const_managedVMPrefix'), copyIndex(1))), '${azure.apiVersionForDeployment}', 'Full').identity.type,'UserAssigned'),reference(resourceId('Microsoft.Compute/virtualMachines',concat(variables('const_managedVMPrefix'), copyIndex(1))), '${azure.apiVersionForDeployment}', 'Full').identity.userAssignedIdentities, variables('obj_empty'))]" - }, - "location": { - "value": "[parameters('location')]" - } - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "installJdbcLibsTemplate", - "condition": "[or(equals(parameters('databaseType'),'mysql'), equals(parameters('databaseType'),'postgresql'))]", - "dependsOn": [ - "virtualMachineIdentityLoop" - ], - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_installJdbcLibsTemplate')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "adminVMName": { - "value": "[parameters('adminVMName')]" - }, - "databaseType": { - "value": "[parameters('databaseType')]" - }, - "enablePswlessConnection": { - "value": true - }, - "location": { - "value": "[parameters('location')]" - }, - "managedServerPrefix": { - "value": "[parameters('managedServerPrefix')]" - }, - "managedVMNamePrefix": { - "value": "[parameters('managedVMNamePrefix')]" - }, - "numberOfManagedApplicationInstances": { - "value": "[parameters('numberOfManagedApplicationInstances')]" - }, - "wlsDomainName": { - "value": "[parameters('wlsDomainName')]" - }, - "wlsPassword": { - "value": "[parameters('wlsPassword')]" - }, - "wlsUserName": { - "value": "[parameters('wlsUserName')]" - } - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "passwordlessDatasourceDeployment", - "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', 'installJdbcLibsTemplate')]" - ], - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_dbTemplate')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "adminVMName": { - "value": "[parameters('adminVMName')]" - }, - "databaseType": { - "value": "[parameters('databaseType')]" - }, - "dbGlobalTranPro": { - "value": "[parameters('dbGlobalTranPro')]" - }, - "dsConnectionURL": { - "value": "[uri(format('{0}{4}{1}{5}{2}={3}', variables('const_connectionString'), variables('array_azureJdbcPlugins')[parameters('databaseType')], variables('array_msiClientId')[parameters('databaseType')], reference(items(parameters('dbIdentity').userAssignedIdentities)[0].key,variables('const_identityAPIVersion'), 'full').properties.clientId, variables('array_urlJoiner')[parameters('databaseType')], variables('array_paramJoiner')[parameters('databaseType')]), '')]" - }, - "dbUser": { - "value": "[if(equals(parameters('databaseType'), 'sqlserver'), variables('const_msiDefaultUser'), parameters('dbUser'))]" - }, - "enablePswlessConnection": { - "value": true - }, - "jdbcDataSourceName": { - "value": "[parameters('jdbcDataSourceName')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "wlsPassword": { - "value": "[parameters('wlsPassword')]" - }, - "wlsUserName": { - "value": "[parameters('wlsUserName')]" - } - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${dynamic.pswless.database.end}", - "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', 'passwordlessDatasourceDeployment')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [] - } - } - } - ], - "outputs": { - "artifactsLocationPassedIn": { - "type": "string", - "value": "[parameters('_artifactsLocation')]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/clusterCustomSSLTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/clusterCustomSSLTemplate.json deleted file mode 100644 index 7033b7be2..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/clusterCustomSSLTemplate.json +++ /dev/null @@ -1,1029 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - } - }, - "_artifactsLocationClusterTemplate": { - "defaultValue": "[if(contains(parameters('_artifactsLocation'), 'githubusercontent'), parameters('_artifactsLocation'), deployment().properties.templateLink.uri)]", - "type": "string", - "metadata": { - "description": "If we are deploying from the command line, use the passed in _artifactsLocation, otherwise use the default." - } - }, - "_artifactsLocationSasToken": { - "defaultValue": "", - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - } - }, - "_globalResourceNameSuffix": { - "type": "string", - "metadata": { - "description": "A suffix to be appended to all resources created by this template." - } - }, - "adminPasswordOrKey": { - "type": "securestring", - "metadata": { - "description": "SSH Key or password for the Virtual Machine. SSH key is recommended." - } - }, - "adminUsername": { - "defaultValue": "weblogic", - "type": "string", - "metadata": { - "description": "User name for the Virtual Machine." - } - }, - "adminVMName": { - "defaultValue": "adminVM", - "type": "string", - "metadata": { - "description": "Admin Server hosting VM name." - } - }, - "authenticationType": { - "type": "string", - "defaultValue": "password", - "allowedValues": [ - "sshPublicKey", - "password" - ], - "metadata": { - "description": "Type of authentication to use on the Virtual Machine. SSH key is recommended." - } - }, - "dnsLabelPrefix": { - "type": "string", - "metadata": { - "description": "Unique DNS Name for the Public IP used to access the Virtual Machine." - } - }, - "dynamicClusterSize": { - "defaultValue": 2, - "type": "int", - "metadata": { - "description": "Initial Number of Managed Servers that will be configured in the Dynamic Cluster" - } - }, - "location": { - "type": "string", - "metadata": { - "description": "Location for all resources." - } - }, - "managedServerPrefix": { - "type": "string", - "metadata": { - "description": "Provide managed server prefix name" - } - }, - "managedVMPrefix": { - "type": "string", - "metadata": { - "description": "Managed Server hosting VM name prefix." - } - }, - "maxDynamicClusterSize": { - "type": "int", - "defaultValue": 10, - "metadata": { - "description": "Maximum Number of Managed Servers allowed to be configured in the Dynamic Cluster" - } - }, - "nsgName": { - "type": "string", - "metadata": { - "description": "Name of the Network Security Group." - } - }, - "portsToExpose": { - "type": "string", - "defaultValue": "80,443,7001-9000", - "metadata": { - "description": "Ports and port ranges to expose" - } - }, - "skuUrnVersion": { - "type": "string", - "defaultValue": "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest", - "allowedValues": [ - "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest", - "owls-141100-jdk11-ol87;Oracle:weblogic-141100-jdk11-ol87:owls-141100-jdk11-ol87;latest", - "owls-141100-jdk8-ol91;Oracle:weblogic-141100-jdk8-ol91:owls-141100-jdk8-ol91;latest", - "owls-141100-jdk8-ol87;Oracle:weblogic-141100-jdk8-ol87:owls-141100-jdk8-ol87;latest", - "owls-122140-jdk8-ol91;Oracle:weblogic-122140-jdk8-ol91:owls-122140-jdk8-ol91;latest", - "owls-122140-jdk8-ol87;Oracle:weblogic-122140-jdk8-ol87:owls-122140-jdk8-ol87;latest", - "owls-122140-jdk8-ol76;Oracle:weblogic-122140-jdk8-ol76:owls-122140-jdk8-ol7;latest", - "owls-141100-jdk8-ol76;Oracle:weblogic-141100-jdk8-ol76:owls-141100-jdk8-ol7;latest", - "owls-141100-jdk11-ol76;Oracle:weblogic-141100-jdk11-ol76:owls-141100-jdk11-ol7;latest", - "owls-141100-jdk11-rhel87;Oracle:weblogic-141100-jdk11-rhel87:owls-141100-jdk11-rhel87;latest", - "owls-141100-jdk8-rhel87;Oracle:weblogic-141100-jdk8-rhel87:owls-141100-jdk8-rhel87;latest", - "owls-122140-jdk8-rhel87;Oracle:weblogic-122140-jdk8-rhel87:owls-122140-jdk8-rhel87;latest", - "owls-122140-jdk8-rhel76;Oracle:weblogic-122140-jdk8-rhel76:owls-122140-jdk8-rhel76;latest", - "owls-141100-jdk8-rhel76;Oracle:weblogic-141100-jdk8-rhel76:owls-141100-jdk8-rhel76;latest", - "owls-141100-jdk11-rhel76;Oracle:weblogic-141100-jdk11-rhel76:owls-141100-jdk11-rhel76;latest", - ], - "metadata": { - "description": "The Oracle Linux image with Weblogic and Java preinstalled. Semicolon separated string of Sku, URN, and Version" - } - }, - "usePreviewImage": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "Bool value, if it's set to true, will deploy with preview weblogic image." - } - }, - "useSystemAssignedManagedIdentity": { - "type": "bool", - "defaultValue": true, - "metadata": { - "description": "Bool value, if it's set to true, a system assigned managed identity will to be created for the VM(s)" - } - }, - "vmSize": { - "type": "string", - "defaultValue": "Standard_A3", - "metadata": { - "description": "Select appropriate VM Size as per requirement" - } - }, - "virtualNetworkNewOrExisting": { - "type": "string", - "defaultValue": "new", - "allowedValues": [ - "new", - "existing" - ], - "metadata": { - "description": "Specify whether to create a new or existing virtual network for the VM." - } - }, - "virtualNetworkName": { - "type": "string", - "defaultValue": "wls-vnet", - "metadata": { - "description": "Name of the existing or new VNET" - } - }, - "virtualNetworkResourceGroupName": { - "type": "string", - "defaultValue": "[resourceGroup().name]", - "metadata": { - "description": "Resource group of Virtual network" - } - }, - "addressPrefixes": { - "type": "array", - "defaultValue": [ - "10.0.0.0/28" - ], - "metadata": { - "description": "Address prefix of the VNET." - } - }, - "subnetName": { - "type": "string", - "defaultValue": "wls-subnet", - "metadata": { - "description": "Name of the existing or new Subnet" - } - }, - "subnetPrefix": { - "type": "string", - "defaultValue": "10.0.0.0/29", - "metadata": { - "description": "Address prefix of the subnet" - } - }, - "wlsDomainName": { - "type": "string", - "metadata": { - "description": "Provide Weblogic domain name" - } - }, - "wlsPassword": { - "type": "securestring", - "metadata": { - "description": "Password for your Weblogic domain name" - } - }, - "wlsUserName": { - "type": "string", - "metadata": { - "description": "Username for your Weblogic domain name" - } - }, - "enableHTTPAdminListenPort": { - "type": "bool", - "defaultValue": true, - "metadata": { - "description": "Boolean value indicating, if WebLogic Admin Server HTTP Listen Port is enabled or not" - } - }, - "enableCustomSSL": { - "defaultValue": true, - "type": "bool", - "metadata": { - "description": "Boolean value indicating, if custom SSL is enabled or not" - } - }, - "enableDNSConfiguration": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "Boolean value indicating, if DNS Zone Configuration is enabled or not" - } - }, - "customDNSNameForAdminServer": { - "type": "string", - "defaultValue": "none", - "metadata": { - "description": "Custom DNS Name for WebLogic Admin Server" - } - }, - "sslCustomIdentityKeyStoreData": { - "type": "securestring", - "metadata": { - "description": "Weblogic Custom Identity Keystore Data" - } - }, - "sslCustomIdentityKeyStorePassPhrase": { - "type": "securestring", - "metadata": { - "description": "Weblogic Custom Identity Keystore Passphrase" - } - }, - "sslCustomIdentityKeyStoreType": { - "type": "string", - "metadata": { - "description": "Weblogic Custom Identity Keystore Type" - }, - "defaultValue": "JKS" - }, - "sslCustomTrustKeyStoreData": { - "type": "securestring", - "metadata": { - "description": "Weblogic Custom Trust Store Data" - } - }, - "sslCustomTrustKeyStorePassPhrase": { - "type": "securestring", - "metadata": { - "description": "Weblogic Custom Trust Store Passphrase" - } - }, - "sslCustomTrustKeyStoreType": { - "type": "string", - "metadata": { - "description": "Weblogic Custom Trust Store Type" - }, - "defaultValue": "JKS" - }, - "sslPrivateKeyAlias": { - "type": "string", - "metadata": { - "description": "Weblogic Server Private Key Alias" - } - }, - "sslPrivateKeyPassPhrase": { - "type": "securestring", - "metadata": { - "description": "Weblogic Server Private Key Pass Phrase" - } - } - }, - "variables": { - "const_addressPrefix": "[parameters('addressPrefixes')]", - "const_hyphen": "-", - "const_imageOffer": "[concat('weblogic',variables('const_hyphen'), split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[1],variables('const_hyphen'),split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[2],variables('const_hyphen'),split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[3],if(parameters('usePreviewImage'),'-preview',''))]", - "const_imagePublisher": "oracle", - "const_linuxConfiguration": { - "disablePasswordAuthentication": true, - "ssh": { - "publicKeys": [ - { - "path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]", - "keyData": "[parameters('adminPasswordOrKey')]" - } - ] - } - }, - "const_managedVMPrefix": "[concat(parameters('managedVMPrefix'),'VM')]", - "const_mountPointPath": "[concat('/mnt/', variables('name_share'))]", - "const_publicIPAddressType": "Dynamic", - "const_requiredPortrange": ",65200-65535,5556", - "const_storageAccountType": "Standard_LRS", - "const_subnetPrefix": "[parameters('subnetPrefix')]", - "const_wlsHome": "/u01/app/wls/install/oracle/middleware/oracle_home", - "const_vmSize": "[parameters('vmSize')]", - "name_linuxImageOfferSKU": "[first(split(parameters('skuUrnVersion'), ';'))]", - "name_linuxImageVersion": "[last(split(parameters('skuUrnVersion'),';'))]", - "name_nic": "_NIC", - "name_nic_with_pub_ip": "[concat(variables('name_nic'), '_with_pub_ip')]", - "name_nic_without_pub_ip": "[concat(variables('name_nic'), '_without_pub_ip')]", - "name_outputAdminHost_with_pub_ip": "[concat(parameters('adminVMName'),variables('name_publicIPAddress'))]", - "name_outputAdminHost_without_pub_ip": "[concat(parameters('adminVMName'),variables('name_nic_without_pub_ip'))]", - "name_publicIPAddress": "_PublicIP", - "name_scriptFile": "setupDynamicClusterDomain.sh", - "name_share": "wlsshare", - "name_storageAccount": "[concat('olvmstg', parameters('_globalResourceNameSuffix'))]", - "name_subnet": "[parameters('subnetName')]", - "name_virtualNetwork": "[parameters('virtualNetworkName')]", - "name_privateSaEndpoint": "[concat('saep', parameters('_globalResourceNameSuffix'))]", - "ref_fileService": "[resourceId('Microsoft.Storage/storageAccounts/fileServices', variables('name_storageAccount'), 'default')]", - "ref_networkSecurityGroup": "[resourceId('Microsoft.Network/networkSecurityGroups', parameters('nsgName'))]", - "ref_storage": "[resourceId('Microsoft.Storage/storageAccounts', variables('name_storageAccount'))]", - "ref_subnet": "[resourceId(parameters('virtualNetworkResourceGroupName'), 'Microsoft.Network/virtualNetworks/subnets', variables('name_virtualNetwork'), variables('name_subnet'))]", - "t3AdminPort": "[if(not(parameters('enableHTTPAdminListenPort')),'7005','7001')]", - "name_customHostnameGeneratorscriptFile": "generateCustomHostNameVerifier.sh", - "name_customHostnameVerifierJavaFile": "src/main/java/WebLogicCustomHostNameVerifier.java", - "name_customHostnameValuesTemplate": "src/main/java/HostNameValuesTemplate.txt", - "name_customHostnameVerifierTest": "src/test/java/WebLogicCustomHostNameVerifierTest.java" - }, - "resources": [ - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${dynamic.cluster.start}", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${dynamic.ssl.start}", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "apiVersion": "${azure.apiVersionForNetworkSecurityGroups}", - "type": "Microsoft.Network/networkSecurityGroups", - "condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'new')]", - "name": "[parameters('nsgName')]", - "location": "[parameters('location')]", - "properties": { - "securityRules": [ - { - "name": "WebLogicPorts", - "properties": { - "protocol": "TCP", - "sourcePortRange": "*", - "sourceAddressPrefix": "*", - "destinationAddressPrefix": "*", - "access": "Allow", - "priority": 320, - "direction": "Inbound", - "destinationPortRanges": "[split(concat(parameters('portsToExpose'),variables('const_requiredPortrange')), ',')]" - } - }, - { - "name": "WebLogicNMPort", - "properties": { - "protocol": "TCP", - "sourcePortRange": "*", - "sourceAddressPrefix": "Internet", - "destinationAddressPrefix": "*", - "access": "Deny", - "priority": 201, - "direction": "Inbound", - "destinationPortRanges": [ "5556" ] - } - }, - { - "name": "WebLogicAdminChannelPort", - "properties": { - "protocol": "TCP", - "sourcePortRange": "*", - "sourceAddressPrefix": "Internet", - "destinationAddressPrefix": "*", - "access": "Deny", - "priority": 202, - "direction": "Inbound", - "destinationPortRanges": [ "7005" ] - } - } - ] - } - }, - { - "type": "Microsoft.Storage/storageAccounts", - "apiVersion": "${azure.apiVersionForStorage}", - "name": "[variables('name_storageAccount')]", - "location": "[parameters('location')]", - "sku": { - "name": "[variables('const_storageAccountType')]" - }, - "kind": "StorageV2", - "properties": { - "supportsHttpsTrafficOnly": false - } - }, - { - "apiVersion": "${azure.apiVersionForPrivateEndpoint}", - "name": "[variables('name_privateSaEndpoint')]", - "type": "Microsoft.Network/privateEndpoints", - "location": "[parameters('location')]", - "properties": { - "privateLinkServiceConnections": [ - { - "name": "[variables('name_privateSaEndpoint')]", - "properties": { - "privateLinkServiceId": "[resourceId('Microsoft.Storage/storageAccounts/', variables('name_storageAccount'))]", - "groupIds": [ - "file" - ] - } - } - ], - "subnet": { - "id": "[variables('ref_subnet')]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('name_storageAccount'))]", - "[variables('name_virtualNetwork')]" - ] - }, - { - "type": "Microsoft.Storage/storageAccounts/fileServices", - "apiVersion": "${azure.apiVersionForStorageFileService}", - "name": "[concat(variables('name_storageAccount'), '/default')]", - "dependsOn": [ - "[variables('ref_storage')]" - ], - "sku": { - "name": "Standard_LRS", - "tier": "Standard" - } - }, - { - "type": "Microsoft.Storage/storageAccounts/fileServices/shares", - "apiVersion": "${azure.apiVersionForStorageFileService}", - "name": "[concat(variables('name_storageAccount'), '/default/', variables('name_share'))]", - "dependsOn": [ - "[variables('ref_fileService')]", - "[variables('ref_storage')]" - ], - "properties": { - "shareQuota": 5 - } - }, - { - "apiVersion": "${azure.apiVersionForPublicIPAddresses}", - "type": "Microsoft.Network/publicIPAddresses", - "condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'new')]", - "name": "[if(equals(copyIndex(),0),concat(parameters('adminVMName'),variables('name_publicIPAddress')),concat(variables('const_managedVMPrefix'), copyIndex(),variables('name_publicIPAddress')))]", - "location": "[parameters('location')]", - "copy": { - "name": "publicIPLoop", - "count": "[add(parameters('dynamicClusterSize'),1)]" - }, - "properties": { - "publicIPAllocationMethod": "[variables('const_publicIPAddressType')]", - "dnsSettings": { - "domainNameLabel": "[take(concat(toLower(parameters('dnsLabelPrefix')), copyindex(),'-', parameters('_globalResourceNameSuffix'),'-',toLower(parameters('wlsDomainName'))), 50)]" - } - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualNetworks}", - "type": "Microsoft.Network/virtualNetworks", - "condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'new')]", - "name": "[variables('name_virtualNetwork')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[variables('ref_networkSecurityGroup')]" - ], - "properties": { - "addressSpace": { - "addressPrefixes": "[variables('const_addressPrefix')]" - }, - "subnets": [ - { - "name": "[variables('name_subnet')]", - "properties": { - "addressPrefix": "[variables('const_subnetPrefix')]", - "networkSecurityGroup": { - "id": "[variables('ref_networkSecurityGroup')]" - } - } - } - ] - } - }, - { - "apiVersion": "${azure.apiVersionForNetworkInterfaces}", - "type": "Microsoft.Network/networkInterfaces", - "condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'new')]", - "name": "[if(equals(copyIndex(),0),concat(parameters('adminVMName'),variables('name_nic_with_pub_ip')),concat(variables('const_managedVMPrefix'), copyIndex(),variables('name_nic_with_pub_ip')))]", - "location": "[parameters('location')]", - "copy": { - "name": "nicLoop_public_ip", - "count": "[add(parameters('dynamicClusterSize'),1)]" - }, - "dependsOn": [ - "[variables('name_virtualNetwork')]", - "publicIPLoop" - ], - "properties": { - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses',if(equals(copyIndex(),0),concat(parameters('adminVMName'),variables('name_publicIPAddress')),concat(variables('const_managedVMPrefix'), copyIndex(),variables('name_publicIPAddress'))))]" - }, - "subnet": { - "id": "[variables('ref_subnet')]" - } - } - } - ], - "dnsSettings": { - "internalDnsNameLabel": "[if(equals(copyIndex(),0),parameters('adminVMName'),concat(variables('const_managedVMPrefix'), copyIndex()))]" - } - } - }, - { - "type": "Microsoft.Network/networkInterfaces", - "apiVersion": "${azure.apiVersionForNetworkInterfaces}", - "condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'existing')]", - "name": "[if(equals(copyIndex(),0),variables('name_outputAdminHost_without_pub_ip'),concat(variables('const_managedVMPrefix'), copyIndex(),variables('name_nic_without_pub_ip')))]", - "location": "[parameters('location')]", - "copy": { - "name": "nicLoop_private_ip", - "count": "[add(parameters('dynamicClusterSize'),1)]" - }, - "dependsOn": [ - "[variables('name_virtualNetwork')]" - ], - "properties": { - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "subnet": { - "id": "[variables('ref_subnet')]" - } - } - } - ] - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines", - "name": "[if(equals(copyIndex(),0),parameters('adminVMName'),concat(variables('const_managedVMPrefix'), copyIndex()))]", - "location": "[parameters('location')]", - "copy": { - "name": "virtualMachineLoop", - "count": "[add(parameters('dynamicClusterSize'),1)]" - }, - "dependsOn": [ - "nicLoop_public_ip", - "nicLoop_private_ip" - ], - "identity": "[if(parameters('useSystemAssignedManagedIdentity'), json('{\"type\":\"SystemAssigned\"}'), null())]", - "properties": { - "hardwareProfile": { - "vmSize": "[variables('const_vmSize')]" - }, - "osProfile": { - "computerName": "[if(equals(copyIndex(),0),parameters('adminVMName'),concat(variables('const_managedVMPrefix'), copyIndex()))]", - "adminUsername": "[parameters('adminUsername')]", - "adminPassword": "[parameters('adminPasswordOrKey')]", - "linuxConfiguration": "[if(equals(parameters('authenticationType'), 'password'), json('null'), variables('const_linuxConfiguration'))]" - }, - "storageProfile": { - "imageReference": { - "publisher": "[variables('const_imagePublisher')]", - "offer": "[variables('const_imageOffer')]", - "sku": "[variables('name_linuxImageOfferSKU')]", - "version": "[variables('name_linuxImageVersion')]" - }, - "osDisk": { - "createOption": "FromImage", - "managedDisk": { - "storageAccountType": "Standard_LRS" - } - } - }, - "networkProfile": { - "networkInterfaces": [ - { - "id": "[if(equals(parameters('virtualNetworkNewOrExisting'), 'new'), resourceId('Microsoft.Network/networkInterfaces',if(equals(copyIndex(),0),concat(parameters('adminVMName'),variables('name_nic_with_pub_ip')),concat(variables('const_managedVMPrefix'), copyIndex(),variables('name_nic_with_pub_ip')))), resourceId('Microsoft.Network/networkInterfaces',if(equals(copyIndex(),0),variables('name_outputAdminHost_without_pub_ip'),concat(variables('const_managedVMPrefix'), copyIndex(),variables('name_nic_without_pub_ip')))))]" - } - ] - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": true, - "storageUri": "[reference(resourceId('Microsoft.Storage/storageAccounts/', variables('name_storageAccount')), '${azure.apiVersionForStorage}').primaryEndpoints.blob]" - } - } - }, - "plan": { - "name": "[variables('name_linuxImageOfferSKU')]", - "publisher": "[variables('const_imagePublisher')]", - "product": "[variables('const_imageOffer')]" - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines/extensions", - "name": "[if(equals(copyIndex(),0),concat(parameters('adminVMName'),'/newuserscript'),concat(variables('const_managedVMPrefix'),copyIndex(),'/newuserscript'))]", - "location": "[parameters('location')]", - "copy": { - "name": "virtualMachineExtensionLoop", - "count": "[add(parameters('dynamicClusterSize'),1)]" - }, - "dependsOn": [ - "virtualMachineLoop" - ], - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.0", - "autoUpgradeMinorVersion": true, - "settings": { - "fileUris": [ - "[uri(parameters('_artifactsLocationClusterTemplate'), concat('../scripts/', variables('name_scriptFile'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationClusterTemplate'), concat('../../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameGeneratorscriptFile'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationClusterTemplate'), concat('../../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameVerifierJavaFile'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationClusterTemplate'), concat('../../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameValuesTemplate'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationClusterTemplate'), concat('../../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameVerifierTest'), parameters('_artifactsLocationSasToken')))]" - ] - }, - "protectedSettings": { - "commandToExecute": "[concat('sh',' ',variables('name_scriptFile'),' <<< \"',parameters('wlsDomainName'),' ',parameters('wlsUserName'),' ',parameters('wlsPassword'),' ',parameters('managedServerPrefix'),' ',copyindex(),' ',variables('const_managedVMPrefix'),' ',parameters('maxDynamicClusterSize'),' ',parameters('dynamicClusterSize'),' ',parameters('adminVMName'),' ', variables('const_wlsHome'),' ',variables('name_storageAccount'),' ',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('name_storageAccount')), '${azure.apiVersionForStorage}').keys[0].value,' ',variables('const_mountPointPath'),' ',string(parameters('enableHTTPAdminListenPort')),' ',if(equals(parameters('virtualNetworkNewOrExisting'), 'new'), if(parameters('enableDNSConfiguration'),parameters('customDNSNameForAdminServer'),reference(variables('name_outputAdminHost_with_pub_ip'), '${azure.apiVersionForPublicIPAddresses}').dnsSettings.fqdn), reference(variables('name_outputAdminHost_without_pub_ip')).ipConfigurations[0].properties.privateIPAddress),' ',parameters('dnsLabelPrefix'),' ',parameters('location'),' ', parameters('virtualNetworkNewOrExisting'),' ',reference(resourceId('Microsoft.Network/privateEndpoints/', variables('name_privateSaEndpoint')), '${azure.apiVersionForPrivateEndpoint}').customDnsConfigs[0].ipAddresses[0], ' ',string(parameters('enableCustomSSL')),' ',base64(parameters('sslCustomIdentityKeyStoreData')),' ',base64(parameters('sslCustomIdentityKeyStorePassPhrase')),' ',base64(parameters('sslCustomIdentityKeyStoreType')),' ',base64(parameters('sslCustomTrustKeyStoreData')),' ',base64(parameters('sslCustomTrustKeyStorePassPhrase')),' ',base64(parameters('sslCustomTrustKeyStoreType')),' ',base64(parameters('sslPrivateKeyAlias')),' ',base64(parameters('sslPrivateKeyPassPhrase')),'\"')]" - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${dynamic.ssl.end}", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${dynamic.cluster.end}", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk11-ol91}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk11-ol91'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk11-ol87}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk11-ol87'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk8-ol91}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk8-ol91'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk8-ol87}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk8-ol87'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-122140-jdk8-ol91}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-122140-jdk8-ol91'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-122140-jdk8-ol87}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-122140-jdk8-ol87'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-122140-jdk8-ol76}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'from.owls-122140-jdk8-ol76'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk8-ol76}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk8-ol76'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk11-ol76}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk11-ol76'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk11-rhel87}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk11-rhel87'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk8-rhel87}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk8-rhel87'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-122140-jdk8-rhel87}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-122140-jdk8-rhel87'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-122140-jdk8-rhel76}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-122140-jdk8-rhel76'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk8-rhel76}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk8-rhel76'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk11-rhel76}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk11-rhel76'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - } - ], - "outputs": { - "_adminPublicIPId": { - "type": "string", - "value": "[resourceId('Microsoft.Network/publicIPAddresses',concat(parameters('adminVMName'),variables('name_publicIPAddress')))]" - }, - "artifactsLocationPassedIn": { - "type": "string", - "value": "[parameters('_artifactsLocation')]" - }, - "wlsDomainLocation": { - "type": "string", - "value": "[concat('/u01/domains/', parameters('wlsDomainName'))]" - }, - "adminHostName": { - "type": "string", - "value": "[if(equals(parameters('virtualNetworkNewOrExisting'), 'new'), reference(variables('name_outputAdminHost_with_pub_ip'), '${azure.apiVersionForPublicIPAddresses}').dnsSettings.fqdn, reference(variables('name_outputAdminHost_without_pub_ip')).ipConfigurations[0].properties.privateIPAddress)]" - }, - "adminConsole": { - "type": "string", - "value": "[uri(concat('http://',if(equals(parameters('virtualNetworkNewOrExisting'), 'new'),reference(variables('name_outputAdminHost_with_pub_ip'), '${azure.apiVersionForPublicIPAddresses}').dnsSettings.fqdn,reference(variables('name_outputAdminHost_without_pub_ip')).ipConfigurations[0].properties.privateIPAddress),':7001/console/'),'')]" - }, - "adminSecuredConsole": { - "type": "string", - "value": "[uri(concat('https://',if(equals(parameters('virtualNetworkNewOrExisting'), 'new'),reference(variables('name_outputAdminHost_with_pub_ip'), '${azure.apiVersionForPublicIPAddresses}').dnsSettings.fqdn,reference(variables('name_outputAdminHost_without_pub_ip')).ipConfigurations[0].properties.privateIPAddress),':7002/console/'),'')]" - }, - "storageAccountName": { - "type": "string", - "value": "[variables('name_storageAccount')]" - }, - "virtualNetworkName": { - "type": "string", - "value": "[variables('name_virtualNetwork')]" - }, - "adminRestMgmtURL": { - "type": "string", - "value": "[uri(format('http://{0}:{1}',parameters('adminVMName'),variables('t3AdminPort')), 'management/weblogic/latest')]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/clusterTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/clusterTemplate.json deleted file mode 100644 index 76f0fbff9..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/clusterTemplate.json +++ /dev/null @@ -1,941 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - } - }, - "_artifactsLocationClusterTemplate": { - "defaultValue": "[if(contains(parameters('_artifactsLocation'), 'githubusercontent'), parameters('_artifactsLocation'), deployment().properties.templateLink.uri)]", - "type": "string", - "metadata": { - "description": "If we are deploying from the command line, use the passed in _artifactsLocation, otherwise use the default." - } - }, - "_artifactsLocationSasToken": { - "defaultValue": "", - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - } - }, - "_globalResourceNameSuffix": { - "type": "string", - "metadata": { - "description": "A suffix to be appended to all resources created by this template." - } - }, - "adminPasswordOrKey": { - "type": "securestring", - "metadata": { - "description": "SSH Key or password for the Virtual Machine. SSH key is recommended." - } - }, - "adminUsername": { - "defaultValue": "weblogic", - "type": "string", - "metadata": { - "description": "User name for the Virtual Machine." - } - }, - "adminVMName": { - "defaultValue": "adminVM", - "type": "string", - "metadata": { - "description": "Admin Server hosting VM name." - } - }, - "authenticationType": { - "type": "string", - "defaultValue": "password", - "allowedValues": [ - "sshPublicKey", - "password" - ], - "metadata": { - "description": "Type of authentication to use on the Virtual Machine. SSH key is recommended." - } - }, - "dnsLabelPrefix": { - "type": "string", - "metadata": { - "description": "Unique DNS Name for the Public IP used to access the Virtual Machine." - } - }, - "dynamicClusterSize": { - "defaultValue": 2, - "type": "int", - "metadata": { - "description": "Initial Number of Managed Servers that will be configured in the Dynamic Cluster" - } - }, - "location": { - "type": "string", - "metadata": { - "description": "Location for all resources." - } - }, - "managedServerPrefix": { - "type": "string", - "metadata": { - "description": "Provide managed server prefix name" - } - }, - "managedVMPrefix": { - "type": "string", - "metadata": { - "description": "Managed Server hosting VM name prefix." - } - }, - "maxDynamicClusterSize": { - "type": "int", - "defaultValue": 10, - "metadata": { - "description": "Maximum Number of Managed Servers allowed to be configured in the Dynamic Cluster" - } - }, - "nsgName": { - "type": "string", - "metadata": { - "description": "Name of the Network Security Group." - } - }, - "portsToExpose": { - "type": "string", - "defaultValue": "80,443,7001-9000", - "metadata": { - "description": "Ports and port ranges to expose" - } - }, - "skuUrnVersion": { - "type": "string", - "defaultValue": "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest", - "allowedValues": [ - "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest", - "owls-141100-jdk11-ol87;Oracle:weblogic-141100-jdk11-ol87:owls-141100-jdk11-ol87;latest", - "owls-141100-jdk8-ol91;Oracle:weblogic-141100-jdk8-ol91:owls-141100-jdk8-ol91;latest", - "owls-141100-jdk8-ol87;Oracle:weblogic-141100-jdk8-ol87:owls-141100-jdk8-ol87;latest", - "owls-122140-jdk8-ol91;Oracle:weblogic-122140-jdk8-ol91:owls-122140-jdk8-ol91;latest", - "owls-122140-jdk8-ol87;Oracle:weblogic-122140-jdk8-ol87:owls-122140-jdk8-ol87;latest", - "owls-122140-jdk8-ol76;Oracle:weblogic-122140-jdk8-ol76:owls-122140-jdk8-ol7;latest", - "owls-141100-jdk8-ol76;Oracle:weblogic-141100-jdk8-ol76:owls-141100-jdk8-ol7;latest", - "owls-141100-jdk11-ol76;Oracle:weblogic-141100-jdk11-ol76:owls-141100-jdk11-ol7;latest", - "owls-141100-jdk11-rhel87;Oracle:weblogic-141100-jdk11-rhel87:owls-141100-jdk11-rhel87;latest", - "owls-141100-jdk8-rhel87;Oracle:weblogic-141100-jdk8-rhel87:owls-141100-jdk8-rhel87;latest", - "owls-122140-jdk8-rhel87;Oracle:weblogic-122140-jdk8-rhel87:owls-122140-jdk8-rhel87;latest", - "owls-122140-jdk8-rhel76;Oracle:weblogic-122140-jdk8-rhel76:owls-122140-jdk8-rhel76;latest", - "owls-141100-jdk8-rhel76;Oracle:weblogic-141100-jdk8-rhel76:owls-141100-jdk8-rhel76;latest", - "owls-141100-jdk11-rhel76;Oracle:weblogic-141100-jdk11-rhel76:owls-141100-jdk11-rhel76;latest" - ], - "metadata": { - "description": "The Oracle Linux image with Weblogic and Java preinstalled. Semicolon separated string of Sku, URN, and Version" - } - }, - "usePreviewImage": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "Bool value, if it's set to true, will deploy with preview weblogic image." - } - }, - "useSystemAssignedManagedIdentity": { - "type": "bool", - "defaultValue": true, - "metadata": { - "description": "Bool value, if it's set to true, a system assigned managed identity will to be created for the VM(s)" - } - }, - "vmSize": { - "type": "string", - "defaultValue": "Standard_A3", - "metadata": { - "description": "Select appropriate VM Size as per requirement" - } - }, - "virtualNetworkNewOrExisting": { - "type": "string", - "defaultValue": "new", - "allowedValues": [ - "new", - "existing" - ], - "metadata": { - "description": "Specify whether to create a new or existing virtual network for the VM." - } - }, - "virtualNetworkName": { - "type": "string", - "defaultValue": "wls-vnet", - "metadata": { - "description": "Name of the existing or new VNET" - } - }, - "virtualNetworkResourceGroupName": { - "type": "string", - "defaultValue": "[resourceGroup().name]", - "metadata": { - "description": "Resource group of Virtual network" - } - }, - "addressPrefixes": { - "type": "array", - "defaultValue": [ - "10.0.0.0/28" - ], - "metadata": { - "description": "Address prefix of the VNET." - } - }, - "subnetName": { - "type": "string", - "defaultValue": "wls-subnet", - "metadata": { - "description": "Name of the existing or new Subnet" - } - }, - "subnetPrefix": { - "type": "string", - "defaultValue": "10.0.0.0/29", - "metadata": { - "description": "Address prefix of the subnet" - } - }, - "wlsDomainName": { - "type": "string", - "metadata": { - "description": "Provide Weblogic domain name" - } - }, - "wlsPassword": { - "type": "securestring", - "metadata": { - "description": "Password for your Weblogic domain name" - } - }, - "wlsUserName": { - "type": "string", - "metadata": { - "description": "Username for your Weblogic domain name" - } - }, - "enableHTTPAdminListenPort": { - "type": "bool", - "defaultValue": true, - "metadata": { - "description": "Boolean value indicating, if WebLogic Admin Server HTTP Listen Port is enabled or not" - } - }, - "enableDNSConfiguration": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "Boolean value indicating, if DNS Zone Configuration is enabled or not" - } - }, - "customDNSNameForAdminServer": { - "type": "string", - "defaultValue": "none", - "metadata": { - "description": "Custom DNS Name for WebLogic Admin Server" - } - } - }, - "variables": { - "const_addressPrefix": "[parameters('addressPrefixes')]", - "const_hyphen": "-", - "const_imageOffer": "[concat('weblogic',variables('const_hyphen'), split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[1],variables('const_hyphen'),split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[2],variables('const_hyphen'),split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[3],if(parameters('usePreviewImage'),'-preview',''))]", - "const_imagePublisher": "oracle", - "const_linuxConfiguration": { - "disablePasswordAuthentication": true, - "ssh": { - "publicKeys": [ - { - "path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]", - "keyData": "[parameters('adminPasswordOrKey')]" - } - ] - } - }, - "const_managedVMPrefix": "[concat(parameters('managedVMPrefix'),'VM')]", - "const_mountPointPath": "[concat('/mnt/', variables('name_share'))]", - "const_publicIPAddressType": "Dynamic", - "const_requiredPortrange": ",65200-65535,5556", - "const_storageAccountType": "Standard_LRS", - "const_subnetPrefix": "[parameters('subnetPrefix')]", - "const_wlsHome": "/u01/app/wls/install/oracle/middleware/oracle_home", - "const_vmSize": "[parameters('vmSize')]", - "name_linuxImageOfferSKU": "[first(split(parameters('skuUrnVersion'), ';'))]", - "name_linuxImageVersion": "[last(split(parameters('skuUrnVersion'),';'))]", - "name_nic": "_NIC", - "name_nic_with_pub_ip": "[concat(variables('name_nic'), '_with_pub_ip')]", - "name_nic_without_pub_ip": "[concat(variables('name_nic'), '_without_pub_ip')]", - "name_outputAdminHost_with_pub_ip": "[concat(parameters('adminVMName'),variables('name_publicIPAddress'))]", - "name_outputAdminHost_without_pub_ip": "[concat(parameters('adminVMName'),variables('name_nic_without_pub_ip'))]", - "name_publicIPAddress": "_PublicIP", - "name_scriptFile": "setupDynamicClusterDomain.sh", - "name_share": "wlsshare", - "name_storageAccount": "[concat('olvmstg', parameters('_globalResourceNameSuffix'))]", - "name_subnet": "[parameters('subnetName')]", - "name_virtualNetwork": "[parameters('virtualNetworkName')]", - "name_privateSaEndpoint": "[concat('saep', parameters('_globalResourceNameSuffix'))]", - "ref_fileService": "[resourceId('Microsoft.Storage/storageAccounts/fileServices', variables('name_storageAccount'), 'default')]", - "ref_networkSecurityGroup": "[resourceId('Microsoft.Network/networkSecurityGroups', parameters('nsgName'))]", - "ref_storage": "[resourceId('Microsoft.Storage/storageAccounts', variables('name_storageAccount'))]", - "ref_subnet": "[resourceId(parameters('virtualNetworkResourceGroupName'), 'Microsoft.Network/virtualNetworks/subnets', variables('name_virtualNetwork'), variables('name_subnet'))]", - "t3AdminPort": "[if(not(parameters('enableHTTPAdminListenPort')),'7005','7001')]", - "name_customHostnameGeneratorscriptFile": "generateCustomHostNameVerifier.sh", - "name_customHostnameVerifierJavaFile": "src/main/java/WebLogicCustomHostNameVerifier.java", - "name_customHostnameValuesTemplate": "src/main/java/HostNameValuesTemplate.txt", - "name_customHostnameVerifierTest": "src/test/java/WebLogicCustomHostNameVerifierTest.java" - }, - "resources": [ - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${dynamic.cluster.start}", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "apiVersion": "${azure.apiVersionForNetworkSecurityGroups}", - "type": "Microsoft.Network/networkSecurityGroups", - "condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'new')]", - "name": "[parameters('nsgName')]", - "location": "[parameters('location')]", - "properties": { - "securityRules": [ - { - "name": "WebLogicPorts", - "properties": { - "protocol": "TCP", - "sourcePortRange": "*", - "sourceAddressPrefix": "*", - "destinationAddressPrefix": "*", - "access": "Allow", - "priority": 320, - "direction": "Inbound", - "destinationPortRanges": "[split(concat(parameters('portsToExpose'),variables('const_requiredPortrange')), ',')]" - } - }, - { - "name": "WebLogicNMPort", - "properties": { - "protocol": "TCP", - "sourcePortRange": "*", - "sourceAddressPrefix": "Internet", - "destinationAddressPrefix": "*", - "access": "Deny", - "priority": 201, - "direction": "Inbound", - "destinationPortRanges": [ "5556" ] - } - }, - { - "name": "WebLogicAdminChannelPort", - "properties": { - "protocol": "TCP", - "sourcePortRange": "*", - "sourceAddressPrefix": "Internet", - "destinationAddressPrefix": "*", - "access": "Deny", - "priority": 202, - "direction": "Inbound", - "destinationPortRanges": [ "7005" ] - } - } - ] - } - }, - { - "type": "Microsoft.Storage/storageAccounts", - "apiVersion": "${azure.apiVersionForStorage}", - "name": "[variables('name_storageAccount')]", - "location": "[parameters('location')]", - "sku": { - "name": "[variables('const_storageAccountType')]" - }, - "kind": "StorageV2", - "properties": { - "supportsHttpsTrafficOnly": false - } - }, - { - "apiVersion": "${azure.apiVersionForPrivateEndpoint}", - "name": "[variables('name_privateSaEndpoint')]", - "type": "Microsoft.Network/privateEndpoints", - "location": "[parameters('location')]", - "properties": { - "privateLinkServiceConnections": [ - { - "name": "[variables('name_privateSaEndpoint')]", - "properties": { - "privateLinkServiceId": "[resourceId('Microsoft.Storage/storageAccounts/', variables('name_storageAccount'))]", - "groupIds": [ - "file" - ] - } - } - ], - "subnet": { - "id": "[variables('ref_subnet')]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('name_storageAccount'))]", - "[variables('name_virtualNetwork')]" - ] - }, - { - "type": "Microsoft.Storage/storageAccounts/fileServices", - "apiVersion": "${azure.apiVersionForStorageFileService}", - "name": "[concat(variables('name_storageAccount'), '/default')]", - "dependsOn": [ - "[variables('ref_storage')]" - ], - "sku": { - "name": "Standard_LRS", - "tier": "Standard" - } - }, - { - "type": "Microsoft.Storage/storageAccounts/fileServices/shares", - "apiVersion": "${azure.apiVersionForStorageFileService}", - "name": "[concat(variables('name_storageAccount'), '/default/', variables('name_share'))]", - "dependsOn": [ - "[variables('ref_fileService')]", - "[variables('ref_storage')]" - ], - "properties": { - "shareQuota": 5 - } - }, - { - "apiVersion": "${azure.apiVersionForPublicIPAddresses}", - "type": "Microsoft.Network/publicIPAddresses", - "condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'new')]", - "name": "[if(equals(copyIndex(),0),concat(parameters('adminVMName'),variables('name_publicIPAddress')),concat(variables('const_managedVMPrefix'), copyIndex(),variables('name_publicIPAddress')))]", - "location": "[parameters('location')]", - "copy": { - "name": "publicIPLoop", - "count": "[add(parameters('dynamicClusterSize'),1)]" - }, - "properties": { - "publicIPAllocationMethod": "[variables('const_publicIPAddressType')]", - "dnsSettings": { - "domainNameLabel": "[take(concat(toLower(parameters('dnsLabelPrefix')), copyindex(),'-', parameters('_globalResourceNameSuffix'),'-',toLower(parameters('wlsDomainName'))), 50)]" - } - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualNetworks}", - "type": "Microsoft.Network/virtualNetworks", - "condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'new')]", - "name": "[variables('name_virtualNetwork')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[variables('ref_networkSecurityGroup')]" - ], - "properties": { - "addressSpace": { - "addressPrefixes": "[variables('const_addressPrefix')]" - }, - "subnets": [ - { - "name": "[variables('name_subnet')]", - "properties": { - "addressPrefix": "[variables('const_subnetPrefix')]", - "networkSecurityGroup": { - "id": "[variables('ref_networkSecurityGroup')]" - } - } - } - ] - } - }, - { - "apiVersion": "${azure.apiVersionForNetworkInterfaces}", - "type": "Microsoft.Network/networkInterfaces", - "condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'new')]", - "name": "[if(equals(copyIndex(),0),concat(parameters('adminVMName'),variables('name_nic_with_pub_ip')),concat(variables('const_managedVMPrefix'), copyIndex(),variables('name_nic_with_pub_ip')))]", - "location": "[parameters('location')]", - "copy": { - "name": "nicLoop_public_ip", - "count": "[add(parameters('dynamicClusterSize'),1)]" - }, - "dependsOn": [ - "[variables('name_virtualNetwork')]", - "publicIPLoop" - ], - "properties": { - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses',if(equals(copyIndex(),0),concat(parameters('adminVMName'),variables('name_publicIPAddress')),concat(variables('const_managedVMPrefix'), copyIndex(),variables('name_publicIPAddress'))))]" - }, - "subnet": { - "id": "[variables('ref_subnet')]" - } - } - } - ], - "dnsSettings": { - "internalDnsNameLabel": "[if(equals(copyIndex(),0),parameters('adminVMName'),concat(variables('const_managedVMPrefix'), copyIndex()))]" - } - } - }, - { - "type": "Microsoft.Network/networkInterfaces", - "apiVersion": "${azure.apiVersionForNetworkInterfaces}", - "condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'existing')]", - "name": "[if(equals(copyIndex(),0),variables('name_outputAdminHost_without_pub_ip'),concat(variables('const_managedVMPrefix'), copyIndex(),variables('name_nic_without_pub_ip')))]", - "location": "[parameters('location')]", - "copy": { - "name": "nicLoop_private_ip", - "count": "[add(parameters('dynamicClusterSize'),1)]" - }, - "dependsOn": [ - "[variables('name_virtualNetwork')]" - ], - "properties": { - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "subnet": { - "id": "[variables('ref_subnet')]" - } - } - } - ] - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines", - "name": "[if(equals(copyIndex(),0),parameters('adminVMName'),concat(variables('const_managedVMPrefix'), copyIndex()))]", - "location": "[parameters('location')]", - "copy": { - "name": "virtualMachineLoop", - "count": "[add(parameters('dynamicClusterSize'),1)]" - }, - "dependsOn": [ - "nicLoop_public_ip", - "nicLoop_private_ip" - ], - "identity": "[if(parameters('useSystemAssignedManagedIdentity'), json('{\"type\":\"SystemAssigned\"}'), null())]", - "properties": { - "hardwareProfile": { - "vmSize": "[variables('const_vmSize')]" - }, - "osProfile": { - "computerName": "[if(equals(copyIndex(),0),parameters('adminVMName'),concat(variables('const_managedVMPrefix'), copyIndex()))]", - "adminUsername": "[parameters('adminUsername')]", - "adminPassword": "[parameters('adminPasswordOrKey')]", - "linuxConfiguration": "[if(equals(parameters('authenticationType'), 'password'), json('null'), variables('const_linuxConfiguration'))]" - }, - "storageProfile": { - "imageReference": { - "publisher": "[variables('const_imagePublisher')]", - "offer": "[variables('const_imageOffer')]", - "sku": "[variables('name_linuxImageOfferSKU')]", - "version": "[variables('name_linuxImageVersion')]" - }, - "osDisk": { - "createOption": "FromImage", - "managedDisk": { - "storageAccountType": "Standard_LRS" - } - } - }, - "networkProfile": { - "networkInterfaces": [ - { - "id": "[if(equals(parameters('virtualNetworkNewOrExisting'), 'new'), resourceId('Microsoft.Network/networkInterfaces',if(equals(copyIndex(),0),concat(parameters('adminVMName'),variables('name_nic_with_pub_ip')),concat(variables('const_managedVMPrefix'), copyIndex(),variables('name_nic_with_pub_ip')))), resourceId('Microsoft.Network/networkInterfaces',if(equals(copyIndex(),0),variables('name_outputAdminHost_without_pub_ip'),concat(variables('const_managedVMPrefix'), copyIndex(),variables('name_nic_without_pub_ip')))))]" - } - ] - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": true, - "storageUri": "[reference(resourceId('Microsoft.Storage/storageAccounts/', variables('name_storageAccount')), '${azure.apiVersionForStorage}').primaryEndpoints.blob]" - } - } - }, - "plan": { - "name": "[variables('name_linuxImageOfferSKU')]", - "publisher": "[variables('const_imagePublisher')]", - "product": "[variables('const_imageOffer')]" - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines/extensions", - "name": "[if(equals(copyIndex(),0),concat(parameters('adminVMName'),'/newuserscript'),concat(variables('const_managedVMPrefix'),copyIndex(),'/newuserscript'))]", - "location": "[parameters('location')]", - "copy": { - "name": "virtualMachineExtensionLoop", - "count": "[add(parameters('dynamicClusterSize'),1)]" - }, - "dependsOn": [ - "virtualMachineLoop" - ], - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.0", - "autoUpgradeMinorVersion": true, - "settings": { - "fileUris": [ - "[uri(parameters('_artifactsLocationClusterTemplate'), concat('../scripts/', variables('name_scriptFile'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationClusterTemplate'), concat('../../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameGeneratorscriptFile'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationClusterTemplate'), concat('../../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameVerifierJavaFile'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationClusterTemplate'), concat('../../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameValuesTemplate'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationClusterTemplate'), concat('../../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameVerifierTest'), parameters('_artifactsLocationSasToken')))]" - ] - }, - "protectedSettings": { - "commandToExecute": "[concat('sh',' ',variables('name_scriptFile'),' <<< \"',parameters('wlsDomainName'),' ',parameters('wlsUserName'),' ',parameters('wlsPassword'),' ',parameters('managedServerPrefix'),' ',copyindex(),' ',variables('const_managedVMPrefix'),' ',parameters('maxDynamicClusterSize'),' ',parameters('dynamicClusterSize'),' ',parameters('adminVMName'),' ', variables('const_wlsHome'),' ',variables('name_storageAccount'),' ',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('name_storageAccount')), '${azure.apiVersionForStorage}').keys[0].value,' ',variables('const_mountPointPath'),' ',string(parameters('enableHTTPAdminListenPort')),' ',if(equals(parameters('virtualNetworkNewOrExisting'), 'new'), if(parameters('enableDNSConfiguration'),parameters('customDNSNameForAdminServer'),reference(variables('name_outputAdminHost_with_pub_ip'), '${azure.apiVersionForPublicIPAddresses}').dnsSettings.fqdn), reference(variables('name_outputAdminHost_without_pub_ip')).ipConfigurations[0].properties.privateIPAddress),' ',parameters('dnsLabelPrefix'),' ',parameters('location'),' ',parameters('virtualNetworkNewOrExisting'),' ',reference(resourceId('Microsoft.Network/privateEndpoints/', variables('name_privateSaEndpoint')), '${azure.apiVersionForPrivateEndpoint}').customDnsConfigs[0].ipAddresses[0], ' ', 'false','\"')]" - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${dynamic.cluster.end}", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk11-ol91}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk11-ol91'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk11-ol87}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk11-ol87'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk8-ol91}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk8-ol91'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk8-ol87}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk8-ol87'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-122140-jdk8-ol91}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-122140-jdk8-ol91'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-122140-jdk8-ol87}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-122140-jdk8-ol87'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-122140-jdk8-ol76}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'from.owls-122140-jdk8-ol76'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk8-ol76}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk8-ol76'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk11-ol76}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk11-ol76'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk11-rhel87}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk11-rhel87'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk8-rhel87}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk8-rhel87'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-122140-jdk8-rhel87}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-122140-jdk8-rhel87'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-122140-jdk8-rhel76}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-122140-jdk8-rhel76'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk8-rhel76}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk8-rhel76'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk11-rhel76}", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk11-rhel76'), bool('true'), bool('false'))]", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - } - ], - "outputs": { - "_adminPublicIPId": { - "type": "string", - "value": "[resourceId('Microsoft.Network/publicIPAddresses',concat(parameters('adminVMName'),variables('name_publicIPAddress')))]" - }, - "artifactsLocationPassedIn": { - "type": "string", - "value": "[parameters('_artifactsLocation')]" - }, - "wlsDomainLocation": { - "type": "string", - "value": "[concat('/u01/domains/', parameters('wlsDomainName'))]" - }, - "adminHostName": { - "type": "string", - "value": "[if(equals(parameters('virtualNetworkNewOrExisting'), 'new'), reference(variables('name_outputAdminHost_with_pub_ip'), '${azure.apiVersionForPublicIPAddresses}').dnsSettings.fqdn, reference(variables('name_outputAdminHost_without_pub_ip')).ipConfigurations[0].properties.privateIPAddress)]" - }, - "adminConsole": { - "type": "string", - "value": "[uri(concat('http://',if(equals(parameters('virtualNetworkNewOrExisting'), 'new'),reference(variables('name_outputAdminHost_with_pub_ip'), '${azure.apiVersionForPublicIPAddresses}').dnsSettings.fqdn,reference(variables('name_outputAdminHost_without_pub_ip')).ipConfigurations[0].properties.privateIPAddress),':7001/console/'),'')]" - }, - "adminSecuredConsole": { - "type": "string", - "value": "[uri(concat('https://',if(equals(parameters('virtualNetworkNewOrExisting'), 'new'),reference(variables('name_outputAdminHost_with_pub_ip'), '${azure.apiVersionForPublicIPAddresses}').dnsSettings.fqdn,reference(variables('name_outputAdminHost_without_pub_ip')).ipConfigurations[0].properties.privateIPAddress),':7002/console/'),'')]" - }, - "storageAccountName": { - "type": "string", - "value": "[variables('name_storageAccount')]" - }, - "virtualNetworkName": { - "type": "string", - "value": "[variables('name_virtualNetwork')]" - }, - "adminRestMgmtURL": { - "type": "string", - "value": "[uri(format('http://{0}:{1}',parameters('adminVMName'),variables('t3AdminPort')),'/management/weblogic/latest')]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/coherenceTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/coherenceTemplate.json deleted file mode 100644 index 915359efa..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/coherenceTemplate.json +++ /dev/null @@ -1,503 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - } - }, - "_artifactsLocationCoherenceTemplate": { - "defaultValue": "[if(contains(parameters('_artifactsLocation'), 'githubusercontent'), parameters('_artifactsLocation'), deployment().properties.templateLink.uri)]", - "type": "string", - "metadata": { - "description": "If we are deploying from the command line, use the passed in _artifactsLocation, otherwise use the default." - } - }, - "_artifactsLocationSasToken": { - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - }, - "defaultValue": "" - }, - "_globalResourceNameSuffix":{ - "type": "string", - "metadata": { - "description": "The suffix to be appended to the globally unique resource name" - } - }, - "adminPasswordOrKey": { - "type": "securestring", - "metadata": { - "description": "SSH Key or password for the Virtual Machine. SSH key is recommended." - } - }, - "adminUsername": { - "type": "string", - "defaultValue": "weblogic", - "metadata": { - "description": "User name for the Virtual Machine." - } - }, - "adminVMName": { - "defaultValue": "adminVM", - "type": "string", - "metadata": { - "description": "Admin Server hosting VM name." - } - }, - "authenticationType": { - "type": "string", - "defaultValue": "password", - "allowedValues": [ - "sshPublicKey", - "password" - ], - "metadata": { - "description": "Type of authentication to use on the Virtual Machine. SSH key is recommended." - } - }, - "dnsLabelPrefix": { - "type": "string", - "defaultValue": "wls", - "metadata": { - "description": "Unique DNS Name for the Public IP used to access the Virtual Machine." - } - }, - "enableCoherenceWebLocalStorage": { - "defaultValue": true, - "type": "bool", - "metadata": { - "description": "Specifies whether Local Storage is enabled for the Coherence*Web cluster tier." - } - }, - "location": { - "type": "string", - "metadata": { - "description": "Location for all resources." - } - }, - "managedServerPrefix": { - "type": "string", - "defaultValue": "msp", - "metadata": { - "description": "Provide managed server prefix name" - } - }, - "managedVMNamePrefix": { - "type": "string", - "metadata": { - "description": "Managed VM name prefix" - } - }, - "numberOfCoherenceCacheInstances": { - "defaultValue": 1, - "type": "int", - "minValue": 1, - "maxValue": 10, - "metadata": { - "description": "Number of Coherence cache instances, used to create Virtual Machines and Managed Server." - } - }, - "skuUrnVersion": { - "type": "string", - "defaultValue": "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest", - "allowedValues": [ - "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest", - "owls-141100-jdk11-ol87;Oracle:weblogic-141100-jdk11-ol87:owls-141100-jdk11-ol87;latest", - "owls-141100-jdk8-ol91;Oracle:weblogic-141100-jdk8-ol91:owls-141100-jdk8-ol91;latest", - "owls-141100-jdk8-ol87;Oracle:weblogic-141100-jdk8-ol87:owls-141100-jdk8-ol87;latest", - "owls-122140-jdk8-ol91;Oracle:weblogic-122140-jdk8-ol91:owls-122140-jdk8-ol91;latest", - "owls-122140-jdk8-ol87;Oracle:weblogic-122140-jdk8-ol87:owls-122140-jdk8-ol87;latest", - "owls-122140-jdk8-ol76;Oracle:weblogic-122140-jdk8-ol76:owls-122140-jdk8-ol7;latest", - "owls-141100-jdk8-ol76;Oracle:weblogic-141100-jdk8-ol76:owls-141100-jdk8-ol7;latest", - "owls-141100-jdk11-ol76;Oracle:weblogic-141100-jdk11-ol76:owls-141100-jdk11-ol7;latest", - "owls-141100-jdk11-rhel87;Oracle:weblogic-141100-jdk11-rhel87:owls-141100-jdk11-rhel87;latest", - "owls-141100-jdk8-rhel87;Oracle:weblogic-141100-jdk8-rhel87:owls-141100-jdk8-rhel87;latest", - "owls-122140-jdk8-rhel87;Oracle:weblogic-122140-jdk8-rhel87:owls-122140-jdk8-rhel87;latest", - "owls-122140-jdk8-rhel76;Oracle:weblogic-122140-jdk8-rhel76:owls-122140-jdk8-rhel76;latest", - "owls-141100-jdk8-rhel76;Oracle:weblogic-141100-jdk8-rhel76:owls-141100-jdk8-rhel76;latest", - "owls-141100-jdk11-rhel76;Oracle:weblogic-141100-jdk11-rhel76:owls-141100-jdk11-rhel76;latest" - ], - "metadata": { - "description": "The Oracle Linux image with Weblogic and Java preinstalled. Semicolon separated string of Sku, URN, and Version" - } - }, - "storageAccountName": { - "type": "string", - "metadata": { - "description": "Name of storage account. One storage account can store 20 vitual machines with 2 VHDs of 500 IOPS." - } - }, - "subnetName": { - "type": "string", - "defaultValue": "wls-subnet", - "metadata": { - "description": "Name of the existing or new Subnet" - } - }, - "usePreviewImage": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "Bool value, if it's set to true, will deploy with preview weblogic image." - } - }, - "vmSizeSelectForCoherence": { - "defaultValue": "Standard_A3", - "type": "string", - "metadata": { - "description": "Select appropriate VM Size for Coherence" - } - }, - "wlsDomainName": { - "type": "string", - "defaultValue": "wlsd", - "metadata": { - "description": "Provide Weblogic domain name" - } - }, - "wlsPassword": { - "type": "securestring", - "metadata": { - "description": "Password for your Weblogic domain name" - } - }, - "wlsUserName": { - "defaultValue": "weblogic", - "type": "string", - "metadata": { - "description": "Username for your Weblogic domain name" - } - }, - "virtualNetworkResourceGroupName": { - "type": "string", - "defaultValue": "[resourceGroup().name]", - "metadata": { - "description": "Resource group of Virtual network" - } - }, - "virtualNetworkName": { - "type": "string", - "defaultValue": "wls-vnet", - "metadata": { - "description": "Name of the existing or new VNET" - } - }, - "enableDNSConfiguration": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "Boolean value indicating, if DNS Zone Configuration is enabled or not" - } - }, - "customDNSNameForAdminServer": { - "type": "string", - "defaultValue": "none", - "metadata": { - "description": "Custom DNS Name for WebLogic Admin Server" - } - }, - "enableCustomSSL":{ - "defaultValue":false, - "type": "bool", - "metadata": { - "description": "Boolean value indicating, if custom SSL is enabled or not" - } - }, - "sslCustomIdentityKeyStoreData": { - "type": "securestring", - "defaultValue":"", - "metadata": { - "description": "Weblogic Custom Identity Keystore Data" - } - }, - "sslCustomIdentityKeyStorePassPhrase": { - "type": "securestring", - "defaultValue":"", - "metadata": { - "description": "Weblogic Custom Identity Keystore Passphrase" - } - }, - "sslCustomIdentityKeyStoreType": { - "type": "string", - "metadata": { - "description": "Weblogic Custom Identity Keystore Type" - }, - "defaultValue": "JKS" - }, - "sslCustomTrustKeyStoreData": { - "type": "securestring", - "defaultValue":"", - "metadata": { - "description": "Weblogic Custom Trust Store Data" - } - }, - "sslCustomTrustKeyStorePassPhrase": { - "type": "securestring", - "defaultValue":"", - "metadata": { - "description": "Weblogic Custom Trust Store Passphrase" - } - }, - "sslCustomTrustKeyStoreType": { - "type": "string", - "metadata": { - "description": "Weblogic Custom Trust Store Type" - }, - "defaultValue": "JKS" - }, - "sslPrivateKeyAlias": { - "type": "string", - "defaultValue":"null", - "metadata": { - "description": "Weblogic Server Private Key Alias" - } - }, - "sslPrivateKeyPassPhrase": { - "type": "securestring", - "defaultValue":"", - "metadata": { - "description": "Weblogic Server Private Key Pass Phrase" - } - } - }, - "variables": { - "const_hyphen": "-", - "const_imageOffer": "[concat('weblogic',variables('const_hyphen'), split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[1],variables('const_hyphen'),split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[2],variables('const_hyphen'),split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[3],if(parameters('usePreviewImage'),'-preview',''))]", - "const_imagePublisher": "oracle", - "const_linuxConfiguration": { - "disablePasswordAuthentication": true, - "ssh": { - "publicKeys": [ - { - "path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]", - "keyData": "[parameters('adminPasswordOrKey')]" - } - ] - } - }, - "const_mountPointPath": "[concat('/mnt/', variables('name_share'))]", - "const_publicIPAddressType": "Dynamic", - "const_vmSize": "[parameters('vmSizeSelectForCoherence')]", - "const_wlsDomainPath": "/u01/domains", - "const_wlsHome": "/u01/app/wls/install/oracle/middleware/oracle_home", - "name_linuxImageOfferSKU": "[first(split(parameters('skuUrnVersion'), ';'))]", - "name_linuxImageVersion": "[last(split(parameters('skuUrnVersion'),';'))]", - "name_nic": "_NIC", - "name_publicIPAddress": "_PublicIP", - "name_scriptFile": "setupCoherence.sh", - "name_share": "wlsshare", - "name_subnet": "[parameters('subnetName')]", - "name_virtualNetwork": "[parameters('virtualNetworkName')]", - "name_vmPrefix": "[concat(parameters('managedVMNamePrefix'), 'StorageVM')]", - "name_wlsServerPrefix": "[concat(parameters('managedServerPrefix'),'Storage')]", - "ref_subnet": "[resourceId(parameters('virtualNetworkResourceGroupName'), 'Microsoft.Network/virtualNetworks/subnets', variables('name_virtualNetwork'), variables('name_subnet'))]", - "name_customHostnameGeneratorscriptFile": "generateCustomHostNameVerifier.sh", - "name_customHostnameVerifierJavaFile": "src/main/java/WebLogicCustomHostNameVerifier.java", - "name_customHostnameValuesTemplate": "src/main/java/HostNameValuesTemplate.txt", - "name_customHostnameVerifierTest" : "src/test/java/WebLogicCustomHostNameVerifierTest.java" - - }, - "functions": [ - { - "namespace": "array", - "members": { - "join": { - "parameters": [ - { - "name": "items", - "type": "array" - } - ], - "output": { - "type": "string", - "value": "[replace(replace(replace(string(parameters('items')), '[\"', ''), '\"]', ''), '\",\"', ',')]" - } - } - } - } - ], - "resources": [ - { - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${dynamic.coherence.start}", - "type": "Microsoft.Resources/deployments", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "apiVersion": "${azure.apiVersionForPublicIPAddresses}", - "type": "Microsoft.Network/publicIPAddresses", - "name": "[concat(variables('name_vmPrefix'),copyIndex(1),variables('name_publicIPAddress'))]", - "location": "[parameters('location')]", - "copy": { - "name": "publicIPLoop", - "count": "[parameters('numberOfCoherenceCacheInstances')]" - }, - "properties": { - "publicIPAllocationMethod": "[variables('const_publicIPAddressType')]", - "dnsSettings": { - "domainNameLabel": "[take(concat(toLower(parameters('dnsLabelPrefix')), 'co', copyindex(),'-', parameters('_globalResourceNameSuffix'),'-',toLower(parameters('wlsDomainName'))), 50)]" - } - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualNetworks}", - "type": "Microsoft.Network/virtualNetworks/subnets", - "name": "[concat(variables('name_virtualNetwork'), '/', variables('name_subnet'))]", - "condition": "[and(empty(variables('name_virtualNetwork')), empty(variables('name_subnet')))]" - }, - { - "apiVersion": "${azure.apiVersionForNetworkInterfaces}", - "type": "Microsoft.Network/networkInterfaces", - "name": "[concat(variables('name_vmPrefix'), copyIndex(1), variables('name_nic'))]", - "location": "[parameters('location')]", - "copy": { - "name": "nicLoop", - "count": "[parameters('numberOfCoherenceCacheInstances')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.Network/publicIPAddresses/', concat(variables('name_vmPrefix'),copyIndex(1),variables('name_publicIPAddress')))]" - ], - "properties": { - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses',concat(variables('name_vmPrefix'),copyIndex(1),variables('name_publicIPAddress')))]" - }, - "subnet": { - "id": "[variables('ref_subnet')]" - } - } - } - ], - "dnsSettings": { - "internalDnsNameLabel": "[concat(variables('name_vmPrefix'), copyIndex(1))]" - } - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines", - "name": "[concat(variables('name_vmPrefix'), copyIndex(1))]", - "location": "[parameters('location')]", - "copy": { - "name": "virtualMachineLoop", - "count": "[parameters('numberOfCoherenceCacheInstances')]" - }, - "dependsOn": [ - "nicLoop" - ], - "properties": { - "hardwareProfile": { - "vmSize": "[variables('const_vmSize')]" - }, - "osProfile": { - "computerName": "[concat(variables('name_vmPrefix'), copyIndex(1))]", - "adminUsername": "[parameters('adminUsername')]", - "adminPassword": "[parameters('adminPasswordOrKey')]", - "linuxConfiguration": "[if(equals(parameters('authenticationType'), 'password'), json('null'), variables('const_linuxConfiguration'))]" - }, - "storageProfile": { - "imageReference": { - "publisher": "[variables('const_imagePublisher')]", - "offer": "[variables('const_imageOffer')]", - "sku": "[variables('name_linuxImageOfferSKU')]", - "version": "[variables('name_linuxImageVersion')]" - }, - "osDisk": { - "createOption": "FromImage", - "managedDisk": { - "storageAccountType": "Standard_LRS" - } - } - }, - "networkProfile": { - "networkInterfaces": [ - { - "id": "[resourceId('Microsoft.Network/networkInterfaces',concat(variables('name_vmPrefix'), copyIndex(1), variables('name_nic')))]" - } - ] - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": true, - "storageUri": "[reference(resourceId('Microsoft.Storage/storageAccounts/', parameters('storageAccountName')), '${azure.apiVersionForStorage}').primaryEndpoints.blob]" - } - } - }, - "plan": { - "name": "[variables('name_linuxImageOfferSKU')]", - "publisher": "[variables('const_imagePublisher')]", - "product": "[variables('const_imageOffer')]" - } - }, - { - "type": "Microsoft.Compute/virtualMachines/extensions", - "name": "[if(equals(copyIndex(),0),concat(parameters('adminVMName'),'/newuserscript'),concat(variables('name_vmPrefix'), copyIndex(),'/newuserscript'))]", - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "location": "[parameters('location')]", - "copy": { - "name": "virtualMachineExtensionLoop", - "count": "[add(parameters('numberOfCoherenceCacheInstances'),1)]" - }, - "dependsOn": [ - "virtualMachineLoop" - ], - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.0", - "autoUpgradeMinorVersion": true, - "settings": { - "fileUris": [ - "[uri(parameters('_artifactsLocationCoherenceTemplate'), concat('../scripts/', variables('name_scriptFile'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationCoherenceTemplate'), concat('../../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameGeneratorscriptFile'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationCoherenceTemplate'), concat('../../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameVerifierJavaFile'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationCoherenceTemplate'), concat('../../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameValuesTemplate'), parameters('_artifactsLocationSasToken')))]", - "[uri(parameters('_artifactsLocationCoherenceTemplate'), concat('../../../../../utilities/custom-hostname-verifier/', variables('name_customHostnameVerifierTest'), parameters('_artifactsLocationSasToken')))]" - ] - }, - "protectedSettings": { - "commandToExecute": "[concat('sh',' ',variables('name_scriptFile'),' <<< \"', parameters('wlsDomainName'),' ',parameters('wlsUserName'),' ',parameters('wlsPassword'),' ',' ', parameters('adminVMName'),' ',variables('const_wlsHome'),' ',variables('const_wlsDomainPath'),' ', parameters('storageAccountName'), ' ', listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName')), '${azure.apiVersionForStorage}').keys[0].value,' ', variables('const_mountPointPath'),' ', parameters('enableCoherenceWebLocalStorage'), ' ',variables('name_wlsServerPrefix'),' ',copyIndex(),' ',if(parameters('enableDNSConfiguration'),parameters('customDNSNameForAdminServer'),parameters('adminVMName')),' ',parameters('dnsLabelPrefix'),' ',parameters('location'),' ',string(parameters('enableCustomSSL')),' ',base64(parameters('sslCustomIdentityKeyStoreData')),' ',base64(parameters('sslCustomIdentityKeyStorePassPhrase')),' ',parameters('sslCustomIdentityKeyStoreType'),' ',base64(parameters('sslCustomTrustKeyStoreData')),' ',base64(parameters('sslCustomTrustKeyStorePassPhrase')),' ',parameters('sslCustomTrustKeyStoreType'),' ',base64(parameters('sslPrivateKeyAlias')),' ',base64(parameters('sslPrivateKeyPassPhrase')),'\"')]" - } - } - }, - { - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${dynamic.coherence.end}", - "type": "Microsoft.Resources/deployments", - "dependsOn": [ - "virtualMachineExtensionLoop" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - } - ], - "outputs": { - "artifactsLocationPassedIn": { - "type": "string", - "value": "[parameters('_artifactsLocation')]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/dbTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/dbTemplate.json deleted file mode 100644 index b29bde02a..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/dbTemplate.json +++ /dev/null @@ -1,313 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - } - }, - "_artifactsLocationSasToken": { - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - }, - "defaultValue": "" - }, - "adminVMName": { - "type": "string", - "defaultValue": "adminVM", - "metadata": { - "description": "Admin Server hosting VM name." - } - }, - "databaseType": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "One of the supported database types" - } - }, - "dbGlobalTranPro": { - "defaultValue": "OnePhaseCommit", - "type": "string", - "metadata": { - "description": "Determines the transaction protocol (global transaction processing behavior) for the data source." - } - }, - "dbIdentity": { - "defaultValue": {}, - "type": "object", - "metadata": { - "description": "Managed identity that has access to the data source." - } - }, - "dbPassword": { - "defaultValue": "[newGuid()]", - "type": "securestring", - "metadata": { - "description": "Password for Database" - } - }, - "dbUser": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "Userid of Database" - } - }, - "dsConnectionURL": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "JDBC Connection String" - } - }, - "enablePswlessConnection": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "True to enable passwordless connection." - } - }, - "jdbcDataSourceName": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "JNDI Name for JDBC Datasource" - } - }, - "location": { - "type": "string", - "metadata": { - "description": "Location for all resources." - } - }, - "managedServerPrefix": { - "type": "string", - "defaultValue": "msp", - "metadata": { - "description": "Provide managed server prefix name" - } - }, - "managedVMNamePrefix": { - "type": "string", - "metadata": { - "description": "Provide managed VM prefix name" - } - }, - "numberOfManagedApplicationInstances": { - "type": "int", - "defaultValue": 2, - "minValue": 1, - "maxValue": 20, - "metadata": { - "description": "Number of VMs that have been deployed to host managed application server." - } - }, - "wlsDomainName": { - "type": "string", - "defaultValue": "wlsd", - "metadata": { - "description": "Provide Weblogic domain name" - } - }, - "wlsPassword": { - "type": "securestring", - "metadata": { - "description": "Password for your Weblogic domain name" - } - }, - "wlsUserName": { - "type": "string", - "metadata": { - "description": "Username for your Weblogic domain name" - } - } - }, - "variables": { - "name_dbLinkedTemplateName": "_dbTemplate.json", - "name_dbPswlessTemplateName": "_pswlessDbTemplate.json", - "name_dbUpgradeMySQLDriver": "_installJdbcLibsTemplate.json" - }, - "resources": [ - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "pswlessDbTemplate", - "condition": "[parameters('enablePswlessConnection')]", - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_dbPswlessTemplateName')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "adminVMName": { - "value": "[parameters('adminVMName')]" - }, - "databaseType": { - "value": "[parameters('databaseType')]" - }, - "dbGlobalTranPro": { - "value": "[parameters('dbGlobalTranPro')]" - }, - "dbIdentity": { - "value": "[parameters('dbIdentity')]" - }, - "dbUser": { - "value": "[parameters('dbUser')]" - }, - "dsConnectionURL": { - "value": "[parameters('dsConnectionURL')]" - }, - "jdbcDataSourceName": { - "value": "[parameters('jdbcDataSourceName')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "managedServerPrefix": { - "value": "[parameters('managedServerPrefix')]" - }, - "managedVMNamePrefix": { - "value": "[parameters('managedVMNamePrefix')]" - }, - "numberOfManagedApplicationInstances": { - "value": "[parameters('numberOfManagedApplicationInstances')]" - }, - "wlsDomainName": { - "value": "[parameters('wlsDomainName')]" - }, - "wlsPassword": { - "value": "[parameters('wlsPassword')]" - }, - "wlsUserName": { - "value": "[parameters('wlsUserName')]" - } - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "upgradeMySQLJdbcDriverTemplate", - "condition": "[and(not(parameters('enablePswlessConnection')), equals(parameters('databaseType'),'mysql'))]", - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_dbUpgradeMySQLDriver')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "adminVMName": { - "value": "[parameters('adminVMName')]" - }, - "databaseType": { - "value": "[parameters('databaseType')]" - }, - "enablePswlessConnection": { - "value": "[parameters('enablePswlessConnection')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "managedServerPrefix": { - "value": "[parameters('managedServerPrefix')]" - }, - "managedVMNamePrefix": { - "value": "[parameters('managedVMNamePrefix')]" - }, - "numberOfManagedApplicationInstances": { - "value": "[parameters('numberOfManagedApplicationInstances')]" - }, - "wlsDomainName": { - "value": "[parameters('wlsDomainName')]" - }, - "wlsPassword": { - "value": "[parameters('wlsPassword')]" - }, - "wlsUserName": { - "value": "[parameters('wlsUserName')]" - } - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "passwordDatasourceDeployment", - "condition": "[not(parameters('enablePswlessConnection'))]", - "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', 'upgradeMySQLJdbcDriverTemplate')]" - ], - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_dbLinkedTemplateName')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "adminVMName": { - "value": "[parameters('adminVMName')]" - }, - "databaseType": { - "value": "[parameters('databaseType')]" - }, - "dbGlobalTranPro": { - "value": "[parameters('dbGlobalTranPro')]" - }, - "dbPassword": { - "value": "[parameters('dbPassword')]" - }, - "dbUser": { - "value": "[parameters('dbUser')]" - }, - "dsConnectionURL": { - "value": "[parameters('dsConnectionURL')]" - }, - "enablePswlessConnection": { - "value": "[parameters('enablePswlessConnection')]" - }, - "jdbcDataSourceName": { - "value": "[parameters('jdbcDataSourceName')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "wlsPassword": { - "value": "[parameters('wlsPassword')]" - }, - "wlsUserName": { - "value": "[parameters('wlsUserName')]" - } - } - } - } - ], - "outputs": { - "artifactsLocationPassedIn": { - "type": "string", - "value": "[parameters('_artifactsLocation')]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/dnszonesTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/dnszonesTemplate.json deleted file mode 100644 index f40e26e1e..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/dnszonesTemplate.json +++ /dev/null @@ -1,225 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - } - }, - "_artifactsLocationSasToken": { - "defaultValue": "", - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - } - }, - "_globalResourceNameSuffix": { - "type": "string", - "metadata": { - "description": "A suffix to be appended to all resources created by this template." - } - }, - "dnszonesARecordSetNames": { - "type": "array", - "defaultValue": [], - "metadata": { - "description": "An array of A record names. Used to create A records." - } - }, - "dnszonesCNAMEAlias": { - "type": "array", - "metadata": { - "description": "An array of CNAME record alias. Used to create CNAME records." - }, - "defaultValue": [] - }, - "dnszonesCNAMERecordSetNames": { - "type": "array", - "metadata": { - "description": "An array of CNAME record names. Used to create CNAME record set." - }, - "defaultValue": [] - }, - "dnszoneName": { - "defaultValue": "contoso.xyz", - "type": "string", - "metadata": { - "description": "Azure DNS Zone name." - } - }, - "dnszoneLocation": { - "defaultValue": "global", - "type": "string", - "metadata": { - "description": "Location used to create Azure DNS Zone." - } - }, - "hasDNSZones": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "If true, update A records in the existing DNS Zone, otherwise, create a new DNS Zone and ." - } - }, - "location": { - "type": "string", - "metadata": { - "description": "Location for all resources." - } - }, - "resourceGroup": { - "type": "string", - "defaultValue": "[resourceGroup()]", - "metadata": { - "description": "Name of the resource group that has an Azure DNS Zone deployed." - } - }, - "targetResources": { - "type": "array", - "defaultValue": [], - "metadata": { - "description": "References to Azure resources from where the DNS resource value is taken. Each item is corresponding to values of dnszonesARecordSetNames." - } - }, - "ttl": { - "type": "int", - "defaultValue": 3600, - "metadata": { - "description": "The TTL (time-to-live) of the records in the record sets." - } - }, - "utcValue": { - "type": "string", - "defaultValue": "[utcNow()]", - "metadata": { - "description": "Current deployment time. Used as a tag in deployment script." - } - } - }, - "variables": { - "name_createDNSZoneLinkedTemplateName": "_createDNSZonesTemplate.json", - "name_dnszoneTempaltesFolder": "_dnszones", - "name_updateDNSZoneLinkedTemplateName": "_updateDNSZonesTemplate.json" - }, - "resources": [ - { - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${cluster.dns.start}", - "type": "Microsoft.Resources/deployments", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "apiVersion": "${azure.apiVersionForDeployment}", - "type": "Microsoft.Resources/deployments", - "name": "createDNSZone", - "condition": "[not(parameters('hasDNSZones'))]", - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/',variables('name_dnszoneTempaltesFolder'),'/', variables('name_createDNSZoneLinkedTemplateName')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "dnszonesARecordSetNames": { - "value": "[parameters('dnszonesARecordSetNames')]" - }, - "dnszonesCNAMEAlias": { - "value": "[parameters('dnszonesCNAMEAlias')]" - }, - "dnszonesCNAMERecordSetNames": { - "value": "[parameters('dnszonesCNAMERecordSetNames')]" - }, - "dnszoneName": { - "value": "[parameters('dnszoneName')]" - }, - "location": { - "value": "[parameters('dnszoneLocation')]" - }, - "targetResources": { - "value": "[parameters('targetResources')]" - }, - "ttl": { - "value": "[parameters('ttl')]" - } - } - } - }, - { - "apiVersion": "${azure.apiVersionForDeployment}", - "type": "Microsoft.Resources/deployments", - "name": "updateDNSZone", - "condition": "[parameters('hasDNSZones')]", - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/',variables('name_dnszoneTempaltesFolder'),'/', variables('name_updateDNSZoneLinkedTemplateName')))]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "_artifactsLocation": { - "value": "[parameters('_artifactsLocation')]" - }, - "_artifactsLocationSasToken": { - "value": "[parameters('_artifactsLocationSasToken')]" - }, - "_globalResourceNameSuffix": { - "value": "[parameters('_globalResourceNameSuffix')]" - }, - "dnszonesARecordSetNames": { - "value": "[parameters('dnszonesARecordSetNames')]" - }, - "dnszonesCNAMEAlias": { - "value": "[parameters('dnszonesCNAMEAlias')]" - }, - "dnszonesCNAMERecordSetNames": { - "value": "[parameters('dnszonesCNAMERecordSetNames')]" - }, - "dnszoneName": { - "value": "[parameters('dnszoneName')]" - }, - "location": { - "value": "[parameters('location')]" - }, - "resourceGroup": { - "value": "[parameters('resourceGroup')]" - }, - "targetResources": { - "value": "[parameters('targetResources')]" - }, - "ttl": { - "value": "[parameters('ttl')]" - }, - "utcValue": { - "value": "[parameters('utcValue')]" - } - } - } - }, - { - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${cluster.dns.end}", - "type": "Microsoft.Resources/deployments", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - } - ], - "outputs": { - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/nsgNestedTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/nsgNestedTemplate.json deleted file mode 100644 index e74edab2b..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/nsgNestedTemplate.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "denyPublicTrafficForAdminServer": { - "type": "bool", - "defaultValue": false - }, - "denyPublicTrafficForManagedServer": { - "type": "bool", - "defaultValue": false - }, - "enableOHS": { - "type": "bool", - "defaultValue": false - }, - "networkSecurityGroupName": { - "type": "string", - "metadata": { - "description": "Network Security Group name" - } - } - }, - "variables": { - "const_subnetPrefix": "10.0.0.0/24" - }, - "resources": [ - { - "type": "Microsoft.Network/networkSecurityGroups/securityRules", - "name": "[concat(parameters('networkSecurityGroupName'),'/','WebLogicAdminPortsAllowed')]", - "condition": "[not(parameters('denyPublicTrafficForAdminServer'))]", - "apiVersion": "${azure.apiVersionForNetworkSecurityGroups}", - "properties": { - "protocol": "TCP", - "sourcePortRange": "*", - "destinationAddressPrefix": "*", - "access": "Allow", - "priority": 210, - "direction": "Inbound", - "destinationPortRanges": [ - "7001", - "7002" - ], - "sourceAddressPrefix": "[variables('const_subnetPrefix')]" - } - }, - { - "type": "Microsoft.Network/networkSecurityGroups/securityRules", - "name": "[concat(parameters('networkSecurityGroupName'),'/','WebLogicAdminPortsDenied')]", - "condition": "[parameters('denyPublicTrafficForAdminServer')]", - "apiVersion": "${azure.apiVersionForNetworkSecurityGroups}", - "properties": { - "protocol": "*", - "sourcePortRange": "*", - "destinationAddressPrefix": "*", - "access": "Deny", - "priority": 211, - "direction": "Inbound", - "destinationPortRanges": [ - "7001", - "7002" - ], - "sourceAddressPrefix": "Internet" - } - }, - { - "type": "Microsoft.Network/networkSecurityGroups/securityRules", - "name": "[concat(parameters('networkSecurityGroupName'),'/','WebLogiManagedPortsAllowed')]", - "condition": "[and(not(parameters('denyPublicTrafficForManagedServer')), parameters('enableOHS'))]", - "apiVersion": "${azure.apiVersionForNetworkSecurityGroups}", - "properties": { - "protocol": "*", - "sourcePortRange": "*", - "destinationAddressPrefix": "*", - "access": "Deny", - "priority": 220, - "direction": "Inbound", - "destinationPortRanges": [ - "8002-8999" - ], - "sourceAddressPrefix": "[variables('const_subnetPrefix')]" - } - }, - { - "type": "Microsoft.Network/networkSecurityGroups/securityRules", - "name": "[concat(parameters('networkSecurityGroupName'),'/','WebLogiManagedPortsDenied')]", - "condition": "[and(parameters('denyPublicTrafficForManagedServer'), parameters('enableOHS'))]", - "apiVersion": "${azure.apiVersionForNetworkSecurityGroups}", - "properties": { - "protocol": "*", - "sourcePortRange": "*", - "destinationAddressPrefix": "*", - "access": "Deny", - "priority": 221, - "direction": "Inbound", - "destinationPortRanges": [ - "8002-8999" - ], - "sourceAddressPrefix": "Internet" - } - } - ] -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/ohsNestedTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/ohsNestedTemplate.json deleted file mode 100644 index d1c110e96..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/ohsNestedTemplate.json +++ /dev/null @@ -1,399 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - } - }, - "_artifactsLocationOHSTemplate": { - "defaultValue": "[if(contains(parameters('_artifactsLocation'), 'githubusercontent'), parameters('_artifactsLocation'), deployment().properties.templateLink.uri)]", - "type": "string", - "metadata": { - "description": "If we are deploying from the command line, use the passed in _artifactsLocation, otherwise use the default." - } - }, - "_artifactsLocationSasToken": { - "defaultValue": "", - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - } - }, - "adminPasswordOrKey": { - "type": "securestring", - "metadata": { - "description": "SSH Key or password for the Virtual Machine. SSH key is recommended." - } - }, - "adminRestMgmtURL": { - "type": "string", - "metadata": { - "description": "Provide admin REST management URL" - } - }, - "adminUsername": { - "type": "string", - "metadata": { - "description": "User name for the Virtual Machine." - } - }, - "authenticationType": { - "type": "string", - "defaultValue": "password", - "allowedValues": [ - "sshPublicKey", - "password" - ], - "metadata": { - "description": "Type of authentication to use on the Virtual Machine. SSH key is recommended." - } - }, - "dnsLabelPrefix": { - "type": "string", - "metadata": { - "description": "Unique DNS Name for the Public IP used to access the Virtual Machine." - } - }, - "guidValue": { - "type": "string", - "defaultValue": "[newGuid()]" - }, - "keyType": { - "type": "string", - "defaultValue": "PKCS12", - "allowedValues": [ - "JKS", - "PKCS12" - ], - "metadata": { - "description": "Provide Key type is JKS or PKCS12 signed certificates" - } - }, - "location": { - "type": "string", - "metadata": { - "description": "Location for all resources." - } - }, - "nsgName": { - "type": "string", - "metadata": { - "description": "Name of the Network Security Group." - } - }, - "ohsComponentName": { - "type": "string", - "metadata": { - "description": "Provide OHS component name" - } - }, - "ohsDomainName": { - "type": "string", - "metadata": { - "description": "Provide OHS domain name" - } - }, - "ohsNMPassword": { - "type": "securestring", - "metadata": { - "description": "Password for OHS NodeManager" - } - }, - "ohsNMUser": { - "type": "string", - "metadata": { - "description": "Provide OHS NodeManager user name" - } - }, - "ohsSSLKeystoreData": { - "type": "securestring", - "metadata": { - "description": "The SSL Certificate Data" - } - }, - "ohsSSLKeystorePassword": { - "type": "securestring", - "metadata": { - "description": "The password for the SSL Certificate" - } - }, - "ohsSkuUrnVersion": { - "type": "string", - "defaultValue": "ohs-122140-jdk8-ol76;ohs-122140-jdk8-ol76;latest", - "allowedValues": [ - "ohs-122140-jdk8-ol76;ohs-122140-jdk8-ol76;latest", - "ohs-122140-jdk8-ol74;ohs-122140-jdk8-ol74;latest", - "ohs-122140-jdk8-ol73;ohs-122140-jdk8-ol73;latest" - ], - "metadata": { - "description": "The Oracle Linux image with OHS and Java preinstalled. Semicolon separated string of Sku, URN, and Version" - } - }, - "ohsVMName": { - "type": "string", - "metadata": { - "description": "User name for the Virtual Machine." - } - }, - "ohshttpPort": { - "type": "string", - "metadata": { - "description": "Provide OHS HTTP port" - } - }, - "ohshttpsPort": { - "type": "string", - "metadata": { - "description": "Provide OHS HTTPS port" - } - }, - "oracleVaultPswd": { - "type": "securestring", - "metadata": { - "description": "Password for Oracle Vault required for OHS SSL setup" - } - }, - "storageAccountName": { - "type": "string", - "metadata": { - "description": "Name of storage account. One storage account can store 20 vitual machines with 2 VHDs of 500 IOPS." - } - }, - "subnetName": { - "type": "string", - "defaultValue": "wls-subnet", - "metadata": { - "description": "Name of the existing or new Subnet" - } - }, - "virtualNetworkNewOrExisting": { - "type": "string", - "defaultValue": "new", - "allowedValues": [ - "new", - "existing" - ], - "metadata": { - "description": "Specify whether to create a new or existing virtual network for the VM." - } - }, - "virtualNetworkResourceGroupName": { - "type": "string", - "defaultValue": "[resourceGroup().name]", - "metadata": { - "description": "Resource group of Virtual network" - } - }, - "virtualNetworkName": { - "type": "string", - "metadata": { - "description": "virtual network name." - } - }, - "vmSize": { - "type": "string", - "defaultValue": "Standard_A3", - "metadata": { - "description": "Select appropriate VM Size as per requirement" - } - }, - "wlsPassword": { - "type": "securestring", - "metadata": { - "description": "Provide WebLogic password" - } - }, - "wlsUserName": { - "type": "string", - "metadata": { - "description": "Provide WebLogic username" - } - } - }, - "variables": { - "const_imageOffer": "[variables('name_ohsSkuUrnVersion')[0]]", - "const_imagePublisher": "oracle", - "const_linuxConfiguration": { - "disablePasswordAuthentication": true, - "ssh": { - "publicKeys": [ - { - "path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]", - "keyData": "[parameters('adminPasswordOrKey')]" - } - ] - } - }, - "const_publicIPAddressType": "Dynamic", - "const_vmSize": "[parameters('vmSize')]", - "name_linuxImageOfferSKU": "[variables('name_ohsSkuUrnVersion')[1]]", - "name_linuxImageVersion": "[variables('name_ohsSkuUrnVersion')[2]]", - "name_nic": "_NIC", - "name_ohsSkuUrnVersion": "[split(parameters('ohsSkuUrnVersion'), ';')]", - "name_outputOHSHost": "[concat(parameters('ohsVMName'),variables('name_publicIPAddress'))]", - "name_publicIPAddress": "_PublicIP", - "name_scriptFile": "setupOHS.sh", - "name_subnet": "[parameters('subnetName')]", - "ref_subnet": "[resourceId(parameters('virtualNetworkResourceGroupName'), 'Microsoft.Network/virtualNetworks/subnets', parameters('virtualNetworkName'), variables('name_subnet'))]" - }, - "resources": [ - { - "type": "Microsoft.Network/networkSecurityGroups/securityRules", - "condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'new')]", - "name": "[concat(parameters('nsgName'),'/','OHSPorts')]", - "apiVersion": "${azure.apiVersionForNetworkSecurityGroups}", - "properties": { - "protocol": "TCP", - "sourcePortRange": "*", - "destinationAddressPrefix": "*", - "access": "Allow", - "priority": 300, - "direction": "Inbound", - "destinationPortRanges": "[split(concat(parameters('ohshttpPort'),',',parameters('ohshttpsPort')), ',')]", - "sourceAddressPrefix": "*" - } - }, - { - "apiVersion": "${azure.apiVersionForPublicIPAddresses}", - "type": "Microsoft.Network/publicIPAddresses", - "name": "[concat(parameters('ohsVMName'),variables('name_publicIPAddress'))]", - "location": "[parameters('location')]", - "properties": { - "publicIPAllocationMethod": "[variables('const_publicIPAddressType')]", - "dnsSettings": { - "domainNameLabel": "[concat(toLower(parameters('dnsLabelPrefix')),'-',take(replace(parameters('guidValue'), '-', ''), 10),'-',toLower(parameters('ohsDomainName')))]" - } - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualNetworks}", - "type": "Microsoft.Network/virtualNetworks/subnets", - "name": "[concat(parameters('virtualNetworkName'), '/', variables('name_subnet'))]", - "condition": "[and(empty(parameters('virtualNetworkName')), empty(variables('name_subnet')))]" - }, - { - "apiVersion": "${azure.apiVersionForNetworkInterfaces}", - "type": "Microsoft.Network/networkInterfaces", - "name": "[concat(parameters('ohsVMName'), variables('name_nic'))]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/publicIPAddresses/', concat(parameters('ohsVMName'),variables('name_publicIPAddress')))]" - ], - "properties": { - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses',concat(parameters('ohsVMName'),variables('name_publicIPAddress')))]" - }, - "subnet": { - "id": "[variables('ref_subnet')]" - } - } - } - ], - "dnsSettings": { - "internalDnsNameLabel": "[parameters('ohsVMName')]" - } - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines", - "name": "[parameters('ohsVMName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/networkInterfaces/', concat(parameters('ohsVMName'), variables('name_nic')))]" - ], - "properties": { - "hardwareProfile": { - "vmSize": "[variables('const_vmSize')]" - }, - "osProfile": { - "computerName": "[parameters('ohsVMName')]", - "adminUsername": "[parameters('adminUsername')]", - "adminPassword": "[parameters('adminPasswordOrKey')]", - "linuxConfiguration": "[if(equals(parameters('authenticationType'), 'password'), json('null'), variables('const_linuxConfiguration'))]" - }, - "storageProfile": { - "imageReference": { - "publisher": "[variables('const_imagePublisher')]", - "offer": "[variables('const_imageOffer')]", - "sku": "[variables('name_linuxImageOfferSKU')]", - "version": "[variables('name_linuxImageVersion')]" - }, - "osDisk": { - "createOption": "FromImage", - "managedDisk": { - "storageAccountType": "StandardSSD_LRS" - } - } - }, - "networkProfile": { - "networkInterfaces": [ - { - "id": "[resourceId('Microsoft.Network/networkInterfaces',concat(parameters('ohsVMName'), variables('name_nic')))]" - } - ] - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": true, - "storageUri": "[reference(resourceId('Microsoft.Storage/storageAccounts/', parameters('storageAccountName')), '${azure.apiVersionForStorage}').primaryEndpoints.blob]" - } - } - }, - "plan": { - "name": "[variables('name_linuxImageOfferSKU')]", - "publisher": "[variables('const_imagePublisher')]", - "product": "[variables('const_imageOffer')]" - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines/extensions", - "name": "[concat(parameters('ohsVMName'),'/newuserscript')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/', parameters('ohsVMName'))]" - ], - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.0", - "autoUpgradeMinorVersion": true, - "settings": { - "fileUris": [ - "[uri(parameters('_artifactsLocationOHSTemplate'), concat('../scripts/', variables('name_scriptFile'), parameters('_artifactsLocationSasToken')))]" - ] - }, - "protectedSettings": { - "commandToExecute": "[concat('sh setupOHS.sh',' <<< \"',parameters('ohsDomainName'),' ',parameters('ohsComponentName'),' ',parameters('ohsNMUser'),' ',parameters('ohsNMPassword'),' ',parameters('ohshttpPort'),' ',parameters('ohshttpsPort'),' ',parameters('adminRestMgmtURL'),' ',parameters('wlsUserName'),' ',parameters('wlsPassword'),' ',base64(parameters('ohsSSLKeystoreData')),' ',base64(parameters('ohsSSLKeystorePassword')),' ',parameters('oracleVaultPswd'),' ',parameters('keyType'),'\"')]" - } - } - } - ], - "outputs": { - "_ohsPublicIP": { - "type": "string", - "value": "[resourceId('Microsoft.Network/publicIPAddresses',concat(parameters('ohsVMName'),variables('name_publicIPAddress')))]" - }, - "ohsHostName": { - "type": "string", - "value": "[reference(variables('name_outputOHSHost'), '${azure.apiVersionForPublicIPAddresses}').dnsSettings.fqdn]" - }, - "ohsAccessURL": { - "type": "string", - "value": "[uri(format('http://{0}:{1}',reference(variables('name_outputOHSHost'), '${azure.apiVersionForPublicIPAddresses}').dnsSettings.fqdn,parameters('ohshttpPort')),'')]" - }, - "ohsSecureAccessURL": { - "type": "string", - "value": "[uri(format('https://{0}:{1}',reference(variables('name_outputOHSHost'), '${azure.apiVersionForPublicIPAddresses}').dnsSettings.fqdn,parameters('ohshttpsPort')),'')]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/resources/README.md b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/resources/README.md deleted file mode 100644 index a6c15c46c..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/resources/README.md +++ /dev/null @@ -1,86 +0,0 @@ - - -# What is this stuff? - -Content that goes into the "Marketplace" tab of the offer. - -See [the Marketplace documentation](https://docs.microsoft.com/en-us/azure/marketplace/cloud-partner-portal/virtual-machine/cpp-marketplace-tab) for details. - -When submitting the offer, use content from [https://github.com/oracle/weblogic-azure/tree/main/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources](this directory), but apply the changes in this file on top. - -## Offer Settings - -Offer Id - -20191021-arm-oraclelinux-wls-dynamic-cluster - -Publisher ID - -oracle - -Name - -Oracle WebLogic Server Dynamic Cluster - -## SKU Details - -SKU ID - -20191021-arm-oraclelinux-wls-dynamic-cluster - -Title - -Oracle WebLogic Server Dynamic Cluster - -Summary - -Provisions an n-node Oracle WebLogic Server Dynamic Cluster - -Description - -Provisions an n-node Oracle WebLogic Server dynamic cluster on Oracle Linux 9.1, 8.7 and 7.6 - -SKU Type - -Solution template - -Cloud Availability - -Public azure - -Is this a private SKU - -No - -## Marketplace - -Title - -Oracle WebLogic Server Dynamic Cluster - -Summary - -Provisions an n-node Oracle WebLogic Server Cluster - -Long Summary - -Provisions an n-node Oracle WebLogic Server cluster on Oracle Linux 9.1, 8.7 and 7.6 - -Description - -[description.html](https://raw.githubusercontent.com/oracle/weblogic-azure/main/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/description.html) - -Offer available to Microsoft CSP Reseller channel? * - -No - -Marketing identifier - -weblogic12c-n-dynamic-cluster - -Preview Subscription Ids - -REDACTED diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/scripts/datasourceConfig-mysql.sh b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/scripts/datasourceConfig-mysql.sh deleted file mode 100644 index 65804065b..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/scripts/datasourceConfig-mysql.sh +++ /dev/null @@ -1,186 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# -#read arguments from stdin -read oracleHome wlsAdminHost wlsAdminPort wlsUserName wlsPassword jdbcDataSourceName dsConnectionURL dsUser dsPassword dbGlobalTranPro enablePswlessConnection wlsClusterName - -if [ -z "$wlsClusterName" ]; then - wlsClusterName="cluster1" -fi - -wlsAdminURL=$wlsAdminHost:$wlsAdminPort -hostName=`hostname` - -#Function to output message to StdErr -function echo_stderr () -{ - echo "$@" >&2 -} - -#Function to display usage message -function usage() -{ - echo_stderr "./configDatasource.sh <<< \"\"" -} - -function validateInput() -{ - # parse base64 string - wlsPassword=$(echo "${wlsPassword}" | base64 -d) - jdbcDataSourceName=$(echo "${jdbcDataSourceName}" | base64 -d) - dsConnectionURL=$(echo "${dsConnectionURL}" | base64 -d) - dsPassword=$(echo "${dsPassword}" | base64 -d) - - if [ -z "$oracleHome" ]; - then - echo _stderr "Please provide oracleHome" - exit 1 - fi - - if [ -z "$wlsAdminHost" ]; - then - echo _stderr "Please provide WeblogicServer hostname" - exit 1 - fi - - if [ -z "$wlsAdminPort" ]; - then - echo _stderr "Please provide Weblogic admin port" - exit 1 - fi - - if [ -z "$wlsUserName" ]; - then - echo _stderr "Please provide Weblogic username" - exit 1 - fi - - if [ -z "$wlsPassword" ]; - then - echo _stderr "Please provide Weblogic password" - exit 1 - fi - - if [ -z "$jdbcDataSourceName" ]; - then - echo _stderr "Please provide JDBC datasource name to be configured" - exit 1 - fi - - if [ -z "$dsConnectionURL" ]; - then - echo _stderr "Please provide Azure database of MySQL URL in the format 'jdbc:oracle:thin:@:/'" - exit 1 - fi - - if [ -z "$dsUser" ]; - then - echo _stderr "Please provide Azure database of MySQL user name" - exit 1 - fi - - if [ -z "$dsPassword" ]; - then - echo _stderr "Please provide Azure database of MySQL password" - exit 1 - fi - - if [ -z "$dbGlobalTranPro" ]; - then - echo _stderr "Please provide Global transactions protocol" - exit 1 - fi - - if [ -z "${enablePswlessConnection}" ]; - then - echo _stderr "Please provide enablePswlessConnection to identity if enabling passwordless connection." - exit 1 - fi - - if [ -z "$wlsClusterName" ]; - then - echo _stderr "Please provide Weblogic target cluster name" - exit 1 - fi - - # reset password - if [[ "${enablePswlessConnection,,}" == "true" ]]; then - dsPassword="" - fi -} - -function createJDBCSource_model() -{ - local driverName="com.mysql.jdbc.Driver" - if [[ "${enablePswlessConnection,,}" == "true" ]]; then - driverName="com.mysql.cj.jdbc.Driver" - fi - - echo "Creating JDBC data source with name $jdbcDataSourceName" - cat <${scriptPath}/create_datasource.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -edit("$hostName") -startEdit() -cd('/') -try: - cmo.createJDBCSystemResource('$jdbcDataSourceName') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName') - cmo.setName('$jdbcDataSourceName') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDataSourceParams/$jdbcDataSourceName') - set('JNDINames',jarray.array([String('$jdbcDataSourceName')], String)) - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName') - cmo.setDatasourceType('GENERIC') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDriverParams/$jdbcDataSourceName') - cmo.setUrl('$dsConnectionURL') - cmo.setDriverName('$driverName') - cmo.setPassword('$dsPassword') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCConnectionPoolParams/$jdbcDataSourceName') - cmo.setTestTableName('SQL ISVALID\r\n\r\n\r\n\r\n') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDriverParams/$jdbcDataSourceName/Properties/$jdbcDataSourceName') - cmo.createProperty('user') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDriverParams/$jdbcDataSourceName/Properties/$jdbcDataSourceName/Properties/user') - cmo.setValue('$dsUser') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDataSourceParams/$jdbcDataSourceName') - cmo.setGlobalTransactionsProtocol('${dbGlobalTranPro}') - cd('/JDBCSystemResources/$jdbcDataSourceName') - set('Targets',jarray.array([ObjectName('com.bea:Name=$wlsClusterName,Type=Cluster')], ObjectName)) - save() - resolve() - activate() -except Exception, e: - e.printStackTrace() - dumpStack() - undo('true',defaultAnswer='y') - cancelEdit('y') - destroyEditSession("$hostName",force = true) - raise("$jdbcDataSourceName configuration failed") -destroyEditSession("$hostName",force = true) -disconnect() -EOF -} - -function createTempFolder() -{ - scriptPath="/u01/tmp" - sudo rm -f -r ${scriptPath} - sudo mkdir ${scriptPath} - sudo rm -rf $scriptPath/* -} - -createTempFolder -validateInput -createJDBCSource_model - -sudo chown -R oracle:oracle ${scriptPath} -runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST ${scriptPath}/create_datasource.py" - -errorCode=$? -if [ $errorCode -eq 1 ] -then - echo "Exception occurs during DB configuration, please check." - exit 1 -fi - -echo "Cleaning up temporary files..." -rm -f -r ${scriptPath} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/scripts/datasourceConfig-oracle.sh b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/scripts/datasourceConfig-oracle.sh deleted file mode 100644 index e158c3e28..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/scripts/datasourceConfig-oracle.sh +++ /dev/null @@ -1,180 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# -read oracleHome wlsAdminHost wlsAdminPort wlsUserName wlsPassword jdbcDataSourceName dsConnectionURL dsUser dsPassword dbGlobalTranPro enablePswlessConnection wlsClusterName - -if [ -z ${wlsClusterName} ]; then - wlsClusterName='cluster1' -fi - -wlsAdminURL=$wlsAdminHost:$wlsAdminPort -hostName=`hostname` - -#Function to output message to StdErr -function echo_stderr () -{ - echo "$@" >&2 -} - -#Function to display usage message -function usage() -{ - echo_stderr "./configDatasource.sh <<< \"\"" -} - -function validateInput() -{ - # parse base64 string - wlsPassword=$(echo "${wlsPassword}" | base64 -d) - jdbcDataSourceName=$(echo "${jdbcDataSourceName}" | base64 -d) - dsConnectionURL=$(echo "${dsConnectionURL}" | base64 -d) - dsPassword=$(echo "${dsPassword}" | base64 -d) - - if [ -z "$oracleHome" ]; - then - echo _stderr "Please provide oracleHome" - exit 1 - fi - - if [ -z "$wlsAdminHost" ]; - then - echo _stderr "Please provide WeblogicServer hostname" - exit 1 - fi - - if [ -z "$wlsAdminPort" ]; - then - echo _stderr "Please provide Weblogic admin port" - exit 1 - fi - - if [ -z "$wlsUserName" ]; - then - echo _stderr "Please provide Weblogic username" - exit 1 - fi - - if [ -z "$wlsPassword" ]; - then - echo _stderr "Please provide Weblogic password" - exit 1 - fi - - if [ -z "$jdbcDataSourceName" ]; - then - echo _stderr "Please provide JDBC datasource name to be configured" - exit 1 - fi - - if [ -z "$dsConnectionURL" ]; - then - echo _stderr "Please provide Oracle Database URL in the format 'jdbc:oracle:thin:@:/'" - exit 1 - fi - - if [ -z "$dsUser" ]; - then - echo _stderr "Please provide Oracle Database user name" - exit 1 - fi - - if [ -z "$dsPassword" ]; - then - echo _stderr "Please provide Oracle Database password" - exit 1 - fi - - if [ -z "$dbGlobalTranPro" ]; - then - echo _stderr "Please provide Global transactions protocol" - exit 1 - fi - - if [ -z "$wlsClusterName" ]; - then - echo _stderr "Please provide Weblogic target cluster name" - exit 1 - fi - - if [ -z "${enablePswlessConnection}" ]; - then - echo _stderr "Please provide enablePswlessConnection to identity if enabling passwordless connection." - exit 1 - fi - - # reset password - if [[ "${enablePswlessConnection,,}" == "true" ]]; then - dsPassword="" - fi -} - -function createJDBCSource_model() -{ -echo "Creating JDBC data source with name $jdbcDataSourceName" -cat <${scriptPath}/create_datasource.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -edit("$hostName") -startEdit() -cd('/') -try: - cmo.createJDBCSystemResource('$jdbcDataSourceName') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName') - cmo.setName('$jdbcDataSourceName') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDataSourceParams/$jdbcDataSourceName') - set('JNDINames',jarray.array([String('$jdbcDataSourceName')], String)) - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName') - cmo.setDatasourceType('GENERIC') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDriverParams/$jdbcDataSourceName') - cmo.setUrl('$dsConnectionURL') - cmo.setDriverName('oracle.jdbc.OracleDriver') - cmo.setPassword('$dsPassword') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCConnectionPoolParams/$jdbcDataSourceName') - cmo.setTestTableName('SQL ISVALID\r\n\r\n\r\n\r\n') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDriverParams/$jdbcDataSourceName/Properties/$jdbcDataSourceName') - cmo.createProperty('user') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDriverParams/$jdbcDataSourceName/Properties/$jdbcDataSourceName/Properties/user') - cmo.setValue('$dsUser') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDataSourceParams/$jdbcDataSourceName') - cmo.setGlobalTransactionsProtocol('${dbGlobalTranPro}') - cd('/JDBCSystemResources/$jdbcDataSourceName') - set('Targets',jarray.array([ObjectName('com.bea:Name=$wlsClusterName,Type=Cluster')], ObjectName)) - save() - resolve() - activate() -except Exception, e: - e.printStackTrace() - dumpStack() - undo('true',defaultAnswer='y') - cancelEdit('y') - destroyEditSession("$hostName",force = true) - raise("$jdbcDataSourceName configuration failed") -destroyEditSession("$hostName",force = true) -disconnect() -EOF -} - -function createTempFolder() -{ - scriptPath="/u01/tmp" - sudo rm -f -r ${scriptPath} - sudo mkdir ${scriptPath} - sudo rm -rf $scriptPath/* -} - -createTempFolder -validateInput -createJDBCSource_model - -sudo chown -R oracle:oracle ${scriptPath} -runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST ${scriptPath}/create_datasource.py" - -errorCode=$? -if [ $errorCode -eq 1 ] -then - echo "Exception occurs during DB configuration, please check." - exit 1 -fi - -echo "Cleaning up temporary files..." -rm -f -r ${scriptPath} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/scripts/datasourceConfig-postgresql.sh b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/scripts/datasourceConfig-postgresql.sh deleted file mode 100644 index b29d1dbaf..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/scripts/datasourceConfig-postgresql.sh +++ /dev/null @@ -1,193 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# -read oracleHome wlsAdminHost wlsAdminPort wlsUserName wlsPassword jdbcDataSourceName dsConnectionURL dsUser dsPassword dbGlobalTranPro enablePswlessConnection wlsClusterName - -if [ -z ${wlsClusterName} ]; then - wlsClusterName='cluster1' -fi - -wlsAdminURL=$wlsAdminHost:$wlsAdminPort -hostName=`hostname` - -#Function to output message to StdErr -function echo_stderr () -{ - echo "$@" >&2 -} - -#Function to display usage message -function usage() -{ - echo_stderr "./configDatasource.sh <<< \"\"" -} - -function validateInput() -{ - # parse base64 string - wlsPassword=$(echo "${wlsPassword}" | base64 -d) - jdbcDataSourceName=$(echo "${jdbcDataSourceName}" | base64 -d) - dsConnectionURL=$(echo "${dsConnectionURL}" | base64 -d) - dsPassword=$(echo "${dsPassword}" | base64 -d) - - if [ -z "$oracleHome" ]; - then - echo _stderr "Please provide oracleHome" - exit 1 - fi - - if [ -z "$wlsAdminHost" ]; - then - echo _stderr "Please provide WeblogicServer hostname" - exit 1 - fi - - if [ -z "$wlsAdminPort" ]; - then - echo _stderr "Please provide Weblogic admin port" - exit 1 - fi - - if [ -z "$wlsUserName" ]; - then - echo _stderr "Please provide Weblogic username" - exit 1 - fi - - if [ -z "$wlsPassword" ]; - then - echo _stderr "Please provide Weblogic password" - exit 1 - fi - - if [ -z "$jdbcDataSourceName" ]; - then - echo _stderr "Please provide JDBC datasource name to be configured" - exit 1 - fi - - if [ -z "$dsConnectionURL" ]; - then - echo _stderr "Please provide PostgreSQL Database URL in the format 'jdbc:oracle:thin:@:/'" - exit 1 - fi - - if [ -z "$dsUser" ]; - then - echo _stderr "Please provide PostgreSQL Database user name" - exit 1 - fi - - if [ -z "$dsPassword" ]; - then - echo _stderr "Please provide PostgreSQL Database password" - exit 1 - fi - - if [ -z "$dbGlobalTranPro" ]; - then - echo _stderr "Please provide Global transactions protocol" - exit 1 - fi - - if [ -z "$wlsClusterName" ]; - then - echo _stderr "Please provide Weblogic target cluster name" - exit 1 - fi - - if [ -z "${enablePswlessConnection}" ]; - then - echo _stderr "Please provide enablePswlessConnection to identity if enabling passwordless connection." - exit 1 - fi - - # reset password - if [[ "${enablePswlessConnection,,}" == "true" ]]; then - dsPassword="" - fi -} - -function createJDBCSource_model() -{ -echo "Creating JDBC data source with name $jdbcDataSourceName" -cat <${scriptPath}/create_datasource.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -edit("$hostName") -startEdit() -cd('/') -try: - cmo.createJDBCSystemResource('$jdbcDataSourceName') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName') - cmo.setName('$jdbcDataSourceName') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDataSourceParams/$jdbcDataSourceName') - set('JNDINames',jarray.array([String('$jdbcDataSourceName')], String)) - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName') - cmo.setDatasourceType('GENERIC') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDriverParams/$jdbcDataSourceName') - cmo.setUrl('$dsConnectionURL') - cmo.setDriverName('org.postgresql.Driver') - cmo.setPassword('$dsPassword') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCConnectionPoolParams/$jdbcDataSourceName') - cmo.setTestTableName('SQL ISVALID\r\n\r\n\r\n\r\n') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDriverParams/$jdbcDataSourceName/Properties/$jdbcDataSourceName') - cmo.createProperty('user') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDriverParams/$jdbcDataSourceName/Properties/$jdbcDataSourceName/Properties/user') - cmo.setValue('$dsUser') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDataSourceParams/$jdbcDataSourceName') - cmo.setGlobalTransactionsProtocol('${dbGlobalTranPro}') - cd('/JDBCSystemResources/$jdbcDataSourceName') - set('Targets',jarray.array([ObjectName('com.bea:Name=$wlsClusterName,Type=Cluster')], ObjectName)) - save() - resolve() - activate() -except Exception, e: - e.printStackTrace() - dumpStack() - undo('true',defaultAnswer='y') - cancelEdit('y') - destroyEditSession("$hostName",force = true) - raise("$jdbcDataSourceName configuration failed") -destroyEditSession("$hostName",force = true) -disconnect() -EOF -} - -function createTempFolder() -{ - scriptPath="/u01/tmp" - sudo rm -f -r ${scriptPath} - sudo mkdir ${scriptPath} - sudo rm -rf $scriptPath/* -} - - -# store arguments in a special array -args=("$@") -# get number of elements -ELEMENTS=${#args[@]} - -# echo each element in array -# for loop -#for (( i=0;i <$ELEMENTS;i++)); do -# echo "ARG[${args[${i}]}]" -#done - -createTempFolder -validateInput -createJDBCSource_model - -sudo chown -R oracle:oracle ${scriptPath} -runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST ${scriptPath}/create_datasource.py" - -errorCode=$? -if [ $errorCode -eq 1 ] -then - echo "Exception occurs during DB configuration, please check." - exit 1 -fi - -echo "Cleaning up temporary files..." -rm -f -r ${scriptPath} - diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/scripts/datasourceConfig-sqlserver.sh b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/scripts/datasourceConfig-sqlserver.sh deleted file mode 100644 index fea561da6..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/scripts/datasourceConfig-sqlserver.sh +++ /dev/null @@ -1,181 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# -read oracleHome wlsAdminHost wlsAdminPort wlsUserName wlsPassword jdbcDataSourceName dsConnectionURL dsUser dsPassword dbGlobalTranPro enablePswlessConnection wlsClusterName - -if [ -z ${wlsClusterName} ]; then - wlsClusterName='cluster1' -fi - -wlsAdminURL=$wlsAdminHost:$wlsAdminPort -hostName=`hostname` - -#Function to output message to StdErr -function echo_stderr () -{ - echo "$@" >&2 -} - -#Function to display usage message -function usage() -{ - echo_stderr "./configDatasource.sh <<< \"\"" -} - -function validateInput() -{ - # parse base64 string - wlsPassword=$(echo "${wlsPassword}" | base64 -d) - jdbcDataSourceName=$(echo "${jdbcDataSourceName}" | base64 -d) - dsConnectionURL=$(echo "${dsConnectionURL}" | base64 -d) - dsPassword=$(echo "${dsPassword}" | base64 -d) - - if [ -z "$oracleHome" ]; - then - echo _stderr "Please provide oracleHome" - exit 1 - fi - - if [ -z "$wlsAdminHost" ]; - then - echo _stderr "Please provide WeblogicServer hostname" - exit 1 - fi - - if [ -z "$wlsAdminPort" ]; - then - echo _stderr "Please provide Weblogic admin port" - exit 1 - fi - - if [ -z "$wlsUserName" ]; - then - echo _stderr "Please provide Weblogic username" - exit 1 - fi - - if [ -z "$wlsPassword" ]; - then - echo _stderr "Please provide Weblogic password" - exit 1 - fi - - if [ -z "$jdbcDataSourceName" ]; - then - echo _stderr "Please provide JDBC datasource name to be configured" - exit 1 - fi - - if [ -z "$dsConnectionURL" ]; - then - echo _stderr "Please provide Azure SQL Database URL in the format 'jdbc:oracle:thin:@:/'" - exit 1 - fi - - if [ -z "$dsUser" ]; - then - echo _stderr "Please provide Azure SQL Database user name" - exit 1 - fi - - if [ -z "$dsPassword" ]; - then - echo _stderr "Please provide Azure SQL Database password" - exit 1 - fi - - if [ -z "$dbGlobalTranPro" ]; - then - echo _stderr "Please provide Global transactions protocol" - exit 1 - fi - - if [ -z "$wlsClusterName" ]; - then - echo _stderr "Please provide Weblogic target cluster name" - exit 1 - fi - - if [ -z "${enablePswlessConnection}" ]; - then - echo _stderr "Please provide enablePswlessConnection to identity if enabling passwordless connection." - exit 1 - fi - - # reset password and user - if [[ "${enablePswlessConnection,,}" == "true" ]]; then - dsPassword="" - dsUser="" - fi -} - -function createJDBCSource_model() -{ -echo "Creating JDBC data source with name $jdbcDataSourceName" -cat <${scriptPath}/create_datasource.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -edit("$hostName") -startEdit() -cd('/') -try: - cmo.createJDBCSystemResource('$jdbcDataSourceName') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName') - cmo.setName('$jdbcDataSourceName') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDataSourceParams/$jdbcDataSourceName') - set('JNDINames',jarray.array([String('$jdbcDataSourceName')], String)) - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName') - cmo.setDatasourceType('GENERIC') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDriverParams/$jdbcDataSourceName') - cmo.setUrl('$dsConnectionURL') - cmo.setDriverName('com.microsoft.sqlserver.jdbc.SQLServerDriver') - cmo.setPassword('$dsPassword') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCConnectionPoolParams/$jdbcDataSourceName') - cmo.setTestTableName('SQL ISVALID\r\n\r\n\r\n\r\n') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDriverParams/$jdbcDataSourceName/Properties/$jdbcDataSourceName') - cmo.createProperty('user') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDriverParams/$jdbcDataSourceName/Properties/$jdbcDataSourceName/Properties/user') - cmo.setValue('$dsUser') - cd('/JDBCSystemResources/$jdbcDataSourceName/JDBCResource/$jdbcDataSourceName/JDBCDataSourceParams/$jdbcDataSourceName') - cmo.setGlobalTransactionsProtocol('${dbGlobalTranPro}') - cd('/JDBCSystemResources/$jdbcDataSourceName') - set('Targets',jarray.array([ObjectName('com.bea:Name=$wlsClusterName,Type=Cluster')], ObjectName)) - save() - resolve() - activate() -except Exception, e: - e.printStackTrace() - dumpStack() - undo('true',defaultAnswer='y') - cancelEdit('y') - destroyEditSession("$hostName",force = true) - raise("$jdbcDataSourceName configuration failed") -destroyEditSession("$hostName",force = true) -disconnect() -EOF -} - -function createTempFolder() -{ - scriptPath="/u01/tmp" - sudo rm -f -r ${scriptPath} - sudo mkdir ${scriptPath} - sudo rm -rf $scriptPath/* -} - -createTempFolder -validateInput -createJDBCSource_model - -sudo chown -R oracle:oracle ${scriptPath} -runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST ${scriptPath}/create_datasource.py" - -errorCode=$? -if [ $errorCode -eq 1 ] -then - echo "Exception occurs during DB configuration, please check." - exit 1 -fi - -echo "Cleaning up temporary files..." -rm -f -r ${scriptPath} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/scripts/installJdbcDrivers.sh b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/scripts/installJdbcDrivers.sh deleted file mode 100644 index 186876fe1..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/scripts/installJdbcDrivers.sh +++ /dev/null @@ -1,278 +0,0 @@ -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# Description -# This script is to install jdbc libraries at WebLogic cluster domain. - -# /bin/bash - -#Function to output message to StdErr -function echo_stderr() { - echo "$@" >&2 -} - -#Function to display usage message -function usage() { - echo_stderr "./installJdbcDrivers.sh <<< \"\"" -} - -function validate_input() { - - # parse base64 string - wlsPassword=$(echo "${wlsPassword}" | base64 -d) - - if [ -z "$oracleHome" ]; then - echo _stderr "Please provide oracleHome" - exit 1 - fi - - if [ -z "$domainPath" ]; then - echo _stderr "Please provide domainPath" - exit 1 - fi - - if [ -z "$wlsServerName" ]; then - echo _stderr "Please provide wlsServerName" - exit 1 - fi - - if [ -z "$wlsAdminHost" ]; then - echo _stderr "Please provide wlsAdminHost" - exit 1 - fi - - if [ -z "$wlsAdminPort" ]; then - echo _stderr "Please provide wlsAdminPort" - exit 1 - fi - - if [ -z "$wlsUserName" ]; then - echo _stderr "Please provide wlsUserName" - exit 1 - fi - - if [ -z "$wlsPassword" ]; then - echo _stderr "Please provide wlsPassword" - exit 1 - fi - - if [ -z "$databaseType" ]; then - echo _stderr "Please provide databaseType" - exit 1 - fi - - if [ -z "$enablePswlessConnection" ]; then - echo _stderr "Please provide enablePswlessConnection" - exit 1 - fi -} - -function install_maven() { - local mavenUrl=$(curl -Ls -o /dev/null -w %{url_effective} ${url4MavenInstaller}) - if [ $? != 0 ]; then - echo_stderr "Failed to get maven download url." - fi - curl -m ${curlMaxTime} --retry ${retryMaxAttempt} -fksL "${mavenUrl}" -o ${mvnInstaller} - if [ $? != 0 ]; then - echo_stderr "Failed to download ${mavenUrl}." - fi - - tar xzvf ${mvnInstaller} -C /u01/app - export MAVEN_HOME=$(find /u01/app -maxdepth 1 -type d -name "apache-maven*") - . $oracleHome/oracle_common/common/bin/setWlstEnv.sh # set JAVA_HOME - export PATH=${MAVEN_HOME}/bin:$PATH - - rm ${mvnInstaller} -f - mvn --version - if [ $? != 0 ]; then - echo_stderr "Failed to install maven." - fi -} - -function uninstall_maven() { - sudo rm -f ${MAVEN_HOME} -R -} - -function install_azure_identity_extension() { - local myPomFile=pom.xml - curl -m ${curlMaxTime} --retry ${retryMaxAttempt} -fksL "${gitUrl4AzureIdentityExtensionPomFile}" -o ${myPomFile} - if [ $? != 0 ]; then - echo_stderr "Failed to download ${gitUrl4AzureIdentityExtensionPomFile}." - fi - - echo "download dependencies" - mvn dependency:copy-dependencies -f ${myPomFile} - if [ $? -eq 0 ]; then - ls -l target/dependency/ - - domainBase=$(dirname $domainPath) - - # check if azure identity extension has been installed, if so, remove old version - if [ -d "${domainBase}/azure-libraries/identity" ]; then - sudo rm ${domainBase}/azure-libraries/identity -f -r - sudo rm ${domainBase}/azure-libraries/jackson -f -r - fi - - sudo mkdir -p ${domainBase}/azure-libraries/identity - sudo mkdir -p ${domainBase}/azure-libraries/jackson - # fix JARs conflict issue, put jackson libraries to PRE_CLASSPATH to upgrade the existing libs. - sudo mv target/dependency/jackson-annotations-*.jar ${domainBase}/azure-libraries/jackson - sudo mv target/dependency/jackson-core-*.jar ${domainBase}/azure-libraries/jackson - sudo mv target/dependency/jackson-databind-*.jar ${domainBase}/azure-libraries/jackson - sudo mv target/dependency/jackson-dataformat-xml-*.jar ${domainBase}/azure-libraries/jackson - # Those jars will be appended to CLASSPATH - sudo mv target/dependency/*.jar ${domainBase}/azure-libraries/identity - sudo chown -R oracle:oracle ${domainBase}/azure-libraries - else - echo "Failed to download dependencies for azure-identity-extension" - exit 1 - fi - - rm ${myPomFile} -f - rm target -f -r - if ! grep -q "${domainBase}/azure-libraries/identity/" "${domainPath}/bin/setDomainEnv.sh"; then - sed -i 's;^export DOMAIN_HOME;&\nCLASSPATH="'${domainBase}'/azure-libraries/identity/*:${CLASSPATH}";' ${domainPath}/bin/setDomainEnv.sh - fi - - if ! grep -q "${domainBase}/azure-libraries/jackson/" "${domainPath}/bin/setDomainEnv.sh"; then - sed -i 's;^export DOMAIN_HOME;&\nPRE_CLASSPATH="'${domainBase}'/azure-libraries/jackson/*:${PRE_CLASSPATH}";' ${domainPath}/bin/setDomainEnv.sh - fi -} - -function upgrade_mysql_driver() { - local mysqlPomFile=mysql-pom.xml - curl -m ${curlMaxTime} --retry ${retryMaxAttempt} -fksL "${gitUrl4MySQLDriverPomFile}" -o ${mysqlPomFile} - if [ $? != 0 ]; then - echo_stderr "Failed to download ${gitUrl4MySQLDriverPomFile}." - fi - - echo "download dependencies" - mvn dependency:copy-dependencies -f ${mysqlPomFile} - if [ $? -eq 0 ]; then - ls -l target/dependency/ - - local domainBase=$(dirname $domainPath) - local preClassLibsFolderName=preclasspath-libraries - - # check if the driver has been upgraded, if so, remove old driver - if [ -e ${domainBase}/${preClassLibsFolderName}/mysql-connector-*.jar ]; then - sudo rm ${domainBase}/${preClassLibsFolderName} -f -r - fi - - sudo mkdir ${domainBase}/${preClassLibsFolderName} - sudo mv target/dependency/mysql-connector-*.jar ${domainBase}/${preClassLibsFolderName}/ - sudo chown -R oracle:oracle ${domainBase}/${preClassLibsFolderName} - else - echo "Failed to download mysql driver." - exit 1 - fi - - rm ${mysqlPomFile} -f - rm target -f -r - - if ! grep -q "${domainBase}/preclasspath-libraries/" "${domainPath}/bin/setDomainEnv.sh"; then - sed -i 's;^export DOMAIN_HOME;&\nPRE_CLASSPATH="'${domainBase}'/preclasspath-libraries/*:${PRE_CLASSPATH}";' ${domainPath}/bin/setDomainEnv.sh - fi -} - -#This function to wait for admin server -function wait_for_admin() { - #wait for admin to start - count=1 - CHECK_URL="http://$wlsAdminURL/weblogic/ready" - status=$(curl --insecure -ILs $CHECK_URL | tac | grep -m1 HTTP/1.1 | awk {'print $2'}) - echo "Waiting for admin server to start" - while [[ "$status" != "200" ]]; do - echo "." - count=$((count + 1)) - if [ $count -le 30 ]; then - sleep 1m - else - echo "Error : Maximum attempts exceeded while starting admin server" - exit 1 - fi - status=$(curl --insecure -ILs $CHECK_URL | tac | grep -m1 HTTP/1.1 | awk {'print $2'}) - if [ "$status" == "200" ]; then - echo "Admin Server started succesfully..." - break - fi - done -} - -function restart_admin_service() { - echo "Restart weblogic admin server service" - sudo systemctl stop wls_admin - sudo systemctl start wls_admin - wait_for_admin -} - -function restart_managed_servers() { - echo "Restart managed servers" - cat <${SCRIPT_PWD}/restart-managedServer.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -servers=cmo.getServers() -domainRuntime() -print "Restart the servers which are in RUNNING status" -for server in servers: - bean="/ServerLifeCycleRuntimes/"+server.getName() - serverbean=getMBean(bean) - if (serverbean.getState() in ("RUNNING")) and (server.getName() == '${wlsServerName}'): - try: - print "Stop the Server ",server.getName() - shutdown(server.getName(),server.getType(),ignoreSessions='true',force='true') - print "Start the Server ",server.getName() - start(server.getName(),server.getType()) - break - except: - print "Failed restarting managed server ", server.getName() - dumpStack() -serverConfig() -disconnect() -EOF - . $oracleHome/oracle_common/common/bin/setWlstEnv.sh - java $WLST_ARGS weblogic.WLST ${SCRIPT_PWD}/restart-managedServer.py - - if [[ $? != 0 ]]; then - echo "Error : Fail to restart managed server to configuration external libraries." - exit 1 - fi -} - -#read arguments from stdin -read oracleHome domainPath wlsServerName wlsAdminHost wlsAdminPort wlsUserName wlsPassword databaseType enablePswlessConnection - -export curlMaxTime=120 # seconds -export gitUrl4AzureIdentityExtensionPomFile="https://raw.githubusercontent.com/oracle/weblogic-azure/main/weblogic-azure-aks/src/main/resources/azure-identity-extensions.xml" -export gitUrl4MySQLDriverPomFile="https://raw.githubusercontent.com/oracle/weblogic-azure/main/weblogic-azure-aks/src/main/resources/mysql-connector-java.xml" -export retryMaxAttempt=5 # retry attempt for curl command -export mvnInstaller="apache-maven-bin.tar.gz" - -# 2024-09-11 https://github.com/oracle/weblogic-azure/pull/325 -# Increase maintainability by putting URL behind redirector. As of today -# target is https://dlcdn.apache.org/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.tar.gz -# A better solution would be if Oracle had an employee accessible URL redirector -# service similar to Microsoft's aka.ms. - -export url4MavenInstaller="https://aka.ms/wls-offer-maven-download-url" -export wlsAdminURL=$wlsAdminHost:$wlsAdminPort - -validate_input - -install_maven - -if [ $databaseType == "mysql" ]; then - upgrade_mysql_driver -fi - -if [ "${enablePswlessConnection,,}" == "true" ]; then - if [[ $databaseType == "mysql" || $databaseType == "postgresql" ]]; then - install_azure_identity_extension - fi -fi - -uninstall_maven - -if [ $wlsServerName == "admin" ]; then - restart_admin_service -else - restart_managed_servers -fi diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/scripts/setupCoherence.sh b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/scripts/setupCoherence.sh deleted file mode 100644 index 2cb3b90c1..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/scripts/setupCoherence.sh +++ /dev/null @@ -1,783 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# -#Function to output message to StdErr -function echo_stderr() { - echo "$@" >&2 -} - -#Function to display usage message -function usage() { - echo_stderr "./setupCoherence.sh <<< \"\"" -} - -function installUtilities() { - echo "Installing zip unzip wget vnc-server rng-tools cifs-utils" - sudo yum install -y zip unzip wget vnc-server rng-tools cifs-utils - - #Setting up rngd utils - attempt=1 - while [[ $attempt -lt 4 ]]; do - echo "Starting rngd service attempt $attempt" - sudo systemctl start rngd - attempt=$(expr $attempt + 1) - sudo systemctl status rngd | grep running - if [[ $? == 0 ]]; then - echo "rngd utility service started successfully" - break - fi - sleep 1m - done -} - -function validateInput() { - if [ -z "$wlsDomainName" ]; then - echo_stderr "wlsDomainName is required. " - fi - - if [[ -z "$wlsUserName" || -z "$wlsPassword" ]]; then - echo_stderr "wlsUserName or wlsPassword is required. " - exit 1 - fi - - if [ -z "$wlsServerName" ]; then - echo_stderr "wlsServerName is required. " - fi - - if [ -z "$adminVMName" ]; then - echo_stderr "adminVMName is required. " - fi - - if [ -z "$oracleHome" ]; then - echo_stderr "oracleHome is required. " - fi - - if [ -z "$wlsDomainPath" ]; then - echo_stderr "wlsDomainPath is required. " - fi - - if [ -z "$storageAccountName" ]; then - echo_stderr "storageAccountName is required. " - fi - - if [ -z "$storageAccountKey" ]; then - echo_stderr "storageAccountKey is required. " - fi - - if [ -z "$mountpointPath" ]; then - echo_stderr "mountpointPath is required. " - fi - - if [ -z "$enableWebLocalStorage" ]; then - echo_stderr "enableWebLocalStorage is required. " - fi - - if [ -z "$serverIndex" ]; then - echo_stderr "serverIndex is required. " - fi - - if [ -z "$managedServerPrefix" ]; then - echo_stderr "managedServerPrefix is required. " - fi - - if [ "${isCustomSSLEnabled}" != "true" ]; - then - echo_stderr "Custom SSL value is not provided. Defaulting to false" - isCustomSSLEnabled="false" - else - if [ -z "$customIdentityKeyStoreData" ] || [ -z "$customIdentityKeyStorePassPhrase" ] || - [ -z "$customIdentityKeyStoreType" ] || [ -z "$customTrustKeyStoreData" ] || - [ -z "$customTrustKeyStorePassPhrase" ] || [ -z "$customTrustKeyStoreType" ] || - [ -z "$serverPrivateKeyAlias" ] || [ -z "$serverPrivateKeyPassPhrase" ]; - then - echo "One of the required values for enabling Custom SSL \ - (CustomKeyIdentityKeyStoreData,CustomKeyIdentityKeyStorePassPhrase,CustomKeyIdentityKeyStoreType,CustomKeyTrustKeyStoreData,CustomKeyTrustKeyStorePassPhrase,CustomKeyTrustKeyStoreType) \ - has not been provided." - exit 1 - fi - fi -} - - -# This function verifies whether certificate is valid and not expired -function verifyCertValidity() -{ - KEYSTORE=$1 - PASSWORD=$2 - CURRENT_DATE=$3 - MIN_CERT_VALIDITY=$4 - KEY_STORE_TYPE=$5 - VALIDITY=$(($CURRENT_DATE + ($MIN_CERT_VALIDITY*24*60*60))) - - echo "Verifying $KEYSTORE is valid at least $MIN_CERT_VALIDITY day from the deployment time" - - if [ $VALIDITY -le $CURRENT_DATE ]; - then - echo "Error : Invalid minimum validity days supplied" - exit 1 - fi - - # Check whether KEYSTORE supplied can be opened for reading - # Redirecting as no need to display the contents - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; keytool -list -v -keystore $KEYSTORE -storepass $PASSWORD -storetype $KEY_STORE_TYPE > /dev/null 2>&1" - if [ $? != 0 ]; - then - echo "Error opening the keystore : $KEYSTORE" - exit 1 - fi - - aliasList=`runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; keytool -list -v -keystore $KEYSTORE -storepass $PASSWORD -storetype $KEY_STORE_TYPE | grep Alias" |awk '{print $3}'` - if [[ -z $aliasList ]]; - then - echo "Error : No alias found in supplied certificate" - exit 1 - fi - - for alias in $aliasList - do - VALIDITY_PERIOD=`runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; keytool -list -v -keystore $KEYSTORE -storepass $PASSWORD -storetype $KEY_STORE_TYPE -alias $alias | grep Valid"` - echo "$KEYSTORE is \"$VALIDITY_PERIOD\"" - CERT_UNTIL_DATE=`echo $VALIDITY_PERIOD | awk -F'until:|\r' '{print $2}'` - CERT_UNTIL_SECONDS=`date -d "$CERT_UNTIL_DATE" +%s` - VALIDITY_REMIANS_SECONDS=`expr $CERT_UNTIL_SECONDS - $VALIDITY` - if [[ $VALIDITY_REMIANS_SECONDS -le 0 ]]; - then - echo "Error : Supplied certificate is either expired or expiring soon within $MIN_CERT_VALIDITY day" - exit 1 - fi - done - echo "$KEYSTORE validation is successful" -} - -#run on admin server -#create coherence cluster -#associate cluster1 with the coherence cluster -#create configured cluter storage1 and enable local storage -#associate storage1 with the coherence cluster -function createCoherenceClusterModel() { - cat <$wlsDomainPath/configure-coherence-cluster.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -try: - shutdown('$clientClusterName','Cluster') -except Exception, e: - print e - dumpStack() - -try: - edit() - startEdit(60000,60000,'true') - cd('/') - cmo.createCoherenceClusterSystemResource('${coherenceClusterName}') - Thread.sleep(100) - - cd('/CoherenceClusterSystemResources/${coherenceClusterName}/CoherenceClusterResource/${coherenceClusterName}/CoherenceClusterParams/${coherenceClusterName}') - cmo.setClusteringMode('unicast') - cmo.setClusterListenPort(${coherenceListenPort}) - - cd('/') - cmo.createCluster('${storageClusterName}') - Thread.sleep(100) - - cd('/Clusters/${storageClusterName}') - cmo.setClusterMessagingMode('unicast') - cmo.setCoherenceClusterSystemResource(getMBean('/CoherenceClusterSystemResources/${coherenceClusterName}')) - - cd('/Clusters/${clientClusterName}') - cmo.setCoherenceClusterSystemResource(getMBean('/CoherenceClusterSystemResources/${coherenceClusterName}')) - - cd('/CoherenceClusterSystemResources/${coherenceClusterName}') - cmo.addTarget(getMBean('/Clusters/${storageClusterName}')) - cmo.addTarget(getMBean('/Clusters/${clientClusterName}')) - - cd('/Clusters/${storageClusterName}/CoherenceTier/${storageClusterName}') - cmo.setCoherenceWebLocalStorageEnabled(${enableWebLocalStorage}) - cmo.setLocalStorageEnabled(true) - - cd('/Clusters/${clientClusterName}/CoherenceTier/${clientClusterName}') - cmo.setLocalStorageEnabled(false) - - cd('/ServerTemplates/${wlsServerTemplate}//ServerStart/${wlsServerTemplate}') - arguments = cmo.getArguments() - if(str(arguments) == 'None'): - arguments = '${wlsCoherenceUnicastPortRange}' - else: - arguments = str(arguments) + ' ' + '${wlsCoherenceUnicastPortRange}' - cmo.setArguments(arguments) - - save() - activate() -except Exception, e : - print e - dumpStack() - stopEdit('y') - sys.exit(1) - -try: - start('$clientClusterName', 'Cluster') -except: - dumpStack() - -disconnect() -sys.exit(0) -EOF - - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST $wlsDomainPath/configure-coherence-cluster.py" - if [[ $? != 0 ]]; then - echo "Error : Create coherence cluster ${coherenceClusterName} failed" - exit 1 - fi -} - -#Creates weblogic deployment model for cluster domain managed server -function create_managed_model() { - echo "Creating admin domain model" - cat <$wlsDomainPath/managed-domain.yaml -domainInfo: - AdminUserName: "$wlsUserName" - AdminPassword: "$wlsPassword" - ServerStartMode: prod -topology: - Name: "$wlsDomainName" - Machine: - '$nmHost': - NodeManager: - ListenAddress: "$nmHost" - ListenPort: $nmPort - NMType : ssl - Cluster: - '$storageClusterName': - MigrationBasis: 'database' - Server: - '$wlsServerName' : - ListenPort: $storageListenPort - Notes: "$wlsServerName managed server" - Cluster: "$storageClusterName" - Machine: "$nmHost" - ServerStart: - Arguments: '${SERVER_STARTUP_ARGS}' -EOF - - if [ "${isCustomSSLEnabled}" == "true" ]; - then -cat <>$wlsDomainPath/managed-domain.yaml - KeyStores: 'CustomIdentityAndCustomTrust' - CustomIdentityKeyStoreFileName: "$customIdentityKeyStoreFileName" - CustomIdentityKeyStoreType: "$customIdentityKeyStoreType" - CustomIdentityKeyStorePassPhraseEncrypted: "$customIdentityKeyStorePassPhrase" - CustomTrustKeyStoreFileName: "$customTrustKeyStoreFileName" - CustomTrustKeyStoreType: "$customTrustKeyStoreType" - CustomTrustKeyStorePassPhraseEncrypted: "$customTrustKeyStorePassPhrase" -EOF - fi - -cat <>$wlsDomainPath/managed-domain.yaml - SSL: - HostnameVerificationIgnored: true - HostnameVerifier: 'None' -EOF - - if [ "${isCustomSSLEnabled}" == "true" ]; - then -cat <>$wlsDomainPath/managed-domain.yaml - ServerPrivateKeyAlias: "$serverPrivateKeyAlias" - ServerPrivateKeyPassPhraseEncrypted: "$serverPrivateKeyPassPhrase" -EOF - fi - -cat <>$wlsDomainPath/managed-domain.yaml - SecurityConfiguration: - NodeManagerUsername: "$wlsUserName" - NodeManagerPasswordEncrypted: "$wlsPassword" -EOF - -} - -#This function to add machine for a given managed server -function create_machine_model() { - echo "Creating machine name model for managed server $wlsServerName" - cat <$wlsDomainPath/add-machine.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -edit("$wlsServerName") -startEdit(60000,60000,'true') -cd('/') -cmo.createMachine('$nmHost') -Thread.sleep(100) -cd('/Machines/$nmHost/NodeManager/$nmHost') -cmo.setListenPort(int($nmPort)) -cmo.setListenAddress('$nmHost') -cmo.setNMType('ssl') -save() -resolve() -activate() -destroyEditSession("$wlsServerName") -disconnect() -EOF -} - -#This function to add managed serverto admin node -function create_ms_server_model() { - echo "Creating managed server $wlsServerName model" - cat <$wlsDomainPath/add-server.py - -isCustomSSLEnabled='${isCustomSSLEnabled}' -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -edit("$wlsServerName") -startEdit(60000,60000,'true') -cd('/') -cmo.createServer('$wlsServerName') -Thread.sleep(100) -cd('/Servers/$wlsServerName') -cmo.setMachine(getMBean('/Machines/$nmHost')) -cmo.setCluster(getMBean('/Clusters/$storageClusterName')) -cmo.setListenAddress('$nmHost') -cmo.setListenPort(int($storageListenPort)) -cmo.setListenPortEnabled(true) - -if isCustomSSLEnabled == 'true' : - cmo.setKeyStores('CustomIdentityAndCustomTrust') - cmo.setCustomIdentityKeyStoreFileName('$customIdentityKeyStoreFileName') - cmo.setCustomIdentityKeyStoreType('$customIdentityKeyStoreType') - set('CustomIdentityKeyStorePassPhrase', '$customIdentityKeyStorePassPhrase') - cmo.setCustomTrustKeyStoreFileName('$customTrustKeyStoreFileName') - cmo.setCustomTrustKeyStoreType('$customTrustKeyStoreType') - set('CustomTrustKeyStorePassPhrase', '$customTrustKeyStorePassPhrase') - -cd('/Servers/$wlsServerName/SSL/$wlsServerName') -cmo.setServerPrivateKeyAlias('$serverPrivateKeyAlias') -set('ServerPrivateKeyPassPhrase', '$serverPrivateKeyPassPhrase') -cmo.setHostnameVerificationIgnored(true) - -cd('/Servers/$wlsServerName//ServerStart/$wlsServerName') -arguments = '${SERVER_STARTUP_ARGS} -Dweblogic.Name=$wlsServerName -Dweblogic.management.server=http://$wlsAdminURL ${wlsCoherenceUnicastPortRange}' -oldArgs = cmo.getArguments() -if oldArgs != None: - newArgs = oldArgs + ' ' + arguments -else: - newArgs = arguments -cmo.setArguments(newArgs) -save() -resolve() -activate() -destroyEditSession("$wlsServerName") -nmEnroll('$wlsDomainPath/$wlsDomainName','$wlsDomainPath/$wlsDomainName/nodemanager') -nmGenBootStartupProps('$wlsServerName') -disconnect() -EOF -} - -#This function to check admin server status -function wait_for_admin() { - #check admin server status - count=1 - CHECK_URL="http://$wlsAdminURL/weblogic/ready" - status=$(curl --insecure -ILs $CHECK_URL | tac | grep -m1 HTTP/1.1 | awk {'print $2'}) - echo "Check admin server status" - while [[ "$status" != "200" ]]; do - echo "." - count=$((count + 1)) - if [ $count -le 30 ]; then - sleep 1m - else - echo "Error : Maximum attempts exceeded while checking admin server status" - exit 1 - fi - status=$(curl --insecure -ILs $CHECK_URL | tac | grep -m1 HTTP/1.1 | awk {'print $2'}) - if [ "$status" == "200" ]; then - echo "WebLogic Server is running..." - break - fi - done -} - -# Create systemctl service for nodemanager -function createNodeManagerService() { - echo "Setting CrashRecoveryEnabled true at $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties" - sed -i.bak -e 's/CrashRecoveryEnabled=false/CrashRecoveryEnabled=true/g' $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - if [ $? != 0 ]; then - echo "Warning : Failed in setting option CrashRecoveryEnabled=true. Continuing without the option." - mv $wlsDomainPath/nodemanager/nodemanager.properties.bak $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - fi - - if [ "${isCustomSSLEnabled}" == "true" ]; - then - echo "KeyStores=CustomIdentityAndCustomTrust" >> $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomIdentityKeystoreType=${customIdentityKeyStoreType}" >> $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomIdentityKeyStoreFileName=${customIdentityKeyStoreFileName}" >> $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomIdentityKeyStorePassPhrase=${customIdentityKeyStorePassPhrase}" >> $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomIdentityAlias=${serverPrivateKeyAlias}" >> $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomIdentityPrivateKeyPassPhrase=${serverPrivateKeyPassPhrase}" >> $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomTrustKeystoreType=${customTrustKeyStoreType}" >> $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomTrustKeyStoreFileName=${customTrustKeyStoreFileName}" >> $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomTrustKeyStorePassPhrase=${customTrustKeyStorePassPhrase}" >> $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties - fi - - sudo chown -R $username:$groupname $wlsDomainPath/$wlsDomainName/nodemanager/nodemanager.properties* - echo "Creating NodeManager service" - # Added waiting for network-online service and restart service - cat </etc/systemd/system/wls_nodemanager.service -[Unit] -Description=WebLogic nodemanager service -After=network-online.target -Wants=network-online.target - -[Service] -Type=simple -# Note that the following three parameters should be changed to the correct paths -# on your own system -WorkingDirectory=/u01/domains -Environment="JAVA_OPTIONS=${SERVER_STARTUP_ARGS}" -ExecStart=/bin/bash $wlsDomainPath/$wlsDomainName/bin/startNodeManager.sh -ExecStop=/bin/bash $wlsDomainPath/$wlsDomainName/bin/stopNodeManager.sh -User=oracle -Group=oracle -KillMode=process -LimitNOFILE=65535 -Restart=always -RestartSec=3 - -[Install] -WantedBy=multi-user.target -EOF -} - -#This function to start managed server -function startManagedServer() { - echo "Starting managed server $wlsServerName" - cat <$wlsDomainPath/start-server.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -try: - start('$wlsServerName', 'Server') -except: - print "Failed starting managed server $wlsServerName" - dumpStack() -disconnect() -EOF - sudo chown -R $username:$groupname $wlsDomainPath - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST $wlsDomainPath/start-server.py" - if [[ $? != 0 ]]; then - echo "Error : Failed in starting managed server $wlsServerName" - exit 1 - fi -} - -# Create managed server setup -function createManagedSetup() { - echo "Creating Managed Server Setup" - cd $wlsDomainPath - - # WebLogic base images are already having weblogic-deploy, hence no need to download - if [ ! -d "$wlsDomainPath/weblogic-deploy" ]; - then - echo "weblogic-deploy tool not found in path $wlsDomainPath" - exit 1 - fi - - echo "Creating managed server model files" - create_managed_model - create_machine_model - create_ms_server_model - echo "Completed managed server model files" - sudo chown -R $username:$groupname $wlsDomainPath - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; $wlsDomainPath/weblogic-deploy/bin/createDomain.sh -oracle_home $oracleHome -domain_parent $wlsDomainPath -domain_type WLS -model_file $wlsDomainPath/managed-domain.yaml" - if [[ $? != 0 ]]; then - echo "Error : Managed setup failed" - exit 1 - fi - wait_for_admin - - # For issue https://github.com/wls-eng/arm-oraclelinux-wls/issues/89 - getSerializedSystemIniFileFromShare - - echo "Adding machine to managed server $wlsServerName" - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST $wlsDomainPath/add-machine.py" - if [[ $? != 0 ]]; then - echo "Error : Adding machine for managed server $wlsServerName failed" - exit 1 - fi - echo "Adding managed server $wlsServerName" - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST $wlsDomainPath/add-server.py" - if [[ $? != 0 ]]; then - echo "Error : Adding server $wlsServerName failed" - exit 1 - fi -} - -function enabledAndStartNodeManagerService() { - sudo systemctl enable wls_nodemanager - sudo systemctl daemon-reload - attempt=1 - while [[ $attempt -lt 6 ]]; do - echo "Starting nodemanager service attempt $attempt" - sudo systemctl start wls_nodemanager - attempt=$(expr $attempt + 1) - sudo systemctl status wls_nodemanager | grep running - if [[ $? == 0 ]]; then - echo "wls_nodemanager service started successfully" - break - fi - sleep 3m - done -} - -function cleanup() { - echo "Cleaning up temporary files..." - rm -rf $wlsDomainPath/managed-domain.yaml - rm -rf $wlsDomainPath/*.py - rm -rf ${CUSTOM_HOSTNAME_VERIFIER_HOME} - echo "Cleanup completed." -} - -function openPortsForCoherence() { - # for Oracle Linux 7.3, 7.4, iptable is not running. - if [ -z $(command -v firewall-cmd) ]; then - return 0 - fi - - # for Oracle Linux 7.6, open weblogic ports - echo "update network rules for managed server" - sudo firewall-cmd --zone=public --add-port=$coherenceListenPort/tcp - sudo firewall-cmd --zone=public --add-port=$coherenceListenPort/udp - sudo firewall-cmd --zone=public --add-port=$storageListenPort/tcp - - sudo firewall-cmd --zone=public --add-port=$coherenceLocalport-$coherenceLocalportAdjust/tcp - sudo firewall-cmd --zone=public --add-port=$coherenceLocalport-$coherenceLocalportAdjust/udp - # Coherence TcpRing/IpMonitor port 7 - sudo firewall-cmd --zone=public --add-port=7/tcp - sudo firewall-cmd --zone=public --add-port=$nmPort/tcp - - sudo firewall-cmd --runtime-to-permanent - sudo systemctl restart firewalld -} - -# Mount the Azure file share on all VMs created -function mountFileShare() { - echo "Creating mount point" - echo "Mount point: $mountpointPath" - sudo mkdir -p $mountpointPath - if [ ! -d "/etc/smbcredentials" ]; then - sudo mkdir /etc/smbcredentials - fi - if [ ! -f "/etc/smbcredentials/${storageAccountName}.cred" ]; then - echo "Crearing smbcredentials" - echo "username=$storageAccountName >> /etc/smbcredentials/${storageAccountName}.cred" - echo "password=$storageAccountKey >> /etc/smbcredentials/${storageAccountName}.cred" - sudo bash -c "echo "username=$storageAccountName" >> /etc/smbcredentials/${storageAccountName}.cred" - sudo bash -c "echo "password=$storageAccountKey" >> /etc/smbcredentials/${storageAccountName}.cred" - fi - echo "chmod 600 /etc/smbcredentials/${storageAccountName}.cred" - sudo chmod 600 /etc/smbcredentials/${storageAccountName}.cred - echo "//${storageAccountName}.file.core.windows.net/wlsshare $mountpointPath cifs nofail,vers=2.1,credentials=/etc/smbcredentials/${storageAccountName}.cred,dir_mode=0777,file_mode=0777,serverino" - sudo bash -c "echo \"//${storageAccountName}.file.core.windows.net/wlsshare $mountpointPath cifs nofail,vers=2.1,credentials=/etc/smbcredentials/${storageAccountName}.cred,dir_mode=0777,file_mode=0777,serverino\" >> /etc/fstab" - echo "mount -t cifs //${storageAccountName}.file.core.windows.net/wlsshare $mountpointPath -o vers=2.1,credentials=/etc/smbcredentials/${storageAccountName}.cred,dir_mode=0777,file_mode=0777,serverino" - sudo mount -t cifs //${storageAccountName}.file.core.windows.net/wlsshare $mountpointPath -o vers=2.1,credentials=/etc/smbcredentials/${storageAccountName}.cred,dir_mode=0777,file_mode=0777,serverino - if [[ $? != 0 ]]; then - echo "Failed to mount //${storageAccountName}.file.core.windows.net/wlsshare $mountpointPath" - exit 1 - fi -} - -# Get SerializedSystemIni.dat file from share point to managed server vm -function getSerializedSystemIniFileFromShare() { - runuser -l oracle -c "mv ${wlsDomainPath}/${wlsDomainName}/security/SerializedSystemIni.dat ${wlsDomainPath}/${wlsDomainName}/security/SerializedSystemIni.dat.backup" - runuser -l oracle -c "cp ${mountpointPath}/SerializedSystemIni.dat ${wlsDomainPath}/${wlsDomainName}/security/." - ls -lt ${wlsDomainPath}/${wlsDomainName}/security/SerializedSystemIni.dat - if [[ $? != 0 ]]; then - echo "Failed to get ${mountpointPath}/SerializedSystemIni.dat" - exit 1 - fi - runuser -l oracle -c "chmod 640 ${wlsDomainPath}/${wlsDomainName}/security/SerializedSystemIni.dat" -} - -function validateSSLKeyStores() -{ - sudo chown -R $username:$groupname $KEYSTORE_PATH - - #validate identity keystore - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; keytool -list -v -keystore $customIdentityKeyStoreFileName -storepass $customIdentityKeyStorePassPhrase -storetype $customIdentityKeyStoreType | grep 'Entry type:' | grep 'PrivateKeyEntry'" - - if [[ $? != 0 ]]; then - echo "Error : Identity Keystore Validation Failed !!" - exit 1 - fi - - # Verify Identity keystore validity period more than MIN_CERT_VALIDITY - verifyCertValidity $customIdentityKeyStoreFileName $customIdentityKeyStorePassPhrase $CURRENT_DATE $MIN_CERT_VALIDITY $customIdentityKeyStoreType - - #validate Trust keystore - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; keytool -list -v -keystore $customTrustKeyStoreFileName -storepass $customTrustKeyStorePassPhrase -storetype $customTrustKeyStoreType | grep 'Entry type:' | grep 'trustedCertEntry'" - - if [[ $? != 0 ]]; then - echo "Error : Trust Keystore Validation Failed !!" - exit 1 - fi - - # Verify Identity keystore validity period more than MIN_CERT_VALIDITY - verifyCertValidity $customTrustKeyStoreFileName $customTrustKeyStorePassPhrase $CURRENT_DATE $MIN_CERT_VALIDITY $customTrustKeyStoreType - - echo "ValidateSSLKeyStores Successfull !!" -} - -function storeCustomSSLCerts() -{ - if [ "${isCustomSSLEnabled}" == "true" ]; - then - - mkdir -p $KEYSTORE_PATH - - echo "Custom SSL is enabled. Storing CertInfo as files..." - customIdentityKeyStoreFileName="$KEYSTORE_PATH/identity.keystore" - customTrustKeyStoreFileName="$KEYSTORE_PATH/trust.keystore" - - customIdentityKeyStoreData=$(echo "$customIdentityKeyStoreData" | base64 --decode) - customIdentityKeyStorePassPhrase=$(echo "$customIdentityKeyStorePassPhrase" | base64 --decode) - - customTrustKeyStoreData=$(echo "$customTrustKeyStoreData" | base64 --decode) - customTrustKeyStorePassPhrase=$(echo "$customTrustKeyStorePassPhrase" | base64 --decode) - - serverPrivateKeyAlias=$(echo "$serverPrivateKeyAlias" | base64 --decode) - serverPrivateKeyPassPhrase=$(echo "$serverPrivateKeyPassPhrase" | base64 --decode) - - #decode cert data once again as it would got base64 encoded while uploading - echo "$customIdentityKeyStoreData" | base64 --decode > $customIdentityKeyStoreFileName - echo "$customTrustKeyStoreData" | base64 --decode > $customTrustKeyStoreFileName - - validateSSLKeyStores - - else - echo "Custom SSL is not enabled" - fi -} - -function generateCustomHostNameVerifier() -{ - mkdir -p ${CUSTOM_HOSTNAME_VERIFIER_HOME} - mkdir -p ${CUSTOM_HOSTNAME_VERIFIER_HOME}/src/main/java - mkdir -p ${CUSTOM_HOSTNAME_VERIFIER_HOME}/src/test/java - cp ${BASE_DIR}/generateCustomHostNameVerifier.sh ${CUSTOM_HOSTNAME_VERIFIER_HOME}/generateCustomHostNameVerifier.sh - cp ${BASE_DIR}/WebLogicCustomHostNameVerifier.java ${CUSTOM_HOSTNAME_VERIFIER_HOME}/src/main/java/WebLogicCustomHostNameVerifier.java - cp ${BASE_DIR}/HostNameValuesTemplate.txt ${CUSTOM_HOSTNAME_VERIFIER_HOME}/src/main/java/HostNameValuesTemplate.txt - cp ${BASE_DIR}/WebLogicCustomHostNameVerifierTest.java ${CUSTOM_HOSTNAME_VERIFIER_HOME}/src/test/java/WebLogicCustomHostNameVerifierTest.java - chown -R $username:$groupname ${CUSTOM_HOSTNAME_VERIFIER_HOME} - chmod +x ${CUSTOM_HOSTNAME_VERIFIER_HOME}/generateCustomHostNameVerifier.sh - - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; ${CUSTOM_HOSTNAME_VERIFIER_HOME}/generateCustomHostNameVerifier.sh ${adminVMName} ${customDNSNameForAdminServer} ${customDNSNameForAdminServer} ${dnsLabelPrefix} ${wlsDomainName} ${location}" -} - -function copyCustomHostNameVerifierJarsToWebLogicClasspath() -{ - runuser -l oracle -c "cp ${CUSTOM_HOSTNAME_VERIFIER_HOME}/output/*.jar $oracleHome/wlserver/server/lib/;" - - echo "Modify WLS CLASSPATH to include hostname verifier jars...." - sed -i 's;^WEBLOGIC_CLASSPATH="${WL_HOME}/server/lib/postgresql.*;&\nWEBLOGIC_CLASSPATH="${WL_HOME}/server/lib/hostnamevalues.jar:${WL_HOME}/server/lib/weblogicustomhostnameverifier.jar:${WEBLOGIC_CLASSPATH}";' $oracleHome/oracle_common/common/bin/commExtEnv.sh - echo "Modified WLS CLASSPATH to include hostname verifier jars." -} - - -function configureCustomHostNameVerifier() -{ - echo "configureCustomHostNameVerifier for domain $wlsDomainName for server $wlsServerName" - cat <$DOMAIN_PATH/configureCustomHostNameVerifier.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -try: - edit("$wlsServerName") - startEdit() - - cd('/Servers/$wlsServerName/SSL/$wlsServerName') - cmo.setHostnameVerifier('com.oracle.azure.weblogic.security.util.WebLogicCustomHostNameVerifier') - cmo.setHostnameVerificationIgnored(false) - cmo.setTwoWaySSLEnabled(false) - cmo.setClientCertificateEnforced(false) - - save() - activate() -except Exception,e: - print e - print "Failed to configureCustomHostNameVerifier for domain $wlsDomainName" - dumpStack() - raise Exception('Failed to configureCustomHostNameVerifier for domain $wlsDomainName') -disconnect() -EOF -sudo chown -R $username:$groupname $DOMAIN_PATH -runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST $DOMAIN_PATH/configureCustomHostNameVerifier.py" -if [[ $? != 0 ]]; then - echo "Error : Failed to configureCustomHostNameVerifier for domain $wlsDomainName" - exit 1 -fi - -} - -# main script starts from here - -SCRIPT_PWD=$(pwd) -CURR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -BASE_DIR="$(readlink -f ${CURR_DIR})" - -# Used for certificate expiry validation -CURRENT_DATE=`date +%s` -# Supplied certificate to have minimum days validity for the deployment -MIN_CERT_VALIDITY="1" - - -# store arguments in a special array -#args=("$@") -# get number of elements -#ELEMENTS=${#args[@]} - -# echo each element in array -# for loop -#for ((i = 0; i < $ELEMENTS; i++)); do -# echo "ARG[${args[${i}]}]" -#done - -read wlsDomainName wlsUserName wlsPassword adminVMName oracleHome wlsDomainPath storageAccountName storageAccountKey mountpointPath enableWebLocalStorage managedServerPrefix serverIndex customDNSNameForAdminServer dnsLabelPrefix location isCustomSSLEnabled customIdentityKeyStoreData customIdentityKeyStorePassPhrase customIdentityKeyStoreType customTrustKeyStoreData customTrustKeyStorePassPhrase customTrustKeyStoreType serverPrivateKeyAlias serverPrivateKeyPassPhrase - -isCustomSSLEnabled="${isCustomSSLEnabled,,}" - -clientClusterName="cluster1" -coherenceClusterName="myCoherence" -coherenceListenPort=7574 -coherenceLocalport=42000 -coherenceLocalportAdjust=42200 -groupname="oracle" -nmHost=$(hostname) -nmPort=5556 -storageClusterName="storage1" -storageListenPort=7501 -username="oracle" -wlsAdminT3ChannelPort=7005 -wlsAdminURL="${adminVMName}:${wlsAdminT3ChannelPort}" -wlsCoherenceUnicastPortRange="-Dcoherence.localport=$coherenceLocalport -Dcoherence.localport.adjust=$coherenceLocalportAdjust" -wlsServerTemplate="myServerTemplate" -KEYSTORE_PATH="${wlsDomainPath}/${wlsDomainName}/keystores" -SERVER_STARTUP_ARGS="-Dlog4j2.formatMsgNoLookups=true" -CUSTOM_HOSTNAME_VERIFIER_HOME="/u01/app/custom-hostname-verifier" - -if [ ${serverIndex} -eq 0 ]; then - wlsServerName="admin" -else - wlsServerName="${managedServerPrefix}${serverIndex}" -fi - -validateInput -cleanup - -# Executing this function first just to make sure certificate errors are first caught -storeCustomSSLCerts - -if [ $wlsServerName == "admin" ]; then - createCoherenceClusterModel - cleanup -else - installUtilities - mountFileShare - openPortsForCoherence - createManagedSetup - generateCustomHostNameVerifier - copyCustomHostNameVerifierJarsToWebLogicClasspath - createNodeManagerService - enabledAndStartNodeManagerService - configureCustomHostNameVerifier - startManagedServer - cleanup -fi diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/scripts/setupDynamicClusterDomain.sh b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/scripts/setupDynamicClusterDomain.sh deleted file mode 100644 index 1800356ec..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/scripts/setupDynamicClusterDomain.sh +++ /dev/null @@ -1,1121 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# -#Function to output message to StdErr -function echo_stderr () -{ - echo "$@" >&2 -} - -#Function to display usage message -function usage() -{ - echo_stderr "./setDynamicClusterDomain.sh <<< \"\"" -} - -function installUtilities() -{ - echo "Installing zip unzip wget vnc-server rng-tools cifs-utils" - sudo yum install -y zip unzip wget vnc-server rng-tools cifs-utils - - #Setting up rngd utils - sudo systemctl status rngd - sudo systemctl start rngd - sudo systemctl status rngd -} - -function validateInput() -{ - if [ -z "$wlsDomainName" ]; - then - echo_stderr "wlsDomainName is required. " - fi - - if [[ -z "$wlsUserName" || -z "$wlsPassword" ]] - then - echo_stderr "wlsUserName or wlsPassword is required. " - exit 1 - fi - - if [ -z "$managedServerPrefix" ]; - then - echo_stderr "managedServerPrefix is required. " - exit 1 - fi - - if [ -z "$maxDynamicClusterSize" ]; - then - echo_stderr "maxDynamicClusterSize is required. " - exit 1 - fi - - if [ -z "$dynamicClusterSize" ]; - then - echo_stderr "dynamicClusterSize is required. " - exit 1 - fi - - - if [ -z "$vmNamePrefix" ]; - then - echo_stderr "vmNamePrefix is required. " - exit 1 - fi - - if [ -z "$adminVMName" ]; - then - echo_stderr "adminVMName is required. " - exit 1 - fi - - if [ -z "$oracleHome" ]; - then - echo_stderr "oracleHome is required" - exit 1 - fi - - if [ -z "$storageAccountName" ]; - then - echo_stderr "storageAccountName is required. " - exit 1 - fi - - if [ -z "$storageAccountKey" ]; - then - echo_stderr "storageAccountKey is required. " - exit 1 - fi - - if [ -z "$mountpointPath" ]; - then - echo_stderr "mountpointPath is required. " - exit 1 - fi - - if [ "${isCustomSSLEnabled}" != "true" ]; - then - echo_stderr "Custom SSL value is not provided. Defaulting to false" - isCustomSSLEnabled="false" - else - if [ -z "$customIdentityKeyStoreData" ] || [ -z "$customIdentityKeyStorePassPhrase" ] || - [ -z "$customIdentityKeyStoreType" ] || [ -z "$customTrustKeyStoreData" ] || - [ -z "$customTrustKeyStorePassPhrase" ] || [ -z "$customTrustKeyStoreType" ] || - [ -z "$serverPrivateKeyAlias" ] || [ -z "$serverPrivateKeyPassPhrase" ]; - then - echo "One of the required values for enabling Custom SSL \ - (CustomKeyIdentityKeyStoreData,CustomKeyIdentityKeyStorePassPhrase,CustomKeyIdentityKeyStoreType,CustomKeyTrustKeyStoreData,CustomKeyTrustKeyStorePassPhrase,CustomKeyTrustKeyStoreType) \ - has not been provided." - exit 1 - fi - fi - - if [ -z "$virtualNetworkNewOrExisting" ]; - then - echo_stderr "virtualNetworkNewOrExisting is required. " - exit 1 - fi - - if [ -z "$storageAccountPrivateIp" ]; - then - echo_stderr "storageAccountPrivateIp is required. " - exit 1 - fi -} - -#Function to cleanup all temporary files -function cleanup() -{ - echo "Cleaning up temporary files..." - rm -rf $DOMAIN_PATH/admin-domain.yaml - rm -rf $DOMAIN_PATH/managed-domain.yaml - rm -rf $DOMAIN_PATH/*.py - rm -rf ${CUSTOM_HOSTNAME_VERIFIER_HOME} - echo "Cleanup completed." -} - -# This function verifies whether certificate is valid and not expired -function verifyCertValidity() -{ - KEYSTORE=$1 - PASSWORD=$2 - CURRENT_DATE=$3 - MIN_CERT_VALIDITY=$4 - KEY_STORE_TYPE=$5 - VALIDITY=$(($CURRENT_DATE + ($MIN_CERT_VALIDITY*24*60*60))) - - echo "Verifying $KEYSTORE is valid at least $MIN_CERT_VALIDITY day from the deployment time" - - if [ $VALIDITY -le $CURRENT_DATE ]; - then - echo "Error : Invalid minimum validity days supplied" - exit 1 - fi - - # Check whether KEYSTORE supplied can be opened for reading - # Redirecting as no need to display the contents - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; keytool -list -v -keystore $KEYSTORE -storepass $PASSWORD -storetype $KEY_STORE_TYPE > /dev/null 2>&1" - if [ $? != 0 ]; - then - echo "Error opening the keystore : $KEYSTORE" - exit 1 - fi - - aliasList=`runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; keytool -list -v -keystore $KEYSTORE -storepass $PASSWORD -storetype $KEY_STORE_TYPE | grep Alias" |awk '{print $3}'` - if [[ -z $aliasList ]]; - then - echo "Error : No alias found in supplied certificate" - exit 1 - fi - - for alias in $aliasList - do - VALIDITY_PERIOD=`runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; keytool -list -v -keystore $KEYSTORE -storepass $PASSWORD -storetype $KEY_STORE_TYPE -alias $alias | grep Valid"` - echo "$KEYSTORE is \"$VALIDITY_PERIOD\"" - CERT_UNTIL_DATE=`echo $VALIDITY_PERIOD | awk -F'until:|\r' '{print $2}'` - CERT_UNTIL_SECONDS=`date -d "$CERT_UNTIL_DATE" +%s` - VALIDITY_REMIANS_SECONDS=`expr $CERT_UNTIL_SECONDS - $VALIDITY` - if [[ $VALIDITY_REMIANS_SECONDS -le 0 ]]; - then - echo_stderr "$KEYSTORE is \"$VALIDITY_PERIOD\"" - echo_stderr "Error : Supplied certificate $KEYSTORE is either expired or expiring soon within $MIN_CERT_VALIDITY day" - exit 1 - fi - done - echo "$KEYSTORE validation is successful" -} - - -#Creates weblogic deployment model for admin domain -function create_admin_model() -{ - echo "Creating admin domain model" - cat /dev/null > $DOMAIN_PATH/admin-domain.yaml - - cat <$DOMAIN_PATH/admin-domain.yaml -domainInfo: - AdminUserName: "$wlsUserName" - AdminPassword: "$wlsPassword" - ServerStartMode: prod -topology: - Name: "$wlsDomainName" - AdminServerName: admin - Machine: - '$nmHost': - NodeManager: - ListenAddress: "$nmHost" - ListenPort: $nmPort - NMType : ssl - Server: - '$wlsServerName': - ListenPort: $wlsAdminPort - ListenPortEnabled: ${isHTTPAdminListenPortEnabled} - RestartDelaySeconds: 10 - NetworkAccessPoint: - 'adminT3Channel': - ListenAddress: '$adminVMName' - ListenPort: $wlsAdminT3ChannelPort - Protocol: t3 - Enabled: true - ServerStart: - Arguments: '${SERVER_STARTUP_ARGS}' - SSL: - ListenPort: $wlsSSLAdminPort - Enabled: true -EOF - - if [ "${isCustomSSLEnabled}" == "true" ]; - then -cat <>$DOMAIN_PATH/admin-domain.yaml - ServerPrivateKeyAlias: "$serverPrivateKeyAlias" - ServerPrivateKeyPassPhraseEncrypted: "$serverPrivateKeyPassPhrase" - KeyStores: 'CustomIdentityAndCustomTrust' - CustomIdentityKeyStoreFileName: "$customIdentityKeyStoreFileName" - CustomIdentityKeyStoreType: "$customIdentityKeyStoreType" - CustomIdentityKeyStorePassPhraseEncrypted: "$customIdentityKeyStorePassPhrase" - CustomTrustKeyStoreFileName: "$customTrustKeyStoreFileName" - CustomTrustKeyStoreType: "$customTrustKeyStoreType" - CustomTrustKeyStorePassPhraseEncrypted: "$customTrustKeyStorePassPhrase" -EOF - fi - - cat <>$DOMAIN_PATH/admin-domain.yaml - Cluster: - '$wlsClusterName': - MigrationBasis: 'consensus' - DynamicServers: - ServerTemplate: '${dynamicServerTemplate}' - DynamicClusterSize: ${dynamicClusterSize} - MaxDynamicClusterSize: ${maxDynamicClusterSize} - CalculatedListenPorts: true - CalculatedMachineNames: true - ServerNamePrefix: "${managedServerPrefix}" - MachineNameMatchExpression: "$machineNamePrefix-${vmNamePrefix}*" - ServerTemplate: - '${dynamicServerTemplate}' : - ListenPort: ${wlsManagedPort} - Cluster: '${wlsClusterName}' -EOF - - if [ "${isCustomSSLEnabled}" == "true" ]; - then -cat <>$DOMAIN_PATH/admin-domain.yaml - SSL: - ServerPrivateKeyAlias: "$serverPrivateKeyAlias" - ServerPrivateKeyPassPhraseEncrypted: "$serverPrivateKeyPassPhrase" - KeyStores: 'CustomIdentityAndCustomTrust' - CustomIdentityKeyStoreFileName: "$customIdentityKeyStoreFileName" - CustomIdentityKeyStoreType: "$customIdentityKeyStoreType" - CustomIdentityKeyStorePassPhraseEncrypted: "$customIdentityKeyStorePassPhrase" - CustomTrustKeyStoreFileName: "$customTrustKeyStoreFileName" - CustomTrustKeyStoreType: "$customTrustKeyStoreType" - CustomTrustKeyStorePassPhraseEncrypted: "$customTrustKeyStorePassPhrase" -EOF - fi - -cat <>$DOMAIN_PATH/admin-domain.yaml - SecurityConfiguration: - NodeManagerUsername: "$wlsUserName" - NodeManagerPasswordEncrypted: "$wlsPassword" -EOF - -hasRemoteAnonymousAttribs="$(containsRemoteAnonymousT3RMIIAttribs)" -echo "hasRemoteAnonymousAttribs: ${hasRemoteAnonymousAttribs}" - -if [ "${hasRemoteAnonymousAttribs}" == "true" ]; -then -echo "adding settings to disable remote anonymous t3/rmi disabled under domain security configuration" -cat <>$DOMAIN_PATH/admin-domain.yaml - RemoteAnonymousRmiiiopEnabled: false - RemoteAnonymousRmit3Enabled: false -EOF -fi - -} - -#Creates weblogic deployment model for admin domain -function create_managed_model() -{ - echo "Creating admin domain model" - cat <$DOMAIN_PATH/managed-domain.yaml -domainInfo: - AdminUserName: "$wlsUserName" - AdminPassword: "$wlsPassword" - ServerStartMode: prod -topology: - Name: "$wlsDomainName" - Machine: - '$machineName': - NodeManager: - ListenAddress: "$nmHost" - ListenPort: $nmPort - NMType: "ssl" - Cluster: - '$wlsClusterName': - MigrationBasis: 'consensus' - DynamicServers: - ServerTemplate: '${dynamicServerTemplate}' - DynamicClusterSize: ${dynamicClusterSize} - MaxDynamicClusterSize: ${maxDynamicClusterSize} - CalculatedListenPorts: true - CalculatedMachineNames: true - ServerNamePrefix: "${managedServerPrefix}" - MachineNameMatchExpression: "machine-${vmNamePrefix}*" - ServerTemplate: - '${dynamicServerTemplate}': - ListenPort: ${wlsManagedPort} - Cluster: '${wlsClusterName}' -EOF - if [ "${isCustomSSLEnabled}" == "true" ]; - then -cat <>$DOMAIN_PATH/managed-domain.yaml - SSL: - ServerPrivateKeyAlias: "$serverPrivateKeyAlias" - ServerPrivateKeyPassPhraseEncrypted: "$serverPrivateKeyPassPhrase" - KeyStores: 'CustomIdentityAndCustomTrust' - CustomIdentityKeyStoreFileName: "$customIdentityKeyStoreFileName" - CustomIdentityKeyStoreType: "$customIdentityKeyStoreType" - CustomIdentityKeyStorePassPhraseEncrypted: "$customIdentityKeyStorePassPhrase" - CustomTrustKeyStoreFileName: "$customTrustKeyStoreFileName" - CustomTrustKeyStoreType: "$customTrustKeyStoreType" - CustomTrustKeyStorePassPhraseEncrypted: "$customTrustKeyStorePassPhrase" -EOF - fi - -cat <>$DOMAIN_PATH/managed-domain.yaml - SecurityConfiguration: - NodeManagerUsername: "$wlsUserName" - NodeManagerPasswordEncrypted: "$wlsPassword" -EOF - -hasRemoteAnonymousAttribs="$(containsRemoteAnonymousT3RMIIAttribs)" -echo "hasRemoteAnonymousAttribs: ${hasRemoteAnonymousAttribs}" - -if [ "${hasRemoteAnonymousAttribs}" == "true" ]; -then -echo "adding settings to disable remote anonymous t3/rmi disabled under domain security configuration" -cat <>$DOMAIN_PATH/managed-domain.yaml - RemoteAnonymousRmiiiopEnabled: false - RemoteAnonymousRmit3Enabled: false -EOF -fi -} - -#This function create py Script to create Machine on the Domain -function createMachinePyScript() -{ - -# Exclusive lock is used for startEdit, without that intermittently it is noticed that deployment fails -# Refer issue https://github.com/wls-eng/arm-oraclelinux-wls/issues/280 - - echo "Creating machine name model: $machineName" - cat <$DOMAIN_PATH/add-machine.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') - -try: - shutdown('$wlsClusterName','Cluster') -except Exception, e: - print e - -edit() -startEdit(60000,60000,'true') -cd('/') -cmo.createMachine('$machineName') -cd('/Machines/$machineName/NodeManager/$machineName') -cmo.setListenPort(int($nmPort)) -cmo.setListenAddress('$nmHost') -cmo.setNMType('ssl') -save() -activate() -disconnect() -EOF -} - - -#This function sets the server startup arguments to dynamic server template -function createServerStartArgumentPyScript() -{ - -# Exclusive lock is used for startEdit, without that intermittently it is noticed that deployment fails -# Refer issue https://github.com/wls-eng/arm-oraclelinux-wls/issues/280 - - echo "setting server startup arguments for Dynamic Server Template: ${wlsServerTemplate}" - cat <$DOMAIN_PATH/setServerStartArgs.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') - -try: - edit() - startEdit(60000,60000,'true') - cd('/ServerTemplates/${wlsServerTemplate}/ServerStart/${wlsServerTemplate}') - arguments = cmo.getArguments() - if(str(arguments) == 'None'): - arguments = '${SERVER_STARTUP_ARGS}' - elif ( '${SERVER_STARTUP_ARGS}' not in str(arguments)): - arguments = str(arguments) + ' ' + '${SERVER_STARTUP_ARGS}' - - cmo.setArguments(arguments) - save() - activate() -except Exception, e: - print e - -disconnect() -EOF -} - -#This function creates py Script to enroll Node Manager to the Domain -function createEnrollServerPyScript() -{ - echo "Creating managed server $wlsServerName model" - cat <$DOMAIN_PATH/enroll-server.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -nmEnroll('$DOMAIN_PATH/$wlsDomainName','$DOMAIN_PATH/$wlsDomainName/nodemanager') -nmGenBootStartupProps('$wlsServerName') -disconnect() -EOF -} - - -#Function to create Admin Only Domain -function create_adminSetup() -{ - echo "Creating Admin Setup" - echo "Creating domain path $DOMAIN_PATH" - - sudo mkdir -p $DOMAIN_PATH - - cd $DOMAIN_PATH - - # WebLogic base images are already having weblogic-deploy, hence no need to download - if [ ! -d "$DOMAIN_PATH/weblogic-deploy" ]; - then - echo "weblogic-deploy tool not found in path $DOMAIN_PATH" - exit 1 - fi - - create_admin_model - sudo chown -R $username:$groupname $DOMAIN_PATH - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; $DOMAIN_PATH/weblogic-deploy/bin/createDomain.sh -oracle_home $oracleHome -domain_parent $DOMAIN_PATH -domain_type WLS -model_file $DOMAIN_PATH/admin-domain.yaml" - if [[ $? != 0 ]]; then - echo "Error : Admin setup failed" - exit 1 - fi - - # For issue https://github.com/wls-eng/arm-oraclelinux-wls/issues/89 - copySerializedSystemIniFileToShare -} - -#Function to start admin server -function start_admin() -{ - #Create the boot.properties directory - mkdir -p "$DOMAIN_PATH/$wlsDomainName/servers/admin/security" - echo "username=$wlsUserName" > "$DOMAIN_PATH/$wlsDomainName/servers/admin/security/boot.properties" - echo "password=$wlsPassword" >> "$DOMAIN_PATH/$wlsDomainName/servers/admin/security/boot.properties" - sudo chown -R $username:$groupname $DOMAIN_PATH/$wlsDomainName/servers - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; \"$DOMAIN_PATH/$wlsDomainName/startWebLogic.sh\" > "$DOMAIN_PATH/$wlsDomainName/admin.out" 2>&1 &" - sleep 3m - wait_for_admin -} - -#Function to setup admin boot properties -function admin_boot_setup() -{ - echo "Creating admin boot properties" - #Create the boot.properties directory - mkdir -p "$DOMAIN_PATH/$wlsDomainName/servers/admin/security" - echo "username=$wlsUserName" > "$DOMAIN_PATH/$wlsDomainName/servers/admin/security/boot.properties" - echo "password=$wlsPassword" >> "$DOMAIN_PATH/$wlsDomainName/servers/admin/security/boot.properties" - sudo chown -R $username:$groupname $DOMAIN_PATH/$wlsDomainName/servers - } - -#This function to wait for admin server -function wait_for_admin() -{ - #wait for admin to start -count=1 -CHECK_URL="http://$wlsAdminURL/weblogic/ready" -status=`curl --insecure -ILs $CHECK_URL | tac | grep -m1 HTTP/1.1 | awk {'print $2'}` -while [[ "$status" != "200" ]] -do - echo "Waiting for admin server to start" - count=$((count+1)) - if [ $count -le 30 ]; - then - sleep 1m - else - echo "Error : Maximum attempts exceeded while starting admin server" - exit 1 - fi - status=`curl --insecure -ILs $CHECK_URL | tac | grep -m1 HTTP/1.1 | awk {'print $2'}` - if [ "$status" == "200" ]; - then - echo "Server $wlsServerName started succesfully..." - break - fi -done -} - -#This function to start managed server -function start_cluster() -{ - echo "Starting managed server $wlsServerName" - cat <$DOMAIN_PATH/start-cluster.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -try: - start('$wlsClusterName', 'Cluster') -except: - print "Failed starting Cluster $wlsClusterName" - dumpStack() -disconnect() -EOF -sudo chown -R $username:$groupname $DOMAIN_PATH -runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST $DOMAIN_PATH/start-cluster.py" -if [[ $? != 0 ]]; then - echo "Error : Failed in starting Cluster $wlsClusterName" - exit 1 -fi -} - -#Function to start nodemanager -function start_nm() -{ - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; \"$DOMAIN_PATH/$wlsDomainName/bin/startNodeManager.sh\" &" - sleep 1m -} - -function create_managedSetup(){ - echo "Creating Managed Server Setup" - echo "Creating domain path $DOMAIN_PATH" - - sudo mkdir -p $DOMAIN_PATH - - # WebLogic base images are already having weblogic-deploy, hence no need to download - if [ ! -d "$DOMAIN_PATH/weblogic-deploy" ]; - then - echo "weblogic-deploy tool not found in path $DOMAIN_PATH" - exit 1 - fi - - echo "Creating managed server model files" - create_managed_model - createServerStartArgumentPyScript - createMachinePyScript - createEnrollServerPyScript - echo "Completed managed server model files" - sudo chown -R $username:$groupname $DOMAIN_PATH - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; $DOMAIN_PATH/weblogic-deploy/bin/createDomain.sh -oracle_home $oracleHome -domain_parent $DOMAIN_PATH -domain_type WLS -model_file $DOMAIN_PATH/managed-domain.yaml" - if [[ $? != 0 ]]; then - echo "Error : Managed setup failed" - exit 1 - fi - wait_for_admin - - # For issue https://github.com/wls-eng/arm-oraclelinux-wls/issues/89 - getSerializedSystemIniFileFromShare - echo "Adding machine to managed server $wlsServerName" - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST $DOMAIN_PATH/add-machine.py" - if [[ $? != 0 ]]; then - echo "Error : Adding machine for managed server $wlsServerName failed" - exit 1 - fi - echo "Enrolling Domain for Managed server $wlsServerName" - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST $DOMAIN_PATH/enroll-server.py" - if [[ $? != 0 ]]; then - echo "Error : Adding server $wlsServerName failed" - exit 1 - fi - - echo "Setting Server Startup Arguments for Dynamic Server Template: ${wlsServerTemplate} " - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST $DOMAIN_PATH/setServerStartArgs.py" - if [[ $? != 0 ]]; then - echo "Error : Adding server startup arguments to Server Template: ${wlsServerTemplate} failed" - exit 1 - fi - -} - -# Create systemctl service for nodemanager -function create_nodemanager_service() -{ - echo "Creating services for Nodemanager" - echo "Setting CrashRecoveryEnabled true at $DOMAIN_PATH/$wlsDomainName/nodemanager/nodemanager.properties" - sed -i.bak -e 's/CrashRecoveryEnabled=false/CrashRecoveryEnabled=true/g' $DOMAIN_PATH/$wlsDomainName/nodemanager/nodemanager.properties - - sed -i.bak -e 's/ListenAddress=.*/ListenAddress=/g' $DOMAIN_PATH/$wlsDomainName/nodemanager/nodemanager.properties - -if [ "${isCustomSSLEnabled}" == "true" ]; -then - echo "KeyStores=CustomIdentityAndCustomTrust" >> $DOMAIN_PATH/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomIdentityKeystoreType=${customIdentityKeyStoreType}" >> $DOMAIN_PATH/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomIdentityKeyStoreFileName=${customIdentityKeyStoreFileName}" >> $DOMAIN_PATH/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomIdentityKeyStorePassPhrase=${customIdentityKeyStorePassPhrase}" >> $DOMAIN_PATH/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomIdentityAlias=${serverPrivateKeyAlias}" >> $DOMAIN_PATH/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomIdentityPrivateKeyPassPhrase=${serverPrivateKeyPassPhrase}" >> $DOMAIN_PATH/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomTrustKeystoreType=${customTrustKeyStoreType}" >> $DOMAIN_PATH/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomTrustKeyStoreFileName=${customTrustKeyStoreFileName}" >> $DOMAIN_PATH/$wlsDomainName/nodemanager/nodemanager.properties - echo "CustomTrustKeyStorePassPhrase=${customTrustKeyStorePassPhrase}" >> $DOMAIN_PATH/$wlsDomainName/nodemanager/nodemanager.properties -fi - - if [ $? != 0 ]; - then - echo "Warning : Failed in setting option CrashRecoveryEnabled=true. Continuing without the option." - mv $DOMAIN_PATH/nodemanager/nodemanager.properties.bak $DOMAIN_PATH/$wlsDomainName/nodemanager/nodemanager.properties - fi - - sudo chown -R $username:$groupname $DOMAIN_PATH/$wlsDomainName/nodemanager/nodemanager.properties* - echo "Creating NodeManager service" - cat </etc/systemd/system/wls_nodemanager.service - [Unit] -Description=WebLogic nodemanager service -After=network-online.target -Wants=network-online.target - -[Service] -Type=simple -# Note that the following three parameters should be changed to the correct paths -# on your own system -WorkingDirectory=/u01/domains -Environment="JAVA_OPTIONS=${SERVER_STARTUP_ARGS}" -ExecStart=/bin/bash $DOMAIN_PATH/$wlsDomainName/bin/startNodeManager.sh -ExecStop=/bin/bash $DOMAIN_PATH/$wlsDomainName/bin/stopNodeManager.sh -User=oracle -Group=oracle -KillMode=process -LimitNOFILE=65535 -Restart=always -RestartSec=3 - -[Install] -WantedBy=multi-user.target -EOF -echo "Created service for Nodemanager" -} - -# This function to create adminserver service -function create_adminserver_service() -{ - echo "Creating admin server service" - cat </etc/systemd/system/wls_admin.service -[Unit] -Description=WebLogic Adminserver service -After=network-online.target -Wants=network-online.target - -[Service] -Type=simple -WorkingDirectory=/u01/domains -Environment="JAVA_OPTIONS=${SERVER_STARTUP_ARGS}" -ExecStart=/bin/bash ${startWebLogicScript} -ExecStop=/bin/bash ${stopWebLogicScript} -User=oracle -Group=oracle -KillMode=process -LimitNOFILE=65535 -Restart=always -RestartSec=3 - -[Install] -WantedBy=multi-user.target -EOF -echo "Created services for Admin Server" -} - -function enableAndStartAdminServerService() -{ - sudo systemctl enable wls_admin - sudo systemctl daemon-reload - echo "Starting admin server service" - sudo systemctl start wls_admin - -} - -function enabledAndStartNodeManagerService() -{ - sudo systemctl enable wls_nodemanager - sudo systemctl daemon-reload - - attempt=1 - while [[ $attempt -lt 6 ]] - do - echo "Starting nodemanager service attempt $attempt" - sudo systemctl start wls_nodemanager - sleep 1m - attempt=`expr $attempt + 1` - sudo systemctl status wls_nodemanager | grep running - if [[ $? == 0 ]]; - then - echo "wls_nodemanager service started successfully" - break - fi - sleep 3m - done -} - -function updateNetworkRules() -{ - # for Oracle Linux 7.3, 7.4, iptable is not running. - if [ -z `command -v firewall-cmd` ]; then - return 0 - fi - - # for Oracle Linux 7.6, open weblogic ports - tag=$1 - if [ ${tag} == 'admin' ]; then - echo "update network rules for admin server" - sudo firewall-cmd --zone=public --add-port=$wlsAdminPort/tcp - sudo firewall-cmd --zone=public --add-port=$wlsSSLAdminPort/tcp - sudo firewall-cmd --zone=public --add-port=$wlsAdminT3ChannelPort/tcp - sudo firewall-cmd --zone=public --add-port=$nmPort/tcp - else - maxManagedIndex=1 - echo "update network rules for managed server" - # Port is dynamic betweent 8002 to 8001+dynamicClusterSize, open port from 8002 to 8001+dynamicClusterSize for managed machines. - while [ $maxManagedIndex -le $maxDynamicClusterSize ] - do - managedPort=$(($wlsManagedPort + $maxManagedIndex)) - sudo firewall-cmd --zone=public --add-port=$managedPort/tcp - maxManagedIndex=$(($maxManagedIndex + 1)) - done - - # open ports for coherence - sudo firewall-cmd --zone=public --add-port=$coherenceListenPort/tcp - sudo firewall-cmd --zone=public --add-port=$coherenceListenPort/udp - sudo firewall-cmd --zone=public --add-port=$coherenceLocalport-$coherenceLocalportAdjust/tcp - sudo firewall-cmd --zone=public --add-port=$coherenceLocalport-$coherenceLocalportAdjust/udp - sudo firewall-cmd --zone=public --add-port=7/tcp - - sudo firewall-cmd --zone=public --add-port=$nmPort/tcp - fi - - sudo firewall-cmd --runtime-to-permanent - sudo systemctl restart firewalld -} - -# Mount the Azure file share on all VMs created -function mountFileShare() -{ - echo "Creating mount point" - echo "Mount point: $mountpointPath" - sudo mkdir -p $mountpointPath - if [ ! -d "/etc/smbcredentials" ]; then - sudo mkdir /etc/smbcredentials - fi - if [ ! -f "/etc/smbcredentials/${storageAccountName}.cred" ]; then - echo "Crearing smbcredentials" - echo "username=$storageAccountName >> /etc/smbcredentials/${storageAccountName}.cred" - echo "password=$storageAccountKey >> /etc/smbcredentials/${storageAccountName}.cred" - sudo bash -c "echo "username=$storageAccountName" >> /etc/smbcredentials/${storageAccountName}.cred" - sudo bash -c "echo "password=$storageAccountKey" >> /etc/smbcredentials/${storageAccountName}.cred" - fi - echo "chmod 600 /etc/smbcredentials/${storageAccountName}.cred" - sudo chmod 600 /etc/smbcredentials/${storageAccountName}.cred - echo "//${storageAccountPrivateIp}/wlsshare $mountpointPath cifs nofail,vers=2.1,credentials=/etc/smbcredentials/${storageAccountName}.cred,dir_mode=0777,file_mode=0777,serverino" - sudo bash -c "echo \"//${storageAccountPrivateIp}/wlsshare $mountpointPath cifs nofail,vers=2.1,credentials=/etc/smbcredentials/${storageAccountName}.cred,dir_mode=0777,file_mode=0777,serverino\" >> /etc/fstab" - echo "mount -t cifs //${storageAccountPrivateIp}/wlsshare $mountpointPath -o vers=2.1,credentials=/etc/smbcredentials/${storageAccountName}.cred,dir_mode=0777,file_mode=0777,serverino" - sudo mount -t cifs //${storageAccountPrivateIp}/wlsshare $mountpointPath -o vers=2.1,credentials=/etc/smbcredentials/${storageAccountName}.cred,dir_mode=0777,file_mode=0777,serverino - if [[ $? != 0 ]]; - then - echo "Failed to mount //${storageAccountPrivateIp}/wlsshare $mountpointPath" - exit 1 - fi -} - -# Copy SerializedSystemIni.dat file from admin server vm to share point -function copySerializedSystemIniFileToShare() -{ - runuser -l oracle -c "cp ${DOMAIN_PATH}/${wlsDomainName}/security/SerializedSystemIni.dat ${mountpointPath}/." - ls -lt ${mountpointPath}/SerializedSystemIni.dat - if [[ $? != 0 ]]; - then - echo "Failed to copy ${DOMAIN_PATH}/${wlsDomainName}/security/SerializedSystemIni.dat" - exit 1 - fi -} - -# Get SerializedSystemIni.dat file from share point to managed server vm -function getSerializedSystemIniFileFromShare() -{ - runuser -l oracle -c "mv ${DOMAIN_PATH}/${wlsDomainName}/security/SerializedSystemIni.dat ${DOMAIN_PATH}/${wlsDomainName}/security/SerializedSystemIni.dat.backup" - runuser -l oracle -c "cp ${mountpointPath}/SerializedSystemIni.dat ${DOMAIN_PATH}/${wlsDomainName}/security/." - ls -lt ${DOMAIN_PATH}/${wlsDomainName}/security/SerializedSystemIni.dat - if [[ $? != 0 ]]; - then - echo "Failed to get ${mountpointPath}/SerializedSystemIni.dat" - exit 1 - fi - runuser -l oracle -c "chmod 640 ${DOMAIN_PATH}/${wlsDomainName}/security/SerializedSystemIni.dat" -} - -# Create custom stopWebLogic script and add it to wls_admin service -# This script is created as stopWebLogic.sh will not work if non ssl admin listening port 7001 is disabled -# Refer https://github.com/wls-eng/arm-oraclelinux-wls/issues/164 -function createStopWebLogicScript() -{ - -cat <${stopWebLogicScript} -#!/bin/sh -# This is custom script for stopping weblogic server using ADMIN_URL supplied -export ADMIN_URL="t3://${wlsAdminURL}" -${DOMAIN_PATH}/${wlsDomainName}/bin/stopWebLogic.sh -EOF - -sudo chown -R $username:$groupname ${stopWebLogicScript} -sudo chmod -R 750 ${stopWebLogicScript} - -} - -function validateSSLKeyStores() -{ - sudo chown -R $username:$groupname $KEYSTORE_PATH - - #validate identity keystore - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; keytool -list -v -keystore $customIdentityKeyStoreFileName -storepass $customIdentityKeyStorePassPhrase -storetype $customIdentityKeyStoreType | grep 'Entry type:' | grep 'PrivateKeyEntry'" - - if [[ $? != 0 ]]; then - echo "Error : Identity Keystore Validation Failed !!" - exit 1 - fi - - # Verify Identity keystore validity period more than MIN_CERT_VALIDITY - verifyCertValidity $customIdentityKeyStoreFileName $customIdentityKeyStorePassPhrase $CURRENT_DATE $MIN_CERT_VALIDITY $customIdentityKeyStoreType - - #validate Trust keystore - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; keytool -list -v -keystore $customTrustKeyStoreFileName -storepass $customTrustKeyStorePassPhrase -storetype $customTrustKeyStoreType | grep 'Entry type:' | grep 'trustedCertEntry'" - - if [[ $? != 0 ]]; then - echo "Error : Trust Keystore Validation Failed !!" - exit 1 - fi - - # Verify Identity keystore validity period more than MIN_CERT_VALIDITY - verifyCertValidity $customTrustKeyStoreFileName $customTrustKeyStorePassPhrase $CURRENT_DATE $MIN_CERT_VALIDITY $customTrustKeyStoreType - - echo "ValidateSSLKeyStores Successfull !!" -} - -function storeCustomSSLCerts() -{ - if [ "${isCustomSSLEnabled}" == "true" ]; - then - - mkdir -p $KEYSTORE_PATH - - echo "Custom SSL is enabled. Storing CertInfo as files..." - customIdentityKeyStoreFileName="$KEYSTORE_PATH/identity.keystore" - customTrustKeyStoreFileName="$KEYSTORE_PATH/trust.keystore" - - customIdentityKeyStoreData=$(echo "$customIdentityKeyStoreData" | base64 --decode) - customIdentityKeyStorePassPhrase=$(echo "$customIdentityKeyStorePassPhrase" | base64 --decode) - customIdentityKeyStoreType=$(echo "$customIdentityKeyStoreType" | base64 --decode) - - customTrustKeyStoreData=$(echo "$customTrustKeyStoreData" | base64 --decode) - customTrustKeyStorePassPhrase=$(echo "$customTrustKeyStorePassPhrase" | base64 --decode) - customTrustKeyStoreType=$(echo "$customTrustKeyStoreType" | base64 --decode) - - serverPrivateKeyAlias=$(echo "$serverPrivateKeyAlias" | base64 --decode) - serverPrivateKeyPassPhrase=$(echo "$serverPrivateKeyPassPhrase" | base64 --decode) - - #decode cert data once again as it would got base64 encoded while uploading - echo "$customIdentityKeyStoreData" | base64 --decode > $customIdentityKeyStoreFileName - echo "$customTrustKeyStoreData" | base64 --decode > $customTrustKeyStoreFileName - - validateSSLKeyStores - - else - echo "Custom SSL is not enabled" - fi -} - -#this function set the umask 027 (chmod 740) as required by WebLogic security checks -function setUMaskForSecurityDir() -{ - echo "setting umask 027 (chmod 740) for domain/$wlsServerName security directory" - - if [ -f "$DOMAIN_PATH/$wlsDomainName/servers/$wlsServerName/security/boot.properties" ]; - then - runuser -l oracle -c "chmod 740 $DOMAIN_PATH/$wlsDomainName/servers/$wlsServerName/security/boot.properties" - fi - - if [ -d "$DOMAIN_PATH/$wlsDomainName/servers/$wlsServerName/security" ]; - then - runuser -l oracle -c "chmod 740 $DOMAIN_PATH/$wlsDomainName/servers/$wlsServerName/security" - fi - -} - -#this function checks if remote Anonymous T3/RMI Attributes are available as part of domain security configuration -function containsRemoteAnonymousT3RMIIAttribs() -{ - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; $DOMAIN_PATH/weblogic-deploy/bin/modelHelp.sh -oracle_home $oracleHome topology:/SecurityConfiguration | grep RemoteAnonymousRmiiiopEnabled" >> /dev/null - - result1=$? - - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; $DOMAIN_PATH/weblogic-deploy/bin/modelHelp.sh -oracle_home $oracleHome topology:/SecurityConfiguration | grep RemoteAnonymousRmit3Enabled" >> /dev/null - - result2=$? - - if [ $result1 == 0 ] && [ $result2 == 0 ]; then - echo "true" - else - echo "false" - fi -} - - -function generateCustomHostNameVerifier() -{ - mkdir -p ${CUSTOM_HOSTNAME_VERIFIER_HOME} - mkdir -p ${CUSTOM_HOSTNAME_VERIFIER_HOME}/src/main/java - mkdir -p ${CUSTOM_HOSTNAME_VERIFIER_HOME}/src/test/java - cp ${BASE_DIR}/generateCustomHostNameVerifier.sh ${CUSTOM_HOSTNAME_VERIFIER_HOME}/generateCustomHostNameVerifier.sh - cp ${BASE_DIR}/WebLogicCustomHostNameVerifier.java ${CUSTOM_HOSTNAME_VERIFIER_HOME}/src/main/java/WebLogicCustomHostNameVerifier.java - cp ${BASE_DIR}/HostNameValuesTemplate.txt ${CUSTOM_HOSTNAME_VERIFIER_HOME}/src/main/java/HostNameValuesTemplate.txt - cp ${BASE_DIR}/WebLogicCustomHostNameVerifierTest.java ${CUSTOM_HOSTNAME_VERIFIER_HOME}/src/test/java/WebLogicCustomHostNameVerifierTest.java - chown -R $username:$groupname ${CUSTOM_HOSTNAME_VERIFIER_HOME} - chmod +x ${CUSTOM_HOSTNAME_VERIFIER_HOME}/generateCustomHostNameVerifier.sh - - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; ${CUSTOM_HOSTNAME_VERIFIER_HOME}/generateCustomHostNameVerifier.sh ${adminVMName} ${customDNSNameForAdminServer} ${customDNSNameForAdminServer} ${dnsLabelPrefix} ${wlsDomainName} ${location}" -} - -function copyCustomHostNameVerifierJarsToWebLogicClasspath() -{ - runuser -l oracle -c "cp ${CUSTOM_HOSTNAME_VERIFIER_HOME}/output/*.jar $oracleHome/wlserver/server/lib/;" - - echo "Modify WLS CLASSPATH to include hostname verifier jars...." - sed -i 's;^WEBLOGIC_CLASSPATH="${WL_HOME}/server/lib/postgresql.*;&\nWEBLOGIC_CLASSPATH="${WL_HOME}/server/lib/hostnamevalues.jar:${WL_HOME}/server/lib/weblogicustomhostnameverifier.jar:${WEBLOGIC_CLASSPATH}";' $oracleHome/oracle_common/common/bin/commExtEnv.sh - echo "Modified WLS CLASSPATH to include hostname verifier jars." -} - -function configureCustomHostNameVerifierForAdmin() -{ - echo "configureCustomHostNameVerifier for domain $wlsDomainName for server $wlsServerName" - cat <$DOMAIN_PATH/configureCustomHostNameVerifier.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -try: - edit("$wlsServerName") - startEdit() - - cd('/Servers/$wlsServerName/SSL/$wlsServerName') - cmo.setHostnameVerifier('com.oracle.azure.weblogic.security.util.WebLogicCustomHostNameVerifier') - cmo.setHostnameVerificationIgnored(false) - cmo.setTwoWaySSLEnabled(false) - cmo.setClientCertificateEnforced(false) - - save() - activate() -except Exception,e: - print e - print "Failed to configureCustomHostNameVerifier for domain $wlsDomainName for server $wlsServerName" - dumpStack() - raise Exception('Failed to configureCustomHostNameVerifier for domain $wlsDomainName for server $wlsServerName') -disconnect() -EOF -sudo chown -R $username:$groupname $DOMAIN_PATH -runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST $DOMAIN_PATH/configureCustomHostNameVerifier.py" -if [[ $? != 0 ]]; then - echo "Error : Failed to configureCustomHostNameVerifier for domain $wlsDomainName" - exit 1 -fi - -} - - -function configureCustomHostNameVerifierForServerTemplate() -{ - echo "configureCustomHostNameVerifier for Server Template $dynamicServerTemplate in domain $wlsDomainName" - cat <$DOMAIN_PATH/configureCustomHostNameVerifierServerTemplate.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -try: - edit("$dynamicServerTemplate") - startEdit() - - cd('/ServerTemplates/$dynamicServerTemplate/SSL/$dynamicServerTemplate') - cmo.setHostnameVerifier('com.oracle.azure.weblogic.security.util.WebLogicCustomHostNameVerifier') - cmo.setHostnameVerificationIgnored(false) - cmo.setTwoWaySSLEnabled(false) - cmo.setClientCertificateEnforced(false) - - save() - activate() -except Exception,e: - print e - print "Failed to configureCustomHostNameVerifier for Server Template $dynamicServerTemplate in domain $wlsDomainName" - dumpStack() - raise Exception('Failed to configureCustomHostNameVerifier for Server Template $dynamicServerTemplate for domain $wlsDomainName') -disconnect() -EOF -sudo chown -R $username:$groupname $DOMAIN_PATH -runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST $DOMAIN_PATH/configureCustomHostNameVerifierServerTemplate.py" -if [[ $? != 0 ]]; then - echo "Error : Failed to configureCustomHostNameVerifier for domain $wlsDomainName" - exit 1 -fi - -} - - -#main script starts here - -SCRIPT_PWD=`pwd` -CURR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -BASE_DIR="$(readlink -f ${CURR_DIR})" - -# Used for certificate expiry validation -CURRENT_DATE=`date +%s` -# Supplied certificate to have minimum days validity for the deployment -# In this case set for 1 day -MIN_CERT_VALIDITY="1" - -read wlsDomainName wlsUserName wlsPassword managedServerPrefix indexValue vmNamePrefix maxDynamicClusterSize dynamicClusterSize adminVMName oracleHome storageAccountName storageAccountKey mountpointPath isHTTPAdminListenPortEnabled customDNSNameForAdminServer dnsLabelPrefix location virtualNetworkNewOrExisting storageAccountPrivateIp isCustomSSLEnabled customIdentityKeyStoreData customIdentityKeyStorePassPhrase customIdentityKeyStoreType customTrustKeyStoreData customTrustKeyStorePassPhrase customTrustKeyStoreType serverPrivateKeyAlias serverPrivateKeyPassPhrase - -DOMAIN_PATH="/u01/domains" -CUSTOM_HOSTNAME_VERIFIER_HOME="/u01/app/custom-hostname-verifier" -startWebLogicScript="${DOMAIN_PATH}/${wlsDomainName}/startWebLogic.sh" -stopWebLogicScript="${DOMAIN_PATH}/${wlsDomainName}/bin/customStopWebLogic.sh" -SERVER_STARTUP_ARGS="-Dlog4j2.formatMsgNoLookups=true" - -isHTTPAdminListenPortEnabled="${isHTTPAdminListenPortEnabled,,}" - -isCustomSSLEnabled="${isCustomSSLEnabled,,}" - -# Always index 0 is set as admin server -coherenceListenPort=7574 -coherenceLocalport=42000 -coherenceLocalportAdjust=42200 -wlsAdminPort=7001 -wlsSSLAdminPort=7002 -wlsAdminT3ChannelPort=7005 -wlsManagedPort=8001 - -wlsAdminURL="$adminVMName:$wlsAdminT3ChannelPort" -SERVER_START_URL="http://$wlsAdminURL" -KEYSTORE_PATH="${DOMAIN_PATH}/${wlsDomainName}/keystores" -wlsServerTemplate="myServerTemplate" -SERVER_STARTUP_ARGS="-Dlog4j2.formatMsgNoLookups=true" - - -if [ "${isCustomSSLEnabled}" == "true" ]; -then - SERVER_START_URL="https://$adminVMName:$wlsSSLAdminPort" -fi - -CHECK_URL="http://$wlsAdminURL/weblogic/ready" -adminWlstURL="t3://$wlsAdminURL" - -wlsClusterName="cluster1" -dynamicServerTemplate="myServerTemplate" -nmHost=`hostname` -nmPort=5556 -machineNamePrefix="machine" -machineName="$machineNamePrefix-$nmHost" -username="oracle" -groupname="oracle" - -validateInput - -if [ $indexValue == 0 ]; -then - wlsServerName="admin" -else - serverIndex=$indexValue - wlsServerName="$managedServerPrefix$serverIndex" -fi - -cleanup - -# Executing this function first just to make sure certificate errors are first caught -storeCustomSSLCerts - -installUtilities -mountFileShare - -if [ $wlsServerName == "admin" ]; -then - updateNetworkRules "admin" - create_adminSetup - createStopWebLogicScript - admin_boot_setup - generateCustomHostNameVerifier - copyCustomHostNameVerifierJarsToWebLogicClasspath - setUMaskForSecurityDir - create_adminserver_service - create_nodemanager_service - enableAndStartAdminServerService - enabledAndStartNodeManagerService - wait_for_admin - configureCustomHostNameVerifierForAdmin - configureCustomHostNameVerifierForServerTemplate -else - updateNetworkRules "managed" - wait_for_admin - create_managedSetup - generateCustomHostNameVerifier - copyCustomHostNameVerifierJarsToWebLogicClasspath - setUMaskForSecurityDir - create_nodemanager_service - enabledAndStartNodeManagerService - wait_for_admin - start_cluster -fi -cleanup diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/scripts/setupOHS.sh b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/scripts/setupOHS.sh deleted file mode 100644 index 34a6aedad..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/scripts/setupOHS.sh +++ /dev/null @@ -1,567 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# -#Function to output message to StdErr -function echo_stderr () -{ - echo "$@" >&2 -} - -#Function to display usage message -function usage() -{ - echo_stderr "./setupOHS.sh <<< \"\"" -} - -# Create user "oracle", used for instalation and setup -function addOracleGroupAndUser() -{ - #add oracle group and user - echo "Adding oracle user and group..." - groupname="oracle" - username="oracle" - user_home_dir="/u01/oracle" - USER_GROUP=${groupname} - sudo groupadd $groupname - sudo useradd -d ${user_home_dir} -g $groupname $username -} - -# Cleaning all installer files -function cleanup() -{ - echo "Cleaning up temporary files..." - rm -f $BASE_DIR/setupOHS.sh - rm -f $OHS_PATH/ohs-domain.py - echo "Cleanup completed." -} - -# Verifies whether user inputs are available -function validateInput() -{ - if [ -z "$OHS_DOMAIN_NAME" ] - then - echo_stderr "OHS domain name is required. " - exit 1 - fi - - if [ -z "$OHS_COMPONENT_NAME" ] - then - echo_stderr "OHS domain name is required. " - exit 1 - fi - - if [[ -z "$OHS_NM_USER" || -z "$OHS_NM_PSWD" ]] - then - echo_stderr "OHS nodemanager username and password is required. " - exit 1 - fi - - if [[ -z "$OHS_HTTP_PORT" || -z "$OHS_HTTPS_PORT" ]] - then - echo_stderr "OHS http port and OHS https port required." - exit 1 - fi - - if [ -z "$WLS_REST_URL" ] - then - echo_stderr "WebLogic REST management url is required." - exit 1 - fi - - if [ -z "${OHS_KEY_STORE_DATA}" ] || [ -z "${OHS_KEY_STORE_PASSPHRASE}" ] - then - echo_stderr "One of the required values for enabling Custom SSL (ohsKeyStoreData,ohsKeyStorePassPhrase) is not provided" - fi - - if [ -z "$ORACLE_VAULT_PASSWORD" ] - then - echo_stderr "Oracle vault password is required to add custom ssl to OHS server" - fi - - if [ -z "${WLS_USER}" ] || [ -z "${WLS_PASSWORD}" ] - then - echo_stderr "Either weblogic username or weblogic password is required" - fi - - if [ -z "$OHS_KEY_TYPE" ] - then - echo_stderr "Provide KeyType either JKS or PKCS12" - fi -} - -# This function verifies whether certificate is valid and not expired -function verifyCertValidity() -{ - KEYSTORE=$1 - PASSWORD=$2 - CURRENT_DATE=$3 - MIN_CERT_VALIDITY=$4 - KEY_STORE_TYPE=$5 - VALIDITY=$(($CURRENT_DATE + ($MIN_CERT_VALIDITY*24*60*60))) - - echo "Verifying $KEYSTORE is valid at least $MIN_CERT_VALIDITY day from the OHS deployment time" - - if [ $VALIDITY -le $CURRENT_DATE ]; - then - echo_stderr "Error : Invalid minimum validity days supplied" - exit 1 - fi - - # Check whether KEYSTORE supplied can be opened for reading - # Redirecting as no need to display the contents - runuser -l oracle -c "$JAVA_HOME/bin/keytool -list -v -keystore $KEYSTORE -storepass $PASSWORD -storetype $KEY_STORE_TYPE > /dev/null 2>&1" - if [ $? != 0 ]; - then - echo_stderr "Error opening the keystore : $KEYSTORE" - exit 1 - fi - - aliasList=`runuser -l oracle -c "$JAVA_HOME/bin/keytool -list -v -keystore $KEYSTORE -storepass $PASSWORD -storetype $KEY_STORE_TYPE | grep Alias" |awk '{print $3}'` - if [[ -z $aliasList ]]; - then - echo_stderr "Error : No alias found in supplied certificate $KEYSTORE" - exit 1 - fi - - for alias in $aliasList - do - VALIDITY_PERIOD=`runuser -l oracle -c "$JAVA_HOME/bin/keytool -list -v -keystore $KEYSTORE -storepass $PASSWORD -storetype $KEY_STORE_TYPE -alias $alias | grep Valid"` - echo "$KEYSTORE is \"$VALIDITY_PERIOD\"" - CERT_UNTIL_DATE=`echo $VALIDITY_PERIOD | awk -F'until:|\r' '{print $2}'` - CERT_UNTIL_SECONDS=`date -d "$CERT_UNTIL_DATE" +%s` - VALIDITY_REMIANS_SECONDS=`expr $CERT_UNTIL_SECONDS - $VALIDITY` - if [[ $VALIDITY_REMIANS_SECONDS -le 0 ]]; - then - echo_stderr "$KEYSTORE is \"$VALIDITY_PERIOD\"" - echo_stderr "Error : Supplied certificate $KEYSTORE is either expired or expiring soon within $MIN_CERT_VALIDITY day" - exit 1 - fi - done - echo "$KEYSTORE validation is successful" -} - -# Setup Domain path -function setupDomainPath() -{ - #create custom directory for setting up wls and jdk - sudo mkdir -p $DOMAIN_PATH - sudo chown -R $username:$groupname $DOMAIN_PATH -} - -# Create .py file to setup OHS domain -function createDomainConfigFile() -{ - echo "creating OHS domain configuration file ..." - cat <$OHS_PATH/ohs-domain.py -import os, sys -setTopologyProfile('Compact') -selectTemplate('Oracle HTTP Server (Standalone)') -loadTemplates() -showTemplates() -cd('/') -create("${OHS_COMPONENT_NAME}", 'SystemComponent') -cd('SystemComponent/' + '${OHS_COMPONENT_NAME}') -set('ComponentType','OHS') -cd('/') -cd('OHS/' + '${OHS_COMPONENT_NAME}') -set('ListenAddress','') -set('ListenPort', '${OHS_HTTP_PORT}') -set('SSLListenPort', '${OHS_HTTPS_PORT}') -cd('/') -create('sc', 'SecurityConfiguration') -cd('SecurityConfiguration/sc') -set('NodeManagerUsername', "${OHS_NM_USER}") -set('NodeManagerPasswordEncrypted', "${OHS_NM_PSWD}") -setOption('NodeManagerType','PerDomainNodeManager') -setOption('OverwriteDomain', 'true') -writeDomain("${OHS_DOMAIN_PATH}") -dumpStack() -closeTemplate() -exit() - -EOF -} - -#Configuring OHS standalone domain -function setupOHSDomain() -{ - createDomainConfigFile - sudo chown -R $username:$groupname $OHS_PATH/ohs-domain.py - echo "Setting up OHS standalone domain at ${OHS_DOMAIN_PATH}" - runuser -l oracle -c "${INSTALL_PATH}/oracle/middleware/oracle_home/oracle_common/common/bin/wlst.sh $OHS_PATH/ohs-domain.py" - if [[ $?==0 ]]; - then - echo "OHS standalone domain is configured successfully" - else - echo_stderr "OHS standalone domain is configuration failed" - exit 1 - fi -} - -# Create OHS silent installation templates -function createOHSTemplates() -{ - sudo cp $BASE_DIR/$OHS_FILE_NAME $OHS_PATH/$OHS_FILE_NAME - echo "unzipping $OHS_FILE_NAME" - sudo unzip -o $OHS_PATH/$OHS_FILE_NAME -d $OHS_PATH - SILENT_FILES_DIR=$OHS_PATH/silent-template - sudo mkdir -p $SILENT_FILES_DIR - sudo rm -rf $OHS_PATH/silent-template/* - mkdir -p $INSTALL_PATH - create_oraInstlocTemplate - create_oraResponseTemplate - sudo chown -R $username:$groupname $OHS_PATH - sudo chown -R $username:$groupname $INSTALL_PATH -} - -# Create OHS nodemanager as service -function create_nodemanager_service() -{ - echo "Setting CrashRecoveryEnabled true at $DOMAIN_PATH/$OHS_DOMAIN_NAME/nodemanager/nodemanager.properties" - sed -i.bak -e 's/CrashRecoveryEnabled=false/CrashRecoveryEnabled=true/g' $DOMAIN_PATH/$OHS_DOMAIN_NAME/nodemanager/nodemanager.properties - if [ $? != 0 ]; - then - echo "Warning : Failed in setting option CrashRecoveryEnabled=true. Continuing without the option." - mv $DOMAIN_PATH/nodemanager/nodemanager.properties.bak $DOMAIN_PATH/$OHS_DOMAIN_NAME/nodemanager/nodemanager.properties - fi - sudo chown -R $username:$groupname $DOMAIN_PATH/$OHS_DOMAIN_NAME/nodemanager/nodemanager.properties* - echo "Creating NodeManager service" - cat </etc/systemd/system/ohs_nodemanager.service - [Unit] - Description=OHS nodemanager service - After=network-online.target - Wants=network-online.target - [Service] - Type=simple - WorkingDirectory=/u01/domains - ExecStart=/bin/bash $DOMAIN_PATH/$OHS_DOMAIN_NAME/bin/startNodeManager.sh - ExecStop=/bin/bash $DOMAIN_PATH/$OHS_DOMAIN_NAME/bin/stopNodeManager.sh - User=oracle - Group=oracle - KillMode=process - LimitNOFILE=65535 - Restart=always - RestartSec=3 - [Install] - WantedBy=multi-user.target -EOF - -} - -# Start the nodemanager service -function enabledAndStartNodeManagerService() -{ - sudo systemctl enable ohs_nodemanager - sudo systemctl daemon-reload - attempt=1 - while [[ $attempt -lt 6 ]] - do - echo "Starting nodemanager service attempt $attempt" - sudo systemctl start ohs_nodemanager - sleep 1m - attempt=`expr $attempt + 1` - sudo systemctl status ohs_nodemanager | grep "active (running)" - if [[ $? == 0 ]]; - then - echo "ohs_nodemanager service started successfully" - break - fi - sleep 3m - done -} - -#Create Start component script -function createStartComponent() -{ - cat < $OHS_DOMAIN_PATH/startComponent.py -import os, sys -nmConnect(username='${OHS_NM_USER}',password='${OHS_NM_PSWD}',domainName='${OHS_DOMAIN_NAME}') -status=nmServerStatus(serverName='${OHS_COMPONENT_NAME}',serverType='OHS') -if status != "RUNNING": - nmStart(serverName='${OHS_COMPONENT_NAME}',serverType='OHS') - nmServerStatus(serverName='${OHS_COMPONENT_NAME}',serverType='OHS') -else: - print 'OHS component ${OHS_COMPONENT_NAME} is already running' -EOF - - sudo chown -R $username:$groupname $OHS_DOMAIN_PATH/startComponent.py -} - -#Create Stop component script -function createStopComponent() -{ - cat < $OHS_DOMAIN_PATH/stopComponent.py -import os, sys -nmConnect(username='${OHS_NM_USER}',password='${OHS_NM_PSWD}',domainName='${OHS_DOMAIN_NAME}') -status=nmServerStatus(serverName='${OHS_COMPONENT_NAME}',serverType='OHS') -if status != "SHUTDOWN": - nmKill(serverName='$OHS_COMPONENT_NAME',serverType='OHS') - nmServerStatus(serverName='$OHS_COMPONENT_NAME',serverType='OHS') -else: - print 'OHS component ${OHS_COMPONENT_NAME} is already SHUTDOWN' -EOF - - sudo chown -R $username:$groupname $OHS_DOMAIN_PATH/stopComponent.py - -} - -# Create OHS component as service -function createComponentService() -{ - echo "Creating ohs component service" - cat </etc/systemd/system/ohs_component.service - [Unit] - Description=OHS Component service - After=ohs_nodemanager.service - Wants=ohs_nodemanager.service - - [Service] - Type=oneshot - RemainAfterExit=true - WorkingDirectory="$DOMAIN_PATH/$OHS_DOMAIN_NAME" - ExecStart=${INSTALL_PATH}/oracle/middleware/oracle_home/oracle_common/common/bin/wlst.sh $OHS_DOMAIN_PATH/startComponent.py - ExecStop=${INSTALL_PATH}/oracle/middleware/oracle_home/oracle_common/common/bin/wlst.sh $OHS_DOMAIN_PATH/stopComponent.py - User=oracle - Group=oracle - KillMode=process - LimitNOFILE=65535 -[Install] -WantedBy=multi-user.target - -EOF - -} - -# Start the OHS component service -function enableAndStartOHSServerService() -{ - sudo systemctl enable ohs_component - sudo systemctl daemon-reload - echo "Starting ohs component service" - attempt=1 - while [[ $attempt -lt 6 ]] - do - echo "Starting ohs component service attempt $attempt" - sudo systemctl start ohs_component - sleep 1m - attempt=`expr $attempt + 1` - sudo systemctl status ohs_component | grep active - if [[ $? == 0 ]]; - then - echo "ohs_component service started successfully" - break - fi - sleep 3m - done -} - -# Query the WLS and form WLS cluster address -function getWLSClusterAddress() -{ - restArgs=" -v --user ${WLS_USER}:${WLS_PASSWORD} -H X-Requested-By:MyClient -H Accept:application/json -H Content-Type:application/json" - curl $restArgs -X GET ${WLS_REST_URL}/domainRuntime/serverRuntimes?fields=defaultURL > out - if [[ $? != 0 ]]; - then - echo_stderr "REST query failed for servers" - exit 1 - fi - # Default admin URL is "defaultURL": "t3:\/\/10.0.0.6:7001" which is not required as part of cluster address - # Exclude 7001 admin port, 7005 admin channel port - # Exclude coherence server listen port 7501 - msString=` cat out | grep defaultURL | grep -v "7001\|7005\|7501" | cut -f3 -d"/" ` - wlsClusterAddress=`echo $msString | sed 's/\" /,/g'` - WLS_CLUSTER_ADDRESS=${wlsClusterAddress::-1} - - # Test whether servers are reachable - testClusterServers=$(echo ${WLS_CLUSTER_ADDRESS} | tr "," "\n") - for server in $testClusterServers - do - echo curl http://${server}/weblogic/ready - curl http://${server}/weblogic/ready - if [[ $? == 0 ]]; - then - echo "${server} is reachable" - else - echo_stderr "Failed to get cluster address properly. Cluster address received: ${wlsClusterAddress}" - exit 1 - fi - done - rm -f out -} - -# Create/update mod_wl_ohs configuration file based on WebLogic Cluster address -function create_mod_wl_ohs_conf() -{ - getWLSClusterAddress - - echo "Creating backup file for existing mod_wl_ohs.conf file" - runuser -l oracle -c "mv $OHS_DOMAIN_PATH/config/fmwconfig/components/OHS/instances/$OHS_COMPONENT_NAME/mod_wl_ohs.conf $OHS_DOMAIN_PATH/config/fmwconfig/components/OHS/instances/$OHS_COMPONENT_NAME/mod_wl_ohs.conf.bkp" - runuser -l oracle -c "mv $OHS_DOMAIN_PATH/config/fmwconfig/components/OHS/$OHS_COMPONENT_NAME/mod_wl_ohs.conf $OHS_DOMAIN_PATH/config/fmwconfig/components/OHS/$OHS_COMPONENT_NAME/mod_wl_ohs.conf.bkp" - - echo "Creating mod_wl_ohs.conf file as per ${WLS_CLUSTER_ADDRESS}" - cat < $OHS_DOMAIN_PATH/config/fmwconfig/components/OHS/instances/$OHS_COMPONENT_NAME/mod_wl_ohs.conf - LoadModule weblogic_module "${INSTALL_PATH}/oracle/middleware/oracle_home/ohs/modules/mod_wl_ohs.so" - - WLIOTimeoutSecs 900 - KeepAliveSecs 290 - FileCaching ON - WLSocketTimeoutSecs 15 - DynamicServerList ON - WLProxySSL ON - WebLogicCluster ${WLS_CLUSTER_ADDRESS} - - - SetHandler weblogic-handler - DynamicServerList ON - WLProxySSL ON - WebLogicCluster ${WLS_CLUSTER_ADDRESS} - - -EOF - - sudo chown -R $username:$groupname $OHS_DOMAIN_PATH/config/fmwconfig/components/OHS/instances/$OHS_COMPONENT_NAME/mod_wl_ohs.conf - runuser -l oracle -c "cp $OHS_DOMAIN_PATH/config/fmwconfig/components/OHS/instances/$OHS_COMPONENT_NAME/mod_wl_ohs.conf $OHS_DOMAIN_PATH/config/fmwconfig/components/OHS/$OHS_COMPONENT_NAME/." -} - -# Update the network rules so that OHS_HTTP_PORT and OHS_HTTPS_PORT is accessible -function updateNetworkRules() -{ - # for Oracle Linux 7.3, 7.4, iptable is not running. - if [ -z `command -v firewall-cmd` ]; then - return 0 - fi - sudo firewall-cmd --zone=public --add-port=$OHS_HTTP_PORT/tcp - sudo firewall-cmd --zone=public --add-port=$OHS_HTTPS_PORT/tcp - sudo firewall-cmd --runtime-to-permanent - sudo systemctl restart firewalld - sleep 30s -} - -# Oracle Vault needs to be created to add JKS keystore or PKCS12 certificate for OHS -function createOracleVault() -{ - runuser -l oracle -c "mkdir -p ${OHS_VAULT_PATH}" - runuser -l oracle -c "${INSTALL_PATH}/oracle/middleware/oracle_home/oracle_common/bin/orapki wallet create -wallet ${OHS_VAULT_PATH} -pwd ${ORACLE_VAULT_PASSWORD} -auto_login" - if [[ $? == 0 ]]; - then - echo "Successfully oracle vault is created" - else - echo_stderr "Failed to create oracle vault" - exit 1 - fi - ls -lt ${OHS_VAULT_PATH} -} - -# Add provided certificates to Oracle vault created -function addCertficateToOracleVault() -{ - ohsKeyStoreData=$(echo "$OHS_KEY_STORE_DATA" | base64 --decode) - ohsKeyStorePassPhrase=$(echo "$OHS_KEY_STORE_PASSPHRASE" | base64 --decode) - - case "${OHS_KEY_TYPE}" in - "JKS") - echo "$ohsKeyStoreData" | base64 --decode > ${OHS_VAULT_PATH}/ohsKeystore.jks - sudo chown -R $username:$groupname ${OHS_VAULT_PATH}/ohsKeystore.jks - # Validate JKS file - verifyCertValidity ${OHS_VAULT_PATH}/ohsKeystore.jks $ohsKeyStorePassPhrase $CURRENT_DATE $MIN_CERT_VALIDITY "JKS" - - KEY_TYPE=`$JAVA_HOME/bin/keytool -list -v -keystore ${OHS_VAULT_PATH}/ohsKeystore.jks -storepass ${ohsKeyStorePassPhrase} | grep 'Keystore type:'` - if [[ $KEY_TYPE == *"jks"* ]]; then - runuser -l oracle -c "${INSTALL_PATH}/oracle/middleware/oracle_home/oracle_common/bin/orapki wallet jks_to_pkcs12 -wallet ${OHS_VAULT_PATH} -pwd ${ORACLE_VAULT_PASSWORD} -keystore ${OHS_VAULT_PATH}/ohsKeystore.jks -jkspwd ${ohsKeyStorePassPhrase}" - if [[ $? == 0 ]]; then - echo "Successfully added JKS keystore to Oracle Wallet" - else - echo_stderr "Adding JKS keystore to Oracle Wallet failed" - exit 1 - fi - else - echo_stderr "Not a valid JKS keystore file" - exit 1 - fi - ;; - - "PKCS12") - echo "$ohsKeyStoreData" | base64 --decode > ${OHS_VAULT_PATH}/ohsCert.p12 - sudo chown -R $username:$groupname ${OHS_VAULT_PATH}/ohsCert.p12 - # Validate PKCS12 file - verifyCertValidity ${OHS_VAULT_PATH}/ohsCert.p12 $ohsKeyStorePassPhrase $CURRENT_DATE $MIN_CERT_VALIDITY "PKCS12" - - runuser -l oracle -c "${INSTALL_PATH}/oracle/middleware/oracle_home/oracle_common/bin/orapki wallet import_pkcs12 -wallet ${OHS_VAULT_PATH} -pwd ${ORACLE_VAULT_PASSWORD} -pkcs12file ${OHS_VAULT_PATH}/ohsCert.p12 -pkcs12pwd ${ohsKeyStorePassPhrase}" - if [[ $? == 0 ]]; then - echo "Successfully added certificate to Oracle Wallet" - else - echo_stderr "Unable to add PKCS12 certificate to Oracle Wallet" - exit 1 - fi - ;; - esac -} - -# Update ssl.conf file for SSL access and vault path -function updateSSLConfFile() -{ - echo "Updating ssl.conf file for oracle vaulet" - runuser -l oracle -c "cp $OHS_DOMAIN_PATH/config/fmwconfig/components/OHS/instances/$OHS_COMPONENT_NAME/ssl.conf $OHS_DOMAIN_PATH/config/fmwconfig/components/OHS/instances/$OHS_COMPONENT_NAME/ssl.conf.bkup" - runuser -l oracle -c "cp $OHS_DOMAIN_PATH/config/fmwconfig/components/OHS/$OHS_COMPONENT_NAME/ssl.conf $OHS_DOMAIN_PATH/config/fmwconfig/components/OHS/$OHS_COMPONENT_NAME/ssl.conf.bkup" - runuser -l oracle -c "sed -i 's|SSLWallet.*|SSLWallet \"${OHS_VAULT_PATH}\"|g' $OHS_DOMAIN_PATH/config/fmwconfig/components/OHS/instances/$OHS_COMPONENT_NAME/ssl.conf" - runuser -l oracle -c "sed -i 's|SSLWallet.*|SSLWallet \"${OHS_VAULT_PATH}\"|g' $OHS_DOMAIN_PATH/config/fmwconfig/components/OHS/$OHS_COMPONENT_NAME/ssl.conf" -} - -#Check whether service is started -function verifyService() -{ - serviceName=$1 - sudo systemctl status $serviceName | grep "active" - if [[ $? != 0 ]]; - then - echo "$serviceName is not in active state" - exit 1 - fi - echo $serviceName is active and running -} - - - -# Execution starts here - -CURR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -BASE_DIR="$(readlink -f ${CURR_DIR})" - -# Used for certificate expiry validation -CURRENT_DATE=`date +%s` -# Supplied certificate to have minimum days validity for the deployment -# In this case set for 1 day -MIN_CERT_VALIDITY="1" - -read OHS_DOMAIN_NAME OHS_COMPONENT_NAME OHS_NM_USER OHS_NM_PSWD OHS_HTTP_PORT OHS_HTTPS_PORT WLS_REST_URL WLS_USER WLS_PASSWORD OHS_KEY_STORE_DATA OHS_KEY_STORE_PASSPHRASE ORACLE_VAULT_PASSWORD OHS_KEY_TYPE - -JDK_PATH="/u01/app/jdk" -JDK_VERSION="jdk1.8.0_291" -JAVA_HOME=$JDK_PATH/$JDK_VERSION -PATH=$JAVA_HOME/bin:$PATH -OHS_PATH="/u01/app/ohs" -DOMAIN_PATH="/u01/domains" -INSTALL_PATH="$OHS_PATH/install" -OHS_DOMAIN_PATH=${DOMAIN_PATH}/${OHS_DOMAIN_NAME} -OHS_VAULT_PATH="${DOMAIN_PATH}/ohsvault" -groupname="oracle" -username="oracle" - -validateInput -setupDomainPath -setupOHSDomain -createStartComponent -createStopComponent -create_nodemanager_service -createComponentService -create_mod_wl_ohs_conf -createOracleVault -addCertficateToOracleVault -updateSSLConfFile -updateNetworkRules -enabledAndStartNodeManagerService -verifyService "ohs_nodemanager" -enableAndStartOHSServerService -verifyService "ohs_component" -cleanup diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/scripts/updateDNSZones.sh b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/scripts/updateDNSZones.sh deleted file mode 100644 index 78f21e8a2..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/scripts/updateDNSZones.sh +++ /dev/null @@ -1,108 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Description -# This script updates the Azure DNS Zones used for configuring DNS for WebLogic Admin Server and Azure Application Gateway. - -# Inputs: -# RESOURCE_GROUP_NAME -# DNS_ZONE_NAME -# DNS_RECORDSET_NAMES -# DNS_TARGET_RESOURCES -# DNS_RECORD_NAMES_LENGTH -# DNS_TARGET_RESOURCES_LENGTH -# DNS_RECORD_TTL -# DNS_CNAME_RECORDSET_NAMES -# DNS_CNAME_ALIAS -# DNS_CNAME_RECORDSET_LENGTH -# DNS_CNAME_ALIAS_LENGTH -# MANAGED_IDENTITY_ID - -if [[ ${DNS_RECORD_NAMES_LENGTH} != ${DNS_TARGET_RESOURCES_LENGTH} ]]; then - echo "Error: number of A record set names is not equal to that of target resources." - exit 1 -fi - -if [[ ${DNS_CNAME_RECORDSET_LENGTH} != ${DNS_CNAME_ALIAS_LENGTH} ]]; then - echo "Error: number of CNAME record set names is not equal to that of alias." - exit 1 -fi - -# check if the zone exist -az network dns zone show -g ${RESOURCE_GROUP_NAME} -n ${DNS_ZONE_NAME} - -# query name server for testing -nsforTest=$(az network dns record-set ns show -g ${RESOURCE_GROUP_NAME} -z ${DNS_ZONE_NAME} -n @ --query "nsRecords"[0].nsdname -o tsv) -echo name server: ${nsforTest} - -if [ ${DNS_RECORD_NAMES_LENGTH} -gt 0 ]; then - recordSetNamesArr=$(echo $DNS_RECORDSET_NAMES | tr "," "\n") - targetResourcesArr=$(echo $DNS_TARGET_RESOURCES | tr "," "\n") - - index=0 - for record in $recordSetNamesArr; do - count=0 - for target in $targetResourcesArr; do - if [ $count -eq $index ]; then - echo Create A record with name: $record, target IP: $target - az network dns record-set a create \ - -g ${RESOURCE_GROUP_NAME} \ - -z ${DNS_ZONE_NAME} \ - -n ${record} \ - --target-resource ${target} \ - --ttl ${DNS_RECORD_TTL} - - nslookup ${record}.${DNS_ZONE_NAME} ${nsforTest} - if [ $? -eq 1 ];then - echo Error: failed to create record with name: $record, target Id: $target - exit 1 - fi - fi - - count=$((count + 1)) - done - - index=$((index + 1)) - done -fi - -if [ ${DNS_CNAME_RECORDSET_LENGTH} -gt 0 ];then - cnameRecordSetArr=$(echo $DNS_CNAME_RECORDSET_NAMES | tr "," "\n") - cnameRecordAliasArr=$(echo $DNS_CNAME_ALIAS | tr "," "\n") - - index=0 - for record in $cnameRecordSetArr; do - count=0 - for target in $cnameRecordAliasArr; do - if [ $count -eq $index ]; then - echo Create CNAME record with name: $record, alias: $target - az network dns record-set cname create \ - -g ${RESOURCE_GROUP_NAME} \ - -z ${DNS_ZONE_NAME} \ - -n ${record} \ - --ttl ${DNS_RECORD_TTL} - - az network dns record-set cname set-record \ - -g ${RESOURCE_GROUP_NAME} \ - -z ${DNS_ZONE_NAME} \ - --cname ${target} \ - --record-set-name ${record} - - nslookup ${record}.${DNS_ZONE_NAME} ${nsforTest} - if [ $? -eq 1 ];then - echo Error: failed to create CNAME record with name: $record, alia: $target - exit 1 - fi - fi - - count=$((count + 1)) - done - - index=$((index + 1)) - done -fi - -# delete user assigned managed identity - -az identity delete --ids ${MANAGED_IDENTITY_ID} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/cli-scripts/custom-dns-alias-cli.sh b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/cli-scripts/custom-dns-alias-cli.sh deleted file mode 100644 index 79e8c2564..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/cli-scripts/custom-dns-alias-cli.sh +++ /dev/null @@ -1,341 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# -# -# Description -# This script is to configure custom DNS alias for Weblogic Server Administration Console and Load Balancer. -# It supports two scenarios: -# * If you have an Azure DNS Zone, create DNS alias for admin console and Load Balancer on the existing DNS Zone. -# * If you don’t have an Azure DNS Zone, create the DNS Zone in the same resource group of WebLogic cluster, and create DNS alias for admin console and Load Balancer. - -# Initialize -script="${BASH_SOURCE[0]}" -scriptDir="$(cd "$(dirname "${script}")" && pwd)" - -function usage() { - cat < \\ - --admin-vm-name adminVM \\ - --admin-console-label admin \\ - --artifact-location \\ - --location eastus \\ - --zone-name contoso.com \\ - --ohs-vm-name ohsVM \\ - --loadbalancer-label application \\ - --zone-resource-group haiche-dns-test1 - - 2. Configure DNS alias on a new DNS Zone - ./custom-dns-alias-cli.sh \\ - --resource-group \\ - --admin-vm-name adminVM \\ - --admin-console-label admin \\ - --artifact-location \\ - --location eastus \\ - --zone-name contoso.com \\ - --ohs-vm-name ohsVM \\ - --loadbalancer-label application - -EOF -} - -function validateInput() { - if [ -z "${resourceGroup}" ]; then - echo "Option --resource-group is required." - exit 1 - fi - if [ -z "${artifactLocation}" ]; then - echo "Option --artifact-location is required." - exit 1 - fi - - templateURL="${artifactLocation}nestedtemplates/dnszonesTemplate.json" - if [ -z "${templateURL}" ]; then - echo "Option --artifact-location is required." - exit 1 - else - if curl --output /dev/null --silent --head --fail "${templateURL}"; then - echo "ARM Tempalte exists: $templateURL" - else - echo "ARM Tempalte does not exist: $templateURL" - exit 1 - fi - fi - if [ -z "${zoneName}" ]; then - echo "Option --zone-name is required." - exit 1 - fi - if [ -z "${adminVMName}" ]; then - echo "Option --admin-vm-name is required." - exit 1 - fi - if [ -z "${adminLabel}" ]; then - echo "Option --admin-console-label is required." - exit 1 - fi - - if [[ -n "${lbLabel}" && -n "${ohsVMName}" ]]; then - enableLB=true - fi - - if [ -n "${zoneResourceGroup}" ]; then - hasDNSZone=true - fi -} - -function queryPublicIPId() { - az extension add --name resource-graph; - - vmName=$1; - tag=$2 - - nicId=$(az graph query -q "Resources - | where type =~ 'microsoft.compute/virtualmachines' - | where name=~ '${vmName}' - | where resourceGroup =~ '${resourceGroup}' - | extend nics=array_length(properties.networkProfile.networkInterfaces) - | mv-expand nic=properties.networkProfile.networkInterfaces - | where nics == 1 or nic.properties.primary =~ 'true' or isempty(nic) - | project nicId = tostring(nic.id)" -o tsv) - - if [ -z "${nicId}" ]; then - echo "Please make sure admin VM '${vmName}' exists in resource group '${resourceGroup}'. " - exit 1 - fi - - ipId=$(az graph query -q "Resources - | where type =~ 'microsoft.network/networkinterfaces' - | where id=~ '${nicId}' - | extend ipConfigsCount=array_length(properties.ipConfigurations) - | mv-expand ipconfig=properties.ipConfigurations - | where ipConfigsCount == 1 or ipconfig.properties.primary =~ 'true' - | project publicIpId = tostring(ipconfig.properties.publicIPAddress.id)" -o tsv) - - if [ -z "${ipId}" ]; then - echo "Can not query public IP of admin VM. Please make sure admin VM '${vmName}' exists in resource group '${resourceGroup}'. " - exit 1 - fi - - if [ $? -eq 1 ];then - exit 1 - fi - - if [ "${tag}" == "admin" ];then - adminIPId=${ipId} - else - lbIPId=${ipId} - fi -} - -function queryAdminIPId() { - queryPublicIPId ${adminVMName} "admin" -} - -function queryLBPublicIP() { - queryPublicIPId ${ohsVMName} -} - -function generateParameterFile() { - parametersPath=parameters.json - cat <${scriptDir}/${parametersPath} -{ - "\$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "value": "${artifactLocation}" - }, - "_artifactsLocationSasToken": { - "value": "" - }, -EOF - - if [ "${enableLB}" == "true" ]; then - cat <>${scriptDir}/${parametersPath} - "dnszonesARecordSetNames": { - "value": [ - "$adminLabel", - "$lbLabel" - ] - }, - "targetResources": { - "value": [ - "${adminIPId}", - "${lbIPId}" - ] - }, -EOF - else - cat <>${scriptDir}/${parametersPath} - "dnszonesARecordSetNames": { - "value": [ - "$adminLabel" - ] - }, - "targetResources": { - "value": [ - "${adminIPId}" - ] - }, -EOF - fi - - cat <>${scriptDir}/${parametersPath} - "dnszonesCNAMEAlias": { - "value": [ - ] - }, - "dnszonesCNAMERecordSetNames": { - "value": [ - ] - }, - "dnszoneName": { - "value": "${zoneName}" - }, - "hasDNSZones": { - "value": ${hasDNSZone} - }, - "location": { - "value": "${location}" - }, - "resourceGroup": { - "value": "${zoneResourceGroup}" - } - } -} -EOF -} - -function invoke() { - # validate the template - az deployment group validate --verbose \ - --resource-group ${resourceGroup} \ - --parameters @${scriptDir}/${parametersPath} \ - --template-uri ${templateURL} - - # invoke the template - az deployment group create --verbose \ - --resource-group ${resourceGroup} \ - --parameters @${scriptDir}/${parametersPath} \ - --template-uri ${templateURL} \ - --name "configure-custom-dns-alias-$(date +"%s")" - - # exit if error happens - if [ $? -eq 1 ]; then - exit 1 - fi -} - -function cleanup() { - if test -f "${scriptDir}/${parametersPath}"; then - rm -f ${scriptDir}/${parametersPath} - fi -} - -function printSummary() { - echo "" - echo "" - echo " -DONE! - " - if [ "${hasDNSZone}" == "false" ]; then - nameServers=$(az network dns zone show -g ${resourceGroup} --name ${zoneName} --query nameServers) - echo " -Action required: - Complete Azure DNS delegation to make the alias accessible. - Reference: https://aka.ms/dns-domain-delegatio - Name servers: - ${nameServers} - " - fi - - echo " -Custom DNS alias: - Resource group: ${resourceGroup} - WebLogic Server Administration Console URL: http://${adminLabel}.${zoneName}:7001/console - WebLogic Server Administration Console secured URL: https://${adminLabel}.${zoneName}:7002/console - " - - if [ "${enableLB}" == "true" ]; then - lbPorts=$(az network nsg rule list -g ${resourceGroup} --nsg-name wls-nsg --query "[?name=='OHSPorts'].destinationPortRanges" -o tsv) - echo " - Load Balancer URL: http://${lbLabel}.${zoneName}:${lbPorts:0:4} - Load Balancer secured URL: https://${lbLabel}.${zoneName}:${lbPorts:5:4} -" - fi -} - -# main script start from here -# default value -enableLB=false -hasDNSZone=false - -# Transform long options to short ones -for arg in "$@"; do - shift - case "$arg" in - "--help") set -- "$@" "-h" ;; - "--resource-group") set -- "$@" "-g" ;; - "--artifact-location") set -- "$@" "-f" ;; - "--zone-name") set -- "$@" "-z" ;; - "--admin-vm-name") set -- "$@" "-m" ;; - "--admin-console-label") set -- "$@" "-c" ;; - "--loadbalancer-label") set -- "$@" "-w" ;; - "--zone-resource-group") set -- "$@" "-r" ;; - "--location") set -- "$@" "-l" ;; - "--ohs-vm-name") set -- "$@" "-o" ;; - "--"*) - set -- usage - exit 2 - ;; - *) set -- "$@" "$arg" ;; - esac -done - -# Parse short options -OPTIND=1 -while getopts "hg:f:z:m:c:w:r:i:l:o:" opt; do - case "$opt" in - "g") resourceGroup="$OPTARG" ;; - "f") artifactLocation="$OPTARG" ;; - "h") - usage - exit 0 - ;; - "z") zoneName="$OPTARG" ;; - "m") adminVMName="$OPTARG" ;; - "c") adminLabel="$OPTARG" ;; - "w") lbLabel="$OPTARG" ;; - "r") zoneResourceGroup="$OPTARG" ;; - "l") location="$OPTARG" ;; - "o") ohsVMName="$OPTARG" ;; - esac -done -shift $(expr $OPTIND - 1) - -validateInput -cleanup -queryAdminIPId -echo Enable Loadbalancer: ${enableLB} -if [ "${enableLB}" == "true" ]; then - queryLBPublicIP -fi -generateParameterFile -invoke -cleanup -printSummary diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/deletenode/pom.xml b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/deletenode/pom.xml deleted file mode 100644 index bf6795168..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/deletenode/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - 4.0.0 - - - com.oracle.weblogic.azure - weblogic-azure-vm - 1.0.0 - ../../pom.xml - - - com.oracle.weblogic.azure - arm-oraclelinux-wls-dynamic-cluster-deletenode - ${version.arm-oraclelinux-wls-dynamic-cluster-deletenode} - - jar - ${project.artifactId} - - - -TestParameter '@{"SampleName"="deletenode/src/main";"RawRepoPath"="${artifactsLocationBase}/arm-oraclelinux-wls-dynamic-cluster/"}' - ${project.basedir}/../../.. - false - false - - - - - - - diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/deletenode/src/main/arm/deletenodedeploy.parameters.json b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/deletenode/src/main/arm/deletenodedeploy.parameters.json deleted file mode 100644 index 1955ad99d..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/deletenode/src/main/arm/deletenodedeploy.parameters.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "adminVMName": { - "value": "GEN-UNIQUE" - }, - "deletingManagedServerNames": { - "value": "GEN-SSH-PUB-KEY" - }, - "deletingManagedServerMachineNames": { - "value": "GEN-UNIQUE" - }, - "wlsUserName": { - "value": "GEN-UNIQUE" - }, - "wlsPassword": { - "value": "GEN-UNIQUE" - }, - "wlsForceShutDown": { - "value": "GEN-UNIQUE" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/deletenode/src/main/arm/mainTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/deletenode/src/main/arm/mainTemplate.json deleted file mode 100644 index 4677f1b92..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/deletenode/src/main/arm/mainTemplate.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "type": "string", - "metadata": { - "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated." - }, - "defaultValue": "${artifactsLocationBase}/arm-oraclelinux-wls-dynamic-cluster/deletenode/src/main/" - }, - "_artifactsLocationSasToken": { - "type": "securestring", - "metadata": { - "description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." - }, - "defaultValue": "" - }, - "adminVMName": { - "type": "string", - "defaultValue": "adminVM", - "metadata": { - "description": "Admin Server hosting VM name." - } - }, - "deletingCacheServerNames": { - "type": "array", - "defaultValue": [], - "metadata": { - "description": "Names of cache servers to be deleted, comma delimited. Please ignore this parameter if you are not deleting cache servers." - } - }, - "deletingManagedServerMachineNames": { - "type": "array", - "metadata": { - "description": "Vitual Machine names of managed servers to be deleted, comma delimited." - } - }, - "managedServerPrefix": { - "type": "string", - "defaultValue": "msp", - "metadata": { - "description": "Provide managed server prefix name" - } - }, - "wlsUserName": { - "type": "string", - "metadata": { - "description": "Username for your Weblogic domain name" - } - }, - "wlsPassword": { - "type": "securestring", - "metadata": { - "description": "Password for your Weblogic domain name" - } - }, - "wlsForceShutDown": { - "type": "string", - "defaultValue": "true", - "allowedValues": [ - "true", - "false" - ], - "metadata": { - "description": "Will force to shut down managed server if the tag set to true." - } - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]", - "metadata": { - "description": "Location for all resources." - } - } - }, - "variables": { - "const_wlsAdminPort": "7001", - "const_wlsHome": "/u01/app/wls/install/oracle/middleware/oracle_home", - "name_scriptDeleteNode": "deletenode.sh" - }, - "functions": [ - { - "namespace": "array", - "members": { - "join": { - "parameters": [ - { - "name": "items", - "type": "array" - } - ], - "output": { - "type": "string", - "value": "[replace(replace(replace(string(parameters('items')), '[\"', ''), '\"]', ''), '\",\"', ',')]" - } - } - } - } - ], - "resources": [ - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${dynamic.deletenode.start}", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines/extensions", - "name": "[concat(parameters('adminVMName'),'/newuserscript')]", - "location": "[parameters('location')]", - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.0", - "autoUpgradeMinorVersion": true, - "settings": { - "fileUris": [ - "[uri(parameters('_artifactsLocation'), concat('scripts/', variables('name_scriptDeleteNode'), parameters('_artifactsLocationSasToken')))]" - ] - }, - "protectedSettings": { - "commandToExecute": "[concat('sh',' ', variables('name_scriptDeleteNode'), ' <<< \"', parameters('wlsUserName'),' ',parameters('wlsPassword'),' ', array.join(parameters('deletingManagedServerMachineNames')),' ', parameters('wlsForceShutDown'), ' ', parameters('adminVMName'), ' ',variables('const_wlsAdminPort'),' ',variables('const_wlsHome'), ' ', parameters('managedServerPrefix'), ' ', array.join(parameters('deletingCacheServerNames')),'\"')]" - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${dynamic.deletenode.end}", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('adminVMName'), 'newuserscript')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - } - ], - "outputs": { - "commandsToDeleteAzureResource": { - "type": "string", - "value": "[concat('export resourceGroup=', resourceGroup().name,';', 'export deleteingIDs=\"\";export managedServerMachineNames=$(echo ',array.join(parameters('deletingManagedServerMachineNames')),' | tr \",\" \"\\n\");','az extension add --name resource-graph;','for machine in $managedServerMachineNames;do vmId=$(az graph query -q \"Resources | where type =~ ','\\','\"microsoft.compute/virtualmachines\\\" | where name=~ \\\"${machine}\\\" | where resourceGroup =~ \\\"${resourceGroup}\\\" | project vmid = tolower(id)\" --query data[0].vmid -o tsv); nicId=$(az graph query -q \"Resources | where type =~ \\\"microsoft.compute/virtualmachines\\\" | where name=~ \\\"${machine}\\\" | where resourceGroup =~ \\\"${resourceGroup}\\\" | extend nics=array_length(properties.networkProfile.networkInterfaces) | mv-expand nic=properties.networkProfile.networkInterfaces | where nics == 1 or nic.properties.primary =~ \\\"true\\\" or isempty(nic) | project nicId = tostring(nic.id)\" --query data[0].nicId -o tsv);ipId=$(az graph query -q \"Resources | where type =~ \\\"microsoft.network/networkinterfaces\\\" | where id=~ \\\"${nicId}\\\" | extend ipConfigsCount=array_length(properties.ipConfigurations) | mv-expand ipconfig=properties.ipConfigurations | where ipConfigsCount == 1 or ipconfig.properties.primary =~ \\\"true\\\" | project publicIpId = tostring(ipconfig.properties.publicIPAddress.id)\" --query data[0].publicIpId -o tsv);osDiskId=$(az graph query -q \"Resources | where type =~ \\\"microsoft.compute/virtualmachines\\\" | where name=~ \\\"${machine}\\\" | where resourceGroup =~ \\\"${resourceGroup}\\\" | project osDiskId = tostring(properties.storageProfile.osDisk.managedDisk.id)\" --query data[0].osDiskId -o tsv);deleteingIDs=$(echo $deleteingIDs ${vmId} ${nicId} ${ipId} ${osDiskId});done;echo \"List resource Ids to be deleted: \";echo ${deleteingIDs} | tr \" \" \"\\n\";echo -n \"Are you sure to delete these resources (y/n)?\";read answer;if [[ \"$answer\" != \"${answer#[Yy]}\" && -n \"${deleteingIDs}\" ]]; then echo \"Deleting managed resources...Please do not stop.\";az resource delete --verbose --ids ${deleteingIDs};fi')]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/deletenode/src/main/scripts/deletenode-cli.sh b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/deletenode/src/main/scripts/deletenode-cli.sh deleted file mode 100644 index 6db2260d2..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/deletenode/src/main/scripts/deletenode-cli.sh +++ /dev/null @@ -1,149 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# -# -# Description -# This script deletes managed nodes from an existing dynamic WebLogic cluster and removes related Azure resources. -# It removes Azure resources including: -# * Virtual Machines that host deleting managed servers. -# * Data disks attached to the Virtual Machines -# * OS disks attached to the Virtual Machines -# * Network Interfaces added to the Virtual Machines -# * Public IPs added to the Virtual Machines -# -# The following pre-requisites must be handled prior to running this script: -# * Azure Dynamic WebLogic Cluster application has deployed, the dynamic WebLogic cluster has an Adminstration Server. -# * The dynamic WebLogic cluster has as least one managed nodes -# * Azure CLI is installed -# * Azure CLI has authorized to manage Azure resources -# - -# Initialize -script="${BASH_SOURCE[0]}" -scriptDir="$( cd "$( dirname "${script}" )" && pwd )" - -function usage { - echo usage: ${script} -g resource-group [-f template-file] [-u template-url] -p paramter-file [-s silent-mode] [-h] - echo " -g Azure Resource Group of the Vitural Machines that host deleting manages servers, must be specified." - echo " -f Path of ARM template to delete nodes, must be specified -f option or -u option." - echo " -u URL of ARM template, must be specified -f option or -u option." - echo " -p Path of ARM parameter, must be specified. " - echo " -s Execute the script in silent mode. The script will input y automatically for the prompt." - echo " -h Help" - exit $1 -} - -silent=false - -# -# Parse the command line options -# -while getopts "shg:f:u:p:" opt; do - case $opt in - g) resourceGroup="${OPTARG}" - ;; - f) templateFile="${OPTARG}" - ;; - u) templateURL="${OPTARG}" - ;; - p) parametersFile="${OPTARG}" - ;; - s) silent=true - ;; - h) usage 0 - ;; - *) usage 1 - ;; - esac -done - - -function initialize { - validateErrors=false - - if [ -z "${resourceGroup}" ]; then - echo "You must use the -g option to specify resource group." >&2 - validateErrors=true - fi - - if [[ -z "${templateFile}" && -z "${templateURL}" ]]; then - echo "You must use the -f option or -u option to specify tempalte path." >&2 - validateErrors=true - fi - - if [ -n "${templateFile}" ]; then - if [ ! -f ${templateFile} ]; then - echo "Unable to locate the template ${templateFile}" >&2 - validateErrors=true - fi - fi - - if [ -z "${parametersFile}" ]; then - echo "You must use the -p option to specify the path of ARM parameters." >&2 - validateErrors=true - else - if [ ! -f ${parametersFile} ]; then - echo "Unable to locate the parameter ${parametersFile}" >&2 - validateErrors=true - fi - fi - - if [ ${validateErrors} == true ]; then - usage 1 - fi -} - -function removeManagedNodes { - # validate template - templateArgument="-u ${templateURL}" - if [ -n "${templateFile}" ];then - templateArgument="-f ${templateFile}" - fi - - az deployment group validate \ - -g ${resourceGroup} \ - ${templateArgument} \ - -p @${parametersFile} \ - --no-prompt - - if [ $? -ne 0 ]; then - echo "Error happens on template or parameters." - exit 1 - fi - - # delete nodes from dynamic weblogic cluster - commandsToDeleteAzureResource=$(az deployment group create --verbose -g ${resourceGroup} ${templateArgument} -p @${parametersFile} -n ${deploymentName} --no-prompt --query properties.outputs.commandsToDeleteAzureResource.value) - if [ $? -ne 0 ]; then - echo "Error happens on template deployment." - exit 1 - fi - - # delete azure resources of the nodes - commandsToDeleteAzureResource=$(echo "${commandsToDeleteAzureResource}" | sed "s/\\\\\"/\"/g" | sed "s/\\\\n/n/g" | sed "s/\\\\\"/\"/g") - commandsToDeleteAzureResource=$(echo ${commandsToDeleteAzureResource:1:${#commandsToDeleteAzureResource}-2}) - cat <remove-azure-resource.sh -${commandsToDeleteAzureResource} -EOF - - chmod ugo+x ./remove-azure-resource.sh - if [ $silent == true ];then - echo "y" | ./remove-azure-resource.sh - else ./remove-azure-resource.sh - fi - - if [ $? -eq 0 ]; then - echo "" - echo "" - echo "Complete!" - fi - - rm -f ./remove-azure-resource.sh -} - - - -deploymentName="deletenode-$(date +"%s")" - -initialize -removeManagedNodes diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/deletenode/src/main/scripts/deletenode.sh b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/deletenode/src/main/scripts/deletenode.sh deleted file mode 100644 index 2282f333e..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/deletenode/src/main/scripts/deletenode.sh +++ /dev/null @@ -1,267 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# -#Function to output message to StdErr -function echo_stderr () -{ - echo "$@" >&2 -} - -#Function to display usage message -function usage() -{ - echo_stderr "./deletenode.sh <<< \"\"" -} - -function validateInput() -{ - if [[ -z "$wlsUserName" || -z "$wlsPassword" ]] - then - echo_stderr "wlsUserName or wlsPassword is required. " - exit 1 - fi - - if [ -z "$managedVMNames" ]; - then - echo_stderr "managedVMNames is required. " - fi - - if [ -z "$wlsForceShutDown" ]; - then - echo_stderr "wlsForceShutDown is required. " - fi - - if [ -z "$wlsAdminHost" ]; - then - echo_stderr "wlsAdminHost is required. " - fi - - if [ -z "$wlsAdminPort" ]; - then - echo_stderr "wlsAdminPort is required. " - fi - - if [ -z "$oracleHome" ]; - then - echo_stderr "oracleHome is required. " - fi - - if [ -z "$managedServerPrefix" ]; - then - echo_stderr "managedServerPrefix is required. " - fi - - if [ -z "$deletingCacheServerNames" ]; - then - echo_stderr "deletingCacheServerNames is required. " - fi -} - -#Function to cleanup all temporary files -function cleanup() -{ - echo "Cleaning up temporary files..." - rm -f ${wlsDomainsPath}/*.py - echo "Cleanup completed." -} - -#This function to delete machines -function delete_machine_model() -{ - arrServerMachineNames=$(echo $managedVMNames | tr "," "\n") - hasClient="false" # if there is client machine, have to shutdown and start cluster1 - for machine in $arrServerMachineNames - do - if [[ "${machine}" =~ ^${managedServerPrefix}StorageVM[0-9]+$ ]]; - then - continue - else - hasClient="true" - break - fi - done - - echo "Deleting managed server machine name model for $managedVMNames" - cat <${wlsDomainsPath}/delete-machine.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -try: - edit() - startEdit() -EOF - - if [[ "${hasClient}" == "true" ]]; then - cat <>${wlsDomainsPath}/delete-machine.py - shutdown('$wlsClusterName', 'Cluster') -EOF - fi - - for machine in $arrServerMachineNames - do - if [[ -n ${managedServerPrefix} && "${machine}" =~ ^${managedServerPrefix}StorageVM[0-9]+$ ]]; - then - # machine name of cache machine - machineName=${machine} - else - # machine name of application machine - machineName="machine-"${machine} - fi - echo "deleting name model for ${machineName}" - cat <>${wlsDomainsPath}/delete-machine.py - editService.getConfigurationManager().removeReferencesToBean(getMBean('/Machines/${machineName}')) - cmo.destroyMachine(getMBean('/Machines/${machineName}')) -EOF - done - - cat <>${wlsDomainsPath}/delete-machine.py - save() - activate() -except: - stopEdit('y') - sys.exit(1) -EOF - - if [[ "${hasClient}" == "true" ]]; then - cat <>${wlsDomainsPath}/delete-machine.py -try: - start('$wlsClusterName', 'Cluster') -except: - dumpStack() -EOF - fi - - cat <>${wlsDomainsPath}/delete-machine.py -disconnect() -EOF -} - -#This function to check admin server status -function wait_for_admin() -{ - #check admin server status - count=1 - CHECK_URL="http://$wlsAdminURL/weblogic/ready" - status=`curl --insecure -ILs $CHECK_URL | tac | grep -m1 HTTP/1.1 | awk {'print $2'}` - echo "Check admin server status" - while [[ "$status" != "200" ]] - do - echo "." - count=$((count+1)) - if [ $count -le 30 ]; - then - sleep 1m - else - echo "Error : Maximum attempts exceeded while checking admin server status" - exit 1 - fi - status=`curl --insecure -ILs $CHECK_URL | tac | grep -m1 HTTP/1.1 | awk {'print $2'}` - if [ "$status" == "200" ]; - then - echo "WebLogic Server is running..." - break - fi - done -} - -function delete_cache_server() -{ - if [[ -z "$deletingCacheServerNames" || "$deletingCacheServerNames" == "[]" ]]; then - return - fi - - echo "Deleting managed server name model for $deletingCacheServerNames" - cat <${wlsDomainsPath}/delete-server.py -connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL') -try: - edit() - startEdit() -EOF - -arrCacheServerNames=$(echo $deletingCacheServerNames | tr "," "\n") -for server in $arrCacheServerNames -do - echo "deleting name model for $server" - cat <>${wlsDomainsPath}/delete-server.py - shutdown('$server', 'Server',ignoreSessions='true',force='$wlsForceShutDown') - editService.getConfigurationManager().removeReferencesToBean(getMBean('/MigratableTargets/$server (migratable)')) - cd('/') - cmo.destroyMigratableTarget(getMBean('/MigratableTargets/$server (migratable)')) - cd('/Servers/$server') - cmo.setCluster(None) - cmo.setMachine(None) - editService.getConfigurationManager().removeReferencesToBean(getMBean('/Servers/$server')) - cd('/') - cmo.destroyServer(getMBean('/Servers/$server')) -EOF -done - -cat <>${wlsDomainsPath}/delete-server.py - save() - activate() -except: - stopEdit('y') - sys.exit(1) - -disconnect() -EOF - - . $oracleHome/oracle_common/common/bin/setWlstEnv.sh - - echo "Start to delete managed server $deletingCacheServerNames" - sudo chown -R ${username}:${groupname} ${wlsDomainsPath} - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST ${wlsDomainsPath}/delete-server.py" - if [[ $? != 0 ]]; then - echo "Error : Deleting managed server $deletingCacheServerNames failed" - exit 1 - fi - echo "Complete deleting managed server $deletingCacheServerNames" -} - -function delete_managed_machine() -{ - . $oracleHome/oracle_common/common/bin/setWlstEnv.sh - - echo "Start to delete managed server machine $managedVMNames" - sudo chown -R ${username}:${groupname} ${wlsDomainsPath} - runuser -l oracle -c ". $oracleHome/oracle_common/common/bin/setWlstEnv.sh; java $WLST_ARGS weblogic.WLST ${wlsDomainsPath}/delete-machine.py" - if [[ $? != 0 ]]; then - echo "Error : Deleting machine $managedVMNames failed" - exit 1 - fi - echo "Complete deleting managed server machine $managedVMNames" -} - -#main script starts here -# store arguments in a special array -#args=("$@") -# get number of elements -#ELEMENTS=${#args[@]} - -# echo each element in array -# for loop -#for ((i = 0; i < $ELEMENTS; i++)); do -# echo "ARG[${args[${i}]}]" -#done - -read wlsUserName wlsPassword managedVMNames wlsForceShutDown wlsAdminHost wlsAdminPort oracleHome managedServerPrefix deletingCacheServerNames - -wlsAdminURL=$wlsAdminHost:$wlsAdminPort -hostName=`hostname` -wlsClusterName="cluster1" -username="oracle" -groupname="oracle" -wlsDomainsPath="/u01/domains" - -validateInput - -cleanup - -wait_for_admin - -delete_cache_server - -delete_machine_model - -delete_managed_machine - -cleanup diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/pom.xml b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/pom.xml deleted file mode 100644 index 7cd131f0e..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/pom.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - 4.0.0 - - - com.oracle.weblogic.azure - weblogic-azure-vm - 1.0.0 - ../pom.xml - - - com.oracle.weblogic.azure - arm-oraclelinux-wls-dynamic-cluster-root - pom - 1.0.9 - ${project.artifactId} - - - - https://github.com/oracle/weblogic-azure/tree/main/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster - - - scm:git:git@github.com:wls-eng/arm-oraclelinux-wls-dynamic-cluster.git - scm:git:git@github.com:wls-eng/arm-oraclelinux-wls-dynamic-cluster.git - https://github.com/oracle/weblogic-azure/tree/main/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster - HEAD - - - - - Universal Permissive License Version 1.0 - http://oss.oracle.com/licenses/upl - repo - - - - - ${project.parent.basedir}/.. - - - - addnode - addnode-coherence - deletenode - arm-oraclelinux-wls-dynamic-cluster - - - diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/src/main/resources/marketing-artifacts/partner-center.html b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/src/main/resources/marketing-artifacts/partner-center.html deleted file mode 100644 index 2d1fd438a..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/src/main/resources/marketing-artifacts/partner-center.html +++ /dev/null @@ -1,51 +0,0 @@ -

    Name

    -

    Oracle WebLogic Server Dynamic Cluster on Azure VMs

    -

    Search results summary

    -

    Provisions an n-node Oracle WebLogic Server dynamic cluster on Azure VMs.

    -

    Short description

    -

    Provisions an n-node Oracle WebLogic Server Enterprise Edition dynamic cluster on Azure VMs. Supports integration with -Oracle HTTP Server, databases, and Coherence.

    -

    Description

    -

    Oracle WebLogic Server (WLS) is an industry-leading Java runtime powering some of the most mission-critical enterprise applications - across the globe. This solution automates most boilerplate steps to provision a WLS dynamic cluster on Azure VMs. Once initial - provisioning is complete, you are completely free to customize deployments further. The solution is jointly developed by Oracle and - Microsoft.

    -

    WLS Enterprise Edition versions supported include 12.2.1.4, and 14.1.1.0.

    -

    The following resources are automatically provisioned by the offer.

    -
      -
    • Oracle Linux or Red Hat Enterprise Linux (RHEL) VMs (you can choose the number of VMs - all instances will have private -IP addresses by default)
    • -
    • Dynamic cluster consisting of WebLogic Managed Server instances on each VM (ORACLE_HOME is -/u01/app/wls/install/oracle/middleware/oracle_home)
    • -
    • Admin Server on one of the VMs
    • -
    • WLS Domain with default name wlsd (domain path is /u01/domains/wlsd/)
    • -
    • Oracle JDK on each VM (JAVA_HOME is /u01/app/jdk/jdk-${version})
    • -
    • Oracle HTTP Server (OHS) VM instance with a public IP address by default for load balancing (ORACLE_HOME -is /u01/app/ohs/install/oracle/middleware/oracle_home) - optional
    • -
    • In addition to drivers that come standard with WLS, most recent supported PostgreSQL and Microsoft SQL JDBC drivers (drivers stored in -/u01/app/wls/install/oracle/middleware/oracle_home/wlserver/server/lib/)
    • -
    • Configured data source connection (Oracle DB, Azure SQL, Azure MySQL, Azure PostgreSQL) - optional
    • -
    • VMs with private IP addresses to run data tier Managed Coherence cache servers - optional
    • -
    • Virtual network and subnet (alternatively, you can deploy to an existing virtual network)
    • -
    • Network security group
    • -
    • OS disks attached to VMs
    • -
    • Storage Account, to store VM diagnostics, and file share named -wlsshare (mount point is /mnt/wlsshare)
    • -
    -

    This offer is Bring-Your-Own-License. It assumes you have already procured the appropriate licenses with Oracle and are properly -licensed to run offers in Microsoft Azure.

    -

    Oracle and Microsoft also provide basic step-by-step instructions on getting started with WLS and Azure VMs without automated -provisioning.

    -

    Oracle and Microsoft provide similar solutions targeting WLS on the Azure Kubernetes Service (AKS) in addition to a single WLS -Admin Server instance on an Azure VM. These options are linked in the Learn more section below.

    -

    You can reach out to the engineering team developing these offers by clicking the CONTACT ME button on -the marketplace WebLogic on Azure overview page. Program managers, architects and engineers will get in touch and can -assist you for free with your Azure migration.

    -

    Links

    - diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/deploy-webapp.sh b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/deploy-webapp.sh deleted file mode 100644 index 0088bcfc5..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/deploy-webapp.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# Description -# This script is to test application deployment on WebLogic cluster domain. - -# Verifying admin server is accessible - -read wlsUserName wlspassword adminVMDNS adminPort - -CURL_REQD_PARMS="--user ${wlsUserName}:${wlspassword} -H X-Requested-By:MyClient -H Accept:application/json -s -v" -CURL_RETRY_PARMS="--connect-timeout 60 --max-time 180 --retry 10 --retry-delay 30 --retry-max-time 180 --retry-connrefused" - -echo "curl ${CURL_REQD_PARMS} ${CURL_RETRY_PARMS} -H Content-Type:multipart/form-data \ --H "weblogic.edit.session: default" \ --F \"model={ - name: 'weblogic-cafe', - targets: [ { identity: [ 'clusters', 'cluster1' ] } ] -}\" \ --F \"sourcePath=@weblogic-on-azure/javaee/weblogic-cafe/target/weblogic-cafe.war\" \ --X Prefer:respond-async \ --X POST http://${adminVMDNS}:${adminPort}/management/weblogic/latest/edit/appDeployments" - -# Deploy webapp to weblogic server -curl ${CURL_REQD_PARMS} ${CURL_RETRY_PARMS} -H Content-Type:multipart/form-data \ --H "weblogic.edit.session: default" \ --F "model={ - name: 'weblogic-cafe', - targets: [ { identity: [ 'clusters', 'cluster1' ] } ] -}" \ --F "sourcePath=@weblogic-on-azure/javaee/weblogic-cafe/target/weblogic-cafe.war" \ --H "Prefer:respond-async" \ --X POST http://${adminVMDNS}:${adminPort}/management/weblogic/latest/edit/appDeployments > out - -echo "Deployment response received" -cat out - -attempt=0 -while [ $attempt -le 10 ] -do - curl ${CURL_REQD_PARMS} ${CURL_RETRY_PARMS} \ - -X GET -i "http://${adminVMDNS}:${adminPort}/management/weblogic/latest/domainRuntime/deploymentManager/deploymentProgressObjects/weblogic-cafe?links=none" > out - echo "Checking deployment operation is completed" - cat out | grep "\"state\": \"STATE_COMPLETED\"" - if [ $? == 0 ]; then - echo "Deployment operation is completed" - cat out - break - fi - attempt=$((attempt+1)) - sleep 10s -done - -echo "Verifying the deployed application status" -sleep 1m - -attempt=0 -while [ $attempt -le 5 ] -do - echo "curl ${CURL_REQD_PARMS} ${CURL_RETRY_PARMS} -H weblogic.edit.session: default -H Content-Type:application/json -d {target='cluster1'} -X POST -i http://${adminVMDNS}:${adminPort}/management/weblogic/latest/domainRuntime/deploymentManager/appDeploymentRuntimes/weblogic-cafe/getState" - curl ${CURL_REQD_PARMS} ${CURL_RETRY_PARMS} -H Content-Type:application/json \ - -H "weblogic.edit.session: default" \ - -d "{target='cluster1'}" \ - -X POST -i "http://${adminVMDNS}:${adminPort}/management/weblogic/latest/domainRuntime/deploymentManager/appDeploymentRuntimes/weblogic-cafe/getState" > out - - echo "Deployment state received" - cat out - cat out | grep "\"return\": \"STATE_ACTIVE\"" - if [ $? == 0 ]; then - echo "Application is deployed successfully and in active state" - exit 0 - elif [[ $? != 0 ]] && [[ $attempt -ge 5 ]]; then - echo "Application deployment is unsuccessful" - exit 1 - fi - - cat out | grep "\"return\": \"STATE_PREPARED\"" - if [[ $? == 0 ]]; then - # Ideally this is not required but noticed only for 122130 OL7.4 it is required - echo "Starting the service explicitly" - echo "curl ${CURL_REQD_PARMS} ${CURL_RETRY_PARMS} -H weblogic.edit.session: default -H Content-Type:application/json -d {} -X POST -i http://${adminVMDNS}:${adminPort}/management/weblogic/latest/domainRuntime/deploymentManager/appDeploymentRuntimes/weblogic-cafe/start" - curl ${CURL_REQD_PARMS} ${CURL_RETRY_PARMS} -H Content-Type:application/json \ - -H "weblogic.edit.session: default" \ - -d "{}" \ - -X POST -i "http://${adminVMDNS}:${adminPort}/management/weblogic/latest/domainRuntime/deploymentManager/appDeploymentRuntimes/weblogic-cafe/start" - fi - - attempt=$((attempt+1)) - sleep 1m -done diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/gen-parameters-coherence.sh b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/gen-parameters-coherence.sh deleted file mode 100644 index 47bab649e..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/gen-parameters-coherence.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# - -read parametersPath repoPath testbranchName - -cat <${parametersPath} -{ - "\$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "value": "https://raw.githubusercontent.com/${repoPath}/${testbranchName}/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/" - }, - "_artifactsLocationSasToken": { - "value": "" - }, - "adminPasswordOrKey": { - "value": "GEN-UNIQUE" - }, - "adminUsername": { - "value": "GEN-UNIQUE" - }, - "adminVMName": { - "value": "GEN-UNIQUE" - }, - "enableCoherence": { - "value": true - }, - "vmSize": { - "value": "Standard_B2ms" - }, - "wlsPassword": { - "value": "GEN-UNIQUE" - }, - "wlsUserName": { - "value": "GEN-UNIQUE" - } - } -} -EOF diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/gen-parameters-db.sh b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/gen-parameters-db.sh deleted file mode 100644 index 50cfb8327..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/gen-parameters-db.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# - -read parametersPath repoPath testbranchName - -cat < ${parametersPath} -{ - "\$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "value": "https://raw.githubusercontent.com/${repoPath}/${testbranchName}/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/" - }, - "_artifactsLocationSasToken": { - "value": "" - }, - "adminPasswordOrKey": { - "value": "GEN-UNIQUE" - }, - "adminUsername": { - "value": "GEN-UNIQUE" - }, - "databaseType": { - "value": "postgresql" - }, - "dbPassword": { - "value": "GEN-UNIQUE" - }, - "dbUser": { - "value": "GEN-UNIQUE" - }, - "dsConnectionURL": { - "value": "GEN-UNIQUE" - }, - "enableDB": { - "value": true - }, - "jdbcDataSourceName": { - "value": "jdbc/postgresql" - }, - "maxDynamicClusterSize": { - "value": 4 - }, - "dynamicClusterSize": { - "value": 2 - }, - "vmSize": { - "value": "Standard_B2ms" - }, - "wlsPassword": { - "value": "GEN-UNIQUE" - }, - "wlsUserName": { - "value": "GEN-UNIQUE" - } - } -} -EOF diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/gen-parameters-deploy-coherence.sh b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/gen-parameters-deploy-coherence.sh deleted file mode 100644 index 210fd1bc9..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/gen-parameters-deploy-coherence.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# -#Generate parameters with value for deploying coherence template independently - -read parametersPath adminVMName adminPasswordOrKey skuUrnVersion location storageAccountName wlsDomainName wlsusername wlspassword repoPath testbranchName managedServerPrefix - -cat < ${parametersPath} -{ - "adminVMName":{ - "value": "${adminVMName}" - }, - "adminPasswordOrKey": { - "value": "${adminPasswordOrKey}" - }, - "enableCoherenceWebLocalStorage": { - "value": true - }, - "numberOfCoherenceCacheInstances": { - "value": 1 - }, - "skuUrnVersion": { - "value": "${skuUrnVersion}" - }, - "location": { - "value": "${location}" - }, - "storageAccountName": { - "value": "${storageAccountName}" - }, - "vmSizeSelectForCoherence": { - "value": "Standard_B2ms" - }, - "wlsDomainName": { - "value": "${wlsDomainName}" - }, - "wlsPassword": { - "value": "${wlsPassword}" - }, - "wlsUserName": { - "value": "${wlsUserName}" - }, - "_artifactsLocation":{ - "value": "https://raw.githubusercontent.com/${repoPath}/${testbranchName}/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/" - }, - "managedServerPrefix": { - "value": "${managedServerPrefix}" - } - } -EOF diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/gen-parameters-deploy-db.sh b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/gen-parameters-deploy-db.sh deleted file mode 100644 index 48f0234ba..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/gen-parameters-deploy-db.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# -#Generate parameters with value for deploying db template independently - -read parametersPath adminVMName dbPassword dbAdminUser dbName location wlsusername wlspassword repoPath testbranchName - -cat < ${parametersPath}/parameters-deploy-db.json -{ - "adminVMName":{ - "value": "${adminVMName}" - }, - "databaseType": { - "value": "postgresql" - }, - "dbPassword": { - "value": "${dbPassword}" - }, - "dbUser": { - "value": "${dbAdminUser}" - }, - "dsConnectionURL": { - "value": "jdbc:postgresql://${dbName}.postgres.database.azure.com:5432/postgres?sslmode=require" - }, - "jdbcDataSourceName": { - "value": "jdbc/WebLogicDB" - }, - "location": { - "value": "${location}" - }, - "wlsPassword": { - "value": "${wlsPassword}" - }, - "wlsUserName": { - "value": "${wlsUserName}" - }, - "_artifactsLocation":{ - "value": "https://raw.githubusercontent.com/${repoPath}/${testbranchName}/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/" - }, - } -EOF diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/gen-parameters-deploy.sh b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/gen-parameters-deploy.sh deleted file mode 100644 index d2165ee9d..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/gen-parameters-deploy.sh +++ /dev/null @@ -1,113 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# -#Generate parameters with value for deployment -read parametersPath location adminPasswordOrKey wlsdomainname wlsusername wlspassword managedserverprefix maxDynamicClusterSize dynamicClusterSize skuUrnVersion testbranchName repoPath dbName dbServerName dbPassword dbUser uploadedKeyStoreData - -cat <${parametersPath} -{ - - "\$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "adminUsername": { - "value": "weblogic" - }, - "adminPasswordOrKey": { - "value": "$adminPasswordOrKey" - }, - "dnsLabelPrefix": { - "value": "wls" - }, - "wlsDomainName": { - "value": "$wlsdomainname" - }, - "wlsUserName": { - "value": "$wlsusername" - }, - "wlsPassword": { - "value": "$wlspassword" - }, - "managedServerPrefix":{ - "value": "$managedserverprefix" - }, - "maxDynamicClusterSize": { - "value": $maxDynamicClusterSize - }, - "dynamicClusterSize": { - "value": $dynamicClusterSize - }, - "vmSize": { - "value": "Standard_B2ms" - }, - "location": { - "value": "$location" - }, - "skuUrnVersion": { - "value": "$skuUrnVersion" - }, - "_artifactsLocation": { - - "value": "https://raw.githubusercontent.com/${repoPath}/${testbranchName}/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/" - }, - "addressPrefixes": { - "value": [ - "172.16.8.0/28" - ] - }, - "subnetPrefix": { - "value": "172.16.8.0/28" - }, - "enableCoherence": { - "value": true - }, - "enableCoherenceWebLocalStorage": { - "value": true - }, - "enableDB": { - "value": true - }, - "databaseType": { - "value": "postgresql" - }, - "dsConnectionURL": { - "value": "jdbc:postgresql://${dbServerName}.postgres.database.azure.com:5432/${dbName}?sslmode=require" - }, - "dbGlobalTranPro": { - "value": "EmulateTwoPhaseCommit" - }, - "dbPassword": { - "value": "${dbPassword}" - }, - "dbUser": { - "value": "${dbUser}" - }, - "jdbcDataSourceName": { - "value": "jdbc/WebLogicCafeDB" - }, - "enableOHS": { - "value": true - }, - "ohsNMUser": { - "value": "weblogic" - }, - "ohsNMPassword": { - "value": "$wlspassword" - }, - "oracleVaultPswd": { - "value": "$wlspassword" - }, - "uploadedKeyStoreData": { - "value": "${uploadedKeyStoreData}" - }, - "uploadedKeyStorePassword": { - "value": "$wlspassword" - }, - "uploadedKeyStoreType": { - "value": "JKS" - } - } -} -EOF - diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/gen-parameters.sh b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/gen-parameters.sh deleted file mode 100644 index b00ebc13a..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/gen-parameters.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# - -read parametersPath repoPath testbranchName - -cat <${parametersPath} -{ - "\$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "_artifactsLocation": { - "value": "https://raw.githubusercontent.com/${repoPath}/${testbranchName}/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/" - }, - "_artifactsLocationSasToken": { - "value": "" - }, - "adminPasswordOrKey": { - "value": "GEN-UNIQUE" - }, - "adminUsername": { - "value": "GEN-UNIQUE" - }, - "enableDB": { - "value": false - }, - "maxDynamicClusterSize": { - "value": 4 - }, - "dynamicClusterSize": { - "value": 2 - }, - "vmSize": { - "value": "Standard_B2ms" - }, - "wlsPassword": { - "value": "GEN-UNIQUE" - }, - "wlsUserName": { - "value": "GEN-UNIQUE" - } - } -} -EOF diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/generate-selfsigned-keystore.sh b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/generate-selfsigned-keystore.sh deleted file mode 100644 index 2c81b8995..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/generate-selfsigned-keystore.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash - -# After running this script, you will have the following files in the current directory: -# identity.jks - Identity keystore -# trust.jks - Trust keystore -# root.cert - Root certificate - -read wlsDemoIdentityKeyStorePassPhrase wlsDemoIdentityPassPhrase wlsDemoTrustPassPhrase - -export wlsIdentityKeyStoreFileName="identity.jks" -export wlsTrustKeyStoreFileName="trust.jks" -export wlsIdentityRootCertFileName="root.cert" -export wlsDemoIndetityKeyAlias="demoidentity" - -function generate_selfsigned_certificates() { - # Note: JDK 8 keytool will create jks by default - # JDK 11 keytool will create PKCS12 by default - # This file uses JDK 11 and generates JKS. - echo "Generate identity key store." - ${JAVA_HOME}/bin/keytool -genkey \ - -alias ${wlsDemoIndetityKeyAlias} \ - -keyalg RSA -keysize 2048 \ - -sigalg SHA256withRSA -validity 365 \ - -keystore $wlsIdentityKeyStoreFileName \ - -keypass ${wlsDemoIdentityPassPhrase} \ - -storepass ${wlsDemoIdentityKeyStorePassPhrase} \ - -storetype JKS \ - -dname "CN=*.cloudapp.azure.com, OU=test, O=test, L=test, ST=test, C=test" - - # update the input variables with Demo values - echo "Exporting root cert from identity key store" - ${JAVA_HOME}/bin/keytool -export \ - -alias ${wlsDemoIndetityKeyAlias} \ - -noprompt \ - -file ${wlsIdentityRootCertFileName} \ - -keystore $wlsIdentityKeyStoreFileName \ - -storepass ${wlsDemoIdentityKeyStorePassPhrase} - - echo "Generate trust key store." - ${JAVA_HOME}/bin/keytool -import \ - -alias ${wlsDemoIndetityKeyAlias} \ - -noprompt \ - -file ${wlsIdentityRootCertFileName} \ - -keystore ${wlsTrustKeyStoreFileName} \ - -storepass ${wlsDemoTrustPassPhrase} \ - -storetype JKS -} - -echo "Starting to generate selfsigned certificates" -generate_selfsigned_certificates \ No newline at end of file diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/verify-admin-services.sh b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/verify-admin-services.sh deleted file mode 100644 index 3b54c7bcf..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/verify-admin-services.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Verify the service using systemctl status -function verifyServiceStatus() -{ - serviceName=$1 - systemctl status $serviceName | grep "active (running)" - if [[ $? != 0 ]]; then - echo "$serviceName is not in active (running) state" - exit 1 - fi - echo "$serviceName is active (running)" -} - -#Verify the service using systemctl is-active -function verifyServiceActive() -{ - serviceName=$1 - state=$(systemctl is-active $serviceName) - if [[ $state == "active" ]]; then - echo "$serviceName is active" - else - echo "$serviceName is not active" - exit 1 - fi -} - -# Pass the services to be checked based on admin/managed servers -# For admin server : rngd wls_admin wls_nodemanager -# For managed server : rngd wls_nodemanager - -servicesList="rngd wls_admin wls_nodemanager" - -for service in $servicesList -do - verifyServiceStatus $service - verifyServiceActive $service -done - -exit 0 - diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/verify-deployments.sh b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/verify-deployments.sh deleted file mode 100644 index 0600ba65c..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/verify-deployments.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# - -read prefix location template repoPath testbranchName scriptsDir - -groupName=${prefix}-preflight - -# create Azure resources for preflight testing -az group create --verbose --name $groupName --location ${location} - -# generate parameters for testing differnt cases -parametersList=() -# parameters for cluster -bash ${scriptsDir}/gen-parameters.sh <<< "${scriptsDir}/parameters.json $repoPath $testbranchName" -parametersList+=(${scriptsDir}/parameters.json) - -# parameters for cluster+db -bash ${scriptsDir}/gen-parameters-db.sh <<< "${scriptsDir}/parameters-db.json $repoPath $testbranchName" -parametersList+=(${scriptsDir}/parameters-db.json) - -# run preflight tests -success=true -for parameters in "${parametersList[@]}"; -do - az deployment group validate -g ${groupName} -f ${template} -p @${parameters} --no-prompt - if [[ $? != 0 ]]; then - echo "deployment validation for ${parameters} failed!" - success=false - fi -done - -# release Azure resources -az group delete --yes --no-wait --verbose --name $groupName - -if [[ $success == "false" ]]; then - exit 1 -else - exit 0 -fi - diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/verify-node-services.sh b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/verify-node-services.sh deleted file mode 100644 index 9ea5927d6..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/verify-node-services.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Verify the service using systemctl status -function verifyServiceStatus() -{ - serviceName=$1 - systemctl status $serviceName | grep "active (running)" - if [[ $? != 0 ]]; then - echo "$serviceName is not in active (running) state" - exit 1 - fi - echo "$serviceName is active (running)" -} - -#Verify the service using systemctl is-active -function verifyServiceActive() -{ - serviceName=$1 - state=$(systemctl is-active $serviceName) - if [[ $state == "active" ]]; then - echo "$serviceName is active" - else - echo "$serviceName is not active" - exit 1 - fi -} - -# Pass the services to be checked based on admin/managed servers -# For admin server : rngd wls_admin wls_nodemanager -# For managed server : rngd wls_nodemanager - -servicesList="rngd wls_nodemanager" - -for service in $servicesList -do - verifyServiceStatus $service - verifyServiceActive $service -done - -exit 0 - diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/verify-servers-lifecycle.sh b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/verify-servers-lifecycle.sh deleted file mode 100644 index 6c1cbaa50..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/verify-servers-lifecycle.sh +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# Description -# This script is to test WebLogic cluster domain managed servers lifecycle. - -read wlsUserName wlspassword adminPublicIP adminPort managedServers - -CURL_REQD_PARMS="-s -v --user ${wlsUserName}:${wlspassword} -H X-Requested-By:MyClient -H Content-Type:application/json -H Accept:application/json" -CURL_RETRY_PARMS="--connect-timeout 60 --max-time 180 --retry 10 --retry-delay 30 --retry-max-time 180 --retry-connrefused " -# Shutdown the server and verify whether it is in SHUTDOWN state -# Restart the managed server -for managedServer in $managedServers -do - echo "Shut down managed server : $managedServer" - attempt=0 - while [ $attempt -le 5 ] - do - echo "Attempt to shutdown $attempt" - echo curl ${CURL_REQD_PARMS} -X POST -i "http://${adminPublicIP}:${adminPort}/management/weblogic/latest/domainRuntime/serverLifeCycleRuntimes/$managedServer/forceShutdown" --data "{}" - curl ${CURL_REQD_PARMS} -X POST -i "http://${adminPublicIP}:${adminPort}/management/weblogic/latest/domainRuntime/serverLifeCycleRuntimes/$managedServer/forceShutdown" --data "{}" > out - echo "Response received for shutdown REST command" - cat out - echo "Attempt to verify shutdown $attempt" - echo curl ${CURL_REQD_PARMS} ${CURL_RETRY_PARMS} -X GET -i "http://${adminPublicIP}:${adminPort}/management/weblogic/latest/domainRuntime/serverLifeCycleRuntimes/${managedServer}?links=none" - curl ${CURL_REQD_PARMS} ${CURL_RETRY_PARMS} -X GET -i "http://${adminPublicIP}:${adminPort}/management/weblogic/latest/domainRuntime/serverLifeCycleRuntimes/${managedServer}?links=none" > out - echo "Recevied response for shutdown verification" - cat out - cat out | grep "\"state\": \"SHUTDOWN\"" - if [ $? == 0 ]; then - echo "$managedServer managed server is in SHUTDOWN state as expected" - break - elif [[ $? != 0 ]] && [[ $attempt -ge 5 ]]; then - echo "$managedServer managed server is not in SHUTDOWN state after multiple attempts" - exit 1 - fi - attempt=$((attempt+1)) - sleep 30s - done - - echo "Starting managed server $managedServer" - attempt=0 - while [ $attempt -le 5 ] - do - echo "Attempt to starting server $attempt" - echo curl ${CURL_REQD_PARMS} -X POST -i "http://${adminPublicIP}:${adminPort}/management/weblogic/latest/domainRuntime/serverLifeCycleRuntimes/$managedServer/start" --data "{}" - curl ${CURL_REQD_PARMS} -X POST -i "http://${adminPublicIP}:${adminPort}/management/weblogic/latest/domainRuntime/serverLifeCycleRuntimes/$managedServer/start" --data "{}" > out - echo "Response received for start REST command" - cat out - - echo "Attempt to verify start $attempt" - echo curl ${CURL_REQD_PARMS} ${CURL_RETRY_PARMS} -X GET -i "http://${adminPublicIP}:${adminPort}/management/weblogic/latest/domainRuntime/serverLifeCycleRuntimes/${managedServer}?links=none" - curl ${CURL_REQD_PARMS} ${CURL_RETRY_PARMS} -X GET -i "http://${adminPublicIP}:${adminPort}/management/weblogic/latest/domainRuntime/serverLifeCycleRuntimes/${managedServer}?links=none" > out - echo "Recevied response for start verification" - cat out - cat out | grep "\"state\": \"RUNNING\"" - if [ $? == 0 ]; then - echo "$managedServer managed server is in RUNNING state as expected" - break - elif [[ $retVal != 0 ]] && [[ $attempt -ge 5 ]]; then - echo "$managedServer managed server is not in RUNNING state after multiple attempts" - exit 1 - fi - attempt=$((attempt+1)) - sleep 1m - done -done -exit 0 diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/verify-webapp-deployment.sh b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/verify-webapp-deployment.sh deleted file mode 100644 index cf648f81f..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/verify-webapp-deployment.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# Description -# This script is to test webapp application deployed on WebLogic cluster domain. - -# Verifying webapp deployment -read appGatewayURL - -CURL_RETRY_PARMS="--connect-timeout 60 --max-time 180 --retry 10 --retry-delay 30 --retry-max-time 180 --retry-connrefused" - -echo "Verifying WebLogic Cafe is deployed as expected" -curl --verbose ${appGatewayURL}weblogic-cafe/rest/coffees -response=$(curl ${CURL_RETRY_PARMS} --write-out '%{http_code}' --silent --output /dev/null ${appGatewayURL}weblogic-cafe/rest/coffees) -echo "$response" -if [ "$response" -ne 200 ]; then - echo "WebLogic Cafe is not accessible" - exit 1 -else - echo "WebLogic Cafe is accessible" -fi -exit 0 diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/verify-wls-access.sh b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/verify-wls-access.sh deleted file mode 100644 index 4ff452b00..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/verify-wls-access.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2021, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -# Description -# This script is to test WebLogic admin, console and managed servers access. - -# Verifying admin server is accessible - -#read arguments from stdin -read adminPublicIP adminPort wlsUserName wlspassword managedServers - -CURL_PARMS="--connect-timeout 60 --max-time 180 --retry 10 --retry-delay 30 --retry-max-time 180 --retry-connrefused" - -echo "Verifying http://${adminPublicIP}:${adminPort}/weblogic/ready" -curl ${CURL_PARMS} http://${adminPublicIP}:${adminPort}/weblogic/ready - -if [[ $? != 0 ]]; then - echo "Failed : WebLogic admin server is not accessible" - exit 1 -else - echo "WebLogic admin server is accessible" -fi - -# Verifying whether admin console is accessible -echo "Checking WebLogic admin console is acessible" -curl ${CURL_PARMS} http://${adminPublicIP}:${adminPort}/console/ -if [[ $? != 0 ]]; then - echo "WebLogic admin console is not accessible" - exit 1 -else - echo "WebLogic admin console is accessible" - exit 0 -fi - - -#Verifying whether managed servers are up/running -for managedServer in $managedServers -do - echo "Verifying managed server : $managedServer" - curl ${CURL_PARMS} --user $wlsUserName:$wlspassword -X GET -H 'X-Requested-By: MyClient' -H 'Content-Type: application/json' -H 'Accept: application/json' -i "http://${adminPublicIP}:${adminPort}/management/weblogic/latest/domainRuntime/serverRuntimes/$managedServer" | grep "\"state\": \"RUNNING\"" - if [ $? == 0 ]; then - echo "$managedServer managed server is in RUNNING state" - else - echo "$managedServer managed server is not in RUNNING state" - exit 1 - fi -done -exit 0 diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/.gitkeep b/weblogic-azure-vm/arm-oraclelinux-wls/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/README.md b/weblogic-azure-vm/arm-oraclelinux-wls/README.md deleted file mode 100644 index 019fb22d4..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls/README.md +++ /dev/null @@ -1,12 +0,0 @@ - - -## WebLogic Server installation on Microsoft Azure Virtual Machine - Marketplace Offerings - -This git repository is used to maintain the Azure Resource Management (ARM) templates and other scripts -used for the implementation of WebLogic Server installation on Microsoft Azure. - -For WebLogic Server running in the Azure Virtual Machines documentation, please refer to the [README documentation](https://github.com/oracle/weblogic-azure/weblogic-azure-vm/README.md). - diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/images/.gitignore b/weblogic-azure-vm/arm-oraclelinux-wls/images/.gitignore deleted file mode 100644 index 43d363a50..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls/images/.gitignore +++ /dev/null @@ -1 +0,0 @@ -# Ignore this file diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/images/wls-on-azure.gif b/weblogic-azure-vm/arm-oraclelinux-wls/images/wls-on-azure.gif deleted file mode 100644 index f9943f0bb..000000000 Binary files a/weblogic-azure-vm/arm-oraclelinux-wls/images/wls-on-azure.gif and /dev/null differ diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/pom.xml b/weblogic-azure-vm/arm-oraclelinux-wls/pom.xml deleted file mode 100644 index 23650b284..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls/pom.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - 4.0.0 - - - com.oracle.weblogic.azure - weblogic-azure-vm - 1.0.0 - ../pom.xml - - - com.oracle.weblogic.azure - arm-oraclelinux-wls - ${version.arm-oraclelinux-wls} - - jar - arm-oraclelinux-wls - - - ${project.parent.basedir}/.. - false - false - - - - - - diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/arm/createUiDefinition.json b/weblogic-azure-vm/arm-oraclelinux-wls/src/main/arm/createUiDefinition.json deleted file mode 100644 index 71e657b4c..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/arm/createUiDefinition.json +++ /dev/null @@ -1,331 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/0.1.2-preview/CreateUIDefinition.MultiVm.json#", - "handler": "Microsoft.Azure.CreateUIDef", - "version": "0.1.2-preview", - "parameters": { - "config": { - "basics": { - "resourceGroup": { - "allowExisting": true - } - } - }, - "basics": [ - { - "name": "skuUrnVersion", - "type": "Microsoft.Common.DropDown", - "label": "Oracle WebLogic Image", - "defaultValue": "WebLogic Server 14.1.1.0.0 and JDK 11 on Oracle Linux 9.1", - "toolTip": "Choose Oracle WebLogic image, which is provided by Oracle, with Java and WebLogic preinstalled.", - "constraints": { - "allowedValues": [ - { - "label": "WebLogic Server 14.1.1.0.0 and JDK 11 on Oracle Linux 9.1", - "value": "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest" - }, - { - "label": "WebLogic Server 14.1.1.0.0 and JDK 11 on Oracle Linux 8.7", - "value": "owls-141100-jdk11-ol87;Oracle:weblogic-141100-jdk11-ol87:owls-141100-jdk11-ol87;latest" - }, - { - "label": "WebLogic Server 14.1.1.0.0 and JDK 8 on Oracle Linux 9.1", - "value": "owls-141100-jdk8-ol91;Oracle:weblogic-141100-jdk8-ol91:owls-141100-jdk8-ol91;latest" - }, - { - "label": "WebLogic Server 14.1.1.0.0 and JDK 8 on Oracle Linux 8.7", - "value": "owls-141100-jdk8-ol87;Oracle:weblogic-141100-jdk8-ol87:owls-141100-jdk8-ol87;latest" - }, - { - "label": "WebLogic Server 12.2.1.4.0 and JDK 8 on Oracle Linux 9.1", - "value": "owls-122140-jdk8-ol91;Oracle:weblogic-122140-jdk8-ol91:owls-122140-jdk8-ol91;latest" - }, - { - "label": "WebLogic Server 12.2.1.4.0 and JDK 8 on Oracle Linux 8.7", - "value": "owls-122140-jdk8-ol87;Oracle:weblogic-122140-jdk8-ol87:owls-122140-jdk8-ol87;latest" - }, - { - "label": "WebLogic Server 12.2.1.4.0 and JDK8 on Oracle Linux 7.6", - "value": "owls-122140-jdk8-ol76;Oracle:weblogic-122140-jdk8-ol76:owls-122140-jdk8-ol7;latest" - }, - { - "label": "WebLogic Server 14.1.1.0.0 and JDK8 on Oracle Linux 7.6", - "value": "owls-141100-jdk8-ol76;Oracle:weblogic-141100-jdk8-ol76:owls-141100-jdk8-ol7;latest" - }, - { - "label": "WebLogic Server 14.1.1.0.0 and JDK11 on Oracle Linux 7.6", - "value": "owls-141100-jdk11-ol76;Oracle:weblogic-141100-jdk11-ol76:owls-141100-jdk11-ol7;latest" - }, - { - "label": "WebLogic Server 14.1.1.0.0 and JDK11 on Red Hat Enterprise Linux 8.7", - "value": "owls-141100-jdk11-rhel87;Oracle:weblogic-141100-jdk11-rhel87:owls-141100-jdk11-rhel87;latest" - }, - { - "label": "WebLogic Server 14.1.1.0.0 and JDK8 on Red Hat Enterprise Linux 8.7", - "value": "owls-141100-jdk8-rhel87;Oracle:weblogic-141100-jdk8-rhel87:owls-141100-jdk8-rhel87;latest" - }, - { - "label": "WebLogic Server 12.2.1.4.0 and JDK8 on Red Hat Enterprise Linux 8.7", - "value": "owls-122140-jdk8-rhel87;Oracle:weblogic-122140-jdk8-rhel87:owls-122140-jdk8-rhel87;latest" - } - ], - "required": true - }, - "visible": true - }, - { - "name": "vmSizeSelect", - "type": "Microsoft.Compute.SizeSelector", - "label": "Virtual machine size", - "toolTip": "The size of virtual machine to provision.", - "recommendedSizes": [ - "Standard_A1", - "Standard_A2", - "Standard_A3", - "Standard_A4", - "Standard_B1ms" - ], - "constraints": { - "excludedSizes": [ - "Standard_B1ls", - "Standard_A0", - "Basic_A0", - "Standard_B1s", - ${azure.armBased.vmSize.list} - ] - }, - "osPlatform": "Linux", - "count": "1", - "visible": true - }, - { - "name": "invalidVMSizeInfo", - "type": "Microsoft.Common.InfoBox", - "visible": "[contains(basics('vmSizeSelect'),'p')]", - "options": { - "icon": "Error", - "text": "The VM size you selected includes the feature letter 'p', indicating it uses ARM CPUs. ARM platform is not supported. Please select a different VM size. For more information, refer to the Azure virtual machine sizes naming conventions." - } - }, - { - "name": "basicsRequired", - "type": "Microsoft.Common.Section", - "label": "Credentials for Virtual Machines and WebLogic", - "elements": [ - { - "name": "adminUsername", - "type": "Microsoft.Common.TextBox", - "label": "Username for admin account of VMs", - "defaultValue": "weblogic", - "toolTip": "Use only letters and numbers", - "constraints": { - "required": true, - "validations": [ - { - "regex": "^[a-z0-9A-Z]{1,30}$", - "message": "The value must be 1-30 characters long and must only contain letters and numbers." - }, - { - "isValid": "[not(contains(basics('vmSizeSelect'),'p'))]", - "message": "ARM platform is not supported. Please select a different VM size." - } - ] - }, - "visible": true - }, - { - "name": "adminPasswordOrKey", - "type": "Microsoft.Compute.CredentialsCombo", - "label": { - "authenticationType": "Authentication type", - "password": "Password", - "confirmPassword": "Confirm password", - "sshPublicKey": "SSH public key" - }, - "toolTip": { - "authenticationType": "Use username and password or SSH public key for authentication to the VM", - "password": "Password for admin account of VMs", - "sshPublicKey": "SSH key for admin account of VMs" - }, - "constraints": { - "required": true, - "customPasswordRegex": "^((?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])|(?=.*[0-9])(?=.*[a-z])(?=.*[!@#$%^&*])|(?=.*[0-9])(?=.*[A-Z])(?=.*[!@#$%^&*])|(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*])).{12,72}$", - "customValidationMessage": "Password must be at least 12 characters long and have 3 out of the following: one number, one lower case, one upper case, or one special character" - }, - "options": { - "hideConfirmation": false, - "hidePassword": false - }, - "osPlatform": "Linux", - "visible": true - } - ], - "visible": true - }, - { - "name": "basicsOptional", - "type": "Microsoft.Common.Section", - "label": "Optional Basic Configuration", - "elements": [ - { - "name": "basicsOptionalAcceptDefaults", - "type": "Microsoft.Common.OptionsGroup", - "label": "Accept defaults for optional configuration?", - "defaultValue": "Yes", - "toolTip": "Select 'No' to edit optional basic configuration.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": "false" - }, - { - "label": "No", - "value": "true" - } - ], - "required": true - } - }, - { - "name": "dnsLabelPrefix", - "type": "Microsoft.Common.TextBox", - "label": "DNS Label Prefix", - "toolTip": "The string to prepend to the DNS label.", - "defaultValue": "wls", - "constraints": { - "required": true, - "regex": "^[a-z0-9A-Z]{3,10}$", - "validationMessage": "The prefix must be between 3 and 10 characters long and contain letters, numbers only." - }, - "visible": "[bool(basics('basicsOptional').basicsOptionalAcceptDefaults)]" - }, - { - "name": "portsToExpose", - "label": "Ports and port ranges to expose (N or N-N, comma separated)", - "type": "Microsoft.Common.TextBox", - "toolTip": "Ports and port ranges to expose (N or N-N, comma separated)", - "defaultValue": "80,443,7001-9000", - "constraints": { - "required": true, - "regex": "^((([0-9]+-[0-9]+)|([0-9]+))[,]?)+[^,]$", - "validationMessage": "Only numbers, hyphen separated ranges of numbers, separated by commas" - }, - "visible": "[bool(basics('basicsOptional').basicsOptionalAcceptDefaults)]" - }, - { - "name": "useSystemAssignedManagedIdentity", - "label": "Cause a system assigned managed identity to be created for the VM(s).", - "type": "Microsoft.Common.OptionsGroup", - "toolTip": "System assigned managed identities enable credential-free secure access to many Azure resources from this VM.", - "constraints": { - "allowedValues": [ - { - "label": "Yes", - "value": true - }, - { - "label": "No", - "value": false - } - ], - "required": true - }, - "defaultValue": "Yes", - "visible": "[bool(basics('basicsOptional').basicsOptionalAcceptDefaults)]" - } - ], - "visible": true - }, - { - "name": "howToReportIssues", - "type": "Microsoft.Common.Section", - "label": "Report issues, get help, and share feedback", - "elements": [ - { - "name": "help", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "See the documentation for this offer.", - "link": { - "label": "Offer documentation", - "uri": "https://aka.ms/wls-vm-docs" - } - } - }, - { - "name": "howToReportIssueText", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "If you encounter problems during the deployment of Oracle WebLogic Server, report them here.", - "link": { - "label": "Issue tracker", - "uri": "https://aka.ms/arm-oraclelinux-wls-issues?version=${project.version}" - } - } - }, - { - "name": "howToJoinSlack", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "If you want to interact directly with the Oracle WebLogic community, join the public Slack channel named 'oracle-weblogic'.", - "link": { - "label": "Join Slack", - "uri": "https://aka.ms/arm-oraclelinux-wls-slack" - } - } - }, - { - "name": "survey", - "type": "Microsoft.Common.TextBlock", - "visible": true, - "options": { - "text": "To get free help with Azure migration from the development team, fill out this survey.", - "link": { - "label": "Take survey", - "uri": "https://aka.ms/wls-on-azure-survey" - } - } - } - ], - "visible": true - } - ], - "steps":[ - { - "name": "tags", - "label": "Tags", - "elements": [ - { - "name": "tagsByResource", - "type": "Microsoft.Common.TagsByResource", - "resources": [ - "${identifier.virtualMachines}", - "${identifier.virtualNetworks}", - "${identifier.networkInterfaces}", - "${identifier.networkSecurityGroups}", - "${identifier.publicIPAddresses}", - "${identifier.storageAccounts}", - "${identifier.resourcesDeployment}" - ], - "toolTip": "Tags help you organize your resources and categorize them for billing or management purposes. You can apply tags to resources deployed by the offer." - } - ] - } - ], - "outputs": { - "adminPasswordOrKey": "[if(equals(basics('basicsRequired').adminPasswordOrKey.authenticationType, 'password'), basics('basicsRequired').adminPasswordOrKey.password, basics('basicsRequired').adminPasswordOrKey.sshPublicKey)]", - "adminUsername": "[basics('basicsRequired').adminUsername]", - "authenticationType": "[basics('basicsRequired').adminPasswordOrKey.authenticationType]", - "dnsLabelPrefix": "[basics('basicsOptional').dnsLabelPrefix]", - "portsToExpose": "[basics('basicsOptional').portsToExpose]", - "skuUrnVersion": "[basics('skuUrnVersion')]", - "tagsByResource": "[steps('tags').tagsByResource]", - "useSystemAssignedManagedIdentity": "[basics('basicsOptional').useSystemAssignedManagedIdentity]", - "vmSize": "[basics('vmSizeSelect')]", - "Location": "[location()]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/arm/mainTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls/src/main/arm/mainTemplate.json deleted file mode 100644 index a264d21d9..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/arm/mainTemplate.json +++ /dev/null @@ -1,662 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "adminPasswordOrKey": { - "type": "securestring", - "metadata": { - "description": "SSH Key or password for the Virtual Machine. SSH key is recommended." - } - }, - "adminUsername": { - "type": "string", - "metadata": { - "description": "User name for the Virtual Machine." - } - }, - "authenticationType": { - "type": "string", - "defaultValue": "password", - "allowedValues": [ - "sshPublicKey", - "password" - ], - "metadata": { - "description": "Type of authentication to use on the Virtual Machine. SSH key is recommended." - } - }, - "dnsLabelPrefix": { - "defaultValue": "wls", - "type": "string", - "metadata": { - "description": "Unique DNS Name for the Public IP used to access the Virtual Machine." - } - }, - "guidValue": { - "type": "string", - "defaultValue": "[newGuid()]" - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]", - "metadata": { - "description": "Location for all resources." - } - }, - "portsToExpose": { - "type": "string", - "defaultValue": "80,443,7001-9000", - "metadata": { - "description": "Ports and port ranges to expose" - } - }, - "skuUrnVersion": { - "type": "string", - "defaultValue": "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest", - "allowedValues": [ - "owls-141100-jdk11-ol91;Oracle:weblogic-141100-jdk11-ol91:owls-141100-jdk11-ol91;latest", - "owls-141100-jdk11-ol87;Oracle:weblogic-141100-jdk11-ol87:owls-141100-jdk11-ol87;latest", - "owls-141100-jdk8-ol91;Oracle:weblogic-141100-jdk8-ol91:owls-141100-jdk8-ol91;latest", - "owls-141100-jdk8-ol87;Oracle:weblogic-141100-jdk8-ol87:owls-141100-jdk8-ol87;latest", - "owls-122140-jdk8-ol91;Oracle:weblogic-122140-jdk8-ol91:owls-122140-jdk8-ol91;latest", - "owls-122140-jdk8-ol87;Oracle:weblogic-122140-jdk8-ol87:owls-122140-jdk8-ol87;latest", - "owls-122140-jdk8-ol76;Oracle:weblogic-122140-jdk8-ol76:owls-122140-jdk8-ol7;latest", - "owls-141100-jdk8-ol76;Oracle:weblogic-141100-jdk8-ol76:owls-141100-jdk8-ol7;latest", - "owls-141100-jdk11-ol76;Oracle:weblogic-141100-jdk11-ol76:owls-141100-jdk11-ol7;latest", - "owls-141100-jdk11-rhel87;Oracle:weblogic-141100-jdk11-rhel87:owls-141100-jdk11-rhel87;latest", - "owls-141100-jdk8-rhel87;Oracle:weblogic-141100-jdk8-rhel87:owls-141100-jdk8-rhel87;latest", - "owls-122140-jdk8-rhel87;Oracle:weblogic-122140-jdk8-rhel87:owls-122140-jdk8-rhel87;latest", - "owls-122140-jdk8-rhel76;Oracle:weblogic-122140-jdk8-rhel76:owls-122140-jdk8-rhel76;latest", - "owls-141100-jdk8-rhel76;Oracle:weblogic-141100-jdk8-rhel76:owls-141100-jdk8-rhel76;latest", - "owls-141100-jdk11-rhel76;Oracle:weblogic-141100-jdk11-rhel76:owls-141100-jdk11-rhel76;latest" - ], - "metadata": { - "description": "The Oracle Linux image with Weblogic and Java preinstalled. Semicolon separated string of Sku, URN, and Version" - } - }, - "tagsByResource": { - "type": "object", - "defaultValue": {}, - "metadata": { - "description": "${label.tagsLabel}" - } - }, - "usePreviewImage": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "Bool value, if it's set to true, will deploy with preview weblogic image." - } - }, - "useSystemAssignedManagedIdentity": { - "type": "bool", - "defaultValue": true, - "metadata": { - "description": "Bool value, if it's set to true, a system assigned managed identity will to be created for the VM(s)" - } - }, - "vmName": { - "type": "string", - "defaultValue": "WeblogicServerVM", - "metadata": { - "description": "VM name." - } - }, - "vmSize": { - "type": "string", - "defaultValue": "Standard_A3", - "metadata": { - "description": "Select appropriate VM Size as per requirement" - } - } - }, - "variables": { - "const_addressPrefix": "10.0.0.0/16", - "const_globalResourceNameSuffix": "[uniqueString(parameters('guidValue'))]", - "const_hyphen": "-", - "const_imageOffer": "[concat('weblogic',variables('const_hyphen'), split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[1],variables('const_hyphen'),split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[2],variables('const_hyphen'),split(variables('name_linuxImageOfferSKU'),variables('const_hyphen'))[3],if(parameters('usePreviewImage'),'-preview',''))]", - "const_imagePublisher": "oracle", - "const_linuxConfiguration": { - "disablePasswordAuthentication": true, - "ssh": { - "publicKeys": [ - { - "path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]", - "keyData": "[parameters('adminPasswordOrKey')]" - } - ] - } - }, - "const_publicIPAddressType": "Dynamic", - "const_requiredPortrange": ",65200-65535,5556", - "const_storageAccountType": "Standard_LRS", - "const_subnetPrefix": "10.0.0.0/24", - "const_vmSize": "[parameters('vmSize')]", - "name_linuxImageOfferSKU": "[first(split(parameters('skuUrnVersion'), ';'))]", - "name_linuxImageVersion": "[last(split(parameters('skuUrnVersion'),';'))]", - "name_networkSecurityGroup": "[concat(parameters('dnsLabelPrefix'), '-nsg_', variables('const_globalResourceNameSuffix'))]", - "name_nic": "[concat('olvm_NIC_', variables('const_globalResourceNameSuffix'))]", - "name_publicIPAddress": "[concat('olvm_PublicIP_', variables('const_globalResourceNameSuffix'))]", - "name_storageAccount": "[concat('olvmstg', variables('const_globalResourceNameSuffix'))]", - "name_subnet": "Subnet", - "name_virtualNetwork": "[concat('olvm_VNET_', variables('const_globalResourceNameSuffix'))]", - "name_vmName": "[concat(parameters('vmName'), variables('const_globalResourceNameSuffix'))]", - "ref_networkSecurityGroup": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('name_networkSecurityGroup'))]", - "ref_subnet": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('name_virtualNetwork'), variables('name_subnet'))]" - }, - "functions": [ - { - // This same function is defined in the mainTemplate.json for every other offer. - // Please ensure any changes are applied in all the other places. - "namespace": "funcTags", - "members": { - "tagsFilter": { - "parameters": [ - { - "name": "tagsByResource", - "type": "object" - }, - { - "name": "resourceIdentifier", - "type": "string" - } - ], - "output": { - "type": "object", - "value": "[if(contains(parameters('tagsByResource'), parameters('resourceIdentifier')), parameters('tagsByResource')[parameters('resourceIdentifier')], json('{}'))]" - } - } - } - } - ], - "resources": [ - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "tags": "[funcTags.tagsFilter(parameters('tagsByResource'),'${identifier.resourcesDeployment}')]", - "name": "${start}", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [] - } - } - }, - { - "type": "Microsoft.Network/networkSecurityGroups", - "apiVersion": "${azure.apiVersionForNetworkSecurityGroups}", - "tags": "[funcTags.tagsFilter(parameters('tagsByResource'),'${identifier.networkSecurityGroups}')]", - "name": "[variables('name_networkSecurityGroup')]", - "location": "[parameters('location')]", - "properties": { - "securityRules": [ - { - "name": "WebLogicPorts", - "properties": { - "protocol": "TCP", - "sourcePortRange": "*", - "sourceAddressPrefix": "*", - "destinationAddressPrefix": "*", - "access": "Allow", - "priority": 320, - "direction": "Inbound", - "destinationPortRanges": "[split(concat(parameters('portsToExpose'),variables('const_requiredPortrange')), ',')]" - } - } - ] - } - }, - { - "type": "Microsoft.Storage/storageAccounts", - "apiVersion": "${azure.apiVersionForStorage}", - "tags": "[funcTags.tagsFilter(parameters('tagsByResource'), '${identifier.storageAccounts}')]", - "name": "[variables('name_storageAccount')]", - "location": "[parameters('location')]", - "sku": { - "name": "[variables('const_storageAccountType')]" - }, - "kind": "Storage", - "properties": {} - }, - { - "apiVersion": "${azure.apiVersionForPublicIPAddresses}", - "type": "Microsoft.Network/publicIPAddresses", - "tags": "[funcTags.tagsFilter(parameters('tagsByResource'), '${identifier.publicIPAddresses}')]", - "name": "[variables('name_publicIPAddress')]", - "location": "[parameters('location')]", - "properties": { - "publicIPAllocationMethod": "[variables('const_publicIPAddressType')]", - "dnsSettings": { - "domainNameLabel": "[concat(toLower(parameters('dnsLabelPrefix')),'-',take(replace(parameters('guidValue'),'-',''),10))]" - } - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualNetworks}", - "type": "Microsoft.Network/virtualNetworks", - "tags": "[funcTags.tagsFilter(parameters('tagsByResource'), '${identifier.virtualNetworks}')]", - "name": "[variables('name_virtualNetwork')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[variables('ref_networkSecurityGroup')]" - ], - "properties": { - "addressSpace": { - "addressPrefixes": [ - "[variables('const_addressPrefix')]" - ] - }, - "subnets": [ - { - "name": "[variables('name_subnet')]", - "properties": { - "addressPrefix": "[variables('const_subnetPrefix')]", - "networkSecurityGroup": { - "id": "[variables('ref_networkSecurityGroup')]" - } - } - } - ] - } - }, - { - "apiVersion": "${azure.apiVersionForNetworkInterfaces}", - "type": "Microsoft.Network/networkInterfaces", - "tags": "[funcTags.tagsFilter(parameters('tagsByResource'), '${identifier.networkInterfaces}')]", - "name": "[variables('name_nic')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/publicIPAddresses/', variables('name_publicIPAddress'))]", - "[resourceId('Microsoft.Network/virtualNetworks/', variables('name_virtualNetwork'))]" - ], - "properties": { - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('name_publicIPAddress'))]" - }, - "subnet": { - "id": "[variables('ref_subnet')]" - } - } - } - ], - "dnsSettings": { - "internalDnsNameLabel": "[variables('name_vmName')]" - } - } - }, - { - "apiVersion": "${azure.apiVersionForVirtualMachines}", - "type": "Microsoft.Compute/virtualMachines", - "tags": "[funcTags.tagsFilter(parameters('tagsByResource'), '${identifier.virtualMachines}')]", - "name": "[variables('name_vmName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts/', variables('name_storageAccount'))]", - "[resourceId('Microsoft.Network/networkInterfaces/', variables('name_nic'))]" - ], - "identity": "[if(parameters('useSystemAssignedManagedIdentity'), json('{\"type\":\"SystemAssigned\"}'), null())]", - "properties": { - "hardwareProfile": { - "vmSize": "[variables('const_vmSize')]" - }, - "osProfile": { - "computerName": "[variables('name_vmName')]", - "adminUsername": "[parameters('adminUsername')]", - "adminPassword": "[parameters('adminPasswordOrKey')]", - "linuxConfiguration": "[if(equals(parameters('authenticationType'), 'password'), json('null'), variables('const_linuxConfiguration'))]" - }, - "storageProfile": { - "imageReference": { - "publisher": "[variables('const_imagePublisher')]", - "offer": "[variables('const_imageOffer')]", - "sku": "[variables('name_linuxImageOfferSKU')]", - "version": "[variables('name_linuxImageVersion')]" - }, - "osDisk": { - "createOption": "FromImage", - "managedDisk": { - "storageAccountType": "[variables('const_storageAccountType')]" - } - } - }, - "networkProfile": { - "networkInterfaces": [ - { - "id": "[resourceId('Microsoft.Network/networkInterfaces',variables('name_nic'))]" - } - ] - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": true, - "storageUri": "[reference(resourceId('Microsoft.Storage/storageAccounts/', variables('name_storageAccount')), '${azure.apiVersionForStorage}').primaryEndpoints.blob]" - } - } - }, - "plan": { - "name": "[variables('name_linuxImageOfferSKU')]", - "publisher": "[variables('const_imagePublisher')]", - "product": "[variables('const_imageOffer')]" - } - }, - { - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${end}", - "type": "Microsoft.Resources/deployments", - "tags": "[funcTags.tagsFilter(parameters('tagsByResource'),'${identifier.resourcesDeployment}')]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/', variables('name_vmName'))]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [] - } - } - }, - { - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk11-ol91}", - "type": "Microsoft.Resources/deployments", - "tags": "[funcTags.tagsFilter(parameters('tagsByResource'),'${identifier.resourcesDeployment}')]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk11-ol91'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/', variables('name_vmName'))]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk11-ol87}", - "type": "Microsoft.Resources/deployments", - "tags": "[funcTags.tagsFilter(parameters('tagsByResource'),'${identifier.resourcesDeployment}')]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk11-ol87'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/', variables('name_vmName'))]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk8-ol91}", - "type": "Microsoft.Resources/deployments", - "tags": "[funcTags.tagsFilter(parameters('tagsByResource'),'${identifier.resourcesDeployment}')]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk8-ol91'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/', variables('name_vmName'))]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk8-ol87}", - "type": "Microsoft.Resources/deployments", - "tags": "[funcTags.tagsFilter(parameters('tagsByResource'),'${identifier.resourcesDeployment}')]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk8-ol87'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/', variables('name_vmName'))]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-122140-jdk8-ol91}", - "type": "Microsoft.Resources/deployments", - "tags": "[funcTags.tagsFilter(parameters('tagsByResource'),'${identifier.resourcesDeployment}')]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-122140-jdk8-ol91'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/', variables('name_vmName'))]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-122140-jdk8-ol87}", - "type": "Microsoft.Resources/deployments", - "tags": "[funcTags.tagsFilter(parameters('tagsByResource'),'${identifier.resourcesDeployment}')]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-122140-jdk8-ol87'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/', variables('name_vmName'))]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-122140-jdk8-ol76}", - "tags": "[funcTags.tagsFilter(parameters('tagsByResource'),'${identifier.resourcesDeployment}')]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'from.owls-122140-jdk8-ol76'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/', variables('name_vmName'))]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk8-ol76}", - "tags": "[funcTags.tagsFilter(parameters('tagsByResource'),'${identifier.resourcesDeployment}')]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk8-ol76'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/', variables('name_vmName'))]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk11-ol76}", - "tags": "[funcTags.tagsFilter(parameters('tagsByResource'),'${identifier.resourcesDeployment}')]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk11-ol76'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/', variables('name_vmName'))]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-122140-jdk8-rhel87}", - "tags": "[funcTags.tagsFilter(parameters('tagsByResource'),'${identifier.resourcesDeployment}')]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-122140-jdk8-rhel87'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/', variables('name_vmName'))]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk8-rhel87}", - "tags": "[funcTags.tagsFilter(parameters('tagsByResource'),'${identifier.resourcesDeployment}')]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk8-rhel87'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/', variables('name_vmName'))]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk11-rhel87}", - "tags": "[funcTags.tagsFilter(parameters('tagsByResource'),'${identifier.resourcesDeployment}')]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk11-rhel87'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/', variables('name_vmName'))]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-122140-jdk8-rhel76}", - "tags": "[funcTags.tagsFilter(parameters('tagsByResource'),'${identifier.resourcesDeployment}')]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-122140-jdk8-rhel76'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/', variables('name_vmName'))]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk8-rhel76}", - "tags": "[funcTags.tagsFilter(parameters('tagsByResource'),'${identifier.resourcesDeployment}')]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk8-rhel76'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/', variables('name_vmName'))]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "${azure.apiVersionForDeployment}", - "name": "${from.owls-141100-jdk11-rhel76}", - "tags": "[funcTags.tagsFilter(parameters('tagsByResource'),'${identifier.resourcesDeployment}')]", - "condition": "[if(contains(variables('name_linuxImageOfferSKU'), 'owls-141100-jdk11-rhel76'), bool('true'), bool('false'))]", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines/', variables('name_vmName'))]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - ] - } - } - } - ], - "outputs": { - "hostname": { - "type": "string", - "value": "[reference(variables('name_publicIPAddress')).dnsSettings.fqdn]" - }, - "sshCommand": { - "type": "string", - "value": "[concat('ssh ', parameters('adminUsername'), '@', reference(variables('name_publicIPAddress')).dnsSettings.fqdn)]" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/arm/metadata.json b/weblogic-azure-vm/arm-oraclelinux-wls/src/main/arm/metadata.json deleted file mode 100644 index 85e745e71..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/arm/metadata.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "$schema": "https://aka.ms/azure-quickstart-templates-metadata-schema#", - "type": "QuickStart", - "itemDisplayName": "Deploy a Oracle Linux VM with pre-installed Weblogic Server", - "icon": "oracle-linux", - "description": "This template allows you to deploy a Oracle Linux VM with pre-installed Weblogic Server. This will deploy a A1 size VM in the resource group location and return the FQDN of the VM.", - "summary": "This template takes a minimum amount of parameters and deploys a Oracle Linux VM, using the latest patched version.", - "githubUsername": "wls-eng", - "dateUpdated": "2019-07-30" -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/arm/olvmdeploy.parameters.json b/weblogic-azure-vm/arm-oraclelinux-wls/src/main/arm/olvmdeploy.parameters.json deleted file mode 100644 index b04d054f2..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/arm/olvmdeploy.parameters.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "adminUsername": { - "value": "GEN-UNIQUE" - }, - "adminPasswordOrKey": { - "value": "GEN-SSH-PUB-KEY" - }, - "dnsLabelPrefix": { - "value": "GEN-UNIQUE" - }, - "vmSize":{ - "value": "GEN-UNIQUE" - } - } -} diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/01-offer-settings.PNG b/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/01-offer-settings.PNG deleted file mode 100644 index e15dfee22..000000000 Binary files a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/01-offer-settings.PNG and /dev/null differ diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/02-sku-details.PNG b/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/02-sku-details.PNG deleted file mode 100644 index e2d2a29c9..000000000 Binary files a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/02-sku-details.PNG and /dev/null differ diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/03-channel-info.PNG b/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/03-channel-info.PNG deleted file mode 100644 index da3940201..000000000 Binary files a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/03-channel-info.PNG and /dev/null differ diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/04-test-drive.PNG b/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/04-test-drive.PNG deleted file mode 100644 index cb2cd8d6f..000000000 Binary files a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/04-test-drive.PNG and /dev/null differ diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/05-marketplace-01.PNG b/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/05-marketplace-01.PNG deleted file mode 100644 index ce23b27c0..000000000 Binary files a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/05-marketplace-01.PNG and /dev/null differ diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/README.md b/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/README.md deleted file mode 100644 index 65fa398ac..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/README.md +++ /dev/null @@ -1,159 +0,0 @@ - - -# Offer setup - -## Alias - -Oracle WebLogic Server on Azure Solution Overview - -## Setup details - -* No, I would prefer to only list my offer through the marketplace and process transactions independently - -* How do you want potential customers to interact with this listing offer? - - * Contact me - -### Test drive - -* Not checked Enable a test drive - -### Customer leads - -CRM System connected - -* HTTPS Endpoint - -* Contact email - - * jacob.x.thomas@oracle.com;edburns@microsoft.com;rezar@microsoft.com - -* HTTPS endpoint URL - - * https://prod-15.westcentralus.logic.azure.com:443/workflows/9024092aefba434c9db98dc2536423f6/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=SggEKOTUpII26Oc6XYVl7nbSgluiYdVeIXkq19LuTtY - -### Microsoft 365 integration - -* No, my SaaS offer does not integrate with Microsoft Graph - -* No, I do not have published Teams apps, Office add-ins, or SharePoint Framework solutions that I would like to link to this SaaS offer - -# Properties - -## Categories - -* Primary category: Compute - - * Subcategory: Application Infrastructure - -* Secondary category: Web - - * Subcategory: Web Apps - -## Industries - -* Checked Apps - -* Not checked Microsoft Clouds for Industry - -* App version: Various - -## Legal - -* Checked Use the Standarard Contract for Microsoft's commercial marketplace? - -## Custom amendments... - -No content. - -# What is this stuff? - -Useful Links to documentation, video, blog of WebLogic on Azure. - -# Offer Listing - -## Name - -Oracle WebLogic Server on Azure Solution Overview - -## Search results summary - -Oracle WebLogic Server is a scalable, enterprise-ready Java application server. - -## Description (Observed max 2973 characters, not including formatting) - -

    Oracle WebLogic Server (WLS) on Azure offers enable you to embrace cloud computing by making it as easy as possible to migrate your Java applications to Azure. The offers increase productivity by automating most boilerplate Java and Azure resource provisioning and configuration tasks so that you can focus on application development. The offers cover deployment to both Azure Virtual Machines and the Azure Kubernetes Service (AKS).

    - -

    The offers are linked in the Learn more section at the bottom of this page.

    - -

    These offers are Bring-Your-Own-License. They assume you have already procured the appropriate licenses with Oracle and are properly licensed to run offers in Azure.

    - -

    If you want to work closely on your migration scenarios with the engineering team developing these offers, just hit the CONTACT ME button. Program managers, architects and engineers will reach back out to you shortly and initiate collaboration!

    - -

    WebLogic Server on Virtual Machines
    -The WebLogic Server on virtual machines offers automate provisioning virtual network, storage, and Linux resources, installing WLS, setting up security with a network security group, easing database connectivity, configuring load-balancing with App Gateway or Oracle HTTP Server, connecting to Azure Active Directory, enabling centralized logging via ELK as well as integrating distributed caching with Oracle Coherence.

    - -

    There are several offers that target use cases such as single node with Administration server enabled and WLS cluster (including both configured and dynamic clusters). These offers supports a range of operating system, Java and WebLogic versions such as WLS 14.1.1.0 and JDK 11 on Oracle Linux 7.6 through base images. These base images are also available on Azure on their own. The base images are suitable for customers that require very highly customized Azure deployments. The current set of base images are available in the Azure marketplace.

    - -

    WebLogic Server on AKS
    -The WebLogic Server on AKS offer automates provisioning an AKS cluster, the WebLogic Kubernetes Operator, WLS Docker images and the Azure Container Registry (ACR). The offer also supports configuring load balancing with Azure App Gateway or the Azure Load Balancer, easing database connectivity, publishing metrics to Azure Monitor as well as mounting Azure Files as Kubernetes Persistent Volumes. The offer will work with any WLS version that supports the Operator, such as 14.1.1.0, and 12.2.1.4.

    - -

    Oracle and Microsoft also provide basic step-by-step guidance on getting started with WLS and AKS. This guidance is suitable for customers that wish to remain as close as possible to a native Kubernetes manual deployment experience.

    - -## Getting Started Instructions - -Blank - -## Search keywords - -Java WLS WebLogic - -## Privacy policy link - -https://www.oracle.com/legal/privacy/privacy-policy.html - - -## Useful Links - -* [Oracle WebLogic Overview](https://www.oracle.com/middleware/weblogic/) - -* [Oracle WebLogic Server Single Node](https://portal.azure.com/#create/oracle.20191001-arm-oraclelinux-wls20191001-arm-oraclelinux-wls) - -* [Oracle WebLogic Server With Administration Server](https://portal.azure.com/#create/oracle.20191009-arm-oraclelinux-wls-admin20191009-arm-oraclelinux-wls-admin) - -* [Oracle WebLogic Server Cluster](https://portal.azure.com/#create/oracle.20191007-arm-oraclelinux-wls-cluster20191007-arm-oraclelinux-wls-cluster) - -* [Oracle WebLogic Server Dynamic Cluster](https://portal.azure.com/#create/oracle.20191021-arm-oraclelinux-wls-dynamic-cluster20191021-arm-oraclelinux-wls-dynamic-cluster) - -* [Weblogic on Azure VMs Offer Documentation](https://oracle.github.io/weblogic-azure/) - -* [WebLogic on Azure Kubernetes Service](https://portal.azure.com/#create/oracle.20210620-wls-on-aks20210620-wls-on-aks) - -* [WebLogic on Azure Kubernetes Service Offer Documentation](https://aka.ms/wls-aks-docs) - -* [Fusion Middleware Documentation](https://docs.oracle.com/en/middleware/fusion-middleware/index.html) - -* [Learn More](https://www.oracle.com/middleware/technologies/weblogic.html) - -## Supporting Documents - -* Release Notes - - * PDF download of WLS Release Notes - -## Videos - -* [WebLogic on Azure IaaS](https://www.youtube.com/watch?v=KZpG280G_vs) - -## Scratch not currently in offer - -* [Documentation](https://oracle.github.io/weblogic-azure/) - -* [Official Blog](https://blogs.oracle.com/weblogicserver/) - -* [WebLogic on Azure IaaS Video](https://youtu.be/m7evI4lObcI) - -See [the Marketplace documentation](https://docs.microsoft.com/en-us/azure/marketplace/cloud-partner-portal/virtual-machine/cpp-marketplace-tab) for details. diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/design/weblogic-app-gateway-key-vault.vsdx b/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/design/weblogic-app-gateway-key-vault.vsdx deleted file mode 100644 index 384cab096..000000000 Binary files a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/design/weblogic-app-gateway-key-vault.vsdx and /dev/null differ diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/design/weblogic-elk.vsdx b/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/design/weblogic-elk.vsdx deleted file mode 100644 index a2820e467..000000000 Binary files a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/design/weblogic-elk.vsdx and /dev/null differ diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/Large.png b/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/Large.png deleted file mode 100644 index 7650617a1..000000000 Binary files a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/Large.png and /dev/null differ diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/Large_216_216.png b/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/Large_216_216.png deleted file mode 100644 index bd4a0a3b0..000000000 Binary files a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/Large_216_216.png and /dev/null differ diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/Medium.PNG b/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/Medium.PNG deleted file mode 100644 index 1acd206a7..000000000 Binary files a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/Medium.PNG and /dev/null differ diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/README.md b/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/README.md deleted file mode 100644 index ac2e7643d..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/README.md +++ /dev/null @@ -1,69 +0,0 @@ - - -

    Offer listing

    - -

    Name

    - -Oracle WebLogic Server on Azure Solution Overview - -

    Oracle WebLogic Server is a scalable, enterprise-ready Java EE application server.

    - -

    Description

    - -

    Azure Oracle WebLogic Server (WLS) offers enable you to embrace cloud computing by providing greater choice and flexibility for WLS migration including lift and shift of your Java applications to Azure Virtual Machines with the smallest effort and biggest impact. The offers empower you to start your business applications quickly by automatically provisioning virtual network, storage and Linux resources, installing WLS, setting up security with a network security group, easing database connectivity, configuring load-balancing with App Gateway or Oracle HTTP Server, connecting to Azure Active Directory, enabling centralized logging via ELK as well as integrating distributed caching with Oracle Coherence.

    -

    There are a number of offers that support different common use cases such as a single working instance with Admin Server enabled as well as highly available clusters.

    -

    The offers are linked in the Learn more section at the bottom of this page. You should feel free to give them a try, the offers are available free of charge.

    -

    These offers are Bring-Your-Own-License. They assume you have already procured the appropriate licenses with Oracle and are properly licensed to run offers in Microsoft Azure.

    -

    This offer supports a range of operating system, Java and WebLogic versions such as WLS 14 and JDK 11 on Oracle Linux 7.6 through base images. These base images are also available on Azure on their own. The base images are suitable for customers that require very highly customized Azure deployments. The current set of base images are available in the Azure marketplace.

    -
    WLS Single Node
    -

    This offer provisions a single virtual machine and installs WLS on it. It does not create a domain or start the Administration Server. This is useful for scenarios with highly customized domain configuration.

    -
    WLS with Admin Server
    -

    This offer provisions a single virtual machine and installs WLS on it. It creates a domain and starts up the Administration Server, which allows you to manage the domain.

    -
    WLS Cluster
    -

    This offer creates a highly available cluster of WLS virtual machines. The Administration Server and all managed servers are started by default, which allow you to manage the domain.

    -
    WLS Dynamic Cluster
    -

    This offer creates a highly available and scalable dynamic cluster of WLS virtual machines. The Administration Server and all managed servers are started by default, which allow you to manage the domain.

    - -

    Search keywords

    - -Java -Java EE -WebLogic - -

    Privacy policy link

    - -https://www.oracle.com/legal/privacy/privacy-policy.html - - -

    Useful links

    - -[Overview](https://www.oracle.com/middleware/weblogic/) - -[Oracle WebLogic Server Single Node](https://portal.azure.com/#create/oracle.20191001-arm-oraclelinux-wls20191001-arm-oraclelinux-wls) - -[Oracle WebLogic Server With Admin Server](https://portal.azure.com/#create/oracle.20191009-arm-oraclelinux-wls-admin20191009-arm-oraclelinux-wls-admin) - -[Oracle WebLogic Server Cluster](https://portal.azure.com/#create/oracle.20191007-arm-oraclelinux-wls-cluster20191007-arm-oraclelinux-wls-cluster) - -[Oracle WebLogic Server Dynamic Cluster](https://portal.azure.com/#create/oracle.20191021-arm-oraclelinux-wls-dynamic-cluster20191021-arm-oraclelinux-wls-dynamic-cluster) - -[Fusion Middleware Documentation](https://docs.oracle.com/en/middleware/fusion-middleware/index.html) - -[Learn More](https://www.oracle.com/middleware/technologies/weblogic.html) - -

    Videos

    - -

    Name

    - -WebLogic on Azure IaaS - -

    Link

    - -https://www.youtube.com/watch?v=gFS-64XQorA - -

    Thumbnail

    - - \ No newline at end of file diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/Small.png b/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/Small.png deleted file mode 100644 index c60a4a72d..000000000 Binary files a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/Small.png and /dev/null differ diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/Small_48_48.png b/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/Small_48_48.png deleted file mode 100644 index faf1aa3e2..000000000 Binary files a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/Small_48_48.png and /dev/null differ diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/Small_48_48_WebLogic.png b/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/Small_48_48_WebLogic.png deleted file mode 100644 index adaa5211b..000000000 Binary files a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/Small_48_48_WebLogic.png and /dev/null differ diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/Wide.png b/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/Wide.png deleted file mode 100644 index 8b344c952..000000000 Binary files a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/Wide.png and /dev/null differ diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/admin_console.png b/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/admin_console.png deleted file mode 100644 index 0bdb367d5..000000000 Binary files a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/admin_console.png and /dev/null differ diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/admin_console_1280_720.png b/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/admin_console_1280_720.png deleted file mode 100644 index 112138010..000000000 Binary files a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/admin_console_1280_720.png and /dev/null differ diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/admin_console_533_324.png b/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/admin_console_533_324.png deleted file mode 100644 index be98f407e..000000000 Binary files a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/admin_console_533_324.png and /dev/null differ diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/base-images.html b/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/base-images.html deleted file mode 100644 index aac2be19c..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/base-images.html +++ /dev/null @@ -1,88 +0,0 @@ -

    Offer listing

    - -

    Name

    - -WebLogic Server NNNN Base Image JDKNN on NNNN - -

    Search results summary

    - -Same as name. - -

    Short description

    - -Same as name. - -

    Description

    - -
    -
    -Oracle WebLogic Server (WLS) is a scalable, enterprise-ready Java application server.
    -
    -Azure Oracle WebLogic Server (WLS) offers enable you to embrace cloud computing by providing greater choice and flexibility for WLS migration including lift and shift of your Java applications to Azure Virtual Machines with the smallest effort and biggest impact.  
    -
    -The VM instance created by this offer is suitable for customers that require very highly customized Azure WLS deployments. Users of this offer are expected to be familiar with WebLogic Server administration. The software stack in the VM is specified in the offer title.
    -
    -The VM is installed with the specified GNU/Linux distribution, Oracle JDK version, and WebLogic Server version. The relevant directories are listed here:
    -
    -ORACLE_HOME /u01/app/wls/install/oracle/middleware/oracle_home
    -
    -WL_HOME /u01/app/wls/install/oracle/middleware/oracle_home/wlserver
    -
    -JAVA_HOME /u01/app/jdk/
    -
    -There is no pre-created domain. During VM creation, you are asked to provide a username and SSH key or credentials for the admin account. After logging in with this account, do sudo su - oracle to get write access to the relevant directories. For instructions on creating a WebLogic domain given the above directories visit Oracle Fusion Middleware documentation in the Useful Links section below. Once there, select the appropriate version of WebLogic Server from the drop-down menu. On the main page for the selected version, select Install, Patch and Upgrade, then find and follow the domain creation instructions.
    -
    -In addition to these base images, the offer also includes four different solution templates to meet different scenarios: single node without an admin server, single node with an admin server, cluster and dynamic cluster. These offers are linked in the Useful links section at the bottom of this page. You should feel free to give them a try, the offers are available free of charge.
    -
    -These offers are Bring-Your-Own-License. They assume you have already procured the appropriate licenses with Oracle and are properly licensed to run offers in Microsoft Azure.
    -
    -
    - -

    Privacy policy link

    - -https://www.oracle.com/legal/privacy/privacy-policy.html - -

    Useful links

    - -
    -
    -  Fusion Middleware Documentation
    -
    -  https://docs.oracle.com/en/middleware/fusion-middleware/index.html
    -
    -  Offer listings page
    -
    -  https://azuremarketplace.microsoft.com/en-us/marketplace/apps/oracle.oraclelinux-wls-cluster
    -
    -  Single Node
    -
    -  https://portal.azure.com/#create/oracle.20191001-arm-oraclelinux-wls20191001-arm-oraclelinux-wls
    -
    -  Single Node with Admin Server
    -
    -  https://portal.azure.com/#create/oracle.20191009-arm-oraclelinux-wls-admin20191009-arm-oraclelinux-wls-admin
    -
    -  Offer listings page
    -
    -  https://portal.azure.com/#create/oracle.20191007-arm-oraclelinux-wls-cluster20191007-arm-oraclelinux-wls-cluster
    -
    -  Dynamic Cluster
    -
    -  https://portal.azure.com/#create/oracle.20191021-arm-oraclelinux-wls-dynamic-cluster20191021-arm-oraclelinux-wls-dynamic-cluster
    -    
    -
    - -

    Customer support links

    - -

    Azure Global support website

    - -https://support.oracle.com/portal/ - -

    Azure Government support website

    - -https://support.oracle.com/portal/ - -

    License

    -Copyright (c) 2021, Oracle and/or its affiliates. -

    -Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/hero-working.PNG b/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/hero-working.PNG deleted file mode 100644 index 6b6c66b63..000000000 Binary files a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/hero-working.PNG and /dev/null differ diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/hero_815_290.png b/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/hero_815_290.png deleted file mode 100644 index c06ef4324..000000000 Binary files a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/hero_815_290.png and /dev/null differ diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/partner-center.html b/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/partner-center.html deleted file mode 100644 index ee183e74e..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/partner-center.html +++ /dev/null @@ -1,43 +0,0 @@ -

    Name

    -

    Oracle WebLogic Server Single Node on Azure VM

    -

    Search results summary

    -

    Provisions a Single Node Oracle WebLogic Server on an Azure VM.

    -

    Short description

    -

    Create a single virtual machine with WebLogic pre-installed.

    -

    Description

    -

    Oracle WebLogic Server (WLS) is an industry-leading Java runtime powering some of the most mission-critical enterprise applications - across the globe. This solution automates most boilerplate steps to provision a single WLS node on an Azure VM. No domain is created and - no Admin Server is started. The offer is useful for scenarios with highly customized domain configuration. Once initial provisioning is - complete, you are completely free to customize deployments further. The solution is jointly developed by Oracle and Microsoft.

    -

    WLS Enterprise Edition versions supported include 12.2.1.4, and 14.1.1.0.

    -

    The following resources are automatically provisioned by the offer.

    -
      -
    • Oracle Linux or Red Hat Enterprise Linux (RHEL) VM with public IP address
    • -
    • Single WLS Enterprise Edition instance (ORACLE_HOME is -/u01/app/wls/install/oracle/middleware/oracle_home)
    • -
    • Oracle JDK (JAVA_HOME is /u01/app/jdk/jdk-${version})
    • -
    • In addition to drivers that come standard with WLS, most recent supported PostgreSQL and Microsoft SQL JDBC drivers (drivers stored in -/u01/app/wls/install/oracle/middleware/oracle_home/wlserver/server/lib/)
    • -
    • Virtual network and subnet (alternatively, you can deploy to an existing virtual network)
    • -
    • Network security group
    • -
    • OS disk attached to VM
    • -
    • Azure Storage Account to store VM diagnostics
    • -
    -

    This offer is Bring-Your-Own-License. It assumes you have already procured the appropriate licenses with Oracle and are properly -licensed to run offers in Microsoft Azure.

    -

    Oracle and Microsoft also provide basic step-by-step instructions on getting started with WLS and Azure VMs without automated -provisioning.

    -

    Oracle and Microsoft provide similar solutions targeting WLS on the Azure Kubernetes Service (AKS) in addition to Azure VMs -(single instance or cluster). These options are linked in the Learn more section below.

    -

    You can reach out to the engineering team developing these offers by clicking the CONTACT ME button on -the marketplace WebLogic on Azure overview page. Program managers, architects and engineers will get in touch and can -assist you for free with your Azure migration.

    -

    Links

    - diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/video.png b/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/video.png deleted file mode 100644 index 52890ef3e..000000000 Binary files a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/marketing-artifacts/video.png and /dev/null differ diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/weblogic-app-gateway-key-vault.vsdx b/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/weblogic-app-gateway-key-vault.vsdx deleted file mode 100644 index 384cab096..000000000 Binary files a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/weblogic-app-gateway-key-vault.vsdx and /dev/null differ diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/weblogic-elk.vsdx b/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/weblogic-elk.vsdx deleted file mode 100644 index a2820e467..000000000 Binary files a/weblogic-azure-vm/arm-oraclelinux-wls/src/main/resources/weblogic-elk.vsdx and /dev/null differ diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/test/data/parameters-test.json b/weblogic-azure-vm/arm-oraclelinux-wls/test/data/parameters-test.json deleted file mode 100644 index 14b6a3e73..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls/test/data/parameters-test.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "adminUsername": { - "value": "weblogic" - }, - "adminPasswordOrKey": { - "value": "#adminPasswordOrKey#" - }, - "dnsLabelPrefix": { - "value": "wls" - }, - "skuUrnVersion": { - "value":"#skuUrnVersion#" - }, - "vmSize": { - "value": "Standard_D2as_v4" - }, - "location": { - "value": "#location#" - } - } -} \ No newline at end of file diff --git a/weblogic-azure-vm/arm-oraclelinux-wls/test/scripts/verify-wls-path.sh b/weblogic-azure-vm/arm-oraclelinux-wls/test/scripts/verify-wls-path.sh deleted file mode 100644 index 3d58e23f1..000000000 --- a/weblogic-azure-vm/arm-oraclelinux-wls/test/scripts/verify-wls-path.sh +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (c) 2021, Oracle Corporation and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -echo "#adminPasswordOrKey#" | sudo -S [ -d "/u01/app/wls/install/oracle/middleware/oracle_home/wlserver/modules" ] && exit 0 -exit 1 diff --git a/weblogic-azure-vm/pom.xml b/weblogic-azure-vm/pom.xml deleted file mode 100644 index 616d7d289..000000000 --- a/weblogic-azure-vm/pom.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - 4.0.0 - - - com.oracle.weblogic.azure - weblogic-azure - 1.0.0 - - - com.oracle.weblogic.azure - weblogic-azure-vm - pom - 1.0.0 - ${project.artifactId} - https://github.com/oracle/weblogic-azure/tree/main/weblogic-azure-vm - - - ${project.basedir}/.. - - - - arm-oraclelinux-wls - arm-oraclelinux-wls-admin - arm-oraclelinux-wls-cluster - arm-oraclelinux-wls-dynamic-cluster - - - diff --git a/weblogic-azure-vm/utilities/custom-hostname-verifier/generateCustomHostNameVerifier.sh b/weblogic-azure-vm/utilities/custom-hostname-verifier/generateCustomHostNameVerifier.sh deleted file mode 100755 index 2c25f77da..000000000 --- a/weblogic-azure-vm/utilities/custom-hostname-verifier/generateCustomHostNameVerifier.sh +++ /dev/null @@ -1,119 +0,0 @@ -#!/bin/bash - -function usage() -{ - echo "Usage: $0 []" - exit 1 -} - - -function readArgs() -{ - - if [ $# -lt 6 ]; - then - echo "Error !! invalid arguments" - usage - fi - - adminInternalHostName="$1" - adminExternalHostName="$2" - adminDNSZoneName="$3" - dnsLabelPrefix="$4" - wlsDomainName="$5" - azureResourceGroupRegion="$6" - - if [ $# -gt 6 ]; - then - debugFlag="$7" - else - debugFlag="false" - fi - -} - - -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" - -java -version > /dev/null 2>&1 - -if [ $? != 0 ]; -then - echo -e "Error !! This script requires java to be installed and available in the path for execution. \n Please install and configure JAVA in PATH variable and retry" - exit 1 -fi - -if [ -z $WL_HOME ]; -then - echo -e "Error !! WL_HOME is not set. \nPlease ensure that WebLogic Server is installed and WL_HOME variable is set to the WebLogic Home Directory" - exit 1 -fi - -#main - -readArgs "$@" - -echo "initializing ..." -CLASSES_DIR="$SCRIPT_DIR/classes" -mkdir -p "$CLASSES_DIR" - -OUTPUT_DIR="$SCRIPT_DIR/output" -mkdir -p "$OUTPUT_DIR" - -echo "Copying HostNames Template file ..." -cp -rf $SCRIPT_DIR/src/main/java/HostNameValuesTemplate.txt $SCRIPT_DIR/src/main/java/HostNameValues.java - -cd $SCRIPT_DIR/src/main/java -echo "Compiling Default HostNameValues.java ..." -$JAVA_HOME/bin/javac -d $CLASSES_DIR HostNameValues.java - -echo "Compiling WebLogicCustomHostNameVerifier.java " -$JAVA_HOME/bin/javac -d $CLASSES_DIR -classpath $WL_HOME/server/lib/weblogic.jar:$CLASSES_DIR WebLogicCustomHostNameVerifier.java - -echo "generating weblogicustomhostnameverifier.jar" -cd $CLASSES_DIR -jar cf $OUTPUT_DIR/weblogicustomhostnameverifier.jar com/oracle/azure/weblogic/security/util/*.class - -#replace arg values in HostNameValues.java -cp $SCRIPT_DIR/src/main/java/HostNameValues.java $SCRIPT_DIR/src/main/java/HostNameValues.java.bak -sed -i "s/debugEnabled=.*/debugEnabled=${debugFlag};/g" $SCRIPT_DIR/src/main/java/HostNameValues.java -sed -i "s/adminInternalHostName=.*/adminInternalHostName=\"${adminInternalHostName}\";/g" $SCRIPT_DIR/src/main/java/HostNameValues.java -sed -i "s/adminExternalHostName=.*/adminExternalHostName=\"${adminExternalHostName}\";/g" $SCRIPT_DIR/src/main/java/HostNameValues.java -sed -i "s/adminDNSZoneName=.*/adminDNSZoneName=\"${adminDNSZoneName}\";/g" $SCRIPT_DIR/src/main/java/HostNameValues.java -sed -i "s/dnsLabelPrefix=.*/dnsLabelPrefix=\"${dnsLabelPrefix}\";/g" $SCRIPT_DIR/src/main/java/HostNameValues.java -sed -i "s/wlsDomainName=.*/wlsDomainName=\"${wlsDomainName}\";/g" $SCRIPT_DIR/src/main/java/HostNameValues.java -sed -i "s/azureResourceGroupRegion=.*/azureResourceGroupRegion=\"${azureResourceGroupRegion}\";/g" $SCRIPT_DIR/src/main/java/HostNameValues.java - -cd $SCRIPT_DIR/src/main/java -echo "Compiling modified HostNameValues.java ..." -$JAVA_HOME/bin/javac -d $CLASSES_DIR HostNameValues.java - -echo "generating hostnamevalues.jar" -cd $CLASSES_DIR -jar cf $OUTPUT_DIR/hostnamevalues.jar com/oracle/azure/weblogic/*.class - -if [ $? != 0 ]; -then - echo "CustomHostNameVerifier jar creation Failed !! Please check the error and retry." - exit 1 -else - echo "CustomHostNameVerifier jar created Successfully !!" -fi - -echo "cleaning up existing classes ..." -find $CLASSES_DIR -type f -name "*.class" -delete - -echo "Running HostNameVerifierTest ..." -cd $SCRIPT_DIR/src/test/java -$JAVA_HOME/bin/javac -d $CLASSES_DIR -classpath $OUTPUT_DIR/hostnamevalues.jar:$OUTPUT_DIR/weblogicustomhostnameverifier.jar WebLogicCustomHostNameVerifierTest.java - -$JAVA_HOME/bin/java -classpath $CLASSES_DIR:$OUTPUT_DIR/hostnamevalues.jar:$OUTPUT_DIR/weblogicustomhostnameverifier.jar com.oracle.azure.weblogic.security.test.WebLogicCustomHostNameVerifierTest "$@" - -if [ $? != 0 ]; -then - echo "CustomHostNameVerifierTest Failed !! Please check the error and retry." - exit 1 -else - echo "CustomHostNameVerifierTest Passed Successfully !!" -fi - diff --git a/weblogic-azure-vm/utilities/custom-hostname-verifier/src/main/java/HostNameValuesTemplate.txt b/weblogic-azure-vm/utilities/custom-hostname-verifier/src/main/java/HostNameValuesTemplate.txt deleted file mode 100644 index 01a7d807e..000000000 --- a/weblogic-azure-vm/utilities/custom-hostname-verifier/src/main/java/HostNameValuesTemplate.txt +++ /dev/null @@ -1,50 +0,0 @@ -package com.oracle.azure.weblogic; - -public class HostNameValues -{ - public static final String azureVMExternalDomainName="cloudapp.azure.com"; - - private static boolean debugEnabled=false; - private static String adminInternalHostName=""; - private static String adminExternalHostName=""; - private static String adminDNSZoneName=""; - private static String dnsLabelPrefix=""; - private static String wlsDomainName=""; - private static String azureResourceGroupRegion=""; - - public static boolean isDebugEnabled() - { - return debugEnabled; - } - - public static String getAdminInternalHostName() - { - return adminInternalHostName; - } - - public static String getAdminExternalHostName() - { - return adminExternalHostName; - } - - public static String getAdminDNSZoneName() - { - return adminDNSZoneName; - } - - public static String getDnsLabelPrefix() - { - return dnsLabelPrefix; - } - - public static String getWlsDomainName() - { - return wlsDomainName; - } - - public static String getAzureResourceGroupRegion() - { - return azureResourceGroupRegion; - } -} - diff --git a/weblogic-azure-vm/utilities/custom-hostname-verifier/src/main/java/WebLogicCustomHostNameVerifier.java b/weblogic-azure-vm/utilities/custom-hostname-verifier/src/main/java/WebLogicCustomHostNameVerifier.java deleted file mode 100644 index ce39b95ec..000000000 --- a/weblogic-azure-vm/utilities/custom-hostname-verifier/src/main/java/WebLogicCustomHostNameVerifier.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.oracle.azure.weblogic.security.util; - -import com.oracle.azure.weblogic.HostNameValues; -import weblogic.security.utils.SSLCertUtility; - -public class WebLogicCustomHostNameVerifier implements weblogic.security.SSL.HostnameVerifier -{ - public boolean verify(String urlHostname, javax.net.ssl.SSLSession session) - { - String commonName = SSLCertUtility.getCommonName(session); - debug("commonName: "+commonName); - debug("urlHostname: "+urlHostname); - - String hostNameMatchStartString = new StringBuilder(HostNameValues.getDnsLabelPrefix().toLowerCase()).append("0").toString(); - String hostNameMatchEndString = new StringBuilder(HostNameValues.getWlsDomainName().toLowerCase()) - .append(".") - .append(HostNameValues.getAzureResourceGroupRegion().toLowerCase()) - .append(".") - .append(HostNameValues.azureVMExternalDomainName.toLowerCase()).toString(); - - if(commonName.equalsIgnoreCase(urlHostname)) - { - debug("urlhostname matching certificate common name"); - return true; - } - else - if(commonName.equalsIgnoreCase(HostNameValues.getAdminInternalHostName())) - { - debug("urlhostname matching certificate common name: "+HostNameValues.getAdminInternalHostName()+","+commonName); - return true; - } - else - if(commonName.equalsIgnoreCase(HostNameValues.getAdminExternalHostName())) - { - debug("urlhostname matching certificate common name: "+HostNameValues.getAdminExternalHostName()+","+commonName); - return true; - } - else - if(commonName.equalsIgnoreCase(HostNameValues.getAdminDNSZoneName())) - { - debug("adminDNSZoneName matching certificate common name: "+HostNameValues.getAdminDNSZoneName()+","+commonName); - return true; - } - else - if(commonName.startsWith(hostNameMatchStartString) && commonName.endsWith(hostNameMatchEndString)) - { - return true; - } - - return false; - } - - private void debug(String debugStatement) - { - if(HostNameValues.isDebugEnabled()) - System.out.println(debugStatement); - } -} - diff --git a/weblogic-azure-vm/utilities/custom-hostname-verifier/src/test/java/WebLogicCustomHostNameVerifierTest.java b/weblogic-azure-vm/utilities/custom-hostname-verifier/src/test/java/WebLogicCustomHostNameVerifierTest.java deleted file mode 100644 index 416888b44..000000000 --- a/weblogic-azure-vm/utilities/custom-hostname-verifier/src/test/java/WebLogicCustomHostNameVerifierTest.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.oracle.azure.weblogic.security.test; - -import com.oracle.azure.weblogic.HostNameValues; -import com.oracle.azure.weblogic.security.util.WebLogicCustomHostNameVerifier; - - -public class WebLogicCustomHostNameVerifierTest -{ - private static String adminInternalHostName; - private static String adminExternalHostName; - private static String adminDNSZoneName; - private static String dnsLabelPrefix; - private static String wlsDomainName; - private static String azureResourceGroupRegion; - private static String debugFlag; - - public static void main(String args[]) - { - readArguments(args); - runTest(); - } - - private static void readArguments(String[] args) - { - if(args != null && args.length >= 6) - { - adminInternalHostName = args[0]; - adminExternalHostName = args[1]; - adminDNSZoneName = args[2]; - dnsLabelPrefix = args[3]; - wlsDomainName = args[4]; - azureResourceGroupRegion = args[5]; - debugFlag="false"; - - if(args.length > 6) - { - debugFlag=args[6]; - } - } - else - { - usage(); - } - } - - private static void runTest() - { - boolean fail=false; - - if(! HostNameValues.getAdminInternalHostName().equals(adminInternalHostName)) - { - System.out.println("Error !! adminInternalHostName not matching in HostNameValues.java: "+HostNameValues.getAdminInternalHostName()+","+adminInternalHostName); - fail=true; - } - - if(! HostNameValues.getAdminExternalHostName().equals(adminExternalHostName)) - { - System.out.println("Error !! adminExternalHostName not matching in HostNameValues.java "+HostNameValues.getAdminExternalHostName()+","+adminExternalHostName); - fail=true; - } - - if(! HostNameValues.getAdminDNSZoneName().equals(adminDNSZoneName)) - { - System.out.println("Error !! adminDNSZoneName not matching in HostNameValues.java "+HostNameValues.getAdminDNSZoneName()+","+adminDNSZoneName); - fail=true; - } - - if(! HostNameValues.getDnsLabelPrefix().equals(dnsLabelPrefix)) - { - System.out.println("Error !! dnsLabelPrefix not matching in HostNameValues.java "+HostNameValues.getDnsLabelPrefix()+","+dnsLabelPrefix); - fail=true; - } - - if(! HostNameValues.getWlsDomainName().equals(wlsDomainName)) - { - System.out.println("Error !! wlsDomainName not matching in HostNameValues.java "+HostNameValues.getWlsDomainName()+","+wlsDomainName); - fail=true; - } - - if(! HostNameValues.getAzureResourceGroupRegion().equals(azureResourceGroupRegion)) - { - System.out.println("Error !! azureResourceGroupRegion not matching in HostNameValues.java "+HostNameValues.getAzureResourceGroupRegion()+","+azureResourceGroupRegion); - fail=true; - } - - if(fail) - { - System.out.println("WebLogicCustomHostNameVerifierTest Failed !!"); - System.exit(1); - } - - System.out.println("WebLogicCustomHostNameVerifierTest Passed !!"); - } - - private static void usage() - { - System.out.println("Usage: java CustomHostNameVerifierGenerator []"); - System.exit(1); - } -} \ No newline at end of file