简体   繁体   中英

azure cli on windows doesnt work

I installed the cli for azure and i want to login using the azure login -u and the below is the error that im getting :

Unsupported wstrust endpoint version. Current support version is wstrust2005 or wstrust13

C:\Program Files\Microsoft SDKs\Windows Azure\.NET SDK\2012-10>azure login -u <email-address>
info:    Executing command login
Password: ********
- Authenticating...info:    Mon, 09 May 2016 22:30:21 GMT:4f547628-a89c-48b1-999
a-9050a4692bf1 - Authority: VERBOSE: Performing instance discovery: https://logi
n.microsoftonline.com/common
info:    Mon, 09 May 2016 22:30:21 GMT:4f547628-a89c-48b1-999a-9050a4692bf1 - Au
thority: VERBOSE: Performing static instance discovery
info:    Mon, 09 May 2016 22:30:21 GMT:4f547628-a89c-48b1-999a-9050a4692bf1 - Au
thority: VERBOSE: Authority validated via static instance discovery.
info:    Mon, 09 May 2016 22:30:21 GMT:4f547628-a89c-48b1-999a-9050a4692bf1 - To
kenRequest: INFO: Acquiring token with username password
info:    Mon, 09 May 2016 22:30:21 GMT:4f547628-a89c-48b1-999a-9050a4692bf1 - Ca
cheDriver: VERBOSE: finding with query:{"clientId":"4b07795-8ddb-461a-bbee-02f9
e1bf7b4","userId":"<email>"}
info:    Mon, 09 May 2016 22:30:21 GMT:4f547628-a89c-48b1-999a-9050a4692bf1 - Ca
cheDriver: VERBOSE: Looking for potential cache entries:
info:    Mon, 09 May 2016 22:30:21 GMT:4f547628-a89c-48b1-999a-9050a4692bf1 - Ca
cheDriver: VERBOSE: {"_clientId":"4b07795-8ddb-461a-bbee-02f9e1bf7b4","userId"
:"<email>"}
info:    Mon, 09 May 2016 22:30:21 GMT:4f547628-a89c-48b1-999a-9050a4692bf1 - Ca
cheDriver: VERBOSE: Found 0 potential entries.
info:    Mon, 09 May 2016 22:30:21 GMT:4f547628-a89c-48b1-999a-9050a4692bf1 - To
kenRequest: VERBOSE: No appropriate cached token found.
info:    Mon, 09 May 2016 22:30:21 GMT:4f547628-a89c-48b1-999a-9050a4692bf1 - Us
erRealm: VERBOSE: Performing user realm discovery at: https://login.microsoftonl
ine.com/common/UserRealm/<email>?api-version=1.0
|info:    Mon, 09 May 2016 22:30:22 GMT:4f547628-a89c-48b1-999a-9050a4692bf1 - U
serRealm: INFO: User Realm DiscoveryServer returned this correlationId: f547628
-a89c-48b1-999a-9050a4692bf
info:    Mon, 09 May 2016 22:30:22 GMT:4f547628-a89c-48b1-999a-9050a4692bf1 - Us
erRealm: VERBOSE: Discovery response:
{"ver":"1.0","account_type":"Federated","domain_name":"<domain-name>","federati
on_protocol":"WSTrust","federation_metadata_url":"https://adfs365prod.bns/adfs/s
ervices/trust/mex","federation_active_auth_url":"https://adfs365prod.bns/adfs/se
rvices/trust/2005/usernamemixed","cloudinstancename":"login.microsoftonline.com"
}
info:    Mon, 09 May 2016 22:30:22 GMT:4f547628-a89c-48b1-999a-9050a4692bf1 - Us
erRealm: VERBOSE: UserRealm response:
info:    Mon, 09 May 2016 22:30:22 GMT:4f547628-a89c-48b1-999a-9050a4692bf1 - Us
erRealm: VERBOSE:  AccountType:             federated
info:    Mon, 09 May 2016 22:30:22 GMT:4f547628-a89c-48b1-999a-9050a4692bf1 - Us
erRealm: VERBOSE:  FederationProtocol:      wstrust
info:    Mon, 09 May 2016 22:30:22 GMT:4f547628-a89c-48b1-999a-9050a4692bf1 - Us
erRealm: VERBOSE:  FederationMetatdataUrl:  https://adfs365prod.bns/adfs/service
s/trust/mex
info:    Mon, 09 May 2016 22:30:22 GMT:4f547628-a89c-48b1-999a-9050a4692bf1 - Us
erRealm: VERBOSE:  FederationActiveAuthUrl: https://adfs365prod.bns/adfs/service
s/trust/2005/usernamemixed
info:    Mon, 09 May 2016 22:30:22 GMT:4f547628-a89c-48b1-999a-9050a4692bf1 - To
kenRequest: VERBOSE: Acquiring token with username password for federated user
info:    Mon, 09 May 2016 22:30:22 GMT:4f547628-a89c-48b1-999a-9050a4692bf1 - To
kenRequest: VERBOSE: Attempting mex at: https://adfs365prod.bns/adfs/services/tr
ust/mex
info:    Mon, 09 May 2016 22:30:22 GMT:4f547628-a89c-48b1-999a-9050a4692bf1 - ME
X: VERBOSE: Mex created with url: https://adfs365prod.bns/adfs/services/trust/me
x
info:    Mon, 09 May 2016 22:30:22 GMT:4f547628-a89c-48b1-999a-9050a4692bf1 - ME
X: VERBOSE: Retrieving mex at: https://adfs365prod.bns/adfs/services/trust/mex
|info:    Mon, 09 May 2016 22:30:24 GMT:4f547628-a89c-48b1-999a-9050a4692bf1 - M
EX: ERROR: Mex Get request failed with
Stack:
Error: getaddrinfo ENOTFOUND adfs365prod.bns adfs365prod.bns:443
    at errnoException (dns.js:26:10)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:77:26)
