I set up a visual studio project template that runs setup scripts to automatically register an application and create application insights for the app. The problem is the app registration uses the AzureAD module while the application insights (and the resource group creation if needed) use the Az modules, so I end up needing to do
Connect-AzAccount
Connect-AzureAD
Which prompts the user for their login twice. Is there a way to use the auth from one to authenticate the other?
I've seen similar questions suggesting using get-credential but since my org has multi factor auth that wont work.
Other suggestions were to use a service principal but I don't want to store anything specific in the template and want the auth tied to the user.
I know the Az module has functionality similar to the AzureAD ( New-AzADApplication
) but there are a few things I can't figure out how to do. Specifically, set the applications permissions to sign in on Microsoft graph and set the application owner to the authenticated user. That is why i'm using the AzureAD module instead
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.