-
Notifications
You must be signed in to change notification settings - Fork 268
Closed
Labels
Description
Repro:
cd <empty>azd init-> Pick minimalAZURE_SUBSCRIPTION_ID='<sub>' azd provisionazd env get-values
Expected:
AZURE_SUBSCRIPTION_ID should be saved
Actual:
AZURE_SUBSCRIPTION_ID is not saved
Example:
⋊> ~/r/p/minimal on main ⨯ azd env get-values 10:36:50
AZURE_ENV_NAME="weilim-min-dev-1"
⋊> ~/r/p/minimal on main ⨯ AZURE_SUBSCRIPTION_ID='faa080af-c1d8-40ad-9cce-e1a450ca5b57' azd provision 10:36:51
Provisioning Azure resources (azd provision)
Provisioning Azure resources can take some time
? Please select an Azure location to use: 42. (US) East US 2 (eastus2)
You can view detailed progress in the Azure Portal:
https://portal.azure.com/#blade/HubsExtension/DeploymentDetailsBlade/overview/id/%2Fsubscriptions%2Ffaa080af-c1d8-40ad-9cce-e1a450ca5b57%2Fproviders%2FMicrosoft.Resources%2Fdeployments%2Fweilim-min-dev-1-1686850623
(✓) Done: Resource group: rg-weilim-min-dev-1
SUCCESS: Your application was provisioned in Azure in 39 seconds.
You can view the resources created under the resource group rg-weilim-min-dev-1 in Azure Portal:
https://portal.azure.com/#@/resource/subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourceGroups/rg-weilim-min-dev-1/overview
⋊> ~/r/p/minimal on main ⨯ azd env get-values 10:38:41
AZURE_ENV_NAME="weilim-min-dev-1"
AZURE_LOCATION="eastus2"
This seems to be because in prompter.go, EnsureEnv calls p.env.GetSubscriptionId(), to decide whether to prompt and save the value. The implementation relies of GetSubscriptionId relies on os.Env as a fallback, which skips prompting and saving.