tools/azdo_pipelines/run-extractor.yaml [51:83]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            inputs:
              azureSubscription: "$(SERVICE_CONNECTION_NAME)"
              scriptType: pscore
              scriptLocation: inlineScript
              inlineScript: |
                Set-StrictMode -Version Latest
                $ErrorActionPreference = "Stop"
                $VerbosePreference = "Continue"
                $InformationPreference = "Continue"

                Write-Host "##vso[task.setvariable issecret=true;variable=AZURE_BEARER_TOKEN]$(az account get-access-token --query "accessToken" --output tsv)"
                Write-Host "##vso[task.setvariable issecret=true;variable=AZURE_CLIENT_ID]$env:servicePrincipalId"
                Write-Host "##vso[task.setvariable issecret=true;variable=AZURE_CLIENT_SECRET]$env:servicePrincipalKey"
                Write-Host "##vso[task.setvariable issecret=true;variable=AZURE_TENANT_ID]$env:tenantId"
                
                if (-not $env:AZURE_SUBSCRIPTION_ID) {
                    $subscriptionCount = az account list --query "length([])" --output tsv
                    if ($subscriptionCount -eq 1) {
                        $subscriptionId = az account list --query "[0].id" --output tsv
                        Write-Host "Setting AZURE_SUBSCRIPTION_ID environment variable to: $subscriptionId"
                        Write-Host "##vso[task.setvariable issecret=true;variable=AZURE_SUBSCRIPTION_ID]$($subscriptionId)"
                    } 
                    elseif ($subscriptionCount -gt 1) {
                        Write-Host "Multiple subscriptions are accessible. Please set the AZURE_SUBSCRIPTION_ID environment variable manually."
                        exit 1
                    }
                }
                else {
                  Write-Host "AZURE_SUBSCRIPTION_ID is already set to: $env:AZURE_SUBSCRIPTION_ID"
                }

              addSpnToEnvironment: true
              failOnStandardError: true
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



tools/azdo_pipelines/run-publisher-with-env.yaml [34:64]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    inputs:
      azureSubscription: "$(SERVICE_CONNECTION_NAME)"
      scriptType: pscore
      scriptLocation: inlineScript
      inlineScript: |
        Set-StrictMode -Version Latest
        $ErrorActionPreference = "Stop"
        $VerbosePreference = "Continue"
        $InformationPreference = "Continue"

        Write-Host "##vso[task.setvariable issecret=true;variable=AZURE_BEARER_TOKEN]$(az account get-access-token --query "accessToken" --output tsv)"
        Write-Host "##vso[task.setvariable issecret=true;variable=AZURE_CLIENT_ID]$env:servicePrincipalId"
        Write-Host "##vso[task.setvariable issecret=true;variable=AZURE_CLIENT_SECRET]$env:servicePrincipalKey"
        Write-Host "##vso[task.setvariable issecret=true;variable=AZURE_TENANT_ID]$env:tenantId"
        if (-not $env:AZURE_SUBSCRIPTION_ID) {
          $subscriptionCount = az account list --query "length([])" --output tsv
          if ($subscriptionCount -eq 1) {
              $subscriptionId = az account list --query "[0].id" --output tsv
              Write-Host "Setting AZURE_SUBSCRIPTION_ID environment variable to: $subscriptionId"
              Write-Host "##vso[task.setvariable issecret=true;variable=AZURE_SUBSCRIPTION_ID]$($subscriptionId)"
          } 
          elseif ($subscriptionCount -gt 1) {
              Write-Host "Multiple subscriptions are accessible. Please set the AZURE_SUBSCRIPTION_ID environment variable manually."
              exit 1
          }
        }
        else {
          Write-Host "AZURE_SUBSCRIPTION_ID is already set to: $env:AZURE_SUBSCRIPTION_ID"
        }
      addSpnToEnvironment: true
      failOnStandardError: true
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



