Azure / azure-quickstart-templates

Azure Quickstart Templates
https://aka.ms/azqst
MIT License
13.86k stars 16.03k forks source link

Deploy to Azure button disregards Azure Portal last visited directory #8680

Open ForrestTrepte opened 3 years ago

ForrestTrepte commented 3 years ago

101-AAD-DomainServices (But I suspect this is a general issue that would happen with any template.)

Issue Details

I was signed into the Azure portal, showing the set of subscriptions that I use all the time. When I clicked the Deploy to Azure button, the link opened with a different set of subscriptions that I didn't recognize.

I think this was caused because the Azure portal has a setting for Sign in to your last visited directory, but the Deploy button works differently and uses the default directory. Now that I understand this, I think I know how to work around the issue and deploy to my intended subscription via Switch directory in my account. I'm reporting this as an issue in case there are other users like me who have this configuration issue. Someone might not even be aware that they have multiple directories and how to switch between them.

Would it be possible to create a link that will follow the same Sign in to your last visited directory behavior as the portal?

Repro steps

It's impractical for me to develop repro steps that create Azure accounts from scratch in a configuration that reproduces this problem. (Please let me know if there's an easy way to do that and I'll try and do so.) So here's what I think the repro steps would be but I'm not sure this will reproduce for someone else.

  1. Sign in to the [Azure Portal[(https://ms.portal.azure.com/#home) using an account that is associated with multiple Azure directories.
  2. Click your login in the upper-right and select Switch directory. Under the Set your default directory, make sure the Sign in to your last visited directory is selected. Click on the directory that isn't your default directory. Notice that now you can close and reopen your browser and you can use the Azure Portal to work with the set of subscriptions in that non-default directory.
  3. Go to 101-AAD-DomainServices and click the Deploy to Azure button.

result: Under deployment scope, the Subscription dropdown lists the subscriptions associated with the default directory.

expected: Under deployment scope, the Subscription dropdown lists the subscriptions associated with the non-default directory that I was previously using in the portal. The Azure Portal is set to sign in to the last visited directory, so it would be expected that the Deploy button would work in the same way.

Please let me know if additional info is needed in order to understand this issue. Thanks!

ForrestTrepte commented 3 years ago

I have also posted this as Azure feedback: https://feedback.azure.com/forums/281804-azure-resource-manager/suggestions/42538306-deploy-to-azure-button-should-obey-azure-portal-la