How to configure package-file path for Azure release pipeline? - azure

I was following this article from Microsoft to use Azure pipeline for build and release. Reached upto this section and confused about the following code:
az batch application package create --application-id $(batchApplicationId)
--name $(batchAccountName)
--resource-group $(resourceGroupName)
--version $(batchApplicationVersion)
--package-file=$(System.DefaultWorkingDirectory)/$(Release.Artifacts.{YourBuildArtifactSourceAlias}.BuildId).zip
I have configured the following in pipeline variables:
batchApplicationId
batchAccountName
resourceGroupName
batchApplicationVersion
The only thing remaning is configuring the package-file
As far as I understand, I just have to replace YourBuildArtifactSourceAlias with my artifact source alias, and I have done that. But when deploying the release pipeline, I get the following error:
.zip was unexpected at this time.
##[error]Script failed with exit code: 255
As we can see in this screenshot, the only failing part of this whole process is when uploading the package to the application created, which is the final step.
Can someone help me with this?

Related

What means Range error on my Release pipelines?

When the release pipeline run end up with this error
RangeError [ERR_INVALID_OPT_VALUE]: The value "4294967295" is invalid for option "size".
I don't know what means this error
task failed
Log of the task failed when release run
Same issue for me using Web Deploy to a nodejs app service.
Web Deploy worked at first, until we added some packages in our package.json (e.g. "#fortawesome/free-brands-svg-icons")
Then our release pipeline suddenly outputs "64-bit = +" in the deployment log.
If we remove the packages, the "64-bit = +" is gone, and our Web Deploy works again.
Image of log from Release pipeline
Not sure how to resolve it, but in our case we used Zip Deploy instead like #Ari Gunawan recommended.
I had the same issue when trying to deploy a node app to Azure App Service from release pipeline. Not sure what the error means as there are no further details about it but I resolved it by using "Zip Deploy" deployment method and "Continue on error"

Azure DevOps : Create Immutable image deployment failed to find the script file

I'm looking to build Release pipeline to create a immutable ubuntu machine for my VMss.
I have deployment.sh with all required application for Vmss.
I'm trying to build Image for a Jar based application.
I have my artifacts structure as per below
I'm trying to build immutable image using build image task from azure DevOps
as given below.
On running task i'm getting a error with the following log.
2021-07-22T10:34:13.5841600Z ==> azure-arm: chmod: cannot access '/deployTemp/app.jar/../../deployment.sh': Not a directory
2021-07-22T10:34:13.5842952Z
2021-07-22T10:34:13.5862730Z ==> azure-arm: /tmp/script_5507.sh: 5: /tmp/script_5507.sh: /deployTemp/app.jar/../../deployment.sh: not found
Any Help ?
Thanks in Advance.

How do I run a pipeline for Business Central in Gitlab?

Our Business Central extension is located on GitLab, and I've been trying to get the CI/CD feature to work. What I'd like to do is to use BcContainerHelper to set up a BC container and run a Test Runner of my choice before letting the pipeline succeed. Unfortunately, I've found very little documentation on this subject, and what I've found was either about BC pipelines in Azure, or pipelines for other projects in GitLab.
When creating the docker container, is it possible to set it up with BcContainerHelper instead so I have BC set up right away? Also, I tried to execute a .ps1 file, but I got the following error message:
Checking out fb0f1471 as 2-implementing-testapp...
Skipping Git submodules setup
Executing "step_script" stage of the job script
Using docker image sha256:13fd310aa3adfd5db7b986cc64b5b6816bea774cf51de468d917e6ef038b418f for ruby:2.5 with digest ruby#sha256:d273723056dda84bda81454eb42743c6c29fdf2c2d4d42bddf8e3dca8bb99aa4 ...
$ ./scripts/create-container.ps1
/bin/bash: line 120: ./scripts/create-container.ps1: Permission denied
Cleaning up file based variables
ERROR: Job failed: exit code 1
Is it even possible to run a pipeline for Business Central on GitLab or do I have to use Azure?
I don't know much about GitLab (we use Auzre DevOps with ALOps in our organization) but I can provide my two cents about BcContainerHelper.
BcContainerHelper has a command that will run a full build pipeline (creates the container, compiles the app, runs the tests). It is called Run-AlPipeline.
An example of running it could be:
Run-AlPipeline `
-pipelineName "My Pipeline" `
-licenseFile "c:\temp\license.flf" `
-baseFolder "...path to your project..." `
-appFolders #("app") `
-testFolders #("test") `
-installTestFramework `
-enablePerTenantExtensionCop `
-enableUICop
You can read about all the parameters available in this blog post.

