I need to restrict access to the Key Vault at the time it is created. I am creating through the Fluent sdk, where I can create the KeyVault and define Tags and Resource Group.
Note: with powershell I can perform the operation using the command: Add-AzKeyVaultNetworkRule but using Fluent I cannot
here how i create the KeyVault:
var azureClient = await GetAzureClientWithSubscription();
var rVault = await azureClient.Vaults
.Define(kvName)
.WithRegion(Region.BrazilSouth)
.WithExistingResourceGroup(kvRG)
.DefineAccessPolicy()
.ForObjectId(_settings.ObjectId)
.AllowSecretPermissions(SecretPermissions.Get)
.AllowSecretPermissions(SecretPermissions.List)
.AllowSecretPermissions(SecretPermissions.Set)
.Attach()
.WithTags(tags)
.CreateAsync();