Skip to content

Conversation

@Harsh-Microsoft
Copy link
Contributor

@Harsh-Microsoft Harsh-Microsoft commented Dec 18, 2025

Purpose

The issue was that the user needed to set AZURE_APP_SAMPLE_ENABLED to true by running the azd command themselves. If they didn't set it and selected true when prompted during azd up, the script didn't recognize their choice, which prevented the App Service from being deployed.

The root cause was that the script only checked the .env file for the AZURE_APP_SAMPLE_ENABLED variable. However, when the user selected this option during the prompt, azd saved the value in config.json instead of the .env file. I have updated the script to check config.json as well.

This pull request updates both the PowerShell (auth_init.ps1) and Bash (auth_init.sh) authentication initialization scripts to improve how they determine whether the "app sample" feature is enabled. The scripts now check both an environment variable and a configuration file, giving preference to the environment variable, and handle value normalization to ensure consistent behavior.

Configuration and logic improvements:

  • Both auth_init.ps1 and auth_init.sh now read the appSampleEnabled setting from the .azure/<env>/config.json file, in addition to supporting the AZURE_APP_SAMPLE_ENABLED environment variable. The environment variable takes precedence if set. [1] [2]
  • The scripts normalize the effective value to lowercase and treat any unset, empty, or "false" values as disabling the app sample, ensuring consistent and predictable script behavior. [1] [2]
  • Updated exit messages to reflect the new logic and improve clarity for users. [1] [2]

Does this introduce a breaking change?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

What to Check

Verify that the following are valid

  • ...

Other Information

@Prajwal-Microsoft Prajwal-Microsoft merged commit 6ed2592 into microsoft:main Dec 18, 2025
3 checks passed
@github-actions
Copy link

🎉 This PR is included in version 1.1.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants