I develop an Azure DevOps extension. Now I want to automate the publishing process. Here the journey begins ... Following the theory here the reality looks different to me.
For me every trial of publish via command line ends in
tfx extension publish --auth-type pat -t
7dblablablablablablablablazq --share-with examplecompany0123
TFS Cross Platform Command Line Interface v0.6.3
Copyright Microsoft Corporation
Checking if this extension is already published
It isn't, create a new extension.
error: Received response 401 (Not Authorized). Check that your personal
access token is correct and hasn't expired.
My first guess on that error message 401 was that I probably have a wrong PAT. A look in my PAT management showed me that everything seems good.
So, now I am confronted like a cow at a five-barred gate. I just don't get the root of the failure. Anyone here who already has left this noob beginner problems behind and reached the next level and can help me?
Ensure your PAT have Account: 'All accessible organizations'.
Related
I am attempting to use an Azure App Service Deploy task in Azure DevOps to deploy a file to an app service in Azure. I have been able to use this release pipeline to deploy to the same app service in the past. Two things have changed: I had to re-make the build machine (which exists in Azure), and the source code moved from Azure DevOps to GitLab.
The error I am running into is:
Error: (3/21/2019 4:34:45 PM) An error occurred when the request was processed on the remote computer.
Error: The server experienced an issue processing the request. Contact the server administrator for more information.
Well, I'm the server admin, and I don't have a clue.
Is there some log file I can look at for more information? Can someone please offer some suggestions?
I'm happy to provide additional information, I'm just not sure what would help at this point.
Thank you Tom Sun for directing me to the system.debug variable. That was very helpful. When I turned on the debugging the release worked, witch really doesn't make sense. I started the build machine after it had automatically shut down the day before, but then I had also rebooted the machine eight or nine times before that.
I removed the debug variable and the release still works.
I have no satisfying answer to how this issue was resolved and I don't know how to get the system in a state to reproduce the error.
An additional finding I have is that the artifact produced by the original build was a corrupt war file. Perhaps that had something to do with it?
I have folders within both Azures VSTS (a TFVC repository) and TFS that I needed to permanently delete. On TFS this was quite easily done using the tf destroy $/<MyProject>/<Folder_To_Delete> command in a command window on the server on which the TFS is running. The web page in learn.microsoft.com that describes the "tf destroy" command (Https:// learn.microsoft.com/en-us/vsts/tfvc/destroy-command-team-foundation-version-control) shows that this command is also available for VSTS however I have been unable to get the command to work within a Developer Command Prompt window running on my local box.
tf destroy $/<MyProject>/<Folder_To_Delete> /collection:https://<MyTeamService>.visualstudio.com/<MyProject> /login:<userid>,<password>
The error I receive back is
TF31002: Unable to connect to this Team Foundation Server:
Team Foundation Server Url:
Possible reasons for failure include:
- The name, port number, or protocol for the Team Foundation Server is incorrect.
- The Team Foundation Server is offline.
- The password has expired or is incorrect.
Technical information (for administrator):
The remote server returned an error: (404) Not Found.
However if I put the URL into a browser my VSTS instance shows up. So the 404 looks to me like azure is blocking outside efforts to permanently delete on VSTS. I have logged onto the Azure portal expecting to find something like the Advanced tools option you would find on Web App Services, But the Team Services / Team Projects has nothing like this. Can someone explain to me how to properly execute the "tf destroy" command on Azure Team Services? Or does Azures VSTS just lack the support to permanently delete individual folders and files?
The tf destroy command requires a collection URL. In VSTS, there is no concept of a collection, only team projects. All team projects are created under the Default Collection.
To use the tf destroy command with VSTS, your collection URL must be in the following format:
https://accountname.visualstudio.com/DefaultCollection
By putting a collection URL of https://accountname.visualstudio.com/Project Name, the command was looking for a collection called Project Name in the VSTS account, which does not exist.
This command works:
Open a Developer Command Prompt in administrator mode and issue the following command and supply your credentials.
tf destroy $/Project Name/Folder To Delete /collection:https://accountname.visualstudio.com/DefaultCollection
To Permanently destroy an item/folder in VSTS is also using Destroy Command (Team Foundation Version Control)
tf destroy [/keephistory] <itemspec1>[;<versionspec>][<itemspec2>...<itemspecN>]
[/stopat:<versionspec>] [/preview] [/startcleanup] [/noprompt] [/silent] [/login:username,[password]] [/collection:TeamProjectCollectionUrl]]
/collection which specifies the team project collection. However, in VSTS you only have one collection. There is no collection name like TFS in the url. And multiple collections under user voice:
Let us create multiple collections on Visual Studio Team Services
https://developercommunity.visualstudio.com/idea/365419/let-us-create-multiple-collections-on-visual-studi.html
So, when you specify /collection for VSTS in tf command line, you just need to enter https://xxx.visualstudio.com
Also pay attention to the /login:<userid>,<password>, you are using the wrong format, it should be /login:userid,[password], add a /preview for test first(When tf destroy runs in the preview mode, the files are not actually destroyed.)
Finally the result will be
When you remove the /preview and perform the really destroy, you will also get a prompt info:
Do you want to destroy $/Scrum/NugetTest/Capture1025.PNG and all of
its children? (Yes/No/All)
Select Yes to delete folder and files in it, All with all of its children.
https://<MyTeamService>.visualstudio.com/<MyProject> is the wrong URL. It should just be https://<MyTeamService>.visualstudio.com/.
The parameter is asking for a project collection, not a team project within the collection.
I'm using visual studio 2012 and tfs to do my development When I try to get the latest files using get command in tf.exe through batch in a logged off state, below error is shown.Where else running the batch manually in logged in state gets the latest file. Could anyone please help me on this regard. Thanks in advance
TF30063: You are not authorized to access
What I have tried:
I have tried to turn on alternate authentication credential also,
tried with correct -login:credentials
Update
You have to use an Active Directory account for on-premise TFS -- you can't directly provide a hotmail account.
According to the error info, you need to specific credentials with the command in the batch script.
Use /login option to specify credentials when running a command
Use the /login option to specify the Team Foundation Server user
account to run a command. This option can be useful when you are
working at the machine of another team member.
For example:
c:\code\SiteApp\Main\SolutionA\Project1>tf get program.cs /login:JuliaI,JuliaPassword
I am trying to get my head around Node.js and using it for building bots. There's a long convoluted reason why I need to do this, the TLDR version is I need it for university.
Anyway, I have found a book online, it's called "Building Bots with Node.js" by Packt publishing. I am working through the book, and I have got to a section where I am supposed to Deploy my app to azure. The book says to do the following, in order:
Create a site with azure site create --git (sitename)
Run git add .
Run git commit -m "TwilioNodeBot first commit
Run git push azure master
Now, steps 1-3 worked fine. But when I get to step 4, I get a Windows pop-up asking me to enter credentials for my site. I have tried everything I can think of, but no matter what I enter I get the following error:
fatal: Authentication failed for 'https://username#sitename.scm.azurewebsites.net/sitename.git/'
Now, the thing is, it says the following in the book:
"After you type these commands, if you've never set up git/FTP deployment credentials for your Azure subscription, you'll also be prompted to create them. You can also enter these credentials on the Azure Portal."
I was never asked to create credentials. I did a bit of web searching and found out how to go into my portal and view my publishing profile, and get the username/password out of there. But when I do enter this information it doesn't work. I even tried resetting my credentials, but this didn't work either.
There's no information in the book about what to do here, and I cannot contact the author as there is no contact info.
Any ideas? What am I supposed to use for my publishing credentials?
OK, I figured it out. I had to open my "config" file in the ".git" folder and update the username at the start of the url.
I'm using Visual Studio 2012 and the publishing feature. I have created a publishing profile that deploys my application to a development server, and it works great when executed from vs2012 on my machine. Here is my problem; on the development server I also have TeamCity installed and I would like to trigger the publishing after a build have completed. So I created a simple build step that looks like this:
Build file path: .\src\Solution.sln
Targets: Rebuild
Command line parameters: /p:DeployOnBuild=true;PublishProfile=Ci
When this step is executing I get the following error:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets(4377, 5): error ERROR_USER_NOT_ADMIN: Web deployment task failed.
(Connected to 'dev.domain.com' using the Web Deployment Agent Service, but could not authorize. Make sure you are an administrator on 'dev.domain.com'.
The Ci profile contains a username and password that works when I run the publishing from Visual Studio on my machine. I have also tried passing in username and password as parameters in the build step, but I get the same result. Do I need to run the TeamCity services under admin accounts to get this working? All suggestions are appreciated.
I have just blogged about this at http://sedodream.com/2013/01/06/CommandLineWebProjectPublishing.aspx.
You are pretty close, hopefully I can close the gap.
You are correct that username and password are specified in the VS publish dialog, but we do not save the password in the .pubxml file. It is currently being saved in the .pubxml.user file, and that file is not used at all for command line scenarios. Because of that you will need to pass in the property. So in your case it should be
msbuild .\src\solution.sln /p:DeployOnBuild=true /p:PublishProfile=ci /p:Password=<insert-password>
If your web server does not have trusted certs you may need to also pass in /p:AllowUntrustedCertificate=true.
One little addition which may not be directly related to your issue, but may be helpful for others which may see this later.
If you are building the .csproj/.vbproj file (and potentially in some scenarios where the .sln file is used) you should pass in the property /p:VisualStudioVersion=11.0. More info on this available at my blog http://sedodream.com/2012/08/19/VisualStudioProjectCompatabilityAndVisualStudioVersion.aspx