Skip to content

Commit

Permalink
Move to Resource Graph API instead of Resource API
Browse files Browse the repository at this point in the history
  • Loading branch information
sinbai committed Oct 13, 2021
1 parent 59b3ed7 commit 62e57eb
Show file tree
Hide file tree
Showing 33 changed files with 943 additions and 96 deletions.
3 changes: 3 additions & 0 deletions internal/clients/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ import (
redisenterprise "github.com/hashicorp/terraform-provider-azurerm/internal/services/redisenterprise/client"
relay "github.com/hashicorp/terraform-provider-azurerm/internal/services/relay/client"
resource "github.com/hashicorp/terraform-provider-azurerm/internal/services/resource/client"
resourceGraph "github.com/hashicorp/terraform-provider-azurerm/internal/services/resourcegraph/client"
search "github.com/hashicorp/terraform-provider-azurerm/internal/services/search/client"
securityCenter "github.com/hashicorp/terraform-provider-azurerm/internal/services/securitycenter/client"
sentinel "github.com/hashicorp/terraform-provider-azurerm/internal/services/sentinel/client"
Expand Down Expand Up @@ -190,6 +191,7 @@ type Client struct {
RedisEnterprise *redisenterprise.Client
Relay *relay.Client
Resource *resource.Client
ResourceGraph *resourceGraph.Client
Search *search.Client
SecurityCenter *securityCenter.Client
Sentinel *sentinel.Client
Expand Down Expand Up @@ -297,6 +299,7 @@ func (client *Client) Build(ctx context.Context, o *common.ClientOptions) error
client.RedisEnterprise = redisenterprise.NewClient(o)
client.Relay = relay.NewClient(o)
client.Resource = resource.NewClient(o)
client.ResourceGraph = resourceGraph.NewClient(o)
client.Search = search.NewClient(o)
client.SecurityCenter = securityCenter.NewClient(o)
client.Sentinel = sentinel.NewClient(o)
Expand Down
10 changes: 5 additions & 5 deletions internal/services/compute/disk_encryption_set_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/client"
keyVaultParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/parse"
keyVaultValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/validate"
resourcesClient "github.com/hashicorp/terraform-provider-azurerm/internal/services/resource/client"
resourcesGraphClient "github.com/hashicorp/terraform-provider-azurerm/internal/services/resourcegraph/client"
"github.com/hashicorp/terraform-provider-azurerm/internal/tags"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation"
Expand Down Expand Up @@ -96,7 +96,7 @@ func resourceDiskEncryptionSet() *pluginsdk.Resource {
func resourceDiskEncryptionSetCreate(d *pluginsdk.ResourceData, meta interface{}) error {
client := meta.(*clients.Client).Compute.DiskEncryptionSetsClient
keyVaultsClient := meta.(*clients.Client).KeyVault
resourcesClient := meta.(*clients.Client).Resource
resourcesClient := meta.(*clients.Client).ResourceGraph
ctx, cancel := timeouts.ForCreate(meta.(*clients.Client).StopContext, d)
defer cancel()

Expand Down Expand Up @@ -207,7 +207,7 @@ func resourceDiskEncryptionSetRead(d *pluginsdk.ResourceData, meta interface{})
func resourceDiskEncryptionSetUpdate(d *pluginsdk.ResourceData, meta interface{}) error {
client := meta.(*clients.Client).Compute.DiskEncryptionSetsClient
keyVaultsClient := meta.(*clients.Client).KeyVault
resourcesClient := meta.(*clients.Client).Resource
resourcesGraphClient := meta.(*clients.Client).ResourceGraph
ctx, cancel := timeouts.ForUpdate(meta.(*clients.Client).StopContext, d)
defer cancel()

Expand All @@ -223,7 +223,7 @@ func resourceDiskEncryptionSetUpdate(d *pluginsdk.ResourceData, meta interface{}

if d.HasChange("key_vault_key_id") {
keyVaultKeyId := d.Get("key_vault_key_id").(string)
keyVaultDetails, err := diskEncryptionSetRetrieveKeyVault(ctx, keyVaultsClient, resourcesClient, keyVaultKeyId)
keyVaultDetails, err := diskEncryptionSetRetrieveKeyVault(ctx, keyVaultsClient, resourcesGraphClient, keyVaultKeyId)
if err != nil {
return fmt.Errorf("validating Key Vault Key %q for Disk Encryption Set: %+v", keyVaultKeyId, err)
}
Expand Down Expand Up @@ -315,7 +315,7 @@ type diskEncryptionSetKeyVault struct {
softDeleteEnabled bool
}

func diskEncryptionSetRetrieveKeyVault(ctx context.Context, keyVaultsClient *client.Client, resourcesClient *resourcesClient.Client, id string) (*diskEncryptionSetKeyVault, error) {
func diskEncryptionSetRetrieveKeyVault(ctx context.Context, keyVaultsClient *client.Client, resourcesClient *resourcesGraphClient.Client, id string) (*diskEncryptionSetKeyVault, error) {
keyVaultKeyId, err := keyVaultParse.ParseNestedItemID(id)
if err != nil {
return nil, err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func DatabricksWorkspaceCustomerManagedKeyCreateUpdate(d *pluginsdk.ResourceData
}

// make sure the key vault exists
keyVaultIdRaw, err := keyVaultsClient.KeyVaultIDFromBaseUrl(ctx, meta.(*clients.Client).Resource, key.KeyVaultBaseUrl)
keyVaultIdRaw, err := keyVaultsClient.KeyVaultIDFromBaseUrl(ctx, meta.(*clients.Client).ResourceGraph, key.KeyVaultBaseUrl)
if err != nil || keyVaultIdRaw == nil {
return fmt.Errorf("retrieving the Resource ID for the Key Vault at URL %q: %+v", key.KeyVaultBaseUrl, err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ func resourceDatabricksWorkspaceCreateUpdate(d *pluginsdk.ResourceData, meta int
}

// make sure the key vault exists
keyVaultIdRaw, err := keyVaultsClient.KeyVaultIDFromBaseUrl(ctx, meta.(*clients.Client).Resource, key.KeyVaultBaseUrl)
keyVaultIdRaw, err := keyVaultsClient.KeyVaultIDFromBaseUrl(ctx, meta.(*clients.Client).ResourceGraph, key.KeyVaultBaseUrl)
if err != nil || keyVaultIdRaw == nil {
return fmt.Errorf("retrieving the Resource ID for the customer-managed keys for managed services Key Vault at URL %q: %+v", key.KeyVaultBaseUrl, err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func resourceDataFactoryLinkedServiceKeyVaultCreateUpdate(d *pluginsdk.ResourceD
func resourceDataFactoryLinkedServiceKeyVaultRead(d *pluginsdk.ResourceData, meta interface{}) error {
client := meta.(*clients.Client).DataFactory.LinkedServiceClient
keyVaultsClient := meta.(*clients.Client).KeyVault
resourcesClient := meta.(*clients.Client).Resource
resourcesGraphClient := meta.(*clients.Client).ResourceGraph
ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d)
defer cancel()

Expand Down Expand Up @@ -237,7 +237,7 @@ func resourceDataFactoryLinkedServiceKeyVaultRead(d *pluginsdk.ResourceData, met

var keyVaultId *string
if baseUrl != "" {
keyVaultId, err = keyVaultsClient.KeyVaultIDFromBaseUrl(ctx, resourcesClient, baseUrl)
keyVaultId, err = keyVaultsClient.KeyVaultIDFromBaseUrl(ctx, resourcesGraphClient, baseUrl)
if err != nil {
return err
}
Expand Down
67 changes: 34 additions & 33 deletions internal/services/keyvault/client/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import (
"context"
"fmt"
"net/url"
"reflect"
"strings"
"sync"

"github.com/Azure/azure-sdk-for-go/services/resourcegraph/mgmt/2021-03-01/resourcegraph"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/parse"
resourcesClient "github.com/hashicorp/terraform-provider-azurerm/internal/services/resource/client"
resourcesGraphClient "github.com/hashicorp/terraform-provider-azurerm/internal/services/resourcegraph/client"
"github.com/hashicorp/terraform-provider-azurerm/utils"
)

Expand Down Expand Up @@ -93,7 +95,7 @@ func (c *Client) Exists(ctx context.Context, keyVaultId parse.VaultId) (bool, er
return true, nil
}

func (c *Client) KeyVaultIDFromBaseUrl(ctx context.Context, resourcesClient *resourcesClient.Client, keyVaultBaseUrl string) (*string, error) {
func (c *Client) KeyVaultIDFromBaseUrl(ctx context.Context, resourcesGraphClient *resourcesGraphClient.Client, keyVaultBaseUrl string) (*string, error) {
keyVaultName, err := c.parseNameFromBaseUrl(keyVaultBaseUrl)
if err != nil {
return nil, err
Expand All @@ -112,40 +114,39 @@ func (c *Client) KeyVaultIDFromBaseUrl(ctx context.Context, resourcesClient *res
return &v.keyVaultId, nil
}

filter := fmt.Sprintf("resourceType eq 'Microsoft.KeyVault/vaults' and name eq '%s'", *keyVaultName)
result, err := resourcesClient.ResourcesClient.List(ctx, filter, "", utils.Int32(5))
if err != nil {
return nil, fmt.Errorf("listing resources matching %q: %+v", filter, err)
query := fmt.Sprintf("resources | where type =~ 'Microsoft.KeyVault/vaults' and name =~ '%s'", *keyVaultName)
request := resourcegraph.QueryRequest{
Subscriptions: &[]string{c.VaultsClient.SubscriptionID},
Query: &query,
Options: &resourcegraph.QueryRequestOptions{
ResultFormat: resourcegraph.ResultFormatObjectArray,
},
}

for result.NotDone() {
for _, v := range result.Values() {
if v.ID == nil {
continue
}

id, err := parse.VaultID(*v.ID)
if err != nil {
return nil, fmt.Errorf("parsing %q: %+v", *v.ID, err)
}
if !strings.EqualFold(id.Name, *keyVaultName) {
continue
}

props, err := c.VaultsClient.Get(ctx, id.ResourceGroup, id.Name)
if err != nil {
return nil, fmt.Errorf("retrieving %s: %+v", *id, err)
}
if props.Properties == nil || props.Properties.VaultURI == nil {
return nil, fmt.Errorf("retrieving %s: `properties.VaultUri` was nil", *id)
results, err := resourcesGraphClient.ResourceClient.Resources(context.Background(), request)
if err != nil {
return nil, fmt.Errorf("listing resources matching %q: %+v", query, err)
}

if results.Data != nil && reflect.TypeOf(results.Data).Kind() == reflect.Slice {
if d := results.Data.([]interface{}); len(d) > 0 && reflect.TypeOf(d[0]).Kind() == reflect.Map {
if v, ok := d[0].(map[string]interface{})["id"]; ok {
id, err := parse.VaultID(v.(string))
if err != nil {
return nil, fmt.Errorf("parsing %q: %+v", d, err)
}

props, err := c.VaultsClient.Get(ctx, id.ResourceGroup, id.Name)
if err != nil {
return nil, fmt.Errorf("retrieving %s: %+v", *id, err)
}
if props.Properties == nil || props.Properties.VaultURI == nil {
return nil, fmt.Errorf("retrieving %s: `properties.VaultUri` was nil", *id)
}

c.AddToCache(*id, *props.Properties.VaultURI)
return utils.String(id.ID()), nil
}

c.AddToCache(*id, *props.Properties.VaultURI)
return utils.String(id.ID()), nil
}

if err := result.NextWithContext(ctx); err != nil {
return nil, fmt.Errorf("iterating over results: %+v", err)
}
}

Expand Down
4 changes: 2 additions & 2 deletions internal/services/keyvault/internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,13 @@ func keyVaultChildItemRefreshFunc(secretUri string) pluginsdk.StateRefreshFunc {

func nestedItemResourceImporter(ctx context.Context, d *pluginsdk.ResourceData, meta interface{}) ([]*pluginsdk.ResourceData, error) {
keyVaultsClient := meta.(*clients.Client).KeyVault
resourcesClient := meta.(*clients.Client).Resource
resourcesGraphClient := meta.(*clients.Client).ResourceGraph
id, err := parse.ParseNestedItemID(d.Id())
if err != nil {
return []*pluginsdk.ResourceData{d}, fmt.Errorf("parsing ID %q for Key Vault Child import: %v", d.Id(), err)
}

keyVaultId, err := keyVaultsClient.KeyVaultIDFromBaseUrl(ctx, resourcesClient, id.KeyVaultBaseUrl)
keyVaultId, err := keyVaultsClient.KeyVaultIDFromBaseUrl(ctx, resourcesGraphClient, id.KeyVaultBaseUrl)
if err != nil {
return []*pluginsdk.ResourceData{d}, fmt.Errorf("retrieving the Resource ID the Key Vault at URL %q: %s", id.KeyVaultBaseUrl, err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func resourceKeyVaultCertificateIssuerCreateOrUpdate(d *pluginsdk.ResourceData,
func resourceKeyVaultCertificateIssuerRead(d *pluginsdk.ResourceData, meta interface{}) error {
client := meta.(*clients.Client).KeyVault.ManagementClient
keyVaultsClient := meta.(*clients.Client).KeyVault
resourcesClient := meta.(*clients.Client).Resource
resourcesGraphClient := meta.(*clients.Client).ResourceGraph
ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d)
defer cancel()

Expand All @@ -188,7 +188,7 @@ func resourceKeyVaultCertificateIssuerRead(d *pluginsdk.ResourceData, meta inter
return err
}

keyVaultIdRaw, err := keyVaultsClient.KeyVaultIDFromBaseUrl(ctx, resourcesClient, id.KeyVaultBaseUrl)
keyVaultIdRaw, err := keyVaultsClient.KeyVaultIDFromBaseUrl(ctx, resourcesGraphClient, id.KeyVaultBaseUrl)
if err != nil {
return fmt.Errorf("retrieving the Resource ID the Key Vault at URL %q: %s", id.KeyVaultBaseUrl, err)
}
Expand Down Expand Up @@ -247,7 +247,7 @@ func resourceKeyVaultCertificateIssuerRead(d *pluginsdk.ResourceData, meta inter
func resourceKeyVaultCertificateIssuerDelete(d *pluginsdk.ResourceData, meta interface{}) error {
client := meta.(*clients.Client).KeyVault.ManagementClient
keyVaultsClient := meta.(*clients.Client).KeyVault
resourcesClient := meta.(*clients.Client).Resource
resourcesGraphClient := meta.(*clients.Client).ResourceGraph
ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d)
defer cancel()

Expand All @@ -257,7 +257,7 @@ func resourceKeyVaultCertificateIssuerDelete(d *pluginsdk.ResourceData, meta int
}

// we verify it exists
keyVaultIdRaw, err := keyVaultsClient.KeyVaultIDFromBaseUrl(ctx, resourcesClient, id.KeyVaultBaseUrl)
keyVaultIdRaw, err := keyVaultsClient.KeyVaultIDFromBaseUrl(ctx, resourcesGraphClient, id.KeyVaultBaseUrl)
if err != nil {
return fmt.Errorf("retrieving the Resource ID the Key Vault at URL %q: %s", id.KeyVaultBaseUrl, err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func (r KeyVaultCertificateIssuerResource) Exists(ctx context.Context, clients *
return nil, err
}

keyVaultIdRaw, err := keyVaultsClient.KeyVaultIDFromBaseUrl(ctx, clients.Resource, id.KeyVaultBaseUrl)
keyVaultIdRaw, err := keyVaultsClient.KeyVaultIDFromBaseUrl(ctx, clients.ResourceGraph, id.KeyVaultBaseUrl)
if err != nil || keyVaultIdRaw == nil {
return nil, fmt.Errorf("retrieving the Resource ID the Key Vault at URL %q: %s", id.KeyVaultBaseUrl, err)
}
Expand Down
8 changes: 4 additions & 4 deletions internal/services/keyvault/key_vault_certificate_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ func keyVaultCertificateCreationRefreshFunc(ctx context.Context, client *keyvaul
func resourceKeyVaultCertificateRead(d *pluginsdk.ResourceData, meta interface{}) error {
keyVaultsClient := meta.(*clients.Client).KeyVault
client := meta.(*clients.Client).KeyVault.ManagementClient
resourcesClient := meta.(*clients.Client).Resource
resourcesGraphClient := meta.(*clients.Client).ResourceGraph
ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d)
defer cancel()

Expand All @@ -537,7 +537,7 @@ func resourceKeyVaultCertificateRead(d *pluginsdk.ResourceData, meta interface{}
return err
}

keyVaultIdRaw, err := keyVaultsClient.KeyVaultIDFromBaseUrl(ctx, resourcesClient, id.KeyVaultBaseUrl)
keyVaultIdRaw, err := keyVaultsClient.KeyVaultIDFromBaseUrl(ctx, resourcesGraphClient, id.KeyVaultBaseUrl)
if err != nil {
return fmt.Errorf("retrieving the Resource ID the Key Vault at URL %q: %s", id.KeyVaultBaseUrl, err)
}
Expand Down Expand Up @@ -617,7 +617,7 @@ func resourceKeyVaultCertificateRead(d *pluginsdk.ResourceData, meta interface{}
func resourceKeyVaultCertificateDelete(d *pluginsdk.ResourceData, meta interface{}) error {
keyVaultsClient := meta.(*clients.Client).KeyVault
client := meta.(*clients.Client).KeyVault.ManagementClient
resourcesClient := meta.(*clients.Client).Resource
resourcesGraphClient := meta.(*clients.Client).ResourceGraph
ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d)
defer cancel()

Expand All @@ -626,7 +626,7 @@ func resourceKeyVaultCertificateDelete(d *pluginsdk.ResourceData, meta interface
return err
}

keyVaultIdRaw, err := keyVaultsClient.KeyVaultIDFromBaseUrl(ctx, resourcesClient, id.KeyVaultBaseUrl)
keyVaultIdRaw, err := keyVaultsClient.KeyVaultIDFromBaseUrl(ctx, resourcesGraphClient, id.KeyVaultBaseUrl)
if err != nil {
return fmt.Errorf("retrieving the Resource ID the Key Vault at URL %q: %s", id.KeyVaultBaseUrl, err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ func (t KeyVaultCertificateResource) Exists(ctx context.Context, clients *client
return nil, err
}

keyVaultIdRaw, err := keyVaultsClient.KeyVaultIDFromBaseUrl(ctx, clients.Resource, id.KeyVaultBaseUrl)
keyVaultIdRaw, err := keyVaultsClient.KeyVaultIDFromBaseUrl(ctx, clients.ResourceGraph, id.KeyVaultBaseUrl)
if err != nil || keyVaultIdRaw == nil {
return nil, fmt.Errorf("retrieving the Resource ID the Key Vault at URL %q: %s", id.KeyVaultBaseUrl, err)
}
Expand Down
12 changes: 6 additions & 6 deletions internal/services/keyvault/key_vault_key_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ func resourceKeyVaultKeyCreate(d *pluginsdk.ResourceData, meta interface{}) erro
func resourceKeyVaultKeyUpdate(d *pluginsdk.ResourceData, meta interface{}) error {
keyVaultsClient := meta.(*clients.Client).KeyVault
client := meta.(*clients.Client).KeyVault.ManagementClient
resourcesClient := meta.(*clients.Client).Resource
resourcesGraphClient := meta.(*clients.Client).ResourceGraph
ctx, cancel := timeouts.ForUpdate(meta.(*clients.Client).StopContext, d)
defer cancel()

Expand All @@ -282,7 +282,7 @@ func resourceKeyVaultKeyUpdate(d *pluginsdk.ResourceData, meta interface{}) erro
return err
}

keyVaultIdRaw, err := keyVaultsClient.KeyVaultIDFromBaseUrl(ctx, resourcesClient, id.KeyVaultBaseUrl)
keyVaultIdRaw, err := keyVaultsClient.KeyVaultIDFromBaseUrl(ctx, resourcesGraphClient, id.KeyVaultBaseUrl)
if err != nil {
return fmt.Errorf("retrieving the Resource ID the Key Vault at URL %q: %s", id.KeyVaultBaseUrl, err)
}
Expand Down Expand Up @@ -338,7 +338,7 @@ func resourceKeyVaultKeyUpdate(d *pluginsdk.ResourceData, meta interface{}) erro
func resourceKeyVaultKeyRead(d *pluginsdk.ResourceData, meta interface{}) error {
keyVaultsClient := meta.(*clients.Client).KeyVault
client := meta.(*clients.Client).KeyVault.ManagementClient
resourcesClient := meta.(*clients.Client).Resource
resourcesGraphClient := meta.(*clients.Client).ResourceGraph
ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d)
defer cancel()

Expand All @@ -347,7 +347,7 @@ func resourceKeyVaultKeyRead(d *pluginsdk.ResourceData, meta interface{}) error
return err
}

keyVaultIdRaw, err := keyVaultsClient.KeyVaultIDFromBaseUrl(ctx, resourcesClient, id.KeyVaultBaseUrl)
keyVaultIdRaw, err := keyVaultsClient.KeyVaultIDFromBaseUrl(ctx, resourcesGraphClient, id.KeyVaultBaseUrl)
if err != nil {
return fmt.Errorf("retrieving the Resource ID the Key Vault at URL %q: %s", id.KeyVaultBaseUrl, err)
}
Expand Down Expand Up @@ -427,7 +427,7 @@ func resourceKeyVaultKeyRead(d *pluginsdk.ResourceData, meta interface{}) error
func resourceKeyVaultKeyDelete(d *pluginsdk.ResourceData, meta interface{}) error {
keyVaultsClient := meta.(*clients.Client).KeyVault
client := meta.(*clients.Client).KeyVault.ManagementClient
resourcesClient := meta.(*clients.Client).Resource
resourcesGraphClient := meta.(*clients.Client).ResourceGraph
ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d)
defer cancel()

Expand All @@ -436,7 +436,7 @@ func resourceKeyVaultKeyDelete(d *pluginsdk.ResourceData, meta interface{}) erro
return err
}

keyVaultIdRaw, err := keyVaultsClient.KeyVaultIDFromBaseUrl(ctx, resourcesClient, id.KeyVaultBaseUrl)
keyVaultIdRaw, err := keyVaultsClient.KeyVaultIDFromBaseUrl(ctx, resourcesGraphClient, id.KeyVaultBaseUrl)
if err != nil {
return fmt.Errorf("retrieving the Resource ID the Key Vault at URL %q: %s", id.KeyVaultBaseUrl, err)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/services/keyvault/key_vault_key_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ func (r KeyVaultKeyResource) Exists(ctx context.Context, clients *clients.Client
return nil, err
}

keyVaultIdRaw, err := keyVaultsClient.KeyVaultIDFromBaseUrl(ctx, clients.Resource, id.KeyVaultBaseUrl)
keyVaultIdRaw, err := keyVaultsClient.KeyVaultIDFromBaseUrl(ctx, clients.ResourceGraph, id.KeyVaultBaseUrl)
if err != nil || keyVaultIdRaw == nil {
return nil, fmt.Errorf("retrieving the Resource ID the Key Vault at URL %q: %s", id.KeyVaultBaseUrl, err)
}
Expand Down
Loading

0 comments on commit 62e57eb

Please sign in to comment.