Azure DevOps API Add public key

后端 未结 1 1461
时光取名叫无心
时光取名叫无心 2021-01-06 01:39

I would like to be able to add a public key for SSH access to Azure DevOps via the API but I can\'t seem to find a way to do it in the doco. Doing it manually via the UI is

相关标签:
1条回答
  • 2021-01-06 01:56

    The API is not documented, however we can track it with tools... You can add SSH public keys by calling below REST API:

    Write a script to create the SSH keys with the ssh-keygen command for users, please see Use SSH key authentication for details.

    Then call the REST API to add the public keys:

    POST https://{Account}.visualstudio.com/_details/security/keys/Edit
    
    Content-Type: application/json
    
    Request body:
    
    {"Description":"Test1001","__RequestVerificationToken":"","AuthorizationId":"","Data":"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDGZyIoG6eH9nTm/Cu2nVDa7hTNfaMWkwayghFmYTvqCkOwao2YJesGVih1fA3oR4tPsVv4+Vr8wxPCfJCboUrL9NDoH1tAMsIlkQZHqgaJwnGNWnPrnp0r2+wjLQJFPq/pPd8xKwr6QU0BxzZ4RuLDfMFz/MR1cQ2iWWKJuO/TXYrSPtY9XqsmMC8Zo4zJln40PGZt+ecOyQCNHCXsEJ3C+QIUXSqAkb8yknZ4apLf1oqfFRngtV4w84Ua/ZLpNduPZrBcm/mCU5Jq6H37jxhx4kluheJrfpAXbvbQlPTKa2zaOHp7wb3B2E2HvESJmx5ExNuAHoygcq/QGjsRsiUR andy@xxx@ws0068"}
    

    0 讨论(0)
提交回复
热议问题