40 C
Dubai
Tuesday, April 29, 2025
Home Blog Page 2

HOW TO SETUP MAESTER IN AZURE DEVOPS

Maester

Maester, within the context of Azure, is a background service used in Microsoft Azure Machine Learning to manage and control compute resources effectively. Its main role is to ensure that compute instances, clusters, and jobs are monitored, and it handles the orchestration and scheduling of compute resources across various Azure Machine Learning workloads.

Set up Maester in Azure DevOps

Azure DevOps is a great way to automate the daily running of Maester tests to monitor your tenant. You can use Azure DevOps to run Maester tests on a schedule, such as daily, and view the results in the Azure DevOps interface.

  • Azure DevOps comes with a free tier that includes 1,800 minutes of Maester test runs per month (unlimited hours if you use a self-hosted agent).
  • Azure DevOps has native integration with Microsoft Entra including single sign on, user and group management as well as support for conditional access policies.

STEP-1: CREATE A RESOURCE GROUP

  • Browse to the Azure portal and open the Resource group.
  • Enter a name for the resource group (e.g. Maester-Resource-Group).
  • Select any region.
  • Select Review + create > Create.
  • Resource group create successfully.

Browse to the Azure portal and open the Resource group.

Enter a name for the resource group (e.g. Maester-Resource-Group).

Select Region.

Select Review + Create > Create.

Resource group create successfully.

STEP-2: CREATE A ORGANIZATION IN AZURE DEVOPS

  • In azure portal, Search Azure DevOps organization.
  • Sign in to Azure DevOps.
  • Select New organization.
  • Enter the name for your organization, select its hosting geography, and then select Continue.
  • Create organization successfully.
  • Sign in to your organization at any time, https://dev.azure.com/{yourorganization}.

In azure portal, Search Azure DevOps organization.

Sign in to Azure DevOps.

Select New organization.

Enter the name for your organization, select its hosting geography, and then select Continue.

Create organization successfully.

Sign in to your organization at any time, https://dev.azure.com/{yourorganization}.

