### AL-Go Multi-Environment Configuration Source: https://github.com/microsoft/al-go/blob/main/Scenarios/DeliveryTargets.md This AL-Go settings example demonstrates a multi-environment setup, publishing to GitHub Packages for development builds and to a private NuGet feed for production releases. ```json { "DeliverToGitHubPackages": { "ContinuousDelivery": true, "Branches": ["main", "develop"] }, "environments": [ { "name": "PRODUCTION", "DeliverToNuGet": { "ContinuousDelivery": true, "Branches": ["main"] } } ] } ``` -------------------------------- ### Example .AL-Go/BuildInitialize.ps1 Hook Script Source: https://github.com/microsoft/al-go/blob/main/Actions/RunHook/README.md This example demonstrates how to author a hook script for the 'BuildInitialize' hook. It accepts a parameters hashtable and logs the project name. ```powershell Param( [Hashtable] $parameters ) Write-Host "BuildInitialize hook running for project '$($parameters.project)'" ``` -------------------------------- ### Install .NET SDK using Chocolatey Source: https://github.com/microsoft/al-go/blob/main/Scenarios/SelfHostedGitHubRunner.md Installs the Microsoft .NET SDK using Chocolatey. This is required for building and running .NET applications. ```powershell choco install dotnet-sdk -y ``` -------------------------------- ### Overwrite Settings Example Source: https://github.com/microsoft/al-go/blob/main/Scenarios/settings.md Demonstrates how to use the 'overwriteSettings' property to force overwriting of complex settings types instead of merging them. ```json { "country": "de" "buildModes": ["Default"] } ``` ```json { "overwriteSettings": ["buildModes"] "country": "dk" "buildModes": ["Clean"] } ``` ```json { "country": "dk" "buildModes": ["Clean"] } ``` -------------------------------- ### Install 7zip using Chocolatey Source: https://github.com/microsoft/al-go/blob/main/Scenarios/SelfHostedGitHubRunner.md Installs 7zip using Chocolatey, a required software for the self-hosted runner. ```powershell choco install 7zip ``` -------------------------------- ### Example AL-Go Hook Script Source: https://github.com/microsoft/al-go/blob/main/Scenarios/CustomizingALGoForGitHub.md This is an example of a PowerShell script that can be used as an AL-Go hook. It receives a hashtable of parameters, including the project folder. ```powershell Param([Hashtable] $parameters) Write-Host "Running custom logic for project '$($parameters.project)'" ``` -------------------------------- ### Install GitHub CLI using Chocolatey Source: https://github.com/microsoft/al-go/blob/main/Scenarios/SelfHostedGitHubRunner.md Installs the GitHub CLI using Chocolatey, which is utilized by getbuildagent. ```powershell choco install gh ``` -------------------------------- ### Run All Pre-Commit Hooks Source: https://github.com/microsoft/al-go/blob/main/Scenarios/Contribute.md Execute all pre-commit hooks on all files in the AL-Go repository to verify changes before committing. Ensure pre-commit is installed locally. ```bash pre-commit run --all-files ``` -------------------------------- ### AL-Go Repository Settings Example Source: https://github.com/microsoft/al-go/blob/main/Scenarios/SetupPowerPlatform.md This JSON defines the settings for AL-Go, specifying the template URL, solution folder, environments, and deployment configurations for Power Platform and Business Central. ```json { "type": "PTE", "templateUrl": "https://github.com/microsoft/AL-Go-PTE@main", "powerPlatformSolutionFolder": "", "environments": [ "" ], "DeployTo": { "environmentName": "", "companyId": "", "ppEnvironmentUrl": "" } } ``` -------------------------------- ### Conditional Settings Example Source: https://github.com/microsoft/al-go/blob/main/RELEASENOTES.md Demonstrates how to use ConditionalSettings to apply specific configurations for different branches. This allows for tailored settings like skipping signing or publishing for feature branches. ```json "ConditionalSettings": [ { "branches": [ "feature/*" ], "settings": { "doNotPublishApps": true, "doNotSignApps": true } } ] ``` -------------------------------- ### Install .NET using Chocolatey Source: https://github.com/microsoft/al-go/blob/main/Scenarios/SelfHostedGitHubRunner.md Installs the Microsoft .NET runtime using Chocolatey. This is a dependency for the self-hosted runner. ```powershell choco install dotnet -y ``` -------------------------------- ### Install Git using Chocolatey Source: https://github.com/microsoft/al-go/blob/main/Scenarios/SelfHostedGitHubRunner.md Installs Git using Chocolatey with parameters to prevent automatic line ending conversion. This is a prerequisite for getbuildagent. ```powershell choco install git --force --params "/NoAutoCrlf" ``` -------------------------------- ### Configure appDependencyProbingPaths in AL-Go Source: https://github.com/microsoft/al-go/blob/main/Workshop/Dependencies2.md Set the 'ALGOREPOSETTINGS' variable in your repository's Actions settings to define paths for dependent apps. This example specifies downloading the 'latestBuild' from the 'freddydkorg/Common' repository. ```json { "appDependencyProbingPaths": [ { "repo": "freddydkorg/Common", "release_status": "latestBuild" } ] } ``` -------------------------------- ### Schedule Daily Reference Documentation Deployment Source: https://github.com/microsoft/al-go/blob/main/Workshop/ReferenceDoc.md Configure this JSON setting in .github/AL-Go-Settings.json to schedule daily updates for your reference documentation. The example sets the deployment to occur every night at 4 AM. ```json "DeployReferenceDocumentationSchedule": "0 4 * * *" ``` -------------------------------- ### Example Unit Test Structure in PowerShell Source: https://github.com/microsoft/al-go/blob/main/Scenarios/Contribute.md Demonstrates the basic structure for a Pester unit test file, including module import, Describe, BeforeAll, It blocks, and mocking. ```powershell Import-Module (Join-Path $PSScriptRoot '../Actions/.Modules/MyModule.psm1') -Force Describe "MyFeature tests" { BeforeAll { # Setup code that runs once } It 'Should do something specific' { Mock Write-Host { } $result = MyFunction -Parameter "value" $result | Should -Be "expected" } ``` -------------------------------- ### Default Settings Merging Example Source: https://github.com/microsoft/al-go/blob/main/Scenarios/settings.md Illustrates how AL-Go merges simple and complex settings by default. Simple types are overwritten, while complex types like arrays are merged. ```json { "country": "de" "buildModes": ["Default"] } ``` ```json { "country": "dk" "buildModes": ["Clean"] } ``` ```json { "country": "dk" "buildModes": ["Default", "Clean"] } ``` -------------------------------- ### Custom Job Step Example Source: https://github.com/microsoft/al-go/blob/main/Tests/CustomizedYamlSnippet-TemplateRepository.txt A custom job step that runs a PowerShell command to print a message. Demonstrates how to define and execute custom logic within a job. ```powershell Write-Host 'My own job!' ``` -------------------------------- ### DeliverToSharePoint.ps1 Script Example Source: https://github.com/microsoft/al-go/blob/main/Scenarios/settings.md A PowerShell script demonstrating how to implement a custom delivery mechanism for SharePoint. It outlines the parameters available for use within the script. ```powershell Param( [Hashtable]$parameters ) Write-Host "Current project path: $($parameters.project)" Write-Host "Current project name: $($parameters.projectName)" Write-Host "Delivery Type (CD or Release): $($parameters.type)" Write-Host "Delivery Context: $($parameters.context)" Write-Host "Folder containing apps: $($parameters.appsFolder)" Write-Host "Folder containing test apps: $($parameters.testAppsFolder)" Write-Host "Folder containing dependencies (requires generateDependencyArtifact set to true): $($parameters.dependenciesFolder)" Write-Host "Repository settings:" $parameters.RepoSettings | Out-Host Write-Host "Project settings:" $parameters.ProjectSettings | Out-Host ``` -------------------------------- ### Conditional Settings for Repositories and Branches Source: https://github.com/microsoft/al-go/blob/main/Scenarios/settings.md Apply settings based on both repository and branch patterns. This example prevents app signing for specific branches within repositories matching a pattern. ```json "ConditionalSettings": [ { "repositories": [ "bcsamples-*" ], "branches": [ "features/*" ], "settings": { "doNotSignApps": true } } ] ``` -------------------------------- ### Custom Delivery Script Example Source: https://github.com/microsoft/al-go/blob/main/Scenarios/DeliveryTargets.md This is a placeholder for a custom PowerShell delivery script. AL-Go can use custom scripts named 'DeliverTo.ps1' located in the .github folder for advanced delivery scenarios. ```powershell # Example custom delivery script: ``` -------------------------------- ### Conditional Settings for Branches Source: https://github.com/microsoft/al-go/blob/main/Scenarios/settings.md Apply specific settings for branches matching a pattern. This example ensures apps are not published or signed for branches starting with 'feature/'. ```json "ConditionalSettings": [ { "branches": [ "feature/*" ], "settings": { "doNotPublishApps": true, "doNotSignApps": true } } ] ``` -------------------------------- ### Install AZ PowerShell module Source: https://github.com/microsoft/al-go/blob/main/Scenarios/SelfHostedGitHubRunner.md Installs the AZ PowerShell module, which is used by getbuildagent. ```powershell Install-Module az -force ``` -------------------------------- ### Enable Continuous Deployment for Reference Docs Source: https://github.com/microsoft/al-go/blob/main/Workshop/ReferenceDoc.md Add this JSON configuration to your ALGOORGSETTINGS or ALGOREPOSETTINGS variable, or to the .github/AL-Go-Settings.json file to enable continuous deployment of reference documentation. ```json { "alDoc": { "continuousDeployment": true } } ``` -------------------------------- ### Install Docker Engine using PowerShell Source: https://github.com/microsoft/al-go/blob/main/Scenarios/SelfHostedGitHubRunner.md This script installs or updates Docker Engine on an Azure VM. Ensure the EnvScope is set to Machine if installing Docker with a different user than the one running the agents. ```powershell InstallOrUpdateDockerEngine.ps1 ``` -------------------------------- ### Install PowerShell 7.4.1 using Chocolatey Source: https://github.com/microsoft/al-go/blob/main/Scenarios/SelfHostedGitHubRunner.md Installs PowerShell version 7.4.1 using Chocolatey. This is part of the software requirements for a self-hosted runner. ```powershell choco install pwsh -y ``` -------------------------------- ### Define DeployTo Setting in GitHub Environment Variable Source: https://github.com/microsoft/al-go/blob/main/RELEASENOTES.md Configure AL-Go settings, specifically 'DeployTo' for environments, using a GitHub environment variable. This setting takes precedence over file-defined settings. ```json { DeployToProduction { "Branches": [ "*" ], "includeTestAppsInSandboxEnvironment": false, "excludeAppIds": [ 1234 ] } } ``` -------------------------------- ### Install Microsoft Visual C++ Redistributable using Chocolatey Source: https://github.com/microsoft/al-go/blob/main/Scenarios/SelfHostedGitHubRunner.md Installs the Microsoft Visual C++ Redistributable for Visual Studio 2015-2022 version 14.36.32532 using Chocolatey. This is required by getbuildagent. ```powershell choco install vcredist140 -y ``` -------------------------------- ### Deploy Power Platform Action Source: https://github.com/microsoft/al-go/blob/main/Actions/DeployPowerPlatform/README.md This action deploys a Power Platform solution from either a set of build artifacts or unpacked solution files. ```APIDOC ## Deploy Power Platform Deploy the Power Platform solution from the artifacts folder ### INPUT #### ENV variables - **Settings** (object) - env.Settings must be set by a prior call to the ReadSettings Action - **Secrets** (object) - env.Secrets with delivery target context secrets must be read by a prior call to the ReadSecrets Action ### Parameters #### Path Parameters - **shell** (string) - Optional - The shell (powershell or pwsh) in which the PowerShell script in this action should run. Default: powershell - **environmentName** (string) - Required - Name of environment to deploy to - **artifactsFolder** (string) - Optional - Path to the downloaded artifacts to deploy (when deploying from a build) - **solutionFolder** (string) - Optional - Path to the unpacked solutions to deploy (when deploying from branch) - **deploymentEnvironmentsJson** (string) - Required - The settings for all Deployment Environments *Note: Either artifactsFolder or solutionFolder needs to be specified.* ### OUTPUT #### Success Response (200) - **environmentUrl** (string) - The URL for the environment. This URL is presented in the Deploy Step in summary under the environment name ``` -------------------------------- ### Get AL-Go Action Telemetry Source: https://github.com/microsoft/al-go/blob/main/Scenarios/EnablingTelemetry.md Retrieves all telemetry emitted when an AL-Go action completes. Filters for messages containing 'AL-Go action'. ```kql traces | where timestamp > ago(7d) | project timestamp, message, severityLevel, RepositoryOwner = tostring(customDimensions.RepositoryOwner), RepositoryName = tostring(customDimensions.RepositoryName), RunId = tostring(customDimensions.RunId), RunNumber = tostring(customDimensions.RunNumber), RunAttempt = tostring(customDimensions.RunAttempt), WorkflowName = tostring(customDimensions.WorkflowName), WorkflowConclusion = tostring(customDimensions.WorkflowConclusion), WorkflowDuration = todouble(customDimensions.WorkflowDuration), ALGoVersion = tostring(customDimensions.ALGoVersion), RefName = tostring(customDimensions.RefName), RunnerOs = tostring(customDimensions.RunnerOs), RunnerEnvironment = tostring(customDimensions.RunnerEnvironment), ErrorMessage = tostring(customDimensions.ErrorMessage), ActionDurationSeconds = todouble(customDimensions.ActionDuration) | extend HtmlUrl = strcat("https://github.com/", RepositoryName, "/actions/runs/", RunId) | where message contains "AL-Go action" ``` -------------------------------- ### AL-Go Repository Settings for Test Runs Source: https://github.com/microsoft/al-go/blob/main/Workshop/AutomatedTests.md Add these settings to the .github/AL-Go-Settings.json file in your single-project repository to enable test runs and app publishing. ```json { "useCompilerFolder": false, "doNotPublishApps": false } ``` -------------------------------- ### Get AL-Go Workflow Telemetry Source: https://github.com/microsoft/al-go/blob/main/Scenarios/EnablingTelemetry.md Retrieves all telemetry emitted when an AL-Go workflow completes. Filters for messages containing 'AL-Go workflow'. ```kql traces | where timestamp > ago(7d) | project timestamp, message, severityLevel, RepositoryOwner = tostring(customDimensions.RepositoryOwner), RepositoryName = tostring(customDimensions.RepositoryName), RunId = tostring(customDimensions.RunId), RunNumber = tostring(customDimensions.RunNumber), RunAttempt = tostring(customDimensions.RunAttempt), WorkflowName = tostring(customDimensions.WorkflowName), WorkflowConclusion = tostring(customDimensions.WorkflowConclusion), WorkflowDurationMinutes = round(todouble(customDimensions.WorkflowDuration) / 60, 2), ALGoVersion = tostring(customDimensions.ALGoVersion), RefName = tostring(customDimensions.RefName) | extend HtmlUrl = strcat("https://github.com/", RepositoryName, "/actions/runs/", RunId) | where message contains "AL-Go workflow" ``` -------------------------------- ### Configure Continuous Deployment to Production Source: https://github.com/microsoft/al-go/blob/main/Workshop/PublishToProduction.md Add this setting to your repository's .github/AL-Go-Settings.json file to enable or disable continuous deployment to the PROD environment. Setting continuousDeployment to false skips production deployments by default. ```json { "DeployToPROD": { "continuousDeployment": false } } ``` -------------------------------- ### Configure Test Projects Source: https://github.com/microsoft/al-go/blob/main/RELEASENOTES.md Define a test project by specifying the projects to test in the `.AL-Go/settings.json` file. This separates test execution from compilation, allowing for faster feedback loops. ```json { "projectsToTest": ["build/projects/MyProject"] } ``` -------------------------------- ### Get Workflow Multi-Run Branches Source: https://github.com/microsoft/al-go/blob/main/Actions/GetWorkflowMultiRunBranches/README.md Retrieves the branches for a multi-branch workflow run. It considers dispatch inputs or schedule settings for branch inclusion. ```APIDOC ## GET /workflows/multi-run/branches ### Description Gets the branches for a multi-branch workflow run. If the workflow is dispatched, the branches are determined based on the input `includeBranches`. If the workflow is run on a schedule, the branches are determined based on the `workflowSchedule.includeBranches` setting. ### Method GET ### Endpoint /workflows/multi-run/branches ### Parameters #### Query Parameters - **shell** (string) - Optional - The shell (powershell or pwsh) in which the PowerShell script in this action should run. Default value: `powershell` - **workflowEventName** (string) - Optional - The GitHub event name that triggered the workflow. *(override for reusable workflows)*. Default value: `github.event_name` - **includeBranches** (string) - Optional - Comma-separated value of branch name patterns to include if they exist. If not specified, only the current branch is returned. Wildcards are supported. Default value: `''` ### Request Example ```json { "shell": "pwsh", "workflowEventName": "push", "includeBranches": "main,develop,feature/*" } ``` ### Response #### Success Response (200) - **Result** (object) - JSON-formatted object with `branches` property, an array of branch names #### Response Example ```json { "branches": [ "main", "develop", "feature/new-login" ] } ``` ``` -------------------------------- ### Get AL-Go Test Results Telemetry Source: https://github.com/microsoft/al-go/blob/main/Scenarios/EnablingTelemetry.md Retrieves all telemetry emitted for AL-Go test results. Filters for messages containing 'AL-Go Test Results'. ```kql traces | where timestamp > ago(7d) | project timestamp, message, severityLevel, RepositoryOwner = tostring(customDimensions.RepositoryOwner), RepositoryName = tostring(customDimensions.RepositoryName), RunId = tostring(customDimensions.RunId), RunNumber = tostring(customDimensions.RunNumber), RunAttempt = tostring(customDimensions.RunAttempt), RefName = tostring(customDimensions.RefName), TotalTests = todouble(customDimensions.TotalTests), TotalFailed = todouble(customDimensions.TotalFailed), TotalSkipped = todouble(customDimensions.TotalSkipped), TotalPassed = todouble(customDimensions.TotalPassed), TotalTime = todouble(customDimensions.TotalTime) | extend HtmlUrl = strcat("https://github.com/", RepositoryName, "/actions/runs/", RunId) | where message contains "AL-Go Test Results" ``` -------------------------------- ### Generate Service Principal Auth Context with BCContainerHelper Source: https://github.com/microsoft/al-go/blob/main/Scenarios/SetupPowerPlatform.md Use this PowerShell command to generate the authentication context for service principal authentication against Power Platform. Ensure BcContainerHelper is installed. ```powershell # If not already installed, install latest BcContainerHelper Install-Module BcContainerHelper -force $ppClientId = Read-Host -Prompt "Enter client id" $ppClientSecret = Read-Host -AsSecureString -Prompt 'Enter client secret' New-BcAuthContext -includeDeviceLogin | New-ALGoAuthContext -ppClientSecret $ppClientSecret -ppApplicationId $ppClientId | Set-Clipboard ``` -------------------------------- ### Workflow Initialization Step Source: https://github.com/microsoft/al-go/blob/main/Tests/CustomizedYamlSnippet-TemplateRepository.txt Initializes the workflow using the 'WorkflowInitialize' action from 'microsoft/AL-Go-Actions'. Requires PowerShell to be set as the shell. ```yaml uses: microsoft/AL-Go-Actions/WorkflowInitialize@main with: shell: powershell ``` -------------------------------- ### Create AUTHCONTEXT using PowerShell Source: https://github.com/microsoft/al-go/blob/main/Workshop/ContinuousDeployment.md This PowerShell command generates an authentication context for AL-Go using impersonation. It requires the BcContainerHelper module and will prompt for device login authentication. The generated context is automatically copied to the clipboard. ```powershell New-BcAuthContext -includeDeviceLogin | New-ALGoAuthContext | set-Clipboard ``` -------------------------------- ### Configure KeyVault Secrets in settings.json Source: https://github.com/microsoft/al-go/blob/main/Scenarios/EnableKeyVaultForAppSourceApp.md Add these settings to your .AL-Go\settings.json file to enable KeyVault access for your app. These settings link the secret names in your repository or KeyVault to the corresponding KeyVault access information. ```json "KeyVaultCertificateUrlSecretName": "KeyVaultCertificateUrl", "KeyVaultCertificatePasswordSecretName": "KeyVaultCertificatePassword", "KeyVaultClientIdSecretName": "KeyVaultClientId" ``` -------------------------------- ### Initialization Job - Read Settings Source: https://github.com/microsoft/al-go/blob/main/Tests/CustomizedYamlSnippet-FinalRepository.txt Part of the Initialization job, this step uses the ReadSettings action to read workflow settings. ```yaml - name: Read settings id: ReadSettings uses: microsoft/AL-Go-Actions/ReadSettings@main with: shell: powershell ``` -------------------------------- ### Configure Scheduled Test Runs in AL-Go-Settings.json Source: https://github.com/microsoft/al-go/blob/main/Workshop/ScheduledTestRuns.md Add these settings to your .github/AL-Go-Settings.json file to define the schedule for your test workflows. Use crontab format for scheduling. ```json "CurrentSchedule": "0 2 * * *", "NextMinorSchedule": "0 2 * * 6", "NextMajorSchedule": "0 2 * * 0" ``` -------------------------------- ### Create New App Configuration Source: https://github.com/microsoft/al-go/blob/main/Workshop/Versioning.md Parameters for the 'Create a new app' workflow. Specify the branch, project name, app details, ID range, and whether to include sample code, commit directly, or use a GitHub token workflow. ```yaml name: Create a new app #--------------------------------------------------------------------------------------------------- # Variables #--------------------------------------------------------------------------------------------------- variables: #--------------------------------------------------------------------------------------------------- # Default values #--------------------------------------------------------------------------------------------------- use_workflow_from: main project_name: "." name: app2 publisher: "" id_range_from: 56000 id_range_to: 56100 include_sample_code: false direct_commit: false use_gh_token_workflow: false #--------------------------------------------------------------------------------------------------- # Workflow #--------------------------------------------------------------------------------------------------- #--------------------------------------------------------------------------------------------------- # Trigger #--------------------------------------------------------------------------------------------------- on: workflow_dispatch: inputs: use_workflow_from: description: 'Use workflow from branch' required: true default: 'main' project_name: description: 'Project name' required: true default: '.' name: description: 'Name of the app' required: true default: 'app2' publisher: description: 'Publisher of the app' required: true default: '' id_range_from: description: 'ID Range From' required: true default: '56000' id_range_to: description: 'ID Range To' required: true default: '56100' include_sample_code: description: 'Include Sample Code' required: true type: boolean default: false direct_commit: description: 'Direct Commit' required: true type: boolean default: false use_gh_token_workflow: description: 'Use GhTokenWorkflow for PR/Commit' required: true type: boolean default: false #--------------------------------------------------------------------------------------------------- # Jobs #--------------------------------------------------------------------------------------------------- jobs: #--------------------------------------------------------------------------------------------------- # Create app job #--------------------------------------------------------------------------------------------------- create_app: runs-on: ubuntu-latest steps: #--------------------------------------------------------------------------------------------------- # Checkout code #--------------------------------------------------------------------------------------------------- - name: Checkout code uses: actions/checkout@v3 with: ref: ${{ inputs.use_workflow_from }} #--------------------------------------------------------------------------------------------------- # Create app #--------------------------------------------------------------------------------------------------- - name: Create app uses: microsoft/AL-Go-Actions/CreateApp@latest env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: project_name: ${{ inputs.project_name }} name: ${{ inputs.name }} publisher: ${{ inputs.publisher }} id_range_from: ${{ inputs.id_range_from }} id_range_to: ${{ inputs.id_range_to }} include_sample_code: ${{ inputs.include_sample_code }} direct_commit: ${{ inputs.direct_commit }} use_gh_token_workflow: ${{ inputs.use_gh_token_workflow }} ``` -------------------------------- ### Enable Auto-Create Blob Container for Storage Delivery Source: https://github.com/microsoft/al-go/blob/main/Workshop/ContinuousDelivery.md Configure repository settings to automatically create a blob container in Azure Storage if it doesn't exist. This is part of the continuous delivery setup for storage accounts. ```json "DeliverToStorage": { "CreateContainerIfNotExist": true } ``` -------------------------------- ### Configure US Localization Settings Source: https://github.com/microsoft/al-go/blob/main/Workshop/Projects.md Add the 'artifact' setting for US localization in the US/.AL-Go/settings.json file. This specifies the artifact to be used for US builds. ```json "artifact": "bcartifacts/sandbox/22.0.54157.55210/us/closest" ``` -------------------------------- ### Generate Username/Password Auth Context with BCContainerHelper Source: https://github.com/microsoft/al-go/blob/main/Scenarios/SetupPowerPlatform.md Use this PowerShell command to generate the authentication context for username/password authentication against Power Platform. This method is only supported for tenants without 2-factor authentication. Ensure BcContainerHelper is installed. ```powershell # If not already installed, install latest BcContainerHelper Install-Module BcContainerHelper -force $ppUserName = Read-Host -Prompt "Enter Power Platform user name" $ppPassword = Read-Host -AsSecureString -Prompt 'Enter Power Platform password' New-BcAuthContext -includeDeviceLogin | New-ALGoAuthContext -ppUsername $ppUserName -ppPassword $ppPassword | Set-Clipboard ```