Azure / Azure/azure-quickstart-templates

Deploy to Azure button disregards Azure Portal last visited directory

Open
#8,680 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Bicep
Stars
14.9k
Forks
16.2k
Avg merge
6d 21h
Merged PRs (30d)
6

Description

[101-AAD-DomainServices](https://github.com/Azure/azure-quickstart-templates/tree/master/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](https://github.com/Azure/azure-quickstart-templates/tree/master/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!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the Deploy to Azure button on the 101-AAD-DomainServices template and trace the generated deployment link. Reproduce the behavior with an Azure account associated with multiple directories, using the portal's last-visited-directory setting. Done means the deployment's Subscription list matches the directory most recently used in the Azure Portal.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
cloud
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.