STEP-3: CREATE A PROJECT ON AZURE DEVOPS

  • Sign in to your organization (https://dev.azure.com/{Your_Organization})
  • Select New project.
  • Enter information into the form provided & Select create.
  • Azure DevOps displays the project welcome page.

Sign in to your organization (https://dev.azure.com/{Your_Organization})

Select New project. Enter information into the form provided & Select create.

Azure DevOps displays the project welcome page.

STEP-4: IMPORT THE MAESTER TESTS REPOSITORY

  • Click The Created Project
  • Select Repos from the left-hand menu.
  • Select the Import button in the Import a repository section.
  • Enter the URL of the Maester repository.
  • Select Import to import the repository into your Azure DevOps project.

Click The Created Project

Select Repos from the left-hand menu.

Select The Project Name.

Select the Import button in the Import a repository section

Enter the URL of the Maester repository https://github.com/maester365/maester-tests

Select Import to import the repository into your Azure DevOps project.

Set up the Azure Pipeline

STEP-5: CREATE AN ENTRA APPLICATION

  • Open Microsoft entra admin center.
  • Select Identity from the left-hand menu.
  • In Identity section, Select Applications > App registration.
  • Select New registration.
  • Enter a name for the application (e.g. Maester DevOps Account).
  • Select Register.
  • App Registration dashboard.

Open Microsoft entra admin center. Select Identity from the left-hand menu.

In Identity section, Select Applications.

Click App registration.

Select New registration.

Enter a name for the application (e.g. Maester DevOps Account). Select Register.

App Registration dashboard.

STEP-6: GRANT PERMISSIONS TO MICROSOFT GRAPH

  • Open the application you created in the previous step.
  • Select API permissions > Add a permission.
  • Select Microsoft Graph.
  • Click Application permissions.
  • Search for each of the permissions and check the box next to each permission.
  • Select Add permissions.
  • Select Grant admin consent for [your organization].
  • Select Yes to confirm.

Open the application you created in the previous step. Select API permissions > Add a permission.

Select Add permissions.

Select Microsoft Graph.

Click Application permissions. Search for each of the permissions and check the box next to each permission. Select Add permissions.

  • Directory.Read.All
  • DirectoryRecommendations.Read.All
  • IdentityRiskEvent.Read.All
  • Policy.Read.All
  • Policy.Read.ConditionalAccess
  • PrivilegedAccess.Read.AzureAD
  • Reports.Read.All
  • RoleEligibilitySchedule.Read.Directory
  • RoleManagement.Read.All
  • SharePointTenantSettings.Read.All
  • UserAuthenticationMethod.Read.All

Select Grant admin consent for [your organization]. Select Yes to confirm. This Is the Dashboard Of API Permission

STEP-7: CREATE A CLIENT SECRET

  • Select Certificates & secrets.
  • Select Client secrets & Click New client secret.
  • Enter a description for the secret (e.g. Maester DevOps Secret) & Select Add.
  • Copy the value of the secret, we will use this value in the Azure Pipeline.

Select Certificates & secrets.

Select Client secrets.

Click New client secret.

Enter a description for the secret (e.g. Maester DevOps Secret) & Select Add.

Copy the value of the secret, we will use this value in the Azure Pipeline.

STEP-8: CREATE SERVICE CONNECTIION ON AZURE DEVOPS

  • In Azure DevOps, Select Project Settings from the left-hand menu.
  • Project Settings > Select Service Connections from the left-hand menu.
  • Service Connections > Click New Connection.
  • Select Azure Resource Manager > Click Next.
  • Select Workload Identity Federation (Automatic) > Click Next.
  • Select The Subscription & Resource Group > Click Save.
  • Create The Service Connection Successfully.

In Azure DevOps, Select Project Settings from the left-hand menu.

Project Settings > Select Service Connections from the left-hand menu.

Service Connections > Click New Connection.

Select Azure Resource Manager > Click Next.

Select The Subscription & Resource Group > Click Save.

Create The Service Connection Successfully.

STEP-9: CREATE AZURE PIPELINE

  • Open your Azure DevOps project.
  • Select Pipelines > New pipeline.
  • Select Azure Repos Git as the location of your code.
  • Select the repository where you imported the Maester tests.
  • Select Starter pipeline.
  • Select Variable to open the variables editor and add the following variables.
  • In the Entra portal, open the application you created earlier and copy the following values from the Overview page:
  • ?Name: TENANTID, Value: The Directory (tenant) ID of the Entra tenant.
  • ?Name: CLIENTID, Value: The Application (client) ID of the Entra application you created.
  • ?Name: CLIENTSECRET, Value: The client secret you copied in the previous step.
  • Replace the content of the azure-pipelines.yml file with the code below.
  • Select Validate and save > Save.
  • Select Run to run the pipeline.
  • Select Job to view the test results.

Open your Azure DevOps project > Select Pipelines.

Click New pipeline.

Select Azure Repos Git as the location of your code.

Select the repository where you imported the Maester tests.

Select Starter pipeline.

Select Variable to open the variables editor and add the following variables.

Click New Variable.

In the Entra portal, open the application you created earlier and copy the following values from the Overview page:

Name: CLIENTSECRET, Value: The client secret you copied in the previous step.

Name: CLIENTID, Value: The Application (client) ID of the Entra application you created.

Name: TENANTID, Value: The Directory (tenant) ID of the Entra tenant.

After Add The Variables > Select The Save

Replace the content of the azure-pipelines.yml file with the code below. Select Validate and save > Save.

Yaml Code

# Maester Daily Tests

trigger:
  - main

schedules:
  - cron: "0 0 * * *"
    displayName: Daily midnight build
    branches:
      include:
        - main

pool:
  vmImage: ubuntu-latest

steps:
  - task: AzurePowerShell@5
    displayName: "Run Maester"
    inputs:
      azureSubscription: "Maester Service Connection"
      pwsh: true
      azurePowerShellVersion: LatestVersion
      ScriptType: InlineScript
      Inline: |
        # Connect to Microsoft Graph
        $accessToken = (Get-AzAccessToken -ResourceTypeName MSGraph).Token | ConvertTo-SecureString -AsPlainText -Force
        Connect-MgGraph $accessToken

        # Install Maester
        Install-Module Maester -Force

        # Configure test results
        $PesterConfiguration = New-PesterConfiguration
        $PesterConfiguration.TestResult.Enabled = $true
        $PesterConfiguration.TestResult.OutputPath = '$(System.DefaultWorkingDirectory)/test-results/test-results.xml'

        # Run Maester tests
        Invoke-Maester -Path $(System.DefaultWorkingDirectory)/tests/Maester/ -PesterConfiguration $PesterConfiguration -OutputFolder '$(System.DefaultWorkingDirectory)/test-results'
  - publish: $(System.DefaultWorkingDirectory)/test-results
    displayName: Publish Maester Html Report
    artifact: TestResults
  - task: PublishTestResults@2
    displayName: Publish Pester Test Results
    inputs:
      testResultsFormat: "NUnit"
      testResultsFiles: "**/test-results.xml"
      failTaskOnFailedTests: true

Select Run to run the pipeline.

Pipeline Run Sucessfully.

STEP-10: VIEWING THE TEST RESULTS

  • Select Pipelines > Runs to view the status of the pipeline.
  • Select on a run to view the test results.
  • Click Publisher > Select TestResults.
  • Click TestResults > Select First File It’s Download.
  • Open The Downloaded File.
  • To View The Maester Test Results.
  • To View Test Results in Pipeline Dashboard.

Click Publisher > Select TestResults.

Click TestResults.

Select First File It’s Download.

Open The Downloaded File. To View The Maester Test Results.

To View The Test Details Passed And Failed In Detailed.

To View Test Results in Pipeline Dashboard.

Intune Web-based Enrollment for iOS Devices: How to Get Started

Intune Web-based Enrollment Prerequisites

  • Intune is the MDM Authority
  • Apple MDM certificate is configured
  • Intune license for the end-user
    • iOS Enrollment profile
    • Just-in-Time(JIT) device configuration profile

    Step 1: Create Web-based device enrollment profile for iOS in Intune

    In the Intune admin center, browse to Devices/Enrollment/Apple and select Enrollment types

    Step 2:

    Select Create Profile/iOS/iPadOS

    Step 3:

    Provide a name of the enrollment profile

    Step 4:

    Select Web-based device enrollment

    Step 5:

    Like other enrollment profiles, select a target group of users allowed to use it

    Step 5:

    Note : Use the left section to change the priority order of the various profiles in case the user is targeted by multiple enrollment profiles.

    Create a Just-in-time registration device configuration profile

    Why JIT configuration?

    Just-in-time registration is required to use the Apple Single sign-on(SSO) extension to complete the Microsoft Entra registration of the device. Just in time will limit the number of authentication prompts by establishing the SSO across the whole device for Microsoft products

    Step 1 :

    In theIntune admin center, browse to Devices/Configuration and create a new policy

    Step 2:

    Select iOSTemplates and Device Features. Click Create

    Step 3 :

    Provide the name

    Step 4:

    Under Single sign-on app extension, select Microsoft EntraID

    Additional configurations are needed.
    App Bundle ID isn’t required for our current need.
    2 keys are needed
    Key: device_registration
    Type: String
    Value: {{DEVICEREGISTRATION}}
    Key: browser_sso_interaction_enabled
    Type: Integer
    Value: 1

    Note : Avoid additional space before/after those values, otherwise Just-in-Time won’t work!!

    Step 5:

    Assign the device configuration to the same group as the Enrollment profile for convenience.

    Enroll iOS using Web-based device enrollment

    Sign-in with Microsoft Entra ID credentials

    Click on Get Started

    Allow this website to download a configuration profile.

    Go to Settings / General / VPN & device management

    A prompt will ask to install the Microsoft Intune root certification authority, click on Install and Trust

    Three Stages to Colour Grading Photography YouTube Thumbnail – 1

    Once the profile is installed, the enrollment is completed and the device will begin to process policies and applications!

    How to Create a SharePoint Site

    Step 1: Access SharePoint

    • Open a web browser and navigate to the Microsoft 365 portal (https://portal.office.com).
    • Sign in with your Microsoft 365 account credentials (if not already signed in).

    Step 2: Navigate to SharePoint Home

    • Click on the “App launcher” (waffle icon) in the top left corner of the Microsoft 365 portal.
    • In the app launcher, click on “SharePoint” to access SharePoint Home.

    Step 3: Create a New SharePoint Site

    In SharePoint Home, you will see a list of your frequently visited sites and recent activities. To create a new site, click on the “+ Create site” button

    You will be presented with a choice of site templates. Common options include Team site, Communication site, or others depending on your needs

    Choose the appropriate template for your site’s purpose

    • After choosing the appropriate template. A Preview of the chosen template will be seen
    • Then “Click” on Use template

    Step 4: Fill in the required information for your site

    • Site name: Give your site a descriptive name.
    • Site description: Provide a brief description of the site’s purpose.
    • Click “Next” to continue
    • Privacy settings: Choose whether your site should be public (everyone can access) or private (restricted access).
    • Click “Create” to continue.

    Step 5: Configure Site Settings

    • Depending on the template you selected, you may have additional options to configure site settings. These can include choosing a site owner, setting permissions, and selecting navigation options. Fill in these details as needed.
    • Click “Finish” or “Create” to create your SharePoint site

    Step 6: Access and Customize Your Site

    • Your new SharePoint site is now created. You can access it by clicking on its name in SharePoint Home.
    • Once on your site, you can customize it further by adding document libraries, lists, pages, and other SharePoint components based on your requirements

    Adding documents in SharePoint Site

    1. Open the SharePoint site library
    2. Select Upload at the top of the Documents library
    3. In the Add a document dialog box, select Choose Files to upload an individual file. Depending on the version of SharePoint that you’re using, you may also be able to upload multiple files by holding down either the Ctrl or Shift key and selecting more than one file.
    4. When you’ve selected the file or files to upload, select OK

    Troubleshoot “Invalid Latest Package Version” Error in Microsoft Endpoint Admin Center

    Deploying Microsoft Store Apps through the Microsoft Endpoint Admin Center can be a straightforward process, but it often comes with its own set of challenges. Over the course of my work in IT operations for SteelHaven, I have encountered several errors while deploying these applications. This blog post will highlight some of the most common issues and provide solutions to help streamline the deployment process.

    Common Error: Invalid Latest Package Version

    One of the errors I frequently encountered when selecting an app in Microsoft Store Apps (new) was the message: “The selected app does not have a valid latest package version.” This error indicates that the app package being referenced does not have a valid version in the Microsoft Store, which can hinder the deployment process.

    Screenshot of the Error

    Here is a screenshot of one of the errors I encountered during the deployment process.

    Now if I try to add a Application it fails.

    .

    Using Microsoft Graph to Deploy Apps in Microsoft Endpoint Admin Center

    Step 1: To solve this error, we will push the desired application from Microsoft Graph to Microsoft Endpoint Admin Center. This approach allows us to directly manage and deploy the application, bypassing the issue with the invalid latest package version.

    Search for Microsoft Explorer and click on the first link.

    Step 2: Once we open the Microsoft Graph Portal, we log in using our credentials and accept the required permissions to access Microsoft Graph API. This step is crucial as it grants our application the necessary permissions to interact with Intune and Microsoft Endpoint Manager resources effectively. By accepting these permissions, we ensure that our deployment process can proceed smoothly, allowing us to push applications and manage settings within the Microsoft Endpoint Admin Center with confidence.

    .

    Step 3: Now, let’s configure a few settings. Select POST, Peta, and add this URL: https://graph.microsoft.com/beta/deviceAppManagement/mobileApps. After adding the URL, click on “Modify Permissions” and proceed to click on “Consent“. This action grants the necessary permissions to connect to the Microsoft Endpoint Admin Portal, enabling seamless interaction and management of mobile apps through Microsoft Graph.

    .

    Creating .json script to Deploy the Application

    Step 4: Now, let’s begin creating the JSON script to deploy the application. This script will include essential details such as the app’s package information, deployment settings, and any specific configurations required for deployment via Microsoft Graph. Crafting this script accurately ensures that the application deployment process is configured correctly and aligns with our organizational requirements.

    This is the required script to deploy the application:

      
    {
        "@odata.type": "#microsoft.graph.winGetApp",
        "displayName": "",
        "description": "",
        "publisher": "",
        "packageIdentifier": "", 
        "installExperience": {
            "runAsAccount": "user"
        }
    }
    

    To complete this script, you need to fill in the following required fields:

    • displayName: Provide the display name of the application.
    • description: Enter a brief description of the application.
    • publisher: Specify the name of the publisher or developer of the application.
    • packageIdentifier: Include the unique package identifier (e.g., app ID or package name) of the application.

    Ensure that these fields are accurately filled out to ensure proper deployment and configuration of the application via Microsoft Graph.

    Finding the Package Identifier of the App

    Step 5: Follow the following steps to get he Package Identifiers Value.

    1.Visit apps.microsoft.com: Open your web browser and go to apps.microsoft.com.

    2.Search for the Application: Use the search functionality on the website to find the application for which you need the Package Identifier.

    3.Inspect the URL: Look at the URL of the application’s details page. The Package Identifier is often part of the URL structure.

    4.Identify the Package Identifier: Within the URL, locate the segment that contains the Package Identifier. It may appear as a series of characters or numbers that uniquely identifies the application.

    5.Convert Package Identifier to Uppercase: Note down the Package Identifier from the URL and convert it to uppercase, if required. This identifier is case-sensitive in some deployment scenarios.

    .

    Step 7: Once your script is ready, click on “Run Query” to execute it. This action sends the deployment request to Microsoft Graph. Then, check the Intune portal to verify whether the application has been successfully created. Ensure that all the app details are correctly listed and that the application is available for installation on target devices.

    .

    Now lets check in the Endpoint Admin Portal

    Step 7: Assign the App to a group that contains Intune Enrolled Device and check the installation from the Company Portal of the device.

    .


    Deploying to Azure VM using Terraform Infrastructure as Code (IaC)

    Introduction

    This article will guide you through deploying a Windows virtual machine on Azure using Terraform for infrastructure as code. You will learn how to set up your Azure account, configure your Terraform environment, write Terraform code to define your VM and associated resources, and deploy your VM to Azure using Terraform

    Prerequisites

    • Azure subscription
    • Install and configure Terraform
    • Visual Studio Code

    Solution Diagram:

    Step 1:

    Create a file directory in your local location

    Step 2:

    Create a named Provider.tf file.

    Step 3:

    Insert the following code in Provide.tf file.

    provider “azurerm” {
    features {}
    }

    Step 4:

    In Main.tf file use the following code to create a resource group (RG).

    # Create a Azure Resource Group
    resource “azurerm_resource_group” “RG” {
    name = “Test-RG”
    location = “East US”
    }

    Step 5

    In Main.tf file use the following code to create a Virtual Network and Subnet

    # Create an Azure Virtual Network
    resource “azurerm_virtual_network” “VNET” {
    name = “Test-VNET”
    address_space = [“10.0.0.0/16”]
    location = azurerm_resource_group.RG.location
    resource_group_name = azurerm_resource_group.RG.name
    }

    # Create a Subnet
    resource “azurerm_subnet” “AzureSubnet” {
    name = “AzureSubnet”
    resource_group_name = azurerm_resource_group.RG.name
    virtual_network_name = azurerm_virtual_network.VNET.name
    address_prefixes = [“10.0.1.0/24”]
    }

    Note: As per your requirement you can choose the IP address space

    Step 6

    Create a Network Interface Card (nic) using the following code

    # Create a NIC
    resource “azurerm_network_interface” “nic” {
    name = “Test-nic”
    location = azurerm_resource_group.RG.location
    resource_group_name = azurerm_resource_group.RG.name

    ip_configuration {
    name = “internal”
    subnet_id = azurerm_subnet.AzureSubnet.id
    private_ip_address_allocation = “Dynamic”
    }
    }

    Step 7

    Create a Public IP address for VM access.

    # Create a Public IP
    resource “azurerm_public_ip” “PIP” {
    name = “Public-IP”
    resource_group_name = azurerm_resource_group.RG.name
    location = azurerm_resource_group.RG.location
    allocation_method = “Static”
    }

    Step 8

    Create a Network Security Group (NSG) for securing your VM

    # Create a Network Security Group
    resource “azurerm_network_security_group” “NSG” {
    name = “Test-NSG”
    location = azurerm_resource_group.RG.location
    resource_group_name = azurerm_resource_group.RG.name
    }

    Step 9

    Create a Windows Virtual Machine.

    # Create a Azure Virtual Machine
    resource “azurerm_windows_virtual_machine” “VM” {
    name = “Test-VM”
    resource_group_name = azurerm_resource_group.RG.name
    location = azurerm_resource_group.RG.location
    size = “Standard_B2ms”
    admin_username = “azureadmin”
    admin_password = “Tf@$$w0rd1234!”
    network_interface_ids = [
    azurerm_network_interface.nic.id,
    ]

    # Create a OS disk
    os_disk {
    caching = “ReadWrite”
    storage_account_type = “Standard_LRS”
    }

    source_image_reference {
    publisher = “MicrosoftWindowsServer”
    offer = “WindowsServer”
    sku = “2022-Datacenter”
    version = “latest”
    }
    }

    Note: 

    Before running this configuration file, ensure that you have the Azure CLI installed and that you have authenticated using the az login command. Additionally, replace the placeholders for subscription_id, client_id, client_secret, and tenant_id with your own values. After executing the az login command, the Microsoft Azure sign-in page will appear automatically, as shown in the snapshot below.

    STEP 10

    Download and install on a local machine

    STEP 11

    After Downloading Run This Command In Terminal

    az login

    Step 12

    login azure Portal

    STEP 13

    Download the Terraform software and install it on your local machine. Then, use the VS Code terminal to run the command terraform init.

    Key commands in Terraform 

    • Terraform init – Initialize a terraform working directory. Example: terraform init
    • Terraform plan – Generate and show an execution plan. Example: terraform plan
    • terraform apply – Build or change infrastructure. Example: terraform apply
    • terraform show – Show the state file in a human-readable format: terraform show

    STEP 1

      In Terminal type terraform init command

    STEP 2

    In Terminal type terraform plan command

    STEP 3

    Open the terminal and type terraform apply -auto-approve command

    It successfully created the Azure infrastructure

    OUTPUT

    Conclusion

    How to deploy Azure virtual machines using Terraform code Infrastructure as Code (IaC). If you have any questions, don’t hesitate to comment below.

    How to Set Google as the Default Search Engine in Microsoft Edge Using Intune: A Step-by-Step Guide

    In today’s digital workplace, customizing browser settings can enhance productivity and user satisfaction. In this post, I’ll guide you through the process of setting Google as the default search engine in Microsoft Edge using Intune. Follow these steps to optimize your team’s browsing experience.

    Recently, I wanted to change the default search engine in Microsoft Edge from Bing to Google for our organization. Using the Intune Settings Catalog, I successfully implemented this change. Here’s how I did it:

    Step 1: Access the Intune admin portal at intune.microsoft.com.

    Step 2: In the left pane, click on Devices. In the Devices Overview page, select Configuration Profiles under the Policy section. Click on “+ Create Profile.”

    Step 3: Under Platform, choose Windows 10 and later. Under Profile Type, select Settings catalog and then click on “Create”.

    Step 4: Provide a meaningful name and description for the new policy, then click Next.

    Step 5: In the Settings Catalog, search for Microsoft Edge and select Microsoft Edge\Default search provider.

    Enable and configure the following settings:

    • Configure the new tab page search box experience: Address bar
    • Default search provider name: Google
    • Default search provider URL: https://www.google.com/search?q={searchTerms}
    • Enable the default search provider

    Step 6: Configure any necessary Scope tags and click Next. Under the Assignments tab, specify where the policy will be applied. Assign it to a Security Group containing your Base Intune Configuration.

    Step 7: On the Review page, check the policy for any issues and then click Create. The policy will successfully apply to your designated group.

    Finally, on my test machine, I searched for something in the address bar and confirmed that Google was set as the default search provider instead of Bing!

    This simple change streamlined the browsing experience for our users, making searches more efficient and familiar. If you’re looking to do the same, following these steps should help you achieve the desired configuration.

    × How can I help you?