diff --git a/cli/azd/cmd/config_options_test.go b/cli/azd/cmd/config_options_test.go index 4444de93df0..87721fad990 100644 --- a/cli/azd/cmd/config_options_test.go +++ b/cli/azd/cmd/config_options_test.go @@ -50,6 +50,11 @@ func TestConfigOptionsAction_JSON(t *testing.T) { // Verify expected options are present foundDefaults := false foundAlpha := false + foundAuthUseAzCliAuth := false + foundPlatformType := false + foundPlatformConfig := false + foundCloudName := false + foundAgentModelType := false for _, opt := range options { if opt.Key == "defaults.subscription" { foundDefaults = true @@ -60,9 +65,29 @@ func TestConfigOptionsAction_JSON(t *testing.T) { require.Contains(t, opt.AllowedValues, "on") require.Contains(t, opt.AllowedValues, "off") } + if opt.Key == "auth.useAzCliAuth" { + foundAuthUseAzCliAuth = true + } + if opt.Key == "platform.type" { + foundPlatformType = true + } + if opt.Key == "platform.config" { + foundPlatformConfig = true + } + if opt.Key == "cloud.name" { + foundCloudName = true + } + if opt.Key == "ai.agent.model.type" { + foundAgentModelType = true + } } require.True(t, foundDefaults, "defaults.subscription should be present") require.True(t, foundAlpha, "alpha.all should be present") + require.True(t, foundAuthUseAzCliAuth, "auth.useAzCliAuth should be present") + require.True(t, foundPlatformType, "platform.type should be present") + require.True(t, foundPlatformConfig, "platform.config should be present") + require.True(t, foundCloudName, "cloud.name should be present") + require.True(t, foundAgentModelType, "ai.agent.model.type should be present") } func TestConfigOptionsAction_Table(t *testing.T) { @@ -95,6 +120,11 @@ func TestConfigOptionsAction_Table(t *testing.T) { require.Contains(t, outputStr, "Description") require.Contains(t, outputStr, "defaults.subscription") require.Contains(t, outputStr, "alpha.all") + require.Contains(t, outputStr, "auth.useAzCliAuth") + require.Contains(t, outputStr, "platform.type") + require.Contains(t, outputStr, "platform.config") + require.Contains(t, outputStr, "cloud.name") + require.Contains(t, outputStr, "ai.agent.model.type") } func TestConfigOptionsAction_DefaultFormat(t *testing.T) { @@ -130,6 +160,11 @@ func TestConfigOptionsAction_DefaultFormat(t *testing.T) { require.Contains(t, outputStr, "Description:") require.Contains(t, outputStr, "Key: alpha.all") require.Contains(t, outputStr, "Allowed Values:") + require.Contains(t, outputStr, "Key: auth.useAzCliAuth") + require.Contains(t, outputStr, "Key: platform.type") + require.Contains(t, outputStr, "Key: platform.config") + require.Contains(t, outputStr, "Key: cloud.name") + require.Contains(t, outputStr, "Key: ai.agent.model.type") } func TestConfigOptionsAction_WithCurrentValues(t *testing.T) { diff --git a/cli/azd/pkg/config/config_options_test.go b/cli/azd/pkg/config/config_options_test.go index eb09650c582..fb633265867 100644 --- a/cli/azd/pkg/config/config_options_test.go +++ b/cli/azd/pkg/config/config_options_test.go @@ -20,6 +20,11 @@ func TestGetAllConfigOptions(t *testing.T) { foundDefaultsSubscription := false foundDefaultsLocation := false foundAlphaAll := false + foundAuthUseAzCliAuth := false + foundPlatformType := false + foundPlatformConfig := false + foundCloudName := false + foundAgentModelType := false for _, option := range options { require.NotEmpty(t, option.Key, "Config option key should not be empty") @@ -41,6 +46,21 @@ func TestGetAllConfigOptions(t *testing.T) { require.Contains(t, option.AllowedValues, "on") require.Contains(t, option.AllowedValues, "off") require.Equal(t, "AZD_ALPHA_ENABLE_ALL", option.EnvVar) + case "auth.useAzCliAuth": + foundAuthUseAzCliAuth = true + require.Equal(t, "string", option.Type) + case "platform.type": + foundPlatformType = true + require.Equal(t, "string", option.Type) + case "platform.config": + foundPlatformConfig = true + require.Equal(t, "object", option.Type) + case "cloud.name": + foundCloudName = true + require.Equal(t, "string", option.Type) + case "ai.agent.model.type": + foundAgentModelType = true + require.Equal(t, "string", option.Type) } } @@ -48,6 +68,11 @@ func TestGetAllConfigOptions(t *testing.T) { require.True(t, foundDefaultsSubscription, "defaults.subscription option should be present") require.True(t, foundDefaultsLocation, "defaults.location option should be present") require.True(t, foundAlphaAll, "alpha.all option should be present") + require.True(t, foundAuthUseAzCliAuth, "auth.useAzCliAuth option should be present") + require.True(t, foundPlatformType, "platform.type option should be present") + require.True(t, foundPlatformConfig, "platform.config option should be present") + require.True(t, foundCloudName, "cloud.name option should be present") + require.True(t, foundAgentModelType, "ai.agent.model.type option should be present") } func TestConfigOptionStructure(t *testing.T) { diff --git a/cli/azd/resources/config_options.yaml b/cli/azd/resources/config_options.yaml index 0bf7b3a2749..b91e5dfc99d 100644 --- a/cli/azd/resources/config_options.yaml +++ b/cli/azd/resources/config_options.yaml @@ -55,6 +55,28 @@ description: "Custom template sources for azd template list and azd init." type: object example: "template.sources..type" +- key: auth.useAzCliAuth + description: "Use Azure CLI authentication instead of azd-managed credentials." + type: string + allowedValues: ["true", "false"] + example: "true" +- key: platform.type + description: "Platform type override for azd." + type: string + example: "devcenter" +- key: platform.config + description: "Platform-specific configuration settings." + type: object + example: "platform.config.name" +- key: cloud.name + description: "Azure cloud name to use for authentication and resource management." + type: string + allowedValues: ["AzureCloud", "AzureChinaCloud", "AzureUSGovernment"] + example: "AzureCloud" +- key: ai.agent.model.type + description: "Default AI agent model provider." + type: string + example: "github-copilot" - key: pipeline.config.applicationServiceManagementReference description: "Application Service Management Reference for Azure pipeline configuration." type: string