Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions .azuredevops/pipelineTemplates/jobs.publishModule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -255,20 +255,23 @@ jobs:

# [private bicep registry publish] task(s)
#-------------------------------------------
- task: AzurePowerShell@5
- task: AzureCLI@2
displayName: 'Publish module to private bicep registry'
condition: and(
eq(variables['bicepRegistryDoPublish'], true),
succeeded()
)
enabled: true
inputs:
addSpnToEnvironment: true
azureSubscription: '${{ parameters.serviceConnection }}'
azurePowerShellVersion: ${{ parameters.azurePowerShellVersion }}
preferredAzurePowerShellVersion: ${{ parameters.preferredAzurePowerShellVersion }}
pwsh: true
ScriptType: InlineScript
inline: |
scriptType: pscore
scriptLocation: inlineScript
inlineScript: |
# Log into Az-PowerShell context
$SecuredPassword = ConvertTo-SecureString -AsPlainText -String $env:servicePrincipalKey
$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $env:servicePrincipalId, $SecuredPassword
Connect-AzAccount -ServicePrincipal -TenantId $env:tenantId -Credential $Credential

# Load used functions
. (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Get-ModulesToPublish.ps1')
. (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Publish-ModuleToPrivateBicepRegistry.ps1')
Expand All @@ -295,16 +298,16 @@ jobs:
Write-Host "##[group]$(' - [{0}] [{1}]' -f $RelPath, $ModuleToPublish.Version)"

$functionInput = @{
TemplateFilePath = $ModuleToPublish.TemplateFilePath
TemplateFilePath = $ModuleToPublish.TemplateFilePath
BicepRegistryName = '${{ parameters.bicepRegistryName }}'
BicepRegistryRgName = '${{ parameters.bicepRegistryRgName }}'
BicepRegistryRgLocation = '${{ parameters.bicepRegistryRgLocation }}'
ModuleVersion = $ModuleToPublish.Version
ModuleVersion = $ModuleToPublish.Version
}

Write-Verbose "Invoke Publish-ModuleToPrivateBicepRegistry with" -Verbose
Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose

Publish-ModuleToPrivateBicepRegistry @functionInput -Verbose
Write-Host "##[endgroup]"
}
}