-
Notifications
You must be signed in to change notification settings - Fork 4
Bugfix for error when creating a new Azure Keyvault #71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
5c381cf
615394a
3641e96
89b7265
c8670d2
7ef127b
e5c57c6
32765c0
40dd646
ec08d59
080ccce
f4fc68c
ec5a460
05a0634
5ca0b5d
448ba2f
f2e00c1
60cf657
f463305
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -158,8 +158,17 @@ public virtual async Task<KeyVaultResource> CreateVault() | |||||||||||||||
|
|
||||||||||||||||
| logger.LogTrace($"getting subscription info for provided subscription id {VaultProperties.SubscriptionId}"); | ||||||||||||||||
|
|
||||||||||||||||
| SubscriptionResource subscription = KvManagementClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(VaultProperties.SubscriptionId)); | ||||||||||||||||
| ResourceGroupResource resourceGroup = subscription.GetResourceGroup(VaultProperties.ResourceGroupName); | ||||||||||||||||
| var subscription = KvManagementClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(VaultProperties.SubscriptionId)); | ||||||||||||||||
|
|
||||||||||||||||
| var resourceGroups = subscription.GetResourceGroups(); | ||||||||||||||||
| ResourceGroupResource resourceGroup = await resourceGroups.GetAsync(VaultProperties.ResourceGroupName); | ||||||||||||||||
| 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}"); | ||||||||||||||||
|
|
||||||||||||||||
|
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}"); |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -17,7 +17,6 @@ | |||||
| using Keyfactor.Orchestrators.Extensions.Interfaces; | ||||||
| using System.Collections.Generic; | ||||||
| using Newtonsoft.Json; | ||||||
| using System.Security.AccessControl; | ||||||
|
|
||||||
| namespace Keyfactor.Extensions.Orchestrator.AzureKeyVault | ||||||
| { | ||||||
|
|
@@ -42,15 +41,18 @@ public JobResult ProcessJob(ManagementJobConfiguration config) | |||||
| { | ||||||
| Result = OrchestratorJobStatusJobResult.Failure, | ||||||
| FailureMessage = "Invalid Management Operation" | ||||||
| }; | ||||||
|
|
||||||
| string tagsJSON; | ||||||
| bool preserveTags; | ||||||
| }; | ||||||
|
|
||||||
| logger.LogTrace("parsing entry parameters.. "); | ||||||
|
|
||||||
| tagsJSON = config.JobProperties[EntryParameters.TAGS] as string ?? string.Empty; | ||||||
| preserveTags = config.JobProperties[EntryParameters.PRESERVE_TAGS] as bool? ?? false; | ||||||
| string tagsJSON = string.Empty; | ||||||
| bool preserveTags = false; | ||||||
| if (config.JobProperties != null) | ||||||
| { | ||||||
| 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()); | ||||||
|
||||||
| preserveTags = preserveTagsObj == null ? false : Boolean.Parse(preserveTagsObj.ToString()); | |
| preserveTags = preserveTagsObj != null && Boolean.Parse(preserveTagsObj.ToString()); |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,3 +1,7 @@ | ||||||
| - 3.1.11 | ||||||
| - bug fix for error when creating new Azure Keyvaults | ||||||
| - documentation updates | ||||||
|
|
||||||
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -70,7 +70,7 @@ The high level steps required to configure the Azure Keyvault Orchestrator exten | |||||
|
|
||||||
| 1) [Configure the Azure Keyvault for client access](#configure-the-azure-keyvault-for-client-access) | ||||||
|
|
||||||
| 1) [Create the Store Type in Keyfactor](#create-the-akv-certificate-store-type) | ||||||
| 1) [Create the Store Type in Keyfactor](#akv-certificate-store-type) | ||||||
|
|
||||||
| 1) [Install the Extension on the Orchestrator](#installation) | ||||||
|
|
||||||
|
|
@@ -544,7 +544,7 @@ To use the Azure Key Vault Universal Orchestrator extension, you **must** create | |||||
|
|
||||||
|
|
||||||
| The Azure Keyvault Certificate Store Type is designed to integrate with Microsoft Azure Key Vault, enabling users to | ||||||
| manage and automate the lifecycle of cryptographic certificates stored in Azure Key Vault through Keyfactor Command. | ||||||
| manage and automate the lifecycle of cryptographic certificates stored in Azure Keyvault through Keyfactor Command. | ||||||
| This Certificate Store Type represents the connection and configuration necessary to interact with specific instances of | ||||||
| Azure Key Vault, allowing for operations such as inventory, addition, removal, and discovery of certificates and | ||||||
| certificate stores. | ||||||
|
|
@@ -565,6 +565,11 @@ However, ensuring that the orchestrator has network access to Azure endpoints is | |||||
| mindful of these caveats and limitations will help ensure successful deployment and use of the Azure Keyvault | ||||||
| Certificate Store Type within your organization’s security framework. | ||||||
|
|
||||||
| > :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). | ||||||
|
||||||
| > 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). |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,7 +1,7 @@ | ||||||
| ## Overview | ||||||
|
|
||||||
| The Azure Keyvault Certificate Store Type is designed to integrate with Microsoft Azure Key Vault, enabling users to | ||||||
| manage and automate the lifecycle of cryptographic certificates stored in Azure Key Vault through Keyfactor Command. | ||||||
| manage and automate the lifecycle of cryptographic certificates stored in Azure Keyvault through Keyfactor Command. | ||||||
| This Certificate Store Type represents the connection and configuration necessary to interact with specific instances of | ||||||
| Azure Key Vault, allowing for operations such as inventory, addition, removal, and discovery of certificates and | ||||||
| certificate stores. | ||||||
|
|
@@ -22,3 +22,8 @@ However, ensuring that the orchestrator has network access to Azure endpoints is | |||||
| mindful of these caveats and limitations will help ensure successful deployment and use of the Azure Keyvault | ||||||
| Certificate Store Type within your organization’s security framework. | ||||||
|
|
||||||
| > :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). | ||||||
|
||||||
| > 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). |
There was a problem hiding this comment.
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 callsGetAsync()to retrieve the resource group. This redundant call should be removed to avoid unnecessary network overhead.