Skip to content

Commit

Permalink
Updated labs
Browse files Browse the repository at this point in the history
* Update readme.md

* Changed in labs of keyvault

* Changes in Launchdarkly

* click on y for geo-redundancy

* Ansible minimal changes

* Modifications in Jenkins

* Changes in Teams Lab

* changes in redgate

* Modified Dockerdep to Java Webapp

* Modified the Tomcat lab

* modified sonar screenshots

* screenshots modified for Release gated

* subscription masking
  • Loading branch information
sriramdasbalaji authored Jan 12, 2023
1 parent af57d9c commit 2f59c28
Show file tree
Hide file tree
Showing 44 changed files with 66 additions and 50 deletions.
26 changes: 13 additions & 13 deletions labs/vstsextend/Jenkins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,16 @@ This lab covers both the approaches and the following tasks will be performed
### Installing and Configuring Plugins
1. We will now install the Maven and VSTS (yet to be renamed Azure DevOps!) plugins that we require for this lab. Click **Manage Jenkins** on the Jenkins home page and select **Manage Plugins**. Select the **Available** tab and search for `team services`
1. We will now install the Maven and VSTS (yet to be renamed Azure DevOps!) plugins that we require for this lab. Click **Manage Jenkins** on the Jenkins home page and select **Manage Plugins**. Select the **Available plugins** tab and search for `team services`
<img class="myImg" src="images/manage-jenkins1.png" alt="Manage Jenkins"/>
<img class="myImg" src="images/manage-jenkins3.png" alt="Manage Jenkins"/>
1. Select **VS Team Services Continuous Deployment** plugin and select **Install without restart**
<img class="myImg" src="images/jenkins-vstsplugin.png" alt="Manage Jenkins"/>
<img class="myImg" src="images/jenkins-vstsplugin1.png" alt="Manage Jenkins"/>
1. Select **Manage Plugins**, select the **Available** tab and search for `maven-plugin`
Expand All @@ -116,13 +116,13 @@ This lab covers both the approaches and the following tasks will be performed
1. Once the plugin is installed, go back to **Manage Jenkins** and select the **Global Tool Configuration** option.
<img class="myImg" src="images/manage-tools-config.png" alt="Global Tool Configuration"/>
<img class="myImg" src="images/manage-tools-config1.png" alt="Global Tool Configuration"/>
{% include note.html content=" Jenkins provides great out-of-the-box support for Maven. Since Maven is not yet installed, it can be manually installed by extracting the `tar` file located in a shared folder. Alternatively, when the **Install automatically** option is selected in the **Global Tool Configuration** screen, Jenkins will download and install Maven from the Apache website when a build job requires it." %}
1. To install Maven, select the **Install automatically** option and select the **Apply** button. The latest version of Maven at the time of writing this lab is 3.5.4
1. To install Maven, go to Maven section and click on **Add Maven** option and provide a name. Then select the **Apply** button. The latest version of Maven at the time of writing this lab is 3.8.6
<img class="myImg" src="images/maveninstallerconfig.png" alt="Maven Installer"/>
<img class="myImg" src="images/maveninstallerconfig1.png" alt="Maven Installer"/>
1. Select the **Back to Dashboard** button to return to the home page. We are done with the setup. Let's go and create a new CI job.
Expand Down Expand Up @@ -151,11 +151,11 @@ This lab covers both the approaches and the following tasks will be performed
1. The source code for this application has both unit tests and UI tests. We are not ready to run the UI test at this point. So, we will specify to run only the unit tests. Scroll down to the **Build** section and provide the text `package -Dtest=FaresTest,SimpleTest` in the **Goals and options** field.
<img class="myImg" src="images/jenkins-buildsettings.png" alt="Build Settings in Jenkins"/>
<img class="myImg" src="images/jenkins-buildsettings1.png" alt="Build Settings in Jenkins"/>
1. Once the build is complete, you can specify what action you want to take. For instance, you can archive the build artifacts, trigger an Azure CD pipeline, deploy directly to Azure App Service, etc., We will choose the **Archive the artifacts** option in the **Post-build Actions**.
<img class="myImg" src="images/jenkinspostbuildaction.png" alt="Post Build Action"/>
<img class="myImg" src="images/jenkinspostbuildaction1.png" alt="Post Build Action"/>
{% include note.html content="Note there is also **Post-build steps** section which is very similar to the actions section. The tasks configured in the post-build steps/actions are executed after all the build steps have been executed." %}
Expand All @@ -165,7 +165,7 @@ This lab covers both the approaches and the following tasks will be performed
1. The configuration is now completed, Select the **Build Now** option to initiate an Ad-hoc build. The build progress will be displayed on the left pane in the **Build History** section
<img class="myImg" src="images/adhocbuild.png" alt="Running Ad-hoc Build"/>
<img class="myImg" src="images/adhocbuild1.png" alt="Running Ad-hoc Build"/>
1. To view the build details and the list of build artifacts, select the build number displayed in the **Build History** section.
Expand All @@ -190,11 +190,11 @@ For the service hook in Azure DevOps to work - Jenkins machine should accept inc
1. Set an inbound rule for port 8080
<img class="myImg" src="images/azuredevops-jenkins-accept8080.png" alt="Accept 8080 inbound port" />
1. Navigate to your Jenkins page and go to **User \| Configure**. Click on **Add new token** under API Token section and give some name and click **Generate**. Make a note of the Token generated. We would be using this Token as Jenkins password in Azure DevOps
1. Navigate to your Jenkins page and go to **User \| Configure**. Click on **Add new token** under API Token section and give some name and click **Generate**. Make a note of the Token generated. We would be using this Token as Jenkins password in Azure DevOps. Save the settings
![](images/jenkinstoken1.png)
![](images/jenkinstoken3.png)
![](images/jenkinstoken2.png)
![](images/jenkinstoken4.png)
## Approach 1: Triggering the CI via a service hook in Azure DevOps
Expand Down Expand Up @@ -252,7 +252,7 @@ To begin, an endpoint to the Jenkins Server for communication with Azure DevOps
<img class="myImg" src="images/jenkinsbuildtemplate.png" alt="[Jenkins Template" />
1. Select **vs2017-win2016** for the Agent specification, provide **MyShuttle** as the Job name ( name of the build definition that was created in Jenkins) and then select the Jenkins service endpoint created earlier.
1. Select **windows-2019** for the Agent specification, provide **MyShuttle** as the Job name ( name of the build definition that was created in Jenkins) and then select the Jenkins service endpoint created earlier.
<img class="myImg" src="images/azuredevops-jenkinsbuild.png" alt="Jenkins Settings in Team Build" />
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added labs/vstsextend/Jenkins/images/adhocbuild1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added labs/vstsextend/Jenkins/images/jenkinstoken3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added labs/vstsextend/Jenkins/images/jenkinstoken4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified labs/vstsextend/dockerjava/images/azuredbmysql2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added labs/vstsextend/dockerjava/images/networking.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 17 additions & 7 deletions labs/vstsextend/dockerjava/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ In this task, you will configure a CI pipeline that will build and push the imag
|Qualify image name| Check (set to true)|
| Include Latest Tag | Check (set to true) | Adds the `latest` tag to the images produced by this build |

