Azure devops - 302 status code when publishing universal package - azure

i am trying to publish artifact from my local host to azure devops as universal package. I downloaded newest azure CLI (2.3.1) installed newest azure devops (0.18.0). After that i logged in using az login and also created my own personal access token and logged in with az devops login command. There were no errors so i assume that i logged in, i also did it with debug enabled and everything went fine.
After that i tried to publish my universal package into artifacts in my project but i got message
Failed to update Universal Packages tooling. Operation returned a 302
status code.
Error screen
In debug mode i've got
failed while trying to get token for tenant {tenant_id}
Later on there was also a retry with PAT but again 302 status from OPTIONS request.
I also tried to do other actions on my account using cli and everything was ok. I removed user from my team and it went smoothly.
Can i ask for help with this issue, if there is other option to publish this package it would be great.

The operation of Package publish from Azure cli need the support of artifacttool, so we combine these 2 operation together. When you run the command of az artifacts universal publish, it will firstly install/update the artifact tool to latest, so that it could make sure the publish action can be smoothly.
Now, the issue you faced is during the artifact tool updating. Not sure what happened on your side since it all work fine for me at present. I did universal package publish very successfully just now.
Work around:
Since you stuck at artifact tool updating, just avoid that. You can do package publish by using Azure devops task.
Just go pipeline, add Universal packages task and then configure it with below arguments:
Then, run this pipeline with self-agent(must). Because your are trying to publish the local files to Azure Universal package, only self-host agent can have ability to access local folder.

Related

Unable to connect to azure pipeline, but deploy still works in app service deployment center?

I keep getting this error message in the Azure App service deployment center:
We were unable to connect to the Azure Pipeline that is connected to
this Web App. This could mean it has been removed from the Azure Dev
Ops Portal. If this has happened, you can disconnect this pipeline and
set up a new deployment pipeline.
The thing is, it stil says that it successfully deploys, but If you try to access swagger for example, you get an HTTP error 500, (swagger does work localy). I have tried restarting the app service, going back commits, to see if that would help, but nothing is working. All Json data has been doubel chekced so that isn't the problem either. Anyone know of a fix?
We were unable to connect to the Azure Pipeline that is connected to this Web App. This could mean it has been removed from the Azure DevOps Portal. If this has happened, you can disconnect this pipeline and set up a new deployment pipeline.
Th error says that files are missing in the current build , try with new deployment pipeline.
You might have added an archive step in the build pipeline. This causes the artifact to be zipped before publish.
In the release pipeline if you use Azure App Service Deploy task , This internally uses Zip Deploy, that will zip the files.
Remove the archive step, the double zipping will be avoided.
HTTP error 500
Make sure the XML documentation file output is in bin and not in bin\Debug or bin\Release (verify this for all build configurations).

How to use nuget packages in azure devops?

Im trying to setup a selenium testproject in azure devops, so i can run it in a pipeline.
I created a project in Visual Studio 2017 and everything works fine. When i try to publish my local code into the azure repository, it doesnt upload my nuget packages and selenium doesnt run without them. How can i solve this? I dont have access to Azure Artifacts btw
Im following these tutorials:
https://learn.microsoft.com/en-us/azure/devops/pipelines/test/continuous-test-selenium?view=azure-devops
https://www.youtube.com/watch?v=tcAMgPywsJA
You need to either manually(via command line) or automatically (a pipeline) publish your Nuget package to Azure Artifacts. Checkout Publish a NuGet package.
Once you publish your Nuget package, you won't be able to change its version, or overwrite. Just take in mind.
How can i solve this? I dont have access to Azure Artifacts btw
As a workaround, you can set up self-hosted agent and use it to run the pipeline.
Then set the path to install the package to the path where the local package is located in the nuget.config file.
nuget.config reference

Azure DevOps: Application Error If you are the application administrator, you can access the diagnostic resources

I am trying to publish Hello-world to azure app service.
I am using below code from my git repo as below
https://github.com/biswajeetbehera/java-hello-world-with-maven/tree/master/src/main/java/hello
I am using Azure-DevOps CI-CD pipeline to build my code from above URL & using maven as my build tool inside it.
after successfully building my package I am trying to deploy it on Azure app service {its a Linux server. I have installed java inside it.)
But I am getting below error:
:( Application Error
If you are the application administrator, you can access the diagnostic resources.
Following things which you can take a look at,
1) Did you try to build at your local machine , did it compiled successfully.
Using the same command which has been triggered with azure devops.
2) Did you have all the dependency installed in the build agent?
3) Here you can find the respected link for maven task for an application
https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/build/maven?view=azure-devops
Please check that and see if it helps.

Getting deployment failed error in Azure API App after syncing with GitHub

I updated the NuGet packages locally and pushed the changes to remote GitHub repo. My remote repo is connected with Azure API App. After this update, I am getting deployment failed error. Below are the logs I found on Azure.
Does anyone know how to resolve this error?
I found the solution. Under the App service on Azure portal, there is a Console link in the menu. I went to the path D\home\site\repository and then ran nuget restore. It updated the package references and my build was back to normal again.

VSTS Build vNext NuGet custom package source

We have an Azure Entreprise Agreement with a main subscription to which a VSTS account is bound. We have setup the Package Management extension in order to host some usefull packages for diferent projects. For each customer, we create a subscription in this EA and a VSTS account bound to it. We build our customer projects on the Hosted build agent of the latter subscription.
But when it's time for the build process to restore NuGet packages (using Nuget Installer task) that are stored on the main package feed, it looks like that the build service cannot access this feed (probably because it's not part of the same subscription).
Is there a way to allow an external build service in the main feed permissions, or even use an api key in the NuGet Installer task of the customer build definition, in order to be able to restore packages from the main feed ?
EDIT: i tryed to use a specific nuget.config with either the apiKey (with the same api key that is locally set on my dev machine) or the packageSourceCredentials tag. None of the 2 let the build agent restore the packages.
EDIT: build agent screenshot (COETools.Testing comes from custom feed on another subscription)
EDIT: nuget.config
EDIT: I changed the build task to use the default agent supplied nuget.exe (i was previously using one in source control) and i managed to have the packages from nuget official feed to be restored. But i'm still unable to have the one from custom feed to restore.
OK, i had it to work, but i don't like the way i did it because i had to use my personal access token in the packageSourceCredentials tag.
Here is the nuget.config i used:
A better way to do it would be to use the API key (as the one that is generated in the dev local machine nuget.config instead of the personal access token.

Resources