diff --git a/Instructions/Labs/AZ400_M00_Validate_lab_environment.md b/Instructions/Labs/AZ400_M00_Validate_lab_environment.md index a0b1ad57a..6b70f294f 100644 --- a/Instructions/Labs/AZ400_M00_Validate_lab_environment.md +++ b/Instructions/Labs/AZ400_M00_Validate_lab_environment.md @@ -8,7 +8,7 @@ lab: # Student lab manual -## Instructions +## Instructions to create an Azure DevOps Organization (you only have to do this once) > **Note**: Start at step 4, if you do already have a **personal Microsoft Account** setup and an active Microsoft Azure Pass subscription linked to that account. @@ -34,3 +34,36 @@ lab: 18. Toggle the switch to **On** for **Allow public projects** > Note: Extensions used in some labs might require a public project to allow using the free version. 19. **Wait at least 3 hours before using the CI/CD capabilities** so that the new settings are reflected in the backend. Otherwise, you will still see the message *"No hosted parallelism has been purchased or granted"*. + +## Instructions to create the sample Azure DevOps Project (you only have to do this once) + +### Exercise 0: Configure the lab prerequisites + +> **Note**: make sure you completed the steps to create your Azure DevOps Organization before continuing with these steps. + +In this exercise, you will set up the prerequisites for the lab, which consist of a new Azure DevOps project with a repository based on the [eShopOnWeb](https://github.com/MicrosoftLearning/eShopOnWeb). + +#### Task 1: Create and configure the team project + +In this task, you will create an **eShopOnWeb** Azure DevOps project to be used by several labs. + +1. On your lab computer, in a browser window open your Azure DevOps organization. Click on **New Project**. Give your project the name **eShopOnWeb** and leave the other fields with defaults. Click on **Create**. + + ![Create Project](images/create-project.png) + +#### Task 2: Import eShopOnWeb Git Repository + +In this task you will import the eShopOnWeb Git repository that will be used by several labs. + +1. On your lab computer, in a browser window open your Azure DevOps organization and the previously created **eShopOnWeb** project. Click on **Repos>Files** , **Import a Repository**. Select **Import**. On the **Import a Git Repository** window, paste the following URL https://github.com/MicrosoftLearning/eShopOnWeb.git and click **Import**: + + ![Import Repository](images/import-repo.png) + +1. The repository is organized the following way: + - **.ado** folder contains Azure DevOps YAML pipelines + - **.devcontainer** folder container setup to develop using containers (either locally in VS Code or GitHub Codespaces) + - **.azure** folder contains Bicep&ARM infrastructure as code templates used in some lab scenarios. + - **.github** folder container YAML GitHub workflow definitions. + - **src** folder contains the .NET 6 website used on the lab scenarios. + +You have now completed the necessary prerequisite steps to continue with the different individual labs for this AZ-400 course. \ No newline at end of file diff --git a/Instructions/Labs/AZ400_M01_L01_Agile_Planning_and_Portfolio_Management_with_Azure_Boards.md b/Instructions/Labs/AZ400_M01_L01_Agile_Planning_and_Portfolio_Management_with_Azure_Boards.md index 538345956..bc6ca6330 100644 --- a/Instructions/Labs/AZ400_M01_L01_Agile_Planning_and_Portfolio_Management_with_Azure_Boards.md +++ b/Instructions/Labs/AZ400_M01_L01_Agile_Planning_and_Portfolio_Management_with_Azure_Boards.md @@ -92,9 +92,9 @@ Each new project is configured with a default team, which name matches the proje ![In the "interations" tab, click on "Edit"](images/m1/EShop-WEB-edit_iteration_v1.png) - > **Note**: Specify the Start Date as the first work day of last week, and specify Friday in 3 weeks from the Start Date as the End Date. This follows the best practice of having 3-week Sprints. + > **Note**: Specify the Start Date as the first work day of last week, and count 3 full work weeks for each sprint. For example, if March 6 is the first work day of the sprint, it goes until March 24th. Sprint 2 starts on March 27, which is 3 weeks out from March 6. -1. Repeat the previous step to add **Sprint 2** and **Sprint 3**. The second sprint is our current iteration, reflecting the working days of the current week, and the third is reflecting the dates of next week. +1. Repeat the previous step to add **Sprint 2** and **Sprint 3**. You could say that we are currently in the 2nd week of the first sprint. ![Do the same for Sprint 2 and 3, make sure they are created for "EShop-Web" team](images/m1/EShop-WEB-3sprints_v1.png) diff --git a/Instructions/Labs/AZ400_M08_L18_Package_Management_with_Azure_Artifacts.md b/Instructions/Labs/AZ400_M08_L18_Package_Management_with_Azure_Artifacts.md index 7a3419e5d..474ab3c2b 100644 --- a/Instructions/Labs/AZ400_M08_L18_Package_Management_with_Azure_Artifacts.md +++ b/Instructions/Labs/AZ400_M08_L18_Package_Management_with_Azure_Artifacts.md @@ -12,7 +12,9 @@ lab: - This lab requires **Microsoft Edge** or an [Azure DevOps supported browser.](https://docs.microsoft.com/en-us/azure/devops/server/compatibility?view=azure-devops#web-portal-supported-browsers) -- **Set up an Azure DevOps organization:** If you don't already have an Azure DevOps organization that you can use for this lab, create one by following the instructions available at [Create an organization or project collection](https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/create-organization?view=azure-devops). +- **Set up an Azure DevOps organization:** If you don't already have an Azure DevOps organization that you can use for this lab, create one by following the instructions available at [AZ-400 Lab Prerequisites](https://microsoftlearning.github.io/AZ400-DesigningandImplementingMicrosoftDevOpsSolutions/Instructions/Labs/AZ400_M00_Validate_lab_environment.html). + +- **Set up the sample EShopOnWeb Project:** If you don't already have the sample EShopOnWeb Project that you can use for this lab, create one by following the instructions available at [AZ-400 Lab Prerequisites](https://microsoftlearning.github.io/AZ400-DesigningandImplementingMicrosoftDevOpsSolutions/Instructions/Labs/AZ400_M00_Validate_lab_environment.html). - Visual Studio 2022 Community Edition available from [Visual Studio Downloads page](https://visualstudio.microsoft.com/downloads/). Visual Studio 2022 installation should include **ASP.NET and web development**, **Azure development**, and **.NET Core cross-platform development** workloads. @@ -35,43 +37,21 @@ After you complete this lab, you will be able to: ### Exercise 0: Configure the lab prerequisites -In this exercise, you will set up the prerequisites for the lab, which include the preconfigured Parts Unlimited team project based on an Azure DevOps Demo Generator template and a Visual Studio configuration. - -#### Task 1: Configure the team project - -In this task, you will use Azure DevOps Demo Generator to generate a new project based on the **PartsUnlimited** template. - -1. On your lab computer, start a web browser and navigate to [Azure DevOps Demo Generator](https://azuredevopsdemogenerator.azurewebsites.net). This utility site will automate the process of creating a new Azure DevOps project within your account that is prepopulated with content (work items, repos, etc.) required for the lab. - - > **Note**: For more information on the site, see . - -1. Click **Sign in** and sign in using the Microsoft account associated with your Azure DevOps subscription. -1. If required, on the **Azure DevOps Demo Generator** page, click **Accept** to accept the permission requests for accessing your Azure DevOps subscription. -1. On the **Create New Project** page, in the **New Project Name** textbox, type **Package Management with Azure Artifacts**, in the **Select organization** dropdown list, select your Azure DevOps organization, and then click **Choose template**. -1. On the **Choose a template** page, in the list of templates, click the **PartsUnlimited** template, and then click **Select Template**. -1. Back on the **Create New Project** page, click **Create Project** +In this exercise, we want to remind you about validating the lab prerequisites, having both an Azure DevOps Organization ready, as well as having created the EShopOnWeb project. See the instructions above for more details. - > **Note**: Wait for the process to complete. This should take about 2 minutes. In case the process fails, navigate to your DevOps organization, delete the project, and try again. - -1. On the **Create New Project** page, click **Navigate to project**. - -#### Task 2: Configuring the Parts Unlimited solution in Visual Studio +#### Task 1: Configuring the EShopOnWeb solution in Visual Studio In this task, you will configure Visual Studio to prepare for the lab. -1. Ensure that you are viewing the **Package Management with Azure Artifacts** team project on the Azure DevOps portal. +1. Ensure that you are viewing the **EShopOnWeb** team project on the Azure DevOps portal. - > **Note**: You can access the project page directly by navigating to the [https://dev.azure.com/``/Package%20Management%20with%20Azure%20Artifacts](https://dev.azure.com/``/Package%20Management%20with%20Azure%20Artifacts) URL, where the `` placeholder, represents your account name. + > **Note**: You can access the project page directly by navigating to the [https://dev.azure.com/``/EShopOnWeb](https://dev.azure.com/``/EShopOnWeb) URL, where the `` placeholder, represents your Azure DevOps Organization name. -1. In the vertical menu on the left side of the **Package Management with Azure Artifacts** pane, click **Repos**. +1. In the vertical menu on the left side of the **EShopOnWeb** pane, click **Repos**. 1. On the **Files** pane, click **Clone**, select the drop-down arrow next to **Clone in VS Code**, and, in the dropdown menu, select **Visual Studio**. 1. If prompted whether to proceed, click **Open**. 1. If prompted, sign in with the user account you used to set up your Azure DevOps organization. -1. Within the Visual Studio interface, in the **Azure DevOps** pop-up window, accept the default local path and click **Clone**. This will automatically import the project into Visual Studio and open a new web browser tab displaying the Migration Report page. - - > **Note**: In the **Review Project and Solution Changes** dialog box, review the warnings about unsupported project types and click **OK**. - -1. Close the web browser tab displaying the Migration Report page. +1. Within the Visual Studio interface, in the **Azure DevOps** pop-up window, accept the default local path (C:\EShopOnWeb) and click **Clone**. This will automatically import the project into Visual Studio. 1. Leave Visual Studio window open for use in your lab. ### Exercise 1: Working with Azure Artifacts @@ -92,47 +72,45 @@ In this task, you will create and connect to a feed. > **Note**: This feed will be a collection of NuGet packages available to users within the organization and will sit alongside the public NuGet feed as a peer. The scenario in this lab will focus on the workflow for using Azure Artifacts, so the actual architectural and development decisions are purely illustrative. This feed will include common functionality that can be shared across projects in this organization. -1. On the **Create new feed** pane, in the **Name** textbox, type **PartsUnlimitedShared**, in the **Scope** section, select the **Organization** option, leave other settings with their default values, and click **Create**. +1. On the **Create new feed** pane, in the **Name** textbox, type **EShopOnWebShared**, in the **Scope** section, select the **Organization** option, leave other settings with their default values, and click **Create**. > **Note**: Any user who wants to connect to this NuGet feed must configure their environment. 1. Back on the **Artifacts** hub, click **Connect to feed**. -1. On the **Connect to feed** pane, in the **NuGet** section, select **Visual Studio** and, on the **Visual Studio** pane, copy the **Source** url. +1. On the **Connect to feed** pane, in the **NuGet** section, select **Visual Studio** and, on the **Visual Studio** pane, copy the **Source** url. (https://pkgs.dev.azure.com/_packaging/EShopOnWebShared/nuget/v3/index.json) 1. Switch back to the **Visual Studio** window. 1. In the Visual Studio window, click **Tools** menu header, in the dropdown menu, select **NuGet Package Manager** and, in the cascading menu, select **Package Manager Settings**. 1. In the **Options** dialog box, click **Package Sources** and click the plus sign to add a new package source. -1. At the bottom of the dialog box, in the **Name** textbox, replace **Package source** with **PartsUnlimitedShared** and, in the **Source** textbox, paste the URL you copied in the Azure DevOps portal. +1. At the bottom of the dialog box, in the **Name** textbox, replace **Package source** with **EShopOnWebShared** and, in the **Source** textbox, paste the URL you copied in the Azure DevOps portal. 1. Click **Update** and then click **OK** to finalize the addition. > **Note**: Visual Studio is now connected to the new feed. -1. Close and reopen the other Visual Studio instance you used for cloning the PartsUnlimited repository, to account for the artifact source update and open the **PartsUnlimited** solution. You will need it in the third task of this exercise. - -#### Task 2: Creating and publishing a NuGet package +#### Task 2: Creating and publishing an in-house developed NuGet package -In this task, you will create and publish a NuGet package. +In this task, you will create and publish an in-house developed custom NuGet package. 1. In the Visual Studio window you used to configure the new package source, in the main menu, click **File**, in the dropdown menu, click **New** and then, in the cascading menu, click **Project**. > **Note**: We will now create a shared assembly that will be published as a NuGet package so that other teams can integrate it and stay up to date without having to work directly with the project source. -1. On the **Recent project templates** page of the **Create a new project** pane, use the search textbox to locate the **Class Library (.NET Framework)** template, select the template for C#, and click **Next**. -1. On the **Class Library (.NET Framework)** page of the **Create a new project** pane, specify the following settings and click **Create**: +1. On the **Recent project templates** page of the **Create a new project** pane, use the search textbox to locate the **Class Library** template, select the template for C#, and click **Next**. +1. On the **Class Library** page of the **Create a new project** pane, specify the following settings and click **Create**: | Setting | Value | | --- | --- | - | Project name | **PartsUnlimited.Shared** | + | Project name | **EShopOnWeb.Shared** | | Location | accept the default value | | Solution | **Create new solution** | - | Solution name | **PartsUnlimited.Shared** | - | Framework | **.NET Framework 4.5.1** | - - > **Note**: Make sure not to select **.NET Standard**. + | Solution name | **EShopOnWeb.Shared** | + + Leave the setting **Place solution and project in the same directory** enabled. +1. Click Next. Accept **.NET 6.0 (Long Term Support)** as Framework option. +1. Confirm the project creation by pressing the **Create** button. + 1. Within the Visual Studio interface, in the **Solution Explorer** pane, right-click **Class1.cs**, in the right-click menu, select **Delete**, and, when prompted for confirmation, click **OK**. -1. Within the Visual Studio interface, in the **Solution Explorer** pane, right-click the **PartsUnlimited.Shared** project node and select **Properties**. -1. Within the **PartsUnlimited.Shared** properties pane, verify that the **Target framework** is set to **.NET Framework 4.5.1**. -1. Press **Ctrl+Shift+B** to build the project. +1. Press **Ctrl+Shift+B** or **Right-click on the EShopOnWeb.Shared Project** and select **Build** to build the project. > **Note**: In the next task we'll use **NuGet.exe** to generate a NuGet package directly from the built project, but it requires the project to be built first. @@ -140,121 +118,135 @@ In this task, you will create and publish a NuGet package. 1. Navigate to the **Connect to feed** pane, in the **NuGet** section and select **NuGet.exe**. This will display the **NuGet.exe** pane. 1. On the **NuGet.exe** pane, click **Get the tools**. 1. On the **Get the tools** pane, click the **Download the latest NuGet** link. This will automatically open another browser tab displaying the **Available NuGet Distribution Versions** page. -1. On the **Available NuGet Distribution Versions** page, select nuget.exe version **v5.5.1** and download the executable to the local **Downloads** folder. -1. Switch to the **Visual Studio** window. In the **Solution Explorer** pane, right-click the **PartsUnlimited.Shared** project node and, in the right-click menu, select **Open Folder in File Explorer**. -1. Within the File Explorer window, move the downloaded **nuget.exe** file from the **Downloads** folder into the folder containing the **.csproj** file. -1. In the same File Explorer window, select the **File** menu header, in the dropdown menu, select **Open Windows PowerShell**, and, in the cascading menu, click **Open Windows PowerShell as administrator**. -1. In the **Administrator: Windows PowerShell** window, run the following to create a **.nupkg** file from the project. +1. On the **Available NuGet Distribution Versions** page, select **nuget.exe - recommended latest v6.x** and download the executable to the local **EShopOnWeb.Shared Project** folder (If you kept the default folder locations, this should be C:\EShopOnWeb\EShopOnWeb.Shared). +1. Select the **nuget.exe** file, and open its properties by right-clicking on the file, and selecting **Properties** from the context menu. +1. In the Properties context window, from the **General** tab, select **Unblock** under the Security section. Confirm by pressing **Apply** and **OK**. +1. From your lab workstation, open the Start menu, and search for **Windows PowerShell**. Next, in the cascading menu, click **Open Windows PowerShell as administrator**. +1. In the **Administrator: Windows PowerShell** window, navigate to the EShopOnWeb.Shared folder, by executing the following command: + +``` +cd c:\EShopOnWeb\EShopOnWeb.Shared +``` +run the following to create a **.nupkg** file from the project. > **Note**: This is a shortcut to package the NuGet bits for deployment. NuGet is highly customizable. To learn more, refer to the [NuGet package creation page](https://docs.microsoft.com/en-us/nuget/create-packages/overview-and-workflow). ``` - ./nuget.exe pack ./PartsUnlimited.Shared.csproj + .\nuget.exe pack ./EShopOnWeb.Shared.csproj ``` > **Note**: Disregard any warnings displayed in the **Administrator: Windows PowerShell** window. - > **Note**: NuGet builds a minimal package based on the information it is able to identify from the project. For example, note that the name is **PartsUnlimited.Shared.1.0.0.nupkg**. That version number was retrieved from the assembly. - -1. Switch back to the **Visual Studio** window, in the **Solution Explorer** pane, expand the **PartsUnlimited.Shared\Properties** node, click **AssemblyInfo.cs** to open it in the central pane of the window, and review its content. - - > **Note**: The **AssemblyVersion** attribute specifies the version number to build into the assembly. Each NuGet release requires a unique version number, so if we continue to use this method for creating packages, we need to increment this before the build. + > **Note**: NuGet builds a minimal package based on the information it is able to identify from the project. For example, note that the name is **EShopOnWeb.Shared.1.0.0.nupkg**. That version number was retrieved from the assembly. -1. Switch to the **Administrator: Windows PowerShell** window and run the following to publish the package to the **PartsUnlimitedShared** feed: +1. After the successful creation of the package, run the following to publish the package to the **EShopOnWebShared** feed: > **Note**: You need to provide an **API Key**, which can be any non-empty string. We're using **AzDO** here. When prompted, sign in to your Azure DevOps organization. ``` - ./nuget.exe push -source "PartsUnlimitedShared" -ApiKey AzDO PartsUnlimited.Shared.1.0.0.nupkg + .\nuget.exe push -source "EShopOnWebShared" -ApiKey AzDO EShopOnWeb.Shared.1.0.0.nupkg ``` - +1. Wait for the confirmation of the successful package push operation. 1. Switch to the web browser window displaying the Azure DevOps portal and, in the vertical navigational pane, select **Artifacts**. -1. On the **Artifacts** hub pane, click the dropdown list in the upper left corner and, in the list of feeds, select the **PartsUnlimitedShared** entry. +1. On the **Artifacts** hub pane, click the dropdown list in the upper left corner and, in the list of feeds, select the **EShopOnWebShared** entry. - > **Note**: The **PartsUnlimitedShared** feed should include the newly published NuGet package. + > **Note**: The **EShopOnWebShared** feed should include the newly published NuGet package. 1. Click the NuGet package to display its details. -#### Task 3: Importing a NuGet package - -In this task, you will import a NuGet package. - -1. Switch to the **Visual Studio** window displaying the **Parts Unlimited** solution. -1. In the **Solution Explorer** pane, right-click the **References** node under the **PartsUnlimitedWebsite** project and, in the right-click menu, select **Manage NuGet Packages**. This will open the **NuGet: PartsUnlimitedWebsite** tab in the central pane of the window. -1. In the **NuGet: PartsUnlimitedWebsite** pane, click the **Browse** tab and, in the **Package source** drop-down list in the upper right corner of the pane, select **PartsUnlimitedShared**. - - > **Note**: The list of packages will consist only of the single package you just added. - -1. Select the package and, in the **PartsUnlimited.Shared** pane, click **Install** to add it to the project. -1. When prompted, in the **Preview Changes** dialog box, click **OK**. -1. Press **Ctrl+Shift+B** to build the project and verify that the build completed successfully. - - > **Note**: The NuGet package doesn't add any value yet, but we managed to verify that the workflow works as intended. - -#### Task 4: Updating a NuGet package - -In this task, you will update a NuGet package. - -1. Switch to the **Visual Studio** window that has the **PartsUnlimited.Shared** project open (containing the NuGet source project). -1. In the **Solution Explorer** pane, right-click the **PartsUnlimited.Shared** project node, in the right-click menu, select **Add** and, in the cascading menu, select **New Item**. -1. In the **Add New Item - PartsUnlimitedShared** dialog box, in the list of **Visual C# items**, ensure that the **Class** template is selected, in the **Name** textbox at the bottom of the dialog box, type **TaxService.cs**, and click **Add** to add the class. - - > **Note**: We will pretend that tax calculation will be consolidated into this shared class and managed centrally so that other teams can simply work with the NuGet package. - -1. In the central pane, in the code of the **TaxService.cs** class, replace the existing definition of the class with the following code and save the file: - - ```c# - namespace PartsUnlimited.Shared - { - public class TaxService - { - static public decimal CalculateTax(decimal taxable, string postalCode) - { - return taxable * (decimal).1; - } - } - } - ``` - - > **Note**: Since we're updating the assembly (and package), we need to update the assembly version. - -1. In the Visual Studio window, in the central pane, click the **AssemblyInfo.cs** tab to display the content of the corresponding file. -1. In the **AssemblyInfo.cs** file, change the `[assembly: AssemblyVersion("1.0.0.0")]` to `[assembly: AssemblyVersion("1.1.0.0")]` and save the file. -1. Press **Ctrl+Shift+B** to build the project. -1. Switch to the **Administrator: Windows PowerShell** window and run the following command to repackage the NuGet package. - - > **Note**: The new package will have the updated version number. - - ``` - ./nuget.exe pack PartsUnlimited.Shared.csproj - ``` - -1. From the **Administrator: Windows PowerShell** window, run the following command to publish the updated package. - - > **Note**: The published artifact version number is changed to reflect the package version update. - - ``` - ./nuget.exe push -source "PartsUnlimitedShared" -ApiKey AzDO PartsUnlimited.Shared.1.1.0.nupkg - ``` - -1. Switch to the web browser window displaying the Azure DevOps portal with the **PartsUnlimitedShared 1.0.0** artifact pane. -1. On the **PartsUnlimitedShared 1.0.0** artifact pane, click the **Versions** tab and verify that it includes versions **1.0.0** and **1.1.0**. -1. Switch back to the **Visual Studio** window displaying the **PartsUnlimited** project. -1. In the **Solution Explorer** pane, navigate to and select **PartsUnlimitedWebsite\Utils\DefaultShippingTaxCalculator.cs**. This will automatically open the file in the central pane of the window. -1. In the code of the **DefaultShippingTaxCalculator.cs** file, locate the call to **CalculateTax** on line **20** and replace `tax = CalculateTax(subTotal + shipping, postalCode);` with `tax = PartsUnlimited.Shared.TaxService.CalculateTax(subTotal + shipping, postalCode);` - - > **Note**: The original code called a method internal to this class, so the code we're adding to the beginning of the line is redirecting it to code from our NuGet assembly. However, since this project hasn't updated the NuGet package yet, it's still referencing 1.0.0.0 and doesn't have these new changes available, so the code will not build properly. - -1. In the **Solution Explorer** pane, right-click the **References** node and, in the right-click menu, select **Manage NuGet Packages**. - - > **Note**: NuGet is aware of our update, as indicated by the content of the **Updates** tab. - -1. In the **NuGet: PartsUnlimitedWebsite** pane, click the **Updates** tab, in the search textbox, type **PartsUnlimited.Shared** and, on the right-hand side of the pane, next to the **Version: Latest stable 1.1.0** dropdown list, click **Update** to install the new version. - - > **Note**: There may be many NuGet updates available, but you should only need to update **PartsUnlimited.Shared**. Note that it may take a little while for the package to become completely available for updating. If you get an error, wait a moment and try again. - -1. When prompted, in the **Preview Changes** dialog box, click **OK**. -1. Press the **F5** key to build and run the site. Verify that it works as expected. +#### Task 3: Importing an Open-Source NuGet package to the Azure DevOps Package Feed + +Besides developing your own packages, why not using the Open Source Nuget (https://www.nuget.org) DotNet Package library? With a few million packages available, there will always be something useful for your application. + +In this task, we will use a generic "Hello World" sample package, but you can use the same approach for other packages in the library. + +1. From the same PowerShell window, run the following **nuget** command to install the sample package: + +``` +.\nuget install HelloWorld -ExcludeVersion +``` + +1. Check the output of the install process. At the first line, it shows the different Feeds it will try to download the package: +``` +Feeds used: + https://api.nuget.org/v3/index.json + https://pkgs.dev.azure.com//eShopOnWeb/_packaging/EShopOnWebPFeed/nuget/v3/index.json +``` +1. Next, it will show additional output regarding the actual installation process itself. + +``` +Installing package 'Helloworld' to 'C:\eShopOnWeb\EShopOnWeb.Shared'. + GET https://api.nuget.org/v3/registration5-gz-semver2/helloworld/index.json + OK https://api.nuget.org/v3/registration5-gz-semver2/helloworld/index.json 114ms +MSBuild auto-detection: using msbuild version '17.5.0.10706' from 'C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\bin'. + GET https://pkgs.dev.azure.com/pdtdemoworld/7dc3351f-bb0c-42ba-b3c9-43dab8e0dc49/_packaging/188ec0d5-ff93-4eb7-b9d3-293fbf759f06/nuget/v3/registrations2-semver2/helloworld/index.json + OK https://pkgs.dev.azure.com/pdtdemoworld/7dc3351f-bb0c-42ba-b3c9-43dab8e0dc49/_packaging/188ec0d5-ff93-4eb7-b9d3-293fbf759f06/nuget/v3/registrations2-semver2/helloworld/index.json 698ms + +Attempting to gather dependency information for package 'Helloworld.1.3.0.17' with respect to project 'C:\eShopOnWeb\EShopOnWeb.Shared', targeting 'Any,Version=v0.0' +Gathering dependency information took 21 ms +Attempting to resolve dependencies for package 'Helloworld.1.3.0.17' with DependencyBehavior 'Lowest' +Resolving dependency information took 0 ms +Resolving actions to install package 'Helloworld.1.3.0.17' +Resolved actions to install package 'Helloworld.1.3.0.17' +Retrieving package 'HelloWorld 1.3.0.17' from 'nuget.org'. + GET https://api.nuget.org/v3-flatcontainer/helloworld/1.3.0.17/helloworld.1.3.0.17.nupkg + OK https://api.nuget.org/v3-flatcontainer/helloworld/1.3.0.17/helloworld.1.3.0.17.nupkg 133ms +Installed HelloWorld 1.3.0.17 from https://api.nuget.org/v3/index.json with content hash 1Pbk5sGihV5JCE5hPLC0DirUypeW8hwSzfhD0x0InqpLRSvTEas7sPCVSylJ/KBzoxbGt2Iapg72WPbEYxLX9g==. +Adding package 'HelloWorld.1.3.0.17' to folder 'C:\eShopOnWeb\EShopOnWeb.Shared' +Added package 'HelloWorld.1.3.0.17' to folder 'C:\eShopOnWeb\EShopOnWeb.Shared' +Successfully installed 'HelloWorld 1.3.0.17' to C:\eShopOnWeb\EShopOnWeb.Shared +Executing nuget actions took 686 ms +``` +1. The HelloWorld package got installed in a subfolder **HelloWorld**, under the EShopOnWeb.Shared folder. From the Visual Studio **Solution Explorer**, navigate to the **EShopOnWeb.Shared** Project, and notice the **HelloWorld** subfolder. Click on the little arrow to the left of the subfolder, to open the folder and file list. +1. Notice the **lib** subfolder, having a **signature.p7s** signature file, which proofs the origin of the package. Next, notice the **HelloWorld.nupkg** package file itself. + +#### Task 4: Upload the Open-Source NuGet package to Azure Artifacts +Let's consider this package an "approved" package for our DevOps team to reuse, by uploading it to the Azure Artifacts Package feed created earlier. + +1. From the PowerShell window, execute the following command: + + ``` +.\nuget.exe push -source "EShopOnWebShared" -ApiKey AzDO c:\EShopOnWeb\EShopOnWeb.Shared\HelloWorld\HelloWorld.nupkg +``` + > **Note**: This results in an error message: + +``` +Response status code does not indicate success: 409 (Conflict - 'HelloWorld 1.3.0.17' cannot be published to the feed because it exists in at least one of the feed's upstream sources. Publishing this copy would prevent you from using 'HelloWorld 1.3.0.17' from 'NuGet Gallery'. For more information, see https://go.microsoft.com/fwlink/?linkid=864880 (DevOps Activity ID: AE08BE89-C2FA-4FF7-89B7-90805C88972C)). +``` + +When you created the Azure DevOps Artifacts Package Feed, by design, it allows for **upstream sources**, such as nuget.org in the dotnet example. However, nothing blocks your DevOps team to create an **"internal-only"** Package Feed. + +1. Navigate to the Azure DevOps Portal, browse to **Artifacts**, and select the **EShopOnWebShared** Feed. +1. Click **Search Upstream Sources** +1. In the **Go to an Upstream Package** window, select **Nuget** as Package Type, and enter **HelloWorld** in the search field. +1. Confirm by pressing the **Search** button. +1. This results in a list of all HelloWorld packages with the different versions available. +1. Click the **left arrow key** to return to the **EShopOnWebShared** Feed. +1. Click the cogwheel to open **Feed Settings**. Within the Feed Settings page, select **Upstream Sources**. +1. Notice the different Upstream Package Managers for different development languages. Select **Nuget.org** from the list. Press the **Delete** button, Followed by pressing the **Save** button. + +1. With these saved changed, it will be possible to upload the **HelloWorld** package using the Nuget.exe from the PowerShell Window, by relaunching the following command: + +``` + .\nuget.exe push -source "EShopOnWebShared" -ApiKey AzDO c:\EShopOnWeb\EShopOnWeb.Shared\HelloWorld\HelloWorld.nupkg +``` + +> **Note**: This should now result in a successful upload + +``` +Pushing HelloWorld.nupkg to 'https://pkgs.dev.azure.com/pdtdemoworld/7dc3351f-bb0c-42ba-b3c9-43dab8e0dc49/_packaging/188ec0d5-ff93-4eb7-b9d3-293fbf759f06/nuget/v2/'... + PUT https://pkgs.dev.azure.com//7dc3351f-bb0c-42ba-b3c9-43dab8e0dc49/_packaging/188ec0d5-ff93-4eb7-b9d3-293fbf759f06/nuget/v2/ +MSBuild auto-detection: using msbuild version '17.5.0.10706' from 'C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\bin'. + Accepted https://pkgs.dev.azure.com/pdtdemoworld/7dc3351f-bb0c-42ba-b3c9-43dab8e0dc49/_packaging/188ec0d5-ff93-4eb7-b9d3-293fbf759f06/nuget/v2/ 1645ms +Your package was pushed. +PS C:\eShopOnWeb\EShopOnWeb.Shared> +``` + +1. From the Azure DevOps Portal, **refresh** the Artifacts Package Feed page. The list of packages shows both the **EShopOnWeb.Shared** custom-developed package, as well as the **HelloWorld** public sourced package. +1. From the Visual Studio **EShopOnWeb.Shared** Solution, right-click the **EShopOnWeb.Shared** Project, and select **Manage Nuget Packages** from the context menu. +1. From the Nuget Package Manager window, validate the **Package Source** is set to **EShopOnWebShared**. +1. Click **Browse**, and wait for the list of Nuget Packages to load. +1. This list will also show both the **EShopOnWeb.Shared** custom-developed package, as well as the **HelloWorld** public sourced package. ## Review @@ -262,5 +254,5 @@ In this lab, you learned how to work with Azure Artifacts by using the following - Created and connect to a feed. - Created and publish a NuGet package. -- Imported a NuGet package. -- Updated a NuGet package. +- Imported a custom-developed NuGet package. +- Imported a public-sourced NuGet package. diff --git a/Instructions/Labs/AZ400_M09_L21_Sharing_Team_Knowledge_using_Azure_Project_Wikis.md b/Instructions/Labs/AZ400_M09_L21_Sharing_Team_Knowledge_using_Azure_Project_Wikis.md index 1952f3f7f..0b2d63d43 100644 --- a/Instructions/Labs/AZ400_M09_L21_Sharing_Team_Knowledge_using_Azure_Project_Wikis.md +++ b/Instructions/Labs/AZ400_M09_L21_Sharing_Team_Knowledge_using_Azure_Project_Wikis.md @@ -12,7 +12,9 @@ lab: - This lab requires **Microsoft Edge** or an [Azure DevOps supported browser.](https://docs.microsoft.com/en-us/azure/devops/server/compatibility?view=azure-devops#web-portal-supported-browsers) -- **Set up an Azure DevOps organization:** If you don't already have an Azure DevOps organization that you can use for this lab, create one by following the instructions available at [Create an organization or project collection](https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/create-organization?view=azure-devops). +- **Set up an Azure DevOps organization:** If you don't already have an Azure DevOps organization that you can use for this lab, create one by following the instructions available at [AZ-400 Lab Prerequisites](https://microsoftlearning.github.io/AZ400-DesigningandImplementingMicrosoftDevOpsSolutions/Instructions/Labs/AZ400_M00_Validate_lab_environment.html). + +- **Set up the sample EShopOnWeb Project:** If you don't already have the sample EShopOnWeb Project that you can use for this lab, create one by following the instructions available at [AZ-400 Lab Prerequisites](https://microsoftlearning.github.io/AZ400-DesigningandImplementingMicrosoftDevOpsSolutions/Instructions/Labs/AZ400_M00_Validate_lab_environment.html). ## Lab overview @@ -32,25 +34,7 @@ After you complete this lab, you will be able to: ### Exercise 0: Configure the lab prerequisites -In this exercise, you will set up the prerequisites for the lab, which consist of the preconfigured **Tailwind Traders** team project based on an Azure DevOps Demo Generator template and a team created in Microsoft Teams. - -#### Task 1: Configure the team project - -In this task, you will use Azure DevOps Demo Generator to generate a new project based on the **Tailwind Traders** template. - -1. On your lab computer, start a web browser and navigate to [Azure DevOps Demo Generator](https://azuredevopsdemogenerator.azurewebsites.net). This utility site will automate the process of creating a new Azure DevOps project within your account that is prepopulated with content (work items, repos, etc.) required for the lab. - - > **Note**: For more information on the site, see . - -1. Click **Sign in** and sign in using the Microsoft account associated with your Azure DevOps subscription. -1. If required, on the **Azure DevOps Demo Generator** page, click **Accept** to accept the permission requests for accessing your Azure DevOps subscription. -1. On the **Create New Project** page, in the **New Project Name** textbox, type **Sharing Team Knowledge using Azure Project Wikis**, in the **Select organization** dropdown list, select your Azure DevOps organization, and then click **Choose template**. -1. In the list of templates, select the **Tailwind Traders** template and click **Select Template**. -1. Back on the **Create New Project** page, if prompted to install a missing extension, select the checkbox below the **ARM Outputs** and click **Create Project**. - - > **Note**: Wait for the process to complete. This should take about 2 minutes. In case the process fails, navigate to your Azure DevOps organization, delete the project, and try again. - -1. On the **Create New Project** page, click **Navigate to project**. +In this exercise, we want to remind you about validating the lab prerequisites, having both an Azure DevOps Organization ready, as well as having created the EShopOnWeb project. See the instructions above for more details. ### Exercise 1: Publish code as a wiki @@ -64,53 +48,78 @@ In this task, you will publish a branch of an Azure DevOps repo as wiki. > **Note**: If your published wiki corresponds to a product version, you can publish new branches as you release new versions of your product. -1. In the vertical menu on the left side, click **Repos**, in the upper section of the **Files** pane, make sure you have the **TailwindTraders-Website** repo selected (choose it from the dropdown on the top with Git icon). In the branch dropdown list (on top of "Files" with the branch icon), select **main**, and review the content of the main branch. -1. To the left of the **Files** pane, in the listing of the repo folder and file hierarchy, expand the **Documents** folder and its **Images** subfolder, in the **Images** subfolder, locate the **Website.png** entry, hover with the mouse pointer over its right end to reveal the vertical ellipsis (three dots) symbol representing the **More** menu, click **More**, and, in the dropdown menu, click **Download** to download the **Website.png** file to the local **Downloads** folder on your lab computer. +1. In the vertical menu on the left side, click **Repos**, in the upper section of the **Files** pane, make sure you have the **EShopOnWeb** repo selected (choose it from the dropdown on the top with Git icon). In the branch dropdown list (on top of "Files" with the branch icon), select **main**, and review the content of the main branch. +1. To the left of the **Files** pane, in the listing of the repo folder and file hierarchy, expand the **src** folder and brows to **Web-> wwwroot -> images** subfolder. In the **Images** subfolder, locate the **brand.png** entry, hover with the mouse pointer over its right end to reveal the vertical ellipsis (three dots) symbol representing the **More** menu, click **Download** to download the **brand.png** file to the local **Downloads** folder on your lab computer. >**Note**: You will use this image in the next exercise of this lab. -1. In the vertical menu on the left side, click **Overview**, in the **Overview** section, select **Wiki**, select **Publish code as wiki*. +1. We will store the Wiki source files in a separate folder within the Repos current folder structure. From within **Repos**, select **Files**. Notice the **EShopOnWeb** Repo title on top of the folder structure. **Select the elipsis (3 dots)**, Choose **New / Folder**, and provide **Documents** as title for the New Folder name. As a repo doesn't allow you to create an empty folder, provide **READ.ME** as New File name. +1. Confirm the creation of the folder and the file by **pressing the Create button**. +1. The READ.ME file will open in the built-in view mode. Since this is stored 'as code', you need to **Commit** the changes by clicking the **Commit** button. In the Commit window, confirm once more by pressing **Commit**. + +1. In the Azure DevOps vertical menu on the left side, click **Overview**, in the **Overview** section, select **Wiki**, select **Publish code as wiki*. 1. On the **Publish code as wiki** pane, specify the following settings and click **Publish**. | Setting | Value | | ------- | ----- | - | Repository | **TailwindTraders-Website** | + | Repository | **EShopOnWeb** | | Branch | **main** | | Folder | **/Documents** | - | Wiki name | **Tailwind Traders (Documents)** | + | Wiki name | **EShopOnWeb (Documents)** | - >**Note**: This will automatically display the content of the **GitHubAction.md** file. + >**Note**: This will automatically open the Wiki section, and publish **the editor**, where you can provide a Wiki page title, as well as adding the actual content. Notice you are encouraged to use MarkDown format, but make use of the ribbon to help you with some of the MarkDown layout syntax. -1. Review the content of **GitHubActions** file and note the overall structure of the wiki, matching the structure of the underlying repo. +1. In the Wiki Page **Title** field, enter "Welcome to our Online Retail Store!" -#### Task 2: Manage content of a published wiki +1. In the body of the Wiki Page, paste in the following text: -In this task, you will manage content of the wiki you published in the previous task. +``` +##Welcome to Our Online Retail Store! +At our online retail store, we offer a **wide range of products** to meet the **needs of our customers**. Our selection includes everything from *clothing and accessories to electronics, home decor, and more*. -1. In the vertical menu on the left side, click **Repos**, ensure that the dropdown menu in the upper section of the **Files** pane displays the **TailwindTraders-Website** repo and **main** branch, in the repo folder hierarchy, select the **Documents** folder, in the upper right corner, click **+ New** and, in the dropdown menu, click **File**. -1. In the **New file** panel, in the **New file name**, after the **/Documents/** prefix, type **.order**, and click **Create**. -1. On the **Contents** tab of the **.order** pane, type the following and click **Commit**. +We pride ourselves on providing a seamless shopping experience for our customers. Our website offers the following benefits: +1. user-friendly, +1. and easy to navigate, +1. allowing you to find what you're looking for, +1. quickly and easily. - ```text - GitHubActions - Images - ``` +We also offer a range of **_payment and shipping options_** to make your shopping experience as convenient as possible. -1. On the **Commit** pane, click **Commit**. -1. In the vertical menu on the left side, click **Overview**, in the **Overview** section, select **Wiki**, verify that **Tailwind Traders (Documents)** appears in the upper section of the pane, and review the ordering of wiki content. +### about the team +Our team is dedicated to providing exceptional customer service. If you have any questions or concerns, our knowledgeable and friendly support team is always available to assist you. We also offer a hassle-free return policy, so if you're not completely satisfied with your purchase, you can easily return it for a refund or exchange. - >**Note**: The order of wiki content should match the sequence of files and folders listed in the **.order** file. +### Physical Stores +|Location|Area|Hours| +|--|--|--| +| New Orleans | Home and DIY |07.30am-09.30pm | +| Seattle | Gardening | 10.00am-08.30pm | +| New York | Furniture Specialists | 10.00am-09.00pm | -1. In the vertical menu on the left side, click **Repos**, ensure that the dropdown menu in the upper section of the **Files** pane displays the **TailwindTraders-Website** repo and **main** branch, in the listing of files, under **Documents**, select **GitHubActions.md**, and on the **GitHubActions.md** pane, click **Edit**. -1. On the **GitHubActions.md** pane, directly below the `#GitHub Actions` header, add the following markdown element referencing one of the images within the **Documents** folder: +## Our Store Qualities +- We're committed to providing high-quality products +- Our products are offered at affordable prices +- We work with reputable suppliers and manufacturers +- We ensure that our products meet our strict standards for quality and durability. +- Plus, we regularly offer sales and discounts to help you save even more. - ``` - ![Tailwind Traders Website](Images/Website.png) - ``` +#Summary +Thank you for choosing our online retail store for your shopping needs. We look forward to serving you! +``` + +1. This sample text gives you an overview of several of the common MarkDown syntax features, ranging from Title and subtitles (##), bold (**), italic (*), how to create tables, and more. + +1. Once finished, **press** the Save button in the upper right corner. + +1. **Refresh** your browser, or select any other DevOps portal option and return to the Wiki section. Notice you are now presented with the **EshopOnWeb (Documents)** Wiki, as well as having the **Welcome to our Online Retail Store** as **HomePage** of the Wiki. + +#### Task 2: Manage content of a published wiki + +In this task, you will manage content of the wiki you published in the previous task. + +1. In the vertical menu on the left side, click **Repos**, ensure that the dropdown menu in the upper section of the **Files** pane displays the **EShopOnWeb** repo and **main** branch, in the repo folder hierarchy, select the **Documents** folder, and select the **Welcome-to-our-Online-Retail-Store!.md** file. +1. Notice how the MarkDown format is visible here as raw text format, allowing you to continue editing the file content from here as well. -1. On the **GitHubActions.md** pane, click **Commit** and, on the **Commit** pane, click **Commit**. -1. On the **Preview** tab of the **GitHubActions.md** pane, verify that the image is being displayed. -1. In the vertical menu on the left side, click **Overview**, in the **Overview** section, select **Wiki**, verify that **Tailwind Traders (Documents)** appears in the upper section of the pane, and that the content of the **GitHubActions** pane includes the newly referenced image. +> **Note**: Since the Wiki source files are handled as source code, remember all practices from traditional source control (Clone, Pull Requests, Approvals and more), can now also be applied to Wiki pages. ### Exercise 2: Create and manage a project wiki @@ -122,7 +131,7 @@ In this exercise, you will step through creating and managing a project wiki. In this task, you will create a project wiki and add to it a Mermaid diagram and an image. -1. On your lab computer, in the Azure DevOps portal displaying the **Wiki pane** of the **Sharing Team Knowledge using Azure Project Wikis** project, with the content of the **Tailwind Traders (Documents)** wiki selected, at the top of the pane, click the **Tailwind Traders (Documents)** dropdown list header, and, in the drop down list, select **Create new project wiki**. +1. On your lab computer, in the Azure DevOps portal displaying the **Wiki pane** of the **EShopOnweb** project, with the content of the **EShopOnWeb (Documents)** wiki selected, at the top of the pane, click the **EShopOnWeb (Documents)** dropdown list header (the arrow down icon), and, in the drop down list, select **Create new project wiki**. 1. In the **Page title** text box, type **Project Design**. 1. Place the cursor in the body of the page, click the left-most icon in the toolbar representing the header setting and, in the dropdown list, click **Header 1**. This will automatically add the hash character (**#**) at the beginning of the line. 1. Directly after the newly added **#** character, type **Authentication and Authorization** and press the **Enter** key. @@ -160,7 +169,7 @@ In this task, you will create a project wiki and add to it a Mermaid diagram and 1. In the **Save page** dialog box, type **Authentication and authorization section with the OAuth 2.0 Mermaid diagram** and click **Save**. 1. On the **Project Design** editor pane, place the cursor at the end of the Mermaid element you added earlier in this task, press the **Enter** key to add an extra line, click the left-most icon in the toolbar representing the header setting and, in the dropdown list, click **Header 2**. This will automatically add the double hash character (**##**) at the beginning of the line. 1. Directly after the newly added **##** character, type **User Interface** and press the **Enter** key. -1. On the **Project Design** editor pane, in the toolbar, click the paper clip icon representing the **Insert a file** action, in the **Open** dialog box, navigate to the **Downloads** folder, select the **Website.png** file you downloaded in the previous exercise, and click **Open**. +1. On the **Project Design** editor pane, in the toolbar, click the paper clip icon representing the **Insert a file** action, in the **Open** dialog box, navigate to the **Downloads** folder, select the **Brand.png** file you downloaded in the previous exercise, and click **Open**. 1. Back on the **Project Design** editor pane, review the preview pane and verify that the image is properly displayed. 1. In the upper right corner of the editor pane, click the down-facing caret next to the **Save** button and, in the dropdown menu, click **Save with revision message**. 1. In the **Save page** dialog box, type **User Interface section with the Tailwind Traders image** and click **Save**. @@ -172,7 +181,7 @@ In this task, you will manage the newly created project wiki. >**Note**: You will start by reverting the most recent change to the wiki page. -1. On you lab computer, in the Azure DevOps portal displaying the **Wiki pane** of the **Sharing Team Knowledge using Azure Project Wikis** project, with the content of the **Project Design** wiki selected, in the upper right corner, click the vertical ellipsis symbol and, in the dropdown menu, click **View revisions**. +1. On you lab computer, in the Azure DevOps portal displaying the **Wiki pane** of the **EShopOnWeb** project, with the content of the **Project Design** wiki selected, in the upper right corner, click the vertical ellipsis symbol and, in the dropdown menu, click **View revisions**. 1. On the **Revisions** pane, click the entry representing the most recent change. 1. On the resulting pane, review the comparison between the previous and the current version of the document, click **Revert**, when prompted for the confirmation, click **Revert** again, and then click **Browse Page**. 1. Back on the **Project Design** pane, verify that the change was successfully reverted. @@ -182,6 +191,7 @@ In this task, you will manage the newly created project wiki. 1. On the **Project Design** pane, at the bottom left corner, click **+ New page**. 1. On the page editor pane, in the **Page title** text box, type **Project Design Overview**, click **Save**, and then click **Close**. 1. Back in the pane listing the pages within the **Project Design** project wiki, locate the **Project Design Overview** entry, select it with the mouse pointer, drag and drop it above the **Project Design** page entry. +1. Confirm the changes by pressing the **Move** button in the appearing window. 1. Verify that the **Project Design Overview** entry is listed as the top level page with the home icon designating it as the wiki home page. ## Review diff --git a/Instructions/Labs/images/m1/EShop-WEB-3sprints_v1.png b/Instructions/Labs/images/m1/EShop-WEB-3sprints_v1.png index a543f0e50..85c94096c 100644 Binary files a/Instructions/Labs/images/m1/EShop-WEB-3sprints_v1.png and b/Instructions/Labs/images/m1/EShop-WEB-3sprints_v1.png differ