![Docker build task](images/dockerbuildtask.png)
![Docker build task](images/dockerbuildtask1.png)

1. There is a second **Docker** task with almost the same settings. The only change is the **Command** is set to **Push** and the **Image name** is set to `Web:$(Build.BuildNumber)`. This action will instruct the task to push the Web image to the container registry.

![Maven task settings](images/dockerpublishtask.png)

1. Click the **Save and Queue** button to save and queue this build. Make sure you are using the **Hosted Ubuntu 1604** build agent.
1. Click the **Save and Queue** button to save and queue this build. Make sure you choose **Azure Pipelines** in Agent pool and Agent Specification should be **ubuntu-18.04**

1. Wait for the build to complete. When it is successful, you can go to your Azure portal and verify if the images were pushed successfully.
![images/Azure Container Registry Images](images/portal-acrrepo2.png)
Expand All @@ -122,7 +122,7 @@ In this exercise, we will setup a Release pipeline to deploy the web application
* Select existing or create new resource group for the web app.
* Leave the App Service plan/Location as it is.

![](images/azurewebappcreate1.png)
![](images/azurewebappcreate01.png)

1. In the Docker tab, select **Azure Container Registry** as Image source. Select the **Registry, Image and Tag** from the respective drop-downs and click **Review + create** and then **Create**.

Expand All @@ -136,18 +136,28 @@ In this exercise, we will setup a Release pipeline to deploy the web application

We could configure *Continuous Deployment* to deploy the web app when a new image is pushed to the registry, within the Azure portal itself. However, setting up an Azure Pipeline will provide more flexibility and additional controls (approvals, release gates, etc.) for application deployment.

1. We need to create Azure Database for MySQL as well. Choose **+ Create a resource**, search for **Azure Database for MySQL**, select and click *Create*. Provide all the required mandatory information and note down **Password** to a notepad. We will use it later in the Deployment pipeline. Click **Review + create** and then **Create**.
1. We need to create Azure Database for MySQL as well. Choose **+ Create a resource**, search for **Azure Database for MySQL**, select and click *Create*. Now select **Flexible server** option in Resource type and click on **Create**

![Choosing Flexible server](images/chooserecommended.png)

1. Provide all the required mandatory information and note down **Password** to a notepad. We will use it later in the Deployment pipeline.


