Skip to content
Open
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
4 changes: 4 additions & 0 deletions src/Accounts/Accounts.Test/EnvironmentCmdletTestsExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ public static PSAzureEnvironment GetAzureChinaCloudEndpoints()
env.SetProperty("ManagedHsmServiceEndpointSuffix", "managedhsm.azure.cn");
env.SetProperty("MicrosoftGraphEndpointResourceId", "https://microsoftgraph.chinacloudapi.cn/");
env.SetProperty("MicrosoftGraphUrl", "https://microsoftgraph.chinacloudapi.cn");
env.SetProperty("AzureAppConfigurationEndpointSuffix", "azconfig.azure.cn");
env.SetProperty("AzureAppConfigurationEndpointResourceId", "https://azconfig.azure.cn");
env.SetProperty("ContainerRegistryEndpointResourceId", "https://management.chinacloudapi.cn");
return env;
}
Expand Down Expand Up @@ -184,6 +186,8 @@ public static PSAzureEnvironment GetAzureUSGovernmentEndpoints()
env.SetProperty("ManagedHsmServiceEndpointSuffix", "managedhsm.usgovcloudapi.net");
env.SetProperty("MicrosoftGraphEndpointResourceId", "https://graph.microsoft.us/");
env.SetProperty("MicrosoftGraphUrl", "https://graph.microsoft.us");
env.SetProperty("AzureAppConfigurationEndpointSuffix", "azconfig.azure.us");
env.SetProperty("AzureAppConfigurationEndpointResourceId", "https://azconfig.azure.us");
env.SetProperty("ContainerRegistryEndpointResourceId", "https://management.usgovcloudapi.net");
return env;
}
Expand Down
2 changes: 2 additions & 0 deletions src/Accounts/Accounts/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
-->

## Upcoming Release
* Added `AzureAppConfigurationEndpointSuffix` and `AzureAppConfigurationEndpointResourceId` parameters to `Add-AzEnvironment` and `Set-AzEnvironment`
- Users can now configure Azure App Configuration endpoints when adding or updating custom environments

## Version 5.3.4
* Improved SSH certificate authentication for Az SSH cmdlets across all Azure clouds.
Expand Down
12 changes: 12 additions & 0 deletions src/Accounts/Accounts/Environment/AddAzureRMEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,14 @@ public string DataLakeAudience
HelpMessage = "The resource identifier of the Azure Attestation service that is the recipient of the requested token.")]
public string AzureAttestationServiceEndpointResourceId { get; set; }

[Parameter(ParameterSetName = EnvironmentPropertiesParameterSet, Mandatory = false, ValueFromPipelineByPropertyName = true,
HelpMessage = "Dns suffix of Azure App Configuration.")]
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the standard capitalization "DNS" in help text (currently "Dns").

Copilot uses AI. Check for mistakes.
public string AzureAppConfigurationEndpointSuffix { get; set; }

[Parameter(ParameterSetName = EnvironmentPropertiesParameterSet, Mandatory = false, ValueFromPipelineByPropertyName = true,
HelpMessage = "The resource identifier of the Azure App Configuration service that is the recipient of the requested token.")]
public string AzureAppConfigurationEndpointResourceId { get; set; }

[Parameter(ParameterSetName = EnvironmentPropertiesParameterSet, Mandatory = false, ValueFromPipelineByPropertyName = true,
HelpMessage = "Dns suffix of Azure Synapse Analytics.")]
[Parameter(ParameterSetName = MetadataParameterSet, Mandatory = false, ValueFromPipelineByPropertyName = true,
Expand Down Expand Up @@ -387,6 +395,10 @@ public override void ExecuteCmdlet()
nameof(AzureAttestationServiceEndpointSuffix));
SetEndpointIfBound(newEnvironment, AzureEnvironment.ExtendedEndpoint.AzureAttestationServiceEndpointResourceId,
nameof(AzureAttestationServiceEndpointResourceId));
SetEndpointIfBound(newEnvironment, AzureEnvironment.ExtendedEndpoint.AzureAppConfigurationEndpointSuffix,
nameof(AzureAppConfigurationEndpointSuffix));
SetEndpointIfBound(newEnvironment, AzureEnvironment.ExtendedEndpoint.AzureAppConfigurationEndpointResourceId,
nameof(AzureAppConfigurationEndpointResourceId));
Comment on lines +398 to +401
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test coverage: EnvironmentCmdletTests.CanCreateEnvironmentWithAllProperties covers many endpoint parameters but not the new App Configuration suffix/resourceId. Please extend that test to assert these endpoints are persisted when bound, to prevent regressions.

Copilot generated this review using guidance from repository custom instructions.
SetEndpointIfBound(newEnvironment, AzureEnvironment.ExtendedEndpoint.AzureSynapseAnalyticsEndpointSuffix,
nameof(AzureSynapseAnalyticsEndpointSuffix));
SetEndpointIfBound(newEnvironment, AzureEnvironment.ExtendedEndpoint.AzureSynapseAnalyticsEndpointResourceId,
Expand Down
12 changes: 12 additions & 0 deletions src/Accounts/Accounts/Environment/SetAzureRMEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,14 @@ public string DataLakeAudience
HelpMessage = "The resource identifier of the Azure Attestation service that is the recipient of the requested token.")]
public string AzureAttestationServiceEndpointResourceId { get; set; }

