{
	"id": "46e6f0a2-aed3-4cf9-9ae4-0d4288c9a404",
	"created_at": "2026-04-06T01:29:01.768606Z",
	"updated_at": "2026-04-10T03:22:06.578126Z",
	"deleted_at": null,
	"sha1_hash": "46126ce79eb6ba0660fb164614a834c2e5515289",
	"title": "Quickstart - Set and retrieve a secret from Azure Key Vault",
	"llm_title": "",
	"authors": "",
	"file_creation_date": "0001-01-01T00:00:00Z",
	"file_modification_date": "0001-01-01T00:00:00Z",
	"file_size": 76800,
	"plain_text": "Quickstart - Set and retrieve a secret from Azure Key Vault\r\nBy msmbaldwin\r\nArchived: 2026-04-06 00:13:02 UTC\r\nIn this quickstart, you create a key vault in Azure Key Vault with Azure CLI. Azure Key Vault is a cloud service\r\nthat works as a secure secrets store. You can securely store keys, passwords, certificates, and other secrets. For\r\nmore information on Key Vault you may review the Overview. Azure CLI is used to create and manage Azure\r\nresources using commands or scripts. Once you've completed that, you will store a secret.\r\nIf you don't have an Azure account, create a free account before you begin.\r\nUse the Bash environment in Azure Cloud Shell. For more information, see Get started with Azure Cloud\r\nShell.\r\nIf you prefer to run CLI reference commands locally, install the Azure CLI. If you're running on Windows\r\nor macOS, consider running Azure CLI in a Docker container. For more information, see How to run the\r\nAzure CLI in a Docker container.\r\nIf you're using a local installation, sign in to the Azure CLI by using the az login command. To\r\nfinish the authentication process, follow the steps displayed in your terminal. For other sign-in\r\noptions, see Authenticate to Azure using Azure CLI.\r\nWhen you're prompted, install the Azure CLI extension on first use. For more information about\r\nextensions, see Use and manage extensions with the Azure CLI.\r\nRun az version to find the version and dependent libraries that are installed. To upgrade to the latest\r\nversion, run az upgrade.\r\nThis quickstart requires version 2.0.4 or later of the Azure CLI. If using Azure Cloud Shell, the latest version is\r\nalready installed.\r\nA resource group is a logical container into which Azure resources are deployed and managed. Use the az group\r\ncreate command to create a resource group named myResourceGroup in the eastus location.\r\naz group create --name \"myResourceGroup\" --location \"EastUS\"\r\nUse the Azure CLI az keyvault create command to create a Key Vault in the resource group from the previous\r\nstep. You will need to provide some information:\r\nhttps://learn.microsoft.com/en-us/azure/key-vault/secrets/quick-create-cli\r\nPage 1 of 3\n\nKey vault name: A string of 3 to 24 characters that can contain only numbers (0-9), letters (a-z, A-Z), and\r\nhyphens (-)\r\nImportant\r\nEach key vault must have a unique name. Replace \u003cvault-name\u003e with the name of your key vault in the\r\nfollowing examples.\r\nResource group name: myResourceGroup\r\nThe location: EastUS\r\naz keyvault create --name \"\u003cvault-name\u003e\" --resource-group \"myResourceGroup\" --enable-rbac-authorization true\r\nThe output of this command shows properties of the newly created key vault. Take note of these two properties:\r\nVault Name: The name you provided to the --name parameter.\r\nVault URI: In this example, the vault URI is https://\u003cvault-name\u003e.vault.azure.net/ . Applications that\r\nuse your vault through its REST API must use this URI.\r\nTo gain permissions to your key vault through Role-Based Access Control (RBAC), assign a role to your \"User\r\nPrincipal Name\" (UPN) using the Azure CLI command az role assignment create.\r\naz role assignment create --role \"Key Vault Secrets Officer\" --assignee \"\u003cupn\u003e\" --scope \"/subscriptions/\u003csubscr\r\nReplace \u003cupn\u003e , \u003csubscription-id\u003e , and \u003cvault-name\u003e with your actual values. If you used a different\r\nresource group name, replace \"myResourceGroup\" as well. Your UPN will typically be in the format of an email\r\naddress (e.g., username@domain.com).\r\nTo add a secret to the vault, you just need to take a couple of additional steps. This password could be used by an\r\napplication. The password will be called ExamplePassword and will store the value of hVFkk965BuUv in it.\r\nUse the Azure CLI az keyvault secret set command below to create a secret in Key Vault called\r\nExamplePassword that will store the value hVFkk965BuUv :\r\naz keyvault secret set --vault-name \"\u003cvault-name\u003e\" --name \"ExamplePassword\" --value \"hVFkk965BuUv\"\r\nYou can now reference this password that you added to Azure Key Vault by using its URI. Use https://\u003cvault-name\u003e.vault.azure.net/secrets/ExamplePassword to get the current version.\r\nTo view the value contained in the secret as plain text, use the Azure CLI az keyvault secret show command:\r\naz keyvault secret show --name \"ExamplePassword\" --vault-name \"\u003cvault-name\u003e\" --query \"value\"\r\nNow, you have created a Key Vault, stored a secret, and retrieved it.\r\nhttps://learn.microsoft.com/en-us/azure/key-vault/secrets/quick-create-cli\r\nPage 2 of 3\n\nOther quickstarts and tutorials in this collection build upon this quickstart. If you plan to continue on to work with\r\nsubsequent quickstarts and tutorials, you may wish to leave these resources in place.\r\nWhen no longer needed, you can use the Azure CLI az group delete command to remove the resource group and\r\nall related resources:\r\naz group delete --name \"myResourceGroup\"\r\nIn this quickstart you created a Key Vault and stored a secret in it. To learn more about Key Vault and how to\r\nintegrate it with your applications, continue on to the articles below.\r\nRead an Overview of Azure Key Vault\r\nLearn how to store multiline secrets in Key Vault\r\nSee the reference for the Azure CLI az keyvault commands\r\nReview the Key Vault security overview\r\nReview secrets-specific security best practices\r\nSource: https://learn.microsoft.com/en-us/azure/key-vault/secrets/quick-create-cli\r\nhttps://learn.microsoft.com/en-us/azure/key-vault/secrets/quick-create-cli\r\nPage 3 of 3",
	"extraction_quality": 1,
	"language": "EN",
	"sources": [
		"MITRE"
	],
	"references": [
		"https://learn.microsoft.com/en-us/azure/key-vault/secrets/quick-create-cli"
	],
	"report_names": [
		"quick-create-cli"
	],
	"threat_actors": [],
	"ts_created_at": 1775438941,
	"ts_updated_at": 1775791326,
	"ts_creation_date": 0,
	"ts_modification_date": 0,
	"files": {
		"pdf": "https://archive.orkl.eu/46126ce79eb6ba0660fb164614a834c2e5515289.pdf",
		"text": "https://archive.orkl.eu/46126ce79eb6ba0660fb164614a834c2e5515289.txt",
		"img": "https://archive.orkl.eu/46126ce79eb6ba0660fb164614a834c2e5515289.jpg"
	}
}