To make sure the we could deliver a release with acceptable quality, it is neccessary to do the following steps:
- Create the required sources e.g. appSerive and VM with the help of terraform. It helps us to make sure that we always have the consitent enviroment.
- Deploy fakeRestAPI into azure appService, so it could be used for API testing with Jmeter
- VM must be configured to be able to exeute Selenium
- Use Postman to make sure API and all the HTTP Protocol like GET and POST are respoding correctly.
- Automate all of the previous step in azure devops pipeline.
Please create the storage account by using this link here.
Either use the same variable name in azure-pipeline.yml file or adjust pipeline file according to your used variable names.
HINT: DO NOT FORGET TO SAVE THE PASSWORD FOT STORAGE ACCOUNT
This key is required for VM deployment.
ssh-keygen -t rsa
create "terraform.tfvars" and fill it with your azure data. **HINT:**DO NOT ADD THIS FILE YOUR REPOSITRY
# Azure GUIDS
subscription_id = <FILL IT>
client_id = <FILL TT>
client_secret = <FILL TT>
tenant_id = <FILL TT>
# Resource Group/Location
location = "East US"
resource_group = "rg-erq"
application_type = "erq"
# Network
virtual_network_name = "vnn_erq"
address_space = ["10.5.0.0/16"]
address_prefix_test = "10.5.1.0/24"
# Virtual Machine
vm_admin_username = "adminuser"
Create azure devops pipeline as it is explained here.
Create service connecton as it is explained here. HINT: LEAVE THE RESOURCE GROUP EMPTY
Install the following azure pipeline extension:
Since we do not want to store the sensitive information in the repository, we need to use secureFile option of the created azure pipeline.
Create the following pipeline enviroment, so VM and Appservice can be configured during pipeline execution in the automatic manner.
- VM-CONFIG
- WEBAPP-DEPLOY
Create the workspace with help of this link.
The required files "azure-storage-account.sh" and "deploylaworkspacetemplate.json" can be found in root of the project.
After creation of the workspace, please make sure that you update WORKSPACE_ID and PRIMARY_KEY in the azure pipeline yaml file.
For more information please check these two Links (1 and 2 ).
The workspace will be used for gathering all required logs and eventually logs analysis.
To make sure that the pipleine can configure the created VM via terraform, we created the pipeline enviroments.
However, there is another step, that should be done once after creation of the VM. Therefore, there is waiting stage
in the pipeline after terraform is finished. During the waiting period, you need to run the following steps:
- After terraform is finished successfully, go to pipeline enviroment -> VM-CONFIG -> Add Resources
- Choose the linux version
- copy paste the given bash script
- SSH into VM (with help of created SSH key earlier)
- Execute the copied bash script
- Log output of Terraform when executed by the CI/CD pipeline
- Successful execution of the pipeline build
- Log output JMeter
- Log output Selenium
- Log output Postman
- Postman Test Report
- AppService HTTP 404 Alert Email
- Selenium Log Analytics