[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true,
HelpMessage = "Dns suffix of Azure App Configuration.")]
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the standard capitalization "DNS" in help text (currently "Dns").

Suggested change
HelpMessage = "Dns suffix of Azure App Configuration.")]
HelpMessage = "DNS suffix of Azure App Configuration.")]

Copilot uses AI. Check for mistakes.
public string AzureAppConfigurationEndpointSuffix { get; set; }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't be including endpoint suffix. It's subject to change, and clients should query endpoint off an app configuration resource rather than build endpoints.


[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true,
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue as the suffix parameter: -AzureAppConfigurationEndpointResourceId can be specified with -ARMEndpoint, but the metadata branch doesn’t persist it, so it will be ignored.

Suggested change
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true,
[Parameter(ParameterSetName = EnvironmentPropertiesParameterSet, Mandatory = false, ValueFromPipelineByPropertyName = true,

Copilot uses AI. Check for mistakes.
HelpMessage = "The resource identifier of the Azure App Configuration service that is the recipient of the requested token.")]
Comment on lines +177 to +182
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new parameter can be bound while using the ARMEndpoint parameter set (it isn’t restricted to Name), but the ARMEndpoint branch of ExecuteCmdlet() doesn’t apply it to the environment being created/updated. Either apply it in the metadata branch or restrict it to the Name parameter set to avoid misleading behavior.

Suggested change
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true,
HelpMessage = "Dns suffix of Azure App Configuration.")]
public string AzureAppConfigurationEndpointSuffix { get; set; }
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true,
HelpMessage = "The resource identifier of the Azure App Configuration service that is the recipient of the requested token.")]
[Parameter(ParameterSetName = EnvironmentPropertiesParameterSet, Mandatory = false, ValueFromPipelineByPropertyName = true,
HelpMessage = "Dns suffix of Azure App Configuration.")]
[Parameter(ParameterSetName = MetadataParameterSet, Mandatory = false, ValueFromPipelineByPropertyName = true,
HelpMessage = "Dns suffix of Azure App Configuration.")]
public string AzureAppConfigurationEndpointSuffix { get; set; }
[Parameter(ParameterSetName = EnvironmentPropertiesParameterSet, Mandatory = false, ValueFromPipelineByPropertyName = true,
HelpMessage = "The resource identifier of the Azure App Configuration service that is the recipient of the requested token.")]
[Parameter(ParameterSetName = MetadataParameterSet, Mandatory = false, ValueFromPipelineByPropertyName = true,
HelpMessage = "The resource identifier of the Azure App Configuration service that is the recipient of the requested token.")]

Copilot uses AI. Check for mistakes.
public string AzureAppConfigurationEndpointResourceId { get; set; }

[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true,
HelpMessage = "Dns suffix of Azure Synapse Analytics.")]
public string AzureSynapseAnalyticsEndpointSuffix { get; set; }
Expand Down Expand Up @@ -358,6 +366,10 @@ public override void ExecuteCmdlet()
nameof(AzureAttestationServiceEndpointSuffix));
SetEndpointIfBound(newEnvironment, AzureEnvironment.ExtendedEndpoint.AzureAttestationServiceEndpointResourceId,
nameof(AzureAttestationServiceEndpointResourceId));
SetEndpointIfBound(newEnvironment, AzureEnvironment.ExtendedEndpoint.AzureAppConfigurationEndpointSuffix,
nameof(AzureAppConfigurationEndpointSuffix));
SetEndpointIfBound(newEnvironment, AzureEnvironment.ExtendedEndpoint.AzureAppConfigurationEndpointResourceId,
nameof(AzureAppConfigurationEndpointResourceId));
Comment on lines +369 to +372
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test coverage: there are existing cmdlet tests asserting endpoint parameters are saved for Add/Set-AzEnvironment, but none cover the new App Configuration suffix/resourceId. Add/extend a test to verify these two endpoints are persisted when provided.

