Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions cli/azd/cmd/config_options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down
25 changes: 25 additions & 0 deletions cli/azd/pkg/config/config_options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -41,13 +46,33 @@ 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)
}
}

// Verify expected options are present
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) {
Expand Down
22 changes: 22 additions & 0 deletions cli/azd/resources/config_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,28 @@
description: "Custom template sources for azd template list and azd init."
type: object
example: "template.sources.<name>.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
Expand Down
Loading