我陷入了从 github 存储库部署到 azure web 应用程序的 jenkins 阶段。
stage('Deployment to Staging')
{
azureWebAppPublish appName: 'app1',
azureCredentialsId: 'cred1',
filePath: '',
publishType: 'file',
resourceGroup: 'rg1',
slotName: '',
sourceDirectory: ''
}
结果是:
[Pipeline] End of Pipeline
java.lang.NoSuchMethodError: com.microsoft.azure.util.AzureBaseCredentials.serializeToTokenData()[B
at com.microsoft.jenkins.appservice.util.AzureUtils.getToken(AzureUtils.java:24)
at com.microsoft.jenkins.appservice.util.AzureUtils.buildClient(AzureUtils.java:28)
at com.microsoft.jenkins.appservice.WebAppDeploymentRecorder.perform(WebAppDeploymentRecorder.java:168)
at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123)
at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:99)
at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:69)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Finished: FAILURE
我对这条管道做错了什么?我已经使用 azure 服务主体设置了凭据并且已经经过验证。真的需要你的帮助
答案1
我已经找到了解决方案。事实证明需要降级 azure 凭据插件。
before :
jenkins version : 2.289.2
azure credential plugin version : 182.v3ccd4a755864
后 :
jenkins version : 2.289.2
azure credential plugin version : 4.0.6
要手动下载插件,我正在使用点击我 并将其上传到 jenkins GUI。