Copilot generated this review using guidance from repository custom instructions.
Comment on lines +369 to +372
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cmdlet now supports setting App Configuration endpoints. Add/extend a test to assert that Set-AzEnvironment persists AzureAppConfigurationEndpointSuffix and AzureAppConfigurationEndpointResourceId onto the environment object (similar to existing endpoint-property assertions), so regressions in parameter binding or endpoint key wiring are caught.

Copilot uses AI. Check for mistakes.
SetEndpointIfBound(newEnvironment, AzureEnvironment.ExtendedEndpoint.AzureSynapseAnalyticsEndpointSuffix,
nameof(AzureSynapseAnalyticsEndpointSuffix));
SetEndpointIfBound(newEnvironment, AzureEnvironment.Endpoint.ContainerRegistryEndpointSuffix,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ public PSAzureEnvironment(PSObject other)
AzureAttestationServiceEndpointResourceId =
other.GetProperty<string>(nameof(AzureAttestationServiceEndpointResourceId));
AzureAttestationServiceEndpointSuffix = other.GetProperty<string>(nameof(AzureAttestationServiceEndpointSuffix));
AzureAppConfigurationEndpointResourceId =
other.GetProperty<string>(nameof(AzureAppConfigurationEndpointResourceId));
AzureAppConfigurationEndpointSuffix = other.GetProperty<string>(nameof(AzureAppConfigurationEndpointSuffix));
AzureSynapseAnalyticsEndpointResourceId =
other.GetProperty<string>(nameof(AzureSynapseAnalyticsEndpointResourceId));
AzureSynapseAnalyticsEndpointSuffix = other.GetProperty<string>(nameof(AzureSynapseAnalyticsEndpointSuffix));
Expand Down Expand Up @@ -342,6 +345,36 @@ public string AzureAttestationServiceEndpointResourceId
}
}

/// <summary>
/// The domain name suffix for Azure App Configuration
/// </summary>
public string AzureAppConfigurationEndpointSuffix
{
get
{
return this.GetEndpoint(AzureEnvironment.ExtendedEndpoint.AzureAppConfigurationEndpointSuffix);
}
set
{
this.SetEndpoint(AzureEnvironment.ExtendedEndpoint.AzureAppConfigurationEndpointSuffix, value);
}
}

/// <summary>
/// Gets or sets the resource Id to use for contacting the Azure App Configuration endpoint
/// </summary>
public string AzureAppConfigurationEndpointResourceId
{
get
{
return this.GetEndpoint(AzureEnvironment.ExtendedEndpoint.AzureAppConfigurationEndpointResourceId);
}
set
{
this.SetEndpoint(AzureEnvironment.ExtendedEndpoint.AzureAppConfigurationEndpointResourceId, value);
}
}

/// <summary>
/// The domain name suffix for Azure Synapse Analytics
/// </summary>
Expand Down Expand Up @@ -414,6 +447,8 @@ public override bool Equals(object obj)
&& AzureOperationalInsightsEndpoint == other.AzureOperationalInsightsEndpoint
&& AzureAttestationServiceEndpointResourceId == other.AzureAttestationServiceEndpointResourceId
&& AzureAttestationServiceEndpointSuffix == other.AzureAttestationServiceEndpointSuffix
&& AzureAppConfigurationEndpointResourceId == other.AzureAppConfigurationEndpointResourceId
&& AzureAppConfigurationEndpointSuffix == other.AzureAppConfigurationEndpointSuffix
&& ContainerRegistryEndpointSuffix == other.ContainerRegistryEndpointSuffix;
Comment on lines 448 to 452
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Equals now includes the App Configuration fields, but GetHashCode() still uses base.GetHashCode() (identity-based). This violates the Equals/GetHashCode contract and can break hash-based collections. Update GetHashCode() to hash the same fields used by Equals (or adjust/remove the Equals override).

Copilot uses AI. Check for mistakes.
}

Expand Down
Loading