This message was deleted.
# general
s
This message was deleted.
w
cc @clever-sunset-76585 in case he has any tips or pointers.
c
@gifted-cat-21399 the Pulumi CLI has an option to use a pre-built binary, which allows you to, as the name implies, a pre-built .NET Pulumi app which accesses private Nuget feeds on Az DO. The caveat here to note is that we currently do not support automatic plugin acquisition for pre-built binaries. What that means is, you’d have to manually install the plugins used by your Pulumi app using the
pulumi plugin install resource <plugin_name> <version>
. You can specify a pre-built binary in the
Pulumi.yaml
. See the
options
property bag on https://www.pulumi.com/docs/intro/concepts/project/#pulumi-yaml, and specifically the
binary
property under that. Here’s an example of a
Pulumi.yaml
using that option:
Copy code
name: azure-csharp-webserver
runtime:
    name: dotnet
    options:
        binary: ./bin/Release/netcoreapp3.1/azure-cs-landingzone.dll
description: A minimal Azure C# Pulumi program
And here’s a sample Azure Pipelines config using that stack:
Copy code
pool:
  vmImage: 'windows-latest'

variables:
  solution: '**/*.sln'
  buildPlatform: 'Any CPU'
  buildConfiguration: 'Release'

steps:
- task: NuGetToolInstaller@1

- task: NuGetCommand@2
  inputs:
    command: 'restore'
    restoreSolution: '$(solution)'
    feedsToUse: 'select'
    vstsFeed: 'xxxxxxxxxxxxxx'

- task: VSBuild@1
  inputs:
    solution: '$(solution)'
    msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)"'
    platform: '$(buildPlatform)'
    configuration: '$(buildConfiguration)'
    msbuildArchitecture: 'x64'

- task: Pulumi@1
  displayName: Install pulumi
  inputs:
    azureSubscription: 'xxxxxxxx'
    command: 'stack'
    stack: '$(pulumi.stack.name)'

- script: pulumi plugin install resource azure v3.12.1
  displayName: Install pulumi plugins

- task: Pulumi@1
  inputs:
    azureSubscription: 'xxxxxxxx'
    command: 'preview'
    stack: '$(pulumi.stack.name)'
👀 1
g
I also stumbled across another way to do this and was successful at it. Pulumi up triggers a dotnet build to start with no way to seemingly inject "source" to specify the URI of the location of Nuget packages. So the key was to run the command "*dotnet nuget add source*" just prior to the Pulumi task. Example of Azure Pipeline YAML: # Place required Nuget package in D:\a\1\s\packages\ - task: ArtifactoryNuGet@2 inputs: command: 'restore' artifactoryService: 'ArtifactoryBot' targetResolveRepo: 'NuGet' solutionPath: '**/*.csproj' verbosityRestore: 'Detailed' packagesDirectory: 'packages/' # Ensure local nuget package location is made known - script: dotnet nuget add source D:\a\1\s\packages - task: Pulumi@1 inputs: azureSubscription: 'DevOps ARM' command: 'up' args: '-y' cwd: 'DevOpsDevTest/OurProject/' stack: 'CompanyName/OurProject/dev' versionSpec: '2.0.0' env: PULUMI_ACCESS_TOKEN: $(PulumiAccessToken)