![Creating MYSQL Server](images/mysqldbcreate.png)
![Creating MYSQL Server](images/mysqldbcreate1.png)

![Creating MYSQL Server](images/mysqldbcreate2.png)

1. Navigate to Networking section and select the check box that says **Allow public access from any Azure service within Azure to this server**. Now **Review + create** and then **Create**

![](images/networking.png)


1. Navigate to the Azure Database for MySQL server provisioned. Save the **Server name** and **Server admin login name** to a notepad.

![](images/azuredbmysql2.png)

1. Select Connection security. Enable **Allow access to Azure services** toggle and **Save** the changes. This provides access to Azure services for all the databases in your MySQL server.

![](images/accesstoazureservices.png)


1. Back in Azure DevOps account, select **Releases** from the **Pipelines** hub. Select the Release definition - **MyShuttleDockerRelease** and click **Edit**.

Expand Down
Binary file modified labs/vstsextend/kubernetes/images/acr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added labs/vstsextend/redgate/images/xmlvariable1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion labs/vstsextend/redgate/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ Now you have both the application and database packages available as build artif

1. **Deploy Azure App Service**: Using this task you will deploy application package to Azure app service which was created. And also we need to update the connection string for this app service to access **pul-prod** database. In App Service task set **XML variable substitution** option.

![](images/xmlvariable.png)
![](images/xmlvariable1.png)

>XML variable substitution enables you to modify configuration settings in configuration files (*.config files) inside web packages and XML parameters files (parameters.xml). In this way, the same package can be configured based on the environment to which it will be deployed. For more information on XML Transformations click [here](https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/transforms-variable-substitution?view=azure-devops)

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 12 additions & 8 deletions labs/vstsextend/releasegates/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,21 +87,25 @@ You will create two **Web Apps** in Azure to depict two environments **Canary**

![](images/appinsightsselect.png)

1. You will create monitor alerts here, which you will use in later part of this lab. Choose **Alerts** and click **New alert rule**.
1. You will create monitor alerts here, which you will use in later part of this lab. Choose **Alerts** and click on **+Create** and choose **Add rule**.

![](images/newaialert.png)
![](images/newaialert1.png)

1. The **Create alert rule** pane appears. Choose **Select condition**. Search for **Failed Requests** rule and select.
1. Choose **Select condition**. Search for **Failed Requests** rule and select.

![](images/addaialert.png)
![](images/addaialert1.png)

In the resulting pane configure **Alert logic** as shown below and click on **Done**.
1. In the **Condition** section set Threshold value as **0**.

![](images/alertlogic.png)
![](images/alertlogic1.png)

1. Now in Create alert rule pane enter Alert rule details as below
1. Now in **Actions** section, choose the values as below

![](images/alertruledetails.png)
![](images/alertruledetails1.png)

1. Now in **Details** section, provide the value for Alert rule name. Then **Review + Create**

![](images/alertruledetails2.png)

1. Once the rule is created you will be able to see that rule under **Alerts**
![](images/managealerts.png)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added labs/vstsextend/sonarqube/images/sonarpage1.png
20 changes: 11 additions & 9 deletions labs/vstsextend/sonarqube/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,33 +73,35 @@ In this lab, you will learn how to setup SonarQube on Azure and integrate with A

![access_sonar_aci](images/access_sonar_aci.png)

1. Open a browser and login to the SonarQube Portal using the following credentials-
1. Open a browser and login to the SonarQube Portal using the following credentials.

>**Username= admin, Password= admin**

1. Click **Skip this tutorial** in the pop-up window to see the home page.

![Skip tutorial](images/skiptutorial.png)

![sonarqube_portal](images/sonarqube_portal.png)
1. Change the password to a different value. Then you will see a below page.
![intro_page_sonarqube](images/sonarpage1.png)



1. Choose **Administration** in the toolbar, click **Projects** tab and then **Management**.

![sonar_admin](images/sonar_admin.png)

1. Create a project with **Name** and **Key** as **MyShuttle**.
1. Create a project with **Name** and **Key** as **MyShuttle**. Provide **Main branch name** as master. Then click on **Create**

- **Name**: Name of the SonarQube project that will be displayed on the web interface.

- **Key**: The SonarQube project key that is unique for each project.

- **Main branch name**: Name of the major branch of the repository. This in some cases will be *main* and in some cases *master*

- Leave the **Visibility** option to **Public**.

![project_creation](images/project_creation.png)
![project_creation](images/project_creation1.png)

Let us create a Quality Gate to enforce a policy which fails the gate if there are bugs in the code. A Quality Gate is a PASS/FAIL check on a code quality that must be enforced before releasing software.

