SmartAssembly 8

Configure error and feature reporting on Azure Pipelines

In this document you will learn how to configure error reporting and feature usage reporting for SmartAssembly running on Microsoft-hosted Azure build agents.

Afterwards you will be able to download and view error reports on your local machine, while building the assemblies on Azure Pipelines.

Prerequisites

Before following this instruction you should have SmartAssembly already installed in your Azure Pipeline (see Using SmartAssembly with Azure Pipelines).

You also must have an SQL database created and configured (see Configure database connection on Azure Pipelines).

Prepare Azure File Share for hosting map files

If you don't have it already, you need to create an Azure File Share to allow SmartAssembly to store the map files.

Map files are required to convert obfuscated information within an error report back to meaningful names. You can learn more in About map files document.

You can learn how to create an Azure File Share in Create a file share in Azure Files.

Prepare the SQL database

Set the map file path

With the Azure File Share and the SQL Server ready, you must update the database to set the path to the Azure File Share folder containing the map files.

To set the map files folder connect to your database and execute the following query (remember to replace the sample values with your actual Azure File Share host and share name):

UPDATE dbo.Information SET MapFolderNetworkPath = '\\YOUR_FILE_SHARE_HOST\YOUR_FILE_SHARE_NAME'

Configuring Azure Pipelines

Option 1: Configure using the azure-pipelines.yml file

Securely storing Azure File Share credentials

  1. Sign-in to Azure DevOps: https://dev.azure.com/.
  2. From the main screen choose a project you’re working on.
  3. From the left-side menu choose Pipelines, then choose an existing pipeline and click Edit in the top-right corner.
  4. Click Variables in the top-right corner, then a  button to add a new variable.
  5. In the Name field type SA_FS_PASSWORD. This name will later be used to set the credentials without ever disclosing the password.
  6. In the Value field provide your Azure File Share password.
  7. Check Keep this value secret to prevent the password to be shown in Azure GUI and build logs (it will be replaced with ***).
  8. Click OK.

Apply credentials for Azure File Share

To allow the build agent to access your Azure File Share, you have to add appropriate credentials to the credential storage.

Add the following task after previously added SmartAssembly.settings task.

- task: PowerShell@2
  displayName: 'Set Azure File Share credentials'
  inputs:
    targetType: 'inline'
    script: |
      ########################
      $fileShareHost = "YOUR_FILE_SHARE_HOST"; # replace with host of your Azure File Share server
      $fileShareUser = "YOUR_FILE_SHARE_USER"; # replace with your Azure File Share username
      ########################
      
      $fileSharePass = "$(SA_FS_PASSWORD)";
      Invoke-Expression -Command "cmdkey /add:$fileShareHost /user:$fileShareUser /pass:$fileSharePass"

Option 2: Configure using the classic editor (without YAML)

Securely storing Azure File Share credentials

  1. Sign-in to Azure DevOps: https://dev.azure.com/.
  2. From the main screen choose a project you’re working on.
  3. From the left-side menu choose Pipelines, then choose an existing pipeline and click Edit in the top-right corner.
  4. Go to Variables tab and make sure Pipeline variables tab is selected on the left-side menu.
  5. Click Add button below the variables table.
  6. In the Name column type SA_FS_PASSWORD. This name will later be used to set the credentials without ever disclosing the password.
  7. In the Value column provide your Azure File Share password.
  8. Click on the padlock icon on the right side of the Value column to change variable type to secret, preventing the password to be shown in Azure GUI and build logs (it will be replaced with ***).
  9. Click Save button located on a toolbar above the variables table.

Apply credentials for Azure File Share

  1. On the pipeline edit screen make go to Tasks tab.
  2. From the list on the left-side of the screen select an agent job responsible for building your project.
  3. Click on the tinymce.emotions_dlg.add icon next to the agent job's name.
  4. Search for PowerShell task, then click Add button. The task will now be added to the tasks list as PowerShell Script.
  5. Drag the PowerShell Script task and drop it after previously added SmartAssembly.settings.
  6. With the task selected, change its Name to Set Azure File Share credentials.
  7. Change the Type to Inline.
  8. In the Script field, paste the following PowerShell script:

    ########################
    $fileShareHost = "YOUR_FILESHARE_HOST"; # replace with host of your Azure File Share server
    $fileShareUser = "YOUR_FILESHARE_USER"; # replace with your Azure File Share username
    ########################
    
    $fileSharePass = "$(SA_FS_PASSWORD)";
    Invoke-Expression -Command "cmdkey /add:$fileShareHost /user:$fileShareUser /pass:$fileSharePass"
  9. Click Save button located on a toolbar above the tasks list.

Didn't find what you were looking for?