Windows self-hosted agent #1897
-
I had PSRule working with an Ubuntu Microsoft-hosted agent, and all was working well. We need to change to a self-hosted windows agent and now the bicep file will not expand from the private container registries. I have set the credential precedence to Environment only to see if that would make a difference, this is the yaml I am using. It would be nice if we could use If I am missing anything, please let me know. Thanks in advance Max # yaml-language-server: $schema=./deploy.yml
stages:
- stage: PSRuleScanning
displayName: PSRule Scanning
jobs:
- job: PSRule
displayName: PS Rule Scanning
steps:
- checkout: Exg.DevOps.ImageBuilder
# Analyze Azure resources using PSRule for Azure
- task: ps-rule-assert@2
displayName: Analyze Azure template files
inputs:
modules: 'PSRule.Rules.Azure'
inputType: "repository"
inputPath: newImage/bicep/
outputFormat: Nunit3
outputPath: rule-report.xml
env:
# Define environment variables within Azure Pipelines
AZURE_CLIENT_ID: $(psrule-clientid)
AZURE_CLIENT_SECRET: $(psrule-secret)
AZURE_TENANT_ID: $(psrule-tenant)
# PSRule results
- task: PublishTestResults@2
displayName: 'Publish PSRule results'
inputs:
testRunTitle: 'PSRule'
testRunner: NUnit3
testResultsFiles: 'rule-report.xml'
mergeTestResults: true
publishRunAttachments: true
condition: succeededOrFailed() |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
@maxricketts Is there are Bicep error returned? If so, are you able to provide the error message. |
Beta Was this translation helpful? Give feedback.
-
@BernieWhite - Thank you for the quick reply. Below is the error. I have triple checked the App ID, App Secret, and tenant ID that is passed through from a variable group. Odd, though as it was all working on ubuntu ms-hosted agent.
|
Beta Was this translation helpful? Give feedback.
@BernieWhite - Thank you for the quick reply.
Below is the error. I have triple checked the App ID, App Secret, and tenant ID that is passed through from a variable group.
Odd, though as it was all working on ubuntu ms-hosted agent.
#[error]Bicep (0.11.1) compilation of 'C:\a\1\s\newImage\bicep\imagebuilder.bicep' failed with: C:\a\1\s\newImage\bicep\imagebuilder.bicep(253,11) : Error BCP192: Unable to restore the module with reference "br:exgprdukacr001.azurecr.io/bicep/modules/microsoft.resources.resourcegroups:0.4.1527": Unhandled exception: System.ArgumentException: Invalid tenant id provided. You can locate your tenant id by following the instructions listed here: https://docs.micros…