Azure CD pipeline can't find build artifacts

Below is Azure error log from the Azure release pipeline.
2020-07-24T05:17:13.7712974Z ##[section]Starting: Deploy Azure App Service
2020-07-24T05:17:14.0464143Z ==============================================================================
2020-07-24T05:17:14.0465719Z Task : Azure App Service deploy
2020-07-24T05:17:14.0469391Z Description : Deploy to Azure App Service a web, mobile, or API app using Docker, Java, .NET, .NET Core, Node.js, PHP, Python, or Ruby
2020-07-24T05:17:14.0469849Z Version : 3.163.5
2020-07-24T05:17:14.0470410Z Author : Microsoft Corporation
2020-07-24T05:17:14.0470921Z Help : https://aka.ms/azureappservicetroubleshooting
2020-07-24T05:17:14.0471274Z =============================================================================
2020-07-24T05:17:16.0650643Z Got connection details for Azure App Service:'XXXXX'
2020-07-24T05:17:17.6576087Z (node:764) Warning: Use Cipheriv for counter mode of aes-256-ctr
**2020-07-24T05:17:17.6627737Z ##[error]Error: No package found with specified pattern: D:\a\r1\a\Drop<br/>Check if the package mentioned in the task is published as an artifact in the build or a previous stage and downloaded in the current job.**
2020-07-24T05:17:22.9168975Z Successfully added release annotation to the Application Insight : XXXXX
2020-07-24T05:17:24.8686063Z Successfully updated deployment History at https://XXXXX.scm.azurewebsites.net/api/deployments/231595567842919
2020-07-24T05:17:24.8933576Z ##[section]Finishing: Deploy Azure App Service
P.S. I have checked build pipeline, I can download build Artificats, but it displays below warning.
[warning]Directory 'D:\a\1\a' is empty. Nothing will be added to build artifact 'drop'.
Assuming you meant you have solved the build artifact empty issue, but the release pipeline still had issue in Azure App Service deploy task.
As the error mentioned, there is "No package found with specified pattern: D:\a\r1\a\Drop", you need to check how you define the package, try format $(System.DefaultWorkingDirectory)/**/*.zip instead of $(System.DefaultWorkingDirectory)\Drop.
As task "Publish Build Artifact" publish artifact from $(build.artifactstagingdirectory), so we need add a task "Copy files" to copy your files ** from $(system.defaultworkingdirectory) to $(build.artifactstagingdirectory) **. which copied my build to stagingdirectory.

VSTS - Build a Docker Image

I have a .NET Core repo in VSTS. I'm trying to create a Build pipeline that builds a Docker image and adds it to my Azure Container Registry. My Build pipeline has a Docker task. This task has the "Build an image" action selected. This action relies on my Dockerfile, which looks like this:
FROM microsoft/dotnet:2.1.2-runtime-nanoserver-1803
# Install .NET Core
ENV DOTNET_VERSION 2.1.2
When my Build pipeline runs, I get an error that says:
failed to register layer: re-exec error: exit status 1: output: ProcessUtilityVMImage \\?\C:\ProgramData\docker\windowsfilter\82aba535faccd8bf0e5ce3c122247672fa671214000a12c5481972212c5e2ca0\UtilityVM: The system cannot find the path specified.
##[error]C:\Program Files\Docker\docker.exe failed with return code: 1
Why am I getting this error? How do I fix it?
It should be the same issue with this one : https://github.com/Microsoft/vsts-tasks/issues/6510
Seems it still have some issues with nanoserver-1803
Just try to setup and host a custom agent on Azure VM, then check it again.
https://github.com/Microsoft/vsts-tasks/issues/6510#issuecomment-370152300
I found maybe an explication about this error: VSTS agents seem not
support nanoserver-1709 actually. Maybe this will change with the next
version 1803.
See details here: Microsoft/vsts-agent#1393
When I setup and host a custom agent on a machine on Azure, it's
working. So it's not a bug with this task. I close this issue. Thanks!

Resources