使用Azure CLI创建具有相同标识符URI的多个应用程序注册 [英] Use Azure CLI to create multiple app registrations with the same identifier URIs

查看:74
本文介绍了使用Azure CLI创建具有相同标识符URI的多个应用程序注册的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在编写一个包含az ad app create命令的脚本。我希望能够多次运行该脚本,以便每次创建具有相同URI的应用程序注册,但使用不同的显示名称和pwd。 

b $ b az ad app create --display-name< unique_name> --identifier-uris< same_uri> --password< unique_pwd>



$
我可以从Portal执行此操作,但是当我尝试使用azure执行此操作时cli我收到此消息:"另一个具有相同值的属性identifyiresUris已经存在。"如何绕过此错误,以便它仍然创建单独的
应用程序注册。 (我的脚本中的下两个命令是az ad sp create,然后是az角色分配创建,这样我就可以将每个应用程序注册到服务主体中,然后使其成为特定资源组中的Contributor。)



我有办法在azure cli中实现这一目标吗?这对我的工作流程至关重要。



谢谢!

Hi,

I am writing a script that includes the az ad app create command. I want to be able to run the script multiple times such that each time it creates an app registration with the same URI, but with a different display-name and pwd. 

az ad app create --display-name <unique_name> --identifier-uris <same_uri> --password <unique_pwd>


I am able to do this from the Portal, but when I try to do this using azure cli I get this message: "Another object with the same value for property identifiresUris already exists." How do I bypass this error so that it still create the individual app registrations. (The next two commands in my script are az ad sp create and then az role assignment create so that I can make each app registration into a service principal and then make it a Contributor in a specific resource group.)

Is there a way for me to achieve this in azure cli? It is essential to my workflow.

Thank you!

推荐答案

不,你不能使用相同的标识符URI创建应用程序。 此命令中的标识符URI与Azure门户网站上的应用程序属性中的AppID URI相同,因此您将收到此错误,因为它必须是唯一的。我相信当你从门户网站创建应用程序时,你会将回复网址传递给不同的应用程序。 命令'az ad app create'有一个可选参数'--reply-urls',您可以在脚本中使用它们来实现相同的目标。 
请参阅  az ad app   documentation。

No, you cannot create application with same identifier URI.  Identifier URI in this command is same as the AppID URI in the application properties on the Azure portal and thus you are getting this error as it needs to be unique. I believe when you are creating the application from the portal you are passing the reply URL as same for your different applications.  The command 'az ad app create' has an optional parameters '--reply-urls' available which you can use in your script to achieve the same.  Please refer to az ad app documentation.


这篇关于使用Azure CLI创建具有相同标识符URI的多个应用程序注册的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