The New-AzKeyVault cmdlet creates a key vault in the specified resource group. This cmdlet
also grants permissions to the currently logged on user to add, remove, or list keys and secrets in
the key vault.
Note: If you see the error The subscription is not registered to use namespace
'Microsoft.KeyVault' when you try to create your new key vault, run
Register-AzResourceProvider -ProviderNamespace "Microsoft.KeyVault" and then rerun your
New-AzKeyVault command. For more information, see Register-AzResourceProvider.
The cmdlet may call below Microsoft Graph API according to input parameters:
Vault Name : contoso03vault
Resource Group Name : group14
Location : East US
Resource ID : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/group14/providers
/Microsoft.KeyVault/vaults/contoso03vault
Vault URI : https://contoso03vault.vault.azure.net/
Tenant ID : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx
SKU : Standard
Enabled For Deployment? :
Enabled For Template Deployment? :
Enabled For Disk Encryption? :
Soft Delete Enabled? : True
Access Policies :
Tenant ID : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx
Object ID : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx
Application ID :
Display Name : User Name (username@microsoft.com)
Permissions to Keys : all
Permissions to Secrets : all
Permissions to Certificates : all
Permissions to (Key Vault Managed) Storage : all
Network Rule Set :
Default Action : Allow
Bypass : AzureServices
IP Rules :
Virtual Network Rules :
Tags :
This command creates a key vault named Contoso03Vault, in the Azure region East US. The command
adds the key vault to the resource group named Group14. Because the command does not specify a
value for the SKU parameter, it creates a Standard key vault.
Vault Name : contoso03vault
Resource Group Name : group14
Location : East US
Resource ID : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/group14/providers
/Microsoft.KeyVault/vaults/contoso03vault
Vault URI : https://contoso03vault.vault.azure.net/
Tenant ID : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx
SKU : Premium
Enabled For Deployment? : False
Enabled For Template Deployment? : False
Enabled For Disk Encryption? : False
Soft Delete Enabled? :
Access Policies :
Tenant ID : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx
Object ID : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx
Application ID :
Display Name : User Name (username@microsoft.com)
Permissions to Keys : all
Permissions to Secrets : all
Permissions to Certificates : all
Permissions to (Key Vault Managed) Storage : all
Network Rule Set :
Default Action : Allow
Bypass : AzureServices
IP Rules :
Virtual Network Rules :
Tags :
This command creates a key vault, just like the previous example. However, it specifies a value of
Premium for the SKU parameter to create a Premium key vault.
Vault Name : myVault
Resource Group Name : myRg
Location : East US
Resource ID : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/myRg/providers
/Microsoft.KeyVault/vaults/myVault
Vault URI : https://myVault.vault.azure.net/
Tenant ID : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx
SKU : Premium
Enabled For Deployment? : False
Enabled For Template Deployment? : False
Enabled For Disk Encryption? : False
Soft Delete Enabled? :
Access Policies :
Tenant ID : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx
Object ID : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx
Application ID :
Display Name : User Name (username@microsoft.com)
Permissions to Keys : all
Permissions to Secrets : all
Permissions to Certificates : all
Permissions to (Key Vault Managed) Storage : all
Network Rule Set :
Default Action : Allow
Bypass : AzureServices
IP Rules : 110.0.1.0/24
Virtual Network Rules : /subscriptions/0b1f6471-1bf0-4dda-ae
c3-cb9272f09590/resourcegroups/myRg/providers/microsoft.network/virtualnetworks
/myvnet/subnets/frontendsubnet
Tags :
Creating a key vault and specifies network rules to allow access to the specified IP address from the virtual network identified by $myNetworkResId. See New-AzKeyVaultNetworkRuleSetObject for more information.
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
If specified, disables to authorize data actions by Role Based Access Control (RBAC), and then the access policies specified in vault properties will be honored. Note that management actions are always authorized with RBAC.
Enables the Microsoft.Compute resource provider to retrieve secrets from this key vault when this
key vault is referenced in resource creation, for example when creating a virtual machine.
Specifies a name of the key vault to create. The name can be any combination of letters, digits, or hyphens. The name must start and end with a letter or digit. The name must be universally unique.
Specifies the network rule set of the vault. It governs the accessibility of the key vault from specific network locations. Created by New-AzKeyVaultNetworkRuleSetObject.
Specifies whether the vault will accept traffic from public internet. If set to 'disabled' all traffic except private endpoint traffic and that that originates from trusted services will be blocked. This will override the set firewall rules, meaning that even if the firewall rules are present we will not honor the rules. By default, we will enable public network access.
Specifies the SKU of the key vault instance. For information about which features are available for each SKU, see the Azure Key Vault Pricing website (https://go.microsoft.com/fwlink/?linkid=512521).
The ID of the subscription.
By default, cmdlets are executed in the subscription that is set in the current context. If the user specifies another subscription, the current cmdlet is executed in the subscription specified by the user.
Overriding subscriptions only take effect during the lifecycle of the current cmdlet. It does not change the subscription in the context, and does not affect subsequent cmdlets.
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.