error:   Error: getaddrinfo ENOTFOUND adfs365prod.bns adfs365prod.bns:443
info:    Mon, 09 May 2016 22:30:24 GMT:4f547628-a89c-48b1-999a-9050a4692bf1 - To
kenRequest: WARNING: MEX exchange failed.  Attempting fallback to AAD supplied e
ndpoint.
info:    Mon, 09 May 2016 22:30:24 GMT:4f547628-a89c-48b1-999a-9050a4692bf1 - WS
TrustRequest: ERROR: Unsupported wstrust endpoint version. Current support versi
on is wstrust2005 or wstrust13.
Stack:
Error: Unsupported wstrust endpoint version. Current support version is wstrust2
005 or wstrust13.
    at Logger.createError (C:\Program Files (x86)\Microsoft SDKs\Azure\CLI\node_
modules\adal-node\lib\log.js:201:13)
    at WSTrustRequest.acquireToken (C:\Program Files (x86)\Microsoft SDKs\Azure\
CLI\node_modules\adal-node\lib\wstrust-request.js:203:25)
    at TokenRequest._performWSTrustExchange (C:\Program Files (x86)\Microsoft SD
Ks\Azure\CLI\node_modules\adal-node\lib\token-request.js:286:11)
    at TokenRequest._performUsernamePasswordForAccessTokenExchange (C:\Program F
iles (x86)\Microsoft SDKs\Azure\CLI\node_modules\adal-node\lib\token-request.js:
311:8)
    at C:\Program Files (x86)\Microsoft SDKs\Azure\CLI\node_modules\adal-node\li
b\token-request.js:371:12
    at Request._callback (C:\Program Files (x86)\Microsoft SDKs\Azure\CLI\node_m
odules\adal-node\lib\util.js:119:7)
    at self.callback (C:\Program Files (x86)\Microsoft SDKs\Azure\CLI\node_modul
es\request\request.js:199:22)
    at emitOne (events.js:77:13)
    at Request.emit (events.js:169:7)
    at Request.onRequestError (C:\Program Files (x86)\Microsoft SDKs\Azure\CLI\n
ode_modules\request\request.js:821:8)
error:   Error: Unsupported wstrust endpoint version. Current support version is
 wstrust2005 or wstrust13.
info:    Mon, 09 May 2016 22:30:24 GMT:4f547628-a89c-48b1-999a-9050a4692bf1 - To
kenRequest: VERBOSE: getTokenFunc returned with err
+
**error:   Unsupported wstrust endpoint version. Current support version is wstrus
t2005 or wstrust13.
info:    Error information has been recorded to C:\Users\minoo\.azure\azure.err
error:   login command failed**

The latest Azure CLI requires interactive login and you can just login with azure login then authenticate with browser.

If you need to login silently for automation scenarios. You could create a service principal in your active directory from the azure portal. Once a service principal is created it can be used for silent login. If you do not have the permission to create a service principal then an admin from your org should be able to create one.

You could refer to Azure Xplat-CLI cannot login due to WS-trust for detailed info. Hope it do help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM