CI provider
Cacheport with Azure Pipelines
Microsoft-hosted agents are fresh for every job. Put the Cacheport token in a variable group, map it into the steps that need it, and restores come from a regional cache.
- Config
- azure-pipelines.yml
- Token
- Secret variable in a variable group
- Agents
- Microsoft-hosted and self-hosted
- Secrets
- Mapped explicitly with env:
Give your pipelines a token
Secret variables are not exposed to scripts unless you map them, which keeps the token out of steps that do not need it.
variables:
- group: cacheport # contains secret CACHEPORT_TOKENExamples
Copy-ready configuration for common setups.
NuGet
pool:
vmImage: ubuntu-latest
variables:
- group: cacheport
steps:
- task: UseDotNet@2
inputs:
version: 8.0.x
- script: dotnet restore --locked-mode
env:
CACHEPORT_TOKEN: $(CACHEPORT_TOKEN)
- script: dotnet test --no-restorenpm
steps:
- task: NodeTool@0
inputs:
versionSpec: 22.x
- script: |
echo "registry=https://acme.cacheport.cc/npm/" > .npmrc
echo "//acme.cacheport.cc/npm/:_authToken=${CACHEPORT_TOKEN}" >> .npmrc
npm ci
env:
CACHEPORT_TOKEN: $(CACHEPORT_TOKEN)FAQ
Questions
Why map the secret with env:?
Azure Pipelines does not expose secret variables to scripts automatically. Mapping them per step is safer.
Does it replace Azure Artifacts upstream sources?
For public packages, yes. Keep Azure Artifacts for internal packages and add it as an upstream if you like.
Does it work on Windows agents?
Yes. Use the same settings; NuGet expands %CACHEPORT_TOKEN% on every platform.
Other CI providers
Setting up somewhere else too?
Start on the free plan
20 GB of cache, every registry, unlimited users. Upgrade when your pipelines outgrow it.