您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

Microsoft.KeyVault vaults/secrets

Template format

To create a Microsoft.KeyVault/vaults/secrets resource, add the following JSON to the resources section of your template.

{
  "name": "string",
  "type": "Microsoft.KeyVault/vaults/secrets",
  "apiVersion": "2019-09-01",
  "tags": {},
  "properties": {
    "value": "string",
    "contentType": "string",
    "attributes": {
      "enabled": "boolean",
      "nbf": "integer",
      "exp": "integer"
    }
  }
}

Property values

The following tables describe the values you need to set in the schema.

Microsoft.KeyVault/vaults/secrets object

Note

In Bicep, type and apiVersion are specified in the first line of the resource declaration. Use the format <type>@<apiVersion>. Don't set those properties in the resource body.

Name Type Required Value
name string Yes Name of the secret
type enum Yes For JSON -secrets
-or-
Microsoft.KeyVault/vaults/secrets

See Set name and type for child resources.
apiVersion enum Yes For JSON - 2019-09-01
tags object No The tags that will be assigned to the secret.
properties object Yes Properties of the secret - SecretProperties object

SecretProperties object

Name Type Required Value
value string No The value of the secret. NOTE: 'value' will never be returned from the service, as APIs using this model are is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets.
contentType string No The content type of the secret.
attributes object No The attributes of the secret. - SecretAttributes object

SecretAttributes object

Name Type Required Value
enabled boolean No Determines whether the object is enabled.
nbf integer No Not before date in seconds since 1970-01-01T00:00:00Z.
exp integer No Expiry date in seconds since 1970-01-01T00:00:00Z.

Quickstart templates

The following quickstart templates deploy this resource type.

Template Description
Create an API Management service with SSL from KeyVault

Deploy to Azure
This template deploys an API Management service configured with User Assigned Identity. It uses this identity to fetch SSL certificate from KeyVault and keeps it updated by checking every 4 hours.
Testing environment for Azure Firewall Premium

Deploy to Azure
This template creates an Azure Firewall Premium and Firewall Policy with premium features such as Intrusion Inspection Detection (IDPS), TLS inspection and Web Category filtering
Continuous Deployment to VM Scale Sets using Spinnaker

Deploy to Azure
This template allows you to install Spinnaker on VM or AKS. Specifically, as for the VM scenario you can deploy and configure a DevOps pipeline from an Aptly repository to a VM Scale Set in Azure.
Create an Azure Key Vault and a secret

Deploy to Azure
This template creates an Azure Key Vault and a secret.
Connect to a Key Vault via private endpoint

Deploy to Azure
This sample shows how to use configure a virtual network and private DNS zone to access Key Vault via private endpoint.
Create a Key Vault and a list of secrets

Deploy to Azure
This template creates a Key Vault and a list of secrets within the key vault as passed along with the parameters
Create an Application Gateway V2 with Key Vault

Deploy to Azure
This template deploys an Application Gateway V2 in a Virtual Network, a user defined identity, Key Vault, a secret (cert data), and access policy on Key Vault and Application Gateway.
Create ssh-keys and store in KeyVault

Deploy to Azure
This template uses the deploymentScript resource to generate ssh keys and stores the private key in keyVault.
SAS 9.4 and Viya Quickstart Template for Azure

Deploy to Azure
The SAS® 9.4 and Viya QuickStart Template for Azure deploy these products on the cloud: SAS® Enterprise BI Server 9.4, SAS® Enterprise Miner 15.1, and SAS® Visual Analytics 8.5 on Linux, and SAS® Visual Data Mining and Machine Learning 8.5 on Linux for Viya. This QuickStart is a reference architecture for users who wants to deploy the combination of SAS® 9.4 and Viya on Azure using cloud-friendly technologies. By deploying the SAS® platform on Azure, you get an integrated environment of SAS® 9.4 and Viya environments so you can take advantage of both worlds. SAS® Viya is a cloud-enabled, in-memory analytics engine. It uses elastic, scalable, and fault-tolerant processing to address complex analytical challenges. SAS® Viya provides faster processing for analytics by using a standardized code base that supports programming in SAS®, Python, R, Java, and Lua. It also supports cloud, on-premises, or hybrid environments and deploys seamlessly to any infrastructure or application ecosystem.