title: Azure AD B2C Importing in users
body: <p>I have a requirement to create a B2C directory and use the graph to import members in from an old .NET Membership based app.</p>
  
  <p>So I followed this tutorial <a href="https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-devquickstarts-graph-dotnet" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-devquickstarts-graph-dotnet</a>
  which states I have to create a B2C directory using Powershell.</p>
  
  <p>Steps I have taken</p>
  
  <p>1) Create a new global admin user in the classic management portal
  2) Installed the Powershell modules and followed the tutorial to create the application in this directory by using the global credentials.</p>
  
  <p>If I use the sample app from <a href="https://github.com/AzureADQuickStarts/B2C-GraphAPI-DotNet.git" rel="nofollow noreferrer">https://github.com/AzureADQuickStarts/B2C-GraphAPI-DotNet.git</a>, I can connect to this app and can query it as expected.</p>
  
  <p>Problems</p>
  
  <p>1) I cant see the app anywhere in the Azure (or classic) portal under the tenant? I actually think I have managed to create a few apps using this tutorial but have no idea what tenant they have fallen under as I cant see them!</p>
  
  <p>2) If i try to connect to the same app using the quickstart webapp <a href="https://github.com/AzureADQuickStarts/B2C-WebApp-WebAPI-OpenIDConnect-DotNet" rel="nofollow noreferrer">https://github.com/AzureADQuickStarts/B2C-WebApp-WebAPI-OpenIDConnect-DotNet</a> I get an error on the Microsoft hosted page saying </p>
  
  <blockquote>
    <p>'Sorry, but we're having trouble signing you in. We track these errors
    automatically, but if the problem persists feel free to contact us. In
    the meantime, please try again. Correlation ID:
    XXXXXXXXXXXXXXXXXXXXXXXXX Timestamp: 2017-03-01 17:37:35Z AADB2C90018:
    The client id 'XXXXXXXXXXXXXXXX' specified in the request is not
    registered in tenant '<a href="http://MYTENANTB2C.onmicrosoft.com" rel="nofollow noreferrer">http://MYTENANTB2C.onmicrosoft.com</a> '.'</p>
  </blockquote>
  
  <p>I did also try numerous ways of doing this via powershell on a directory created in the portal but couldnt get anywhere.</p>
  
  <p>Can you outline some more explicit steps on how to achieve this requirement as there seems to be very little info on how to achieve this.</p>
  
  <p>Update...</p>
  
  <p>I actually did create the B2C app in the new portal, and used the same links to create the signup-sign in web app which works perfectly fine. The problem I was having is that I cannot connect to this directory using the Graph quickstart app. </p>
  
  <p>I managed to get some progress. The problem was I was connecting to the wrong Azure Directory (Seems like I have more than 1 'Azure directory' under my name, as I have a Bizspark account and then the AD B2C had to be in a Free Trial subscription so created another 'Azure Directory'. Very confusing).</p>
  
  <p>Once i created the service principal, I can now find it in the classic portal and also via console using Get-MsolServicePrincipal | ft DisplayName, AppPrincipalId –AutoSize so that's progress! However I still cannot see it in the new portal, so therefore how would I setup everything else? (eg the reply url, get access keys, enable webapp/webapi/native etc). For the graph client, I need the Client Secret but im confused whether this should be the one generated in powershell or the Keys you can generate in the new portal (which I cant do as I cant see the app!)</p>
  
  <p>Sorry, real newbie at this!</p>