azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

Use az ad app create to creata a SPA

Open alexander-kastil opened this issue 3 years ago • 8 comments

Could you please provide a sample on how to create an app registration of type SPA. When using:

az ad app create --display-name $app-ui --required-resource-accesses @manifest-ui.json
--oauth2-allow-implicit-flow false
--reply-urls $urlUI --query appId -o tsv

the resulting replyUrlsWithType is always

"replyUrlsWithType": [ { "url": "http://localhost:4200", "type": "Web" } ],

instead of

"replyUrlsWithType": [ { "url": "http://localhost:4200", "type": "Spa" } ],

This results in error: Cross-origin token redemption is permitted only for the 'Single-Page Application' client-type.

Can you please comment on how to create other platform types than web. Thank you


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

  • ID: 921aa920-c25f-5227-aabb-49116da38fa7
  • Version Independent ID: 9b5a53ad-edf8-4d89-f8e6-cde01b7866f6
  • Content: az ad app
  • Content Source: latest/docs-ref-autogen/ad/app.yml
  • Service: active-directory
  • GitHub Login: @rloutlaw
  • Microsoft Alias: routlaw

alexander-kastil avatar Mar 01 '22 13:03 alexander-kastil

@jiasli for awareness

yonzhan avatar Mar 01 '22 13:03 yonzhan

Please see https://github.com/Azure/azure-cli/issues/9501#issuecomment-610979930 for a the Microsoft Graph approach.

Meanwhile, we will publish the first beta version using Microsoft Graph shortly at https://docs.microsoft.com/cli/azure/microsoft-graph-migration. You are very welcome to test it and give us your feedback. 😉

jiasli avatar Mar 04 '22 02:03 jiasli

@jiasli thanks that helped ... I actually found this post before but did not take the time to try it out because there were so many posts to try ... I think for less experienced users it would be great to have some kind of application type switch in the azure cli

alexander-kastil avatar Mar 07 '22 08:03 alexander-kastil

Why is this closed

It's not resolved or fixed, there's still no way to create a SPA app using the CLI without some frankly pretty nasty workarounds

benc-uk avatar Apr 10 '23 16:04 benc-uk

@benc-uk I closed it because for a long time it seemed that nobody else cared

alexander-kastil avatar Apr 10 '23 17:04 alexander-kastil

Apologies I thought it had been closed by one of the Azure CLI team

benc-uk avatar Apr 11 '23 13:04 benc-uk

Are there any updates to that? Seems strange that there are only options for creating web or public client app registrations but not for SPAs

MatthiasThurnbauer avatar Jun 20 '24 13:06 MatthiasThurnbauer

@benc-uk is this on the roadmap somewhere? Its very annoying we can't totally script our application because of this missing feature.

Expecho avatar Jul 02 '24 06:07 Expecho

@benc-uk is this on the roadmap somewhere? Its very annoying we can't totally script our application because of this missing feature.

I work for Microsoft but I'm not part of the Azure CLI team But I think it's insane this hasn't been addressed in two years, it's not like deploying a SPA to Azure is a crazy new thing anymore

benc-uk avatar Jul 02 '24 14:07 benc-uk