I am running a Azure DevOps pipeline, and I get the following error.
error: Unable to load the service index for source https://pkgs.dev.azure.com/companyName/_packaging/12345678-1234-1234-1234-1234567890ab/nuget/v3/index.json.
error: Response status code does not indicate success: 403 (Forbidden - User '12345678-1234-1234-1234-1234567890ab' lacks permission to complete this action. You need to have 'ReadPackages'. (DevOps Activity ID: 12345678-1234-1234-1234-1234567890ab)).
And I am getting the error from a task whose yaml looks like this.
steps:
- task: DotNetCoreCLI#2
displayName: 'Push the created package to Nuget feed. '
inputs:
command: push
publishVstsFeed: '12345678-1234-1234-1234-1234567890ab'
versioningScheme: byPrereleaseNumber
Any ideas what to be done?
Azure DevOps - Unable to load the service index for source
It seems you have not authenticated your private feed, please try to add the task NuGetAuthenticate
- task: NuGetAuthenticate#0
displayName: 'NuGet Authenticate'
inputs:
nuGetServiceConnections: TestNuGet
And create a service connection for the private feed:
Related
I have a pipeline stage that is using a template as follows:
# Deploy to AKS
- stage: DeployTEST
displayName: Test env for my-app
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
variables:
- group: 'my-app-var-group-test'
- group: 'package-variables'
- template: templates/shared-template-vars.yml#templates
jobs:
- deployment: TestDeployment
displayName: Deploy to AKS - Test
pool:
vmImage: $(vmImageName)
environment: env-test
strategy:
runOnce:
deploy:
steps:
- template: ./aks/deployment-steps.yml
...and the content of the template deployment-steps.yml is:
steps:
- script: |
echo AzureSubscription: '$(azureSubscription)'
echo KubernetesServiceConnection: '$(kubernetesServiceConnection)' # this is working
- task: KubernetesManifest#0
displayName: Create imagePullSecret
inputs:
action: createSecret
secretName: $(imagePullSecret)
dockerRegistryEndpoint: $(dockerRegistryServiceConnection)
kubernetesServiceConnection: $(kubernetesServiceConnection) # this is causing an error
I get an error like this:
There was a resource authorization issue: "The pipeline is not valid. Job TestDeployment: Step input kubernetesServiceConnection references service connection $(kubernetesServiceConnection) which could not be found. The service connection does not exist or has not been authorized for use. For authorization details, refer to https://aka.ms/yamlauthz."
and like this when I try to select individual stages prior manual pipeline run:
Encountered error(s) while parsing pipeline YAML:
Job TestDeployment: Step input kubernetesServiceConnection references service connection $(kubernetesServiceConnection) which could not be found. The service connection does not exist or has not been authorized for use. For authorization details, refer to https://aka.ms/yamlauthz.
The errors above are misleading, because it is not an authorization issue:
the referenced K8s service connection is authorized
when I hardcode the value of the $(kubernetesServiceConnection) variable the pipeline runs just fine - no errors
variable group my-app-var-group-test is authorized - IMPORTANT: this is where the $(kubernetesServiceConnection) variable is defined
NOTE: The variable kubernetesServiceConnection is defined in the my-app-var-group-test variable group & when I comment out the KubernetesManifest task, the value of the $(kubernetesServiceConnection) variable is properly printed to the pipeline console output without any issues and the pipeline runs successfully!?
I know I could use parameters to pass values into the template, but this setup is already used by all other pipelines (variable group vars are used/references in templates) and this issue appeared on a newly created pipeline. I have used file comparison to compare the yaml of a working pipeline and this one and failed to spot anything...
I might be missing something obvious, but I spent hours on this failing to resolve the error...
I have created a new pipeline as part of investigating this issue as follows:
New Pipeline > Azure Repos Git > Start pipeline
I have not edited the base template pipeline code, so it looks like this:
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- main
pool:
vmImage: ubuntu-latest
steps:
- script: echo Hello, world!
displayName: 'Run a one-line script'
- script: |
echo Add other tasks to build, test, and deploy your project.
echo See https://aka.ms/yaml
displayName: 'Run a multi-line script'
However randomly (at least 1 in every 15), I will see the following warning when running the pipeline:
There was a failure in sending the provision message: Unexpected response code from remote provider InternalServerError
Considering that im using their starter pipeline without any changes, I don't think this is an issue with the yaml, but an issue on Azure DevOps / Hosted Agents side.
I also enabled the diagnostic logs, and found the following in Agent_20220611-100355-utc.log:
[2022-06-11 10:03:56Z ERR JobNotification] Connection to monitor port 49100 failed!
[2022-06-11 10:03:56Z ERR JobNotification] System.Net.Internals.SocketExceptionFactory+ExtendedSocketException (111): Connection refused [::ffff:127.0.0.1]:49100
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
at System.Net.Sockets.Socket.Connect(IPAddress address, Int32 port)
at Microsoft.VisualStudio.Services.Agent.JobNotification.ConnectMonitor(String monitorSocketAddress)
[2022-06-11 10:03:56Z ERR JobNotification] Invalid socket address hello. Job Notification will be disabled.
Does anyone have any suggestions?
I switched from windows-latest to windows-2022 and that cured things for me. Which is weird because this says they are the same thing.
Maybe a similar trick will work for you? Try ubuntu-20.04.
I am trying to run Jmeter test in Azure Load test and in Azure pipeline. When i run the pipeline i get the error 'invalid secret url'.
My azurepipeline.yml looks like this:
steps:
- task: AzureLoadTest#1
inputs:
azureSubscription: $(serviceConnection)
resourceGroup: $(loadTestResourceGroup)
loadTestResource: $(loadTestResource)
loadTestConfigFile: 'GraphQLPOC.yaml'
and my Jmeter test yml is like this:
version: v0.1
testName: GraphQL_POC
testPlan: GraphQLPOCTestPlan.jmx
description: 'Test Run'
engineInstances: 1
secrets:
- name: client_secret
value: ----
keyVaultReferenceIdentity: ---
When i remove the secret from my jmeter test.yml it passes but fails the test as it is unable to fetch the secret.
when i add the secret to the jmeter.yml it gives the error 'invalid secret url'
I am new to this and i am not sure what i am doing wrong here.
I am trying to figure out the appropriate way to connect an Azure DevOps pipeline that executes a Maven build to a remote JFrog Artifactory Maven repository.
I first looked at Feeds and Upstream Sources. I didn't see anything in the documentation that shows how to do this. Indeed it looks as though you can't actually do it.
Then I looked at Service Endpoints. Here, I was able to create a service endpoint that points at my Artifactory host. Great! I added a task of Maven Authenticate, which is the only one I saw that allows me to reference the mavenServiceConnection. But the pipeline still fails when trying to resolve artifacts, because it only looks at Maven Central.
# Docker
trigger:
- master
resources:
- repo: self
variables:
tag: '$(Build.BuildId)'
stages:
- stage: Build
displayName: Build image
jobs:
- job: Build
displayName: Build
pool:
vmImage: 'ubuntu-latest'
steps:
- task: MavenAuthenticate#0
inputs:
mavenServiceConnections: 'eti-libs-snapshots-local'
- task: Maven#3
inputs:
options: '-X'
mavenPomFile: 'pom.xml'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
javaHomeOption: 'JDKVersion'
mavenVersionOption: 'Default'
mavenAuthenticateFeed: false
effectivePomSkip: false
sonarQubeRunAnalysis: true
sqMavenPluginVersionChoice: 'latest'
- task: Docker#2
displayName: Build an image
inputs:
command: build
dockerfile: '$(Build.SourcesDirectory)/Dockerfile'
tags: |
$(tag)
Edited: Found some more relevant information
So as Kontekst pointed out, I needed to add the Jfrog extension for pipelines. I have done that and got it configured.
I am trying to configure an IIS Web Application In Azure Dev Ops / VSTS which has a website at level 3, for example
Sites/Applications/payroll-forms/hub-manager
Applications is a Website
payroll-forms is a was a virtual directory but is now an Application
hub-manager is a application
Here is my Variables and YAML
Configuration type : IIS Web Application
Website Name : applications
Virtual Path : '/payroll-forms/hub-manager'
steps:
- task: IISWebAppManagementOnMachineGroup#0
displayName: 'IIS Web App Manage'
inputs:
IISDeploymentType: '$(Parameters.IISDeploymentType)'
WebsiteName: '$(Parameters.WebsiteName)'
WebsitePhysicalPath: 'f:\Websites\Applications'
AddBinding: '$(Parameters.AddBinding)'
Bindings: '$(Parameters.Bindings)'
CreateOrUpdateAppPoolForWebsite: true
AppPoolNameForWebsite: Applications
DotNetVersionForWebsite: v2.0
PipeLineModeForWebsite: Classic
ParentWebsiteNameForVD: '$(Parameters.WebsiteName)'
VirtualPathForVD: '$(Parameters.VirtualPathForApplication)'
ParentWebsiteNameForApplication: '$(Parameters.WebsiteName)'
VirtualPathForApplication: '$(Parameters.VirtualPathForApplication)'
PhysicalPathForApplication: 'F:\Websites\Applications\payroll-forms\hub-manager'
AppPoolName: '$(Parameters.AppPoolName)'
steps:
- task: IISWebAppDeploymentOnMachineGroup#0
displayName: 'IIS Web App Deploy'
inputs:
WebSiteName: '$(Parameters.WebsiteName)'
VirtualApplication: 'hub-manager'
TakeAppOfflineFlag: True
XmlVariableSubstitution: True
The Error
2019-07-31T14:49:46.1783681Z ##[command]"C:\Windows\system32\inetsrv\appcmd.exe" list app "applications/payroll-forms/hub-manager"
2019-07-31T14:49:46.2584534Z ##[command]"C:\Windows\system32\inetsrv\appcmd.exe" add app /site.name:"applications" /path:"/payroll-forms/hub-manager" /physicalPath:"F:\Websites\Applications\payroll-forms\hub-manager"
2019-07-31T14:49:46.3231472Z ERROR ( message:Failed to add duplicate collection element "/payroll-forms/hub-manager". )
2019-07-31T14:49:46.4988608Z ##[error]Process 'appcmd.exe' exited with code '183'.
2019-07-31T14:49:46.5431004Z ##[section]Finishing: IIS Web App Manage
I have tried many combinations and struggling to find an example even though i got a 2 level one working fine.
[error]Process 'appcmd.exe' exited with code '183'.
The error code 183 means sorry this files already exists, so I could not create this file since that.
And also, this message can be validate by the previous error message:
ERROR ( message:Failed to add duplicate collection element
"/payroll-forms/hub-manager". )
So according to this message, the issue occurred between Virtual Path : '/payroll-forms/hub-manager' and /path:"/payroll-forms/hub-manager". Please try with run this script by removing Virtual Path. Or, please change /path:"/payroll-forms/hub-manager" as another path value which will not conflict with the value of Virtual Path