Skip to content

Conversation

@joevanwanzeeleKF
Copy link
Contributor

  • bug fix for error when creating new Azure Keyvaults
  • documentation updates

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a bug that occurred when creating new Azure Keyvaults by making the custom alias required instead of optional, which resolves errors related to invalid certificate names in Azure Keyvault. The changes also include documentation updates to clarify alias naming requirements.

Key Changes:

  • Changed CustomAliasAllowed from "Optional" to "Required" to enforce proper certificate naming in Azure Keyvault
  • Added documentation warning about alias naming restrictions (alphanumeric and hyphens only)
  • Improved null safety in job property parsing to prevent errors when creating new vaults

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
integration-manifest.json Updated CustomAliasAllowed to "Required" to enforce alias usage
docsource/content.md Fixed anchor link reference
docsource/akv.md Updated terminology and added warning about alias naming requirements
README.md Updated terminology, fixed anchor link, updated CustomAliasAllowed documentation, and added alias naming warning
CHANGELOG.md Added version 3.1.11 release notes
AzureKeyVault/Jobs/Management.cs Improved null safety by adding defensive checks for JobProperties before accessing dictionary values
AzureKeyVault/Jobs/AzureKeyVaultJob.cs Changed null check to string.IsNullOrEmpty for better validation
AzureKeyVault/AzureClient.cs Refactored resource group retrieval, added debug logging, and enhanced error handling with specific exception types

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +165 to 172
logger.LogTrace("calling getAsync on resourcegroup...");
await resourceGroup.GetAsync();
logger.LogTrace("completed getAsync on resource group...");

var s = resourceGroup.HasData.ToString();

logger.LogTrace($"resource group has data?: {s}");

Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

This appears to be debug code that should be removed. The variable s is created but never used, and the logging statements around GetAsync() seem excessive for production code. Consider removing lines 165-171 or clarifying if this debug logging is intentional.

Suggested change
logger.LogTrace("calling getAsync on resourcegroup...");
await resourceGroup.GetAsync();
logger.LogTrace("completed getAsync on resource group...");
var s = resourceGroup.HasData.ToString();
logger.LogTrace($"resource group has data?: {s}");

Copilot uses AI. Check for mistakes.
var resourceGroups = subscription.GetResourceGroups();
ResourceGroupResource resourceGroup = await resourceGroups.GetAsync(VaultProperties.ResourceGroupName);
logger.LogTrace("calling getAsync on resourcegroup...");
await resourceGroup.GetAsync();
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

Unnecessary API call: await resourceGroup.GetAsync() is called but its result is not used. The previous line already calls GetAsync() to retrieve the resource group. This redundant call should be removed to avoid unnecessary network overhead.

Suggested change
await resourceGroup.GetAsync();

Copilot uses AI. Check for mistakes.
- 3.1.11
- bug fix for error when creating new Azure Keyvaults
- documentation updates

Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

Inconsistent whitespace: this line uses spaces for indentation while the rest of the file likely uses tabs (based on the CHANGELOG file structure). This should use tabs to be consistent with the formatting of line 5.

Suggested change

Copilot uses AI. Check for mistakes.

> :warning:
> The alias you provide when enrolling a certificate will be used as the certificate name in Azure Keyvault.
> Consequently; [it must _only_ contain alphanumeric characters and hyphens](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules#microsoftkeyvault).
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

Inconsistent punctuation: A semicolon is used here instead of a comma. Change "Consequently;" to "Consequently," for proper grammar.

Suggested change
> Consequently; [it must _only_ contain alphanumeric characters and hyphens](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules#microsoftkeyvault).
> Consequently, [it must _only_ contain alphanumeric characters and hyphens](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules#microsoftkeyvault).

Copilot uses AI. Check for mistakes.

> :warning:
> The alias you provide when enrolling a certificate will be used as the certificate name in Azure Keyvault.
> Consequently; [it must _only_ contain alphanumeric characters and hyphens](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules#microsoftkeyvault).
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

Inconsistent punctuation: A semicolon is used here instead of a comma. Change "Consequently;" to "Consequently," for proper grammar.

Suggested change
> Consequently; [it must _only_ contain alphanumeric characters and hyphens](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules#microsoftkeyvault).
> Consequently, [it must _only_ contain alphanumeric characters and hyphens](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules#microsoftkeyvault).

Copilot uses AI. Check for mistakes.
config.JobProperties.TryGetValue(EntryParameters.TAGS, out object tagsJSONObj);
config.JobProperties.TryGetValue(EntryParameters.PRESERVE_TAGS, out object preserveTagsObj);
tagsJSON = tagsJSONObj == null ? string.Empty : tagsJSONObj.ToString();
preserveTags = preserveTagsObj == null ? false : Boolean.Parse(preserveTagsObj.ToString());
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

The expression 'A ? false : B' can be simplified to '!A && B'.

Suggested change
preserveTags = preserveTagsObj == null ? false : Boolean.Parse(preserveTagsObj.ToString());
preserveTags = preserveTagsObj != null && Boolean.Parse(preserveTagsObj.ToString());

Copilot uses AI. Check for mistakes.
…b#78506

# Conflicts:
#	CHANGELOG.md
#	README.md
@spbsoluble spbsoluble force-pushed the create_vault_bugfix_ab#78506 branch from ddf79c1 to 080ccce Compare November 11, 2025 16:32
@spbsoluble spbsoluble merged commit 578318c into release-3.1 Nov 20, 2025
@spbsoluble spbsoluble deleted the create_vault_bugfix_ab#78506 branch November 20, 2025 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants