danhigham / azure-sp-tool

4 stars 4 forks source link

Cannot create SP, err is appId of null #2

Open rjain-pivotal opened 8 years ago

rjain-pivotal commented 8 years ago

I have logged in to the azure cli $azure --version 0.10.5 (node: 6.7.0)

When I try to create service principal, I get the error TypeError: Cannot read property 'appId' of null

Details

$azure-sp-tool create-sp
Creating application...ERROR: Error: We don't have a valid access token. Please run "azure login" again.
/Users/rjain/.nvm/versions/node/v6.7.0/lib/node_modules/azure-sp-tool/index-create-sp.js:143
    clientID: clientId.appId,
                      ^

TypeError: Cannot read property 'appId' of null
    at /Users/rjain/.nvm/versions/node/v6.7.0/lib/node_modules/azure-sp-tool/index-create-sp.js:143:23
    at /Users/rjain/.nvm/versions/node/v6.7.0/lib/node_modules/azure-sp-tool/node_modules/async/dist/async.js:486:20
    at /Users/rjain/.nvm/versions/node/v6.7.0/lib/node_modules/azure-sp-tool/node_modules/async/dist/async.js:5013:37
    at /Users/rjain/.nvm/versions/node/v6.7.0/lib/node_modules/azure-sp-tool/node_modules/async/dist/async.js:339:31
    at /Users/rjain/.nvm/versions/node/v6.7.0/lib/node_modules/azure-sp-tool/node_modules/async/dist/async.js:847:20
    at /Users/rjain/.nvm/versions/node/v6.7.0/lib/node_modules/azure-sp-tool/index-create-sp.js:114:9
    at /Users/rjain/.nvm/versions/node/v6.7.0/lib/node_modules/azure-sp-tool/node_modules/azure-graph/lib/operations/applicationOperations.js:151:14
    at retryCallback (/Users/rjain/.nvm/versions/node/v6.7.0/lib/node_modules/azure-sp-tool/node_modules/ms-rest/lib/filters/exponentialRetryPolicyFilter.js:140:9)
    at handleRedirect (/Users/rjain/.nvm/versions/node/v6.7.0/lib/node_modules/azure-sp-tool/node_modules/ms-rest/lib/filters/redirectFilter.js:36:9)
    at /Users/rjain/.nvm/versions/node/v6.7.0/lib/node_modules/azure-sp-tool/node_modules/ms-rest/lib/filters/signingFilter.js:19:18
cnow7 commented 8 years ago

@rjain-pivotal I was getting the exact same problem. I think we're trying to get a file that looks like this:

screen shot 2016-10-19 at 2 26 45 pm

If this is the case, you should follow the process from this link: https://azure.microsoft.com/en-us/documentation/articles/resource-group-authenticate-service-principal-cli/

cnow7 commented 8 years ago

Never mind my supposed solution. My attempt to deploy Pivotal Cloud Foundry on top of Microsoft Azure still fails because I am unable to create a service principle using the "azure-sp-tool create-sp" command.

cnow7 commented 8 years ago

@rjain-pivotal I was able to get the azure-credentials.json by following this tutorial: http://blog.erds.xyz/technology/install-cloud-foundry-on-azure/.

Basically, I had to install and use Docker to get this done. I have no idea why doing it with Docker ends up doing the trick.