1. Click the **Quality Gates** menu and click **Create** in the Quality Gates screen. Enter a name for the Quality Gate and click **Create**.
1. Click the **Quality Gates** menu and click **Create** in the Quality Gates screen. Enter a name for the Quality Gate and click **Save**.

![qualitygate](images/qualitygate.png)

Expand Down Expand Up @@ -132,7 +134,7 @@ Now that the SonarQube server is running, we will modify Azure Build pipeline to

In the **Add SonarQube service connection** wizard enter the SonarQube server URL and SonarQube security token detials. If you don't have SonarQube security token follow [this](https://docs.sonarqube.org/latest/user-guide/user-token/) to create one. And make sure SonarQube project name and project key are same as you entered while creating SonarQube project in **Exercise 1**.
![](images/sonar_endpoint.png)
![](images/sonar_endpoint1.png)
{% include note.html content= "The tokens are used to run analysis or invoke web services without access to the user's actual credentials." %}
Expand Down
Binary file added labs/vstsextend/teams/images/add_to_team1.png
Binary file added labs/vstsextend/teams/images/set_up_bots1.png
18 changes: 9 additions & 9 deletions labs/vstsextend/teams/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ In this lab, you’ll learn about how **Azure DevOps** integrates with **Microso

![](images/create_team2.png)

1. Select **Build a team from scratch** and then select the privacy settings.
1. Select **From scratch** and then select the privacy settings.

![](images/create_team3_new.png)
![](images/create_team3_new1.png)

![](images/create_team3_new01.png)

Expand All @@ -65,11 +65,11 @@ In this lab, you’ll learn about how **Azure DevOps** integrates with **Microso

1. Select **Azure DevOps** connector from the list and click **Add**.

![](images/azuredevops_connector.png)
![](images/azuredevops_connector1.png)

1. Click **Add** to add the connector for your team.
1. Click **Add** to add the connector for your team. Navigate back to Connectors option to start configuring it

![](images/install_connector_new.png)
![](images/install_connector_new1.png)

1. Select your organization (you may be prompted to sign in first), the project and your team. Choose the type of activity you want to be notified about. Depending on the event, you may be given further fields to filter down the notifications so you can filter out notifications your team does not care about. For example, for work item events, you can filter by area path, work item type, and even particular field changes.

Expand Down Expand Up @@ -137,14 +137,14 @@ Azure Pipelines app on Microsoft Teams enables you to monitor the events for you

1. In the app,click on **Add**.

![](images/install_azurepipelines_new.png)
![](images/install_azurepipelines_new1.png)

1. Once the app is added, click on the drop down and select **Add to a team**

![](images/add_to_team.png)
![](images/add_to_team1.png)

1. Select your team and click on **Set up a bot**
![](images/set_up_bots.png)
![](images/set_up_bots1.png)

1. Use the `@azure pipelines` handle to start interacting with the app.

Expand Down Expand Up @@ -241,7 +241,7 @@ To learn more about best practices for creating teams and channels view this sho

1. Give a name, description for your channel and select privacy and click on **Add**

![](images/create_channel_new.png)
![](images/create_channel_new1.png)

1. Once the channel is created, the conversations can be started among the team members.

Expand Down
Binary file added labs/vstsextend/tomcat/images/dbconnstrings1.png
Binary file added labs/vstsextend/tomcat/images/mysqlaccess1.png
Binary file added labs/vstsextend/tomcat/images/webcontainer1.png
6 changes: 3 additions & 3 deletions labs/vstsextend/tomcat/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ This lab will show how you will

1. Select **Connection security**. Enable **Allow access to Azure services** toggle and **Save** the changes. This provides access to Azure services for all the databases in your MySQL server.

![](images/mysqlaccess.png)
![](images/mysqlaccess1.png)

## Exercise 2: Updating the App Settings for the Web App

Next, navigate to the Web app that you have created. As you are deploying a Java application, you need to change the web app’s web container to Apache Tomcat.

1. Select **Configuration**. Set the **Stack settings** as shown in below image and click **Save**.

![Setting Web container to Tomcat](images/webcontainer.png)
![Setting Web container to Tomcat](images/webcontainer1.png)

1. Select **Overview** and click **Browse**.

Expand All @@ -94,7 +94,7 @@ Next, navigate to the Web app that you have created. As you are deploying a Java

> <code style="color:black;">jdbc:mysql://{MySQL Server Name}:3306/alm?useSSL=true&requireSSL=false&autoReconnect=true&user={your user name}&password={your password}</code>
![DB Connection](images/dbconnstrings.png)
![DB Connection](images/dbconnstrings1.png)

- MySQL Server Name : Value that you copied previously from the MySQL server Properties.
- your user name : Value that you copied previously from the MySQL server Properties.
Expand Down

0 comments on commit 2f59c28

Please sign in to comment.