You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/key-vault/tutorial-net-windows-virtual-machine.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,9 +49,9 @@ When you enable MSI for an Azure service, such as Azure Virtual Machines, Azure
49
49
50
50
Next, to get an access token, your code calls a local metadata service that's available on the Azure resource. To authenticate to an Azure Key Vault service, your code uses the access token that it gets from the local MSI endpoint.
51
51
52
-
## Set up the project
52
+
## Create resources and assign permissions
53
53
54
-
Before you start coding you need to create some resources, put a secret into your key vault, and set up the .NET project.
54
+
Before you start coding you need to create some resources, put a secret into your key vault, and assign permissions.
55
55
56
56
### Log in to Azure
57
57
@@ -61,9 +61,7 @@ To log in to Azure by using the Azure CLI, enter:
61
61
az login
62
62
```
63
63
64
-
### Create resources and assign permissions
65
-
66
-
#### Create a resource group
64
+
### Create a resource group
67
65
68
66
An Azure resource group is a logical container into which Azure resources are deployed and managed. Create a resource group by using the [az group create](/cli/azure/group#az-group-create) command.
69
67
@@ -76,7 +74,7 @@ az group create --name "<YourResourceGroupName>" --location "West US"
76
74
77
75
Your newly created resource group will be used throughout this tutorial.
78
76
79
-
####Create a key vault and populate it with a secret
77
+
### Create a key vault and populate it with a secret
80
78
81
79
Create a key vault in your resource group by providing the [az keyvault create](/cli/azure/keyvault?view=azure-cli-latest#az-keyvault-create) command with the following information:
82
80
@@ -100,14 +98,14 @@ az keyvault secret set --vault-name "<YourKeyVaultName>" --name "AppSecret" --va
100
98
101
99
This secret stores the value **MySecret**.
102
100
103
-
####Create a virtual machine
101
+
### Create a virtual machine
104
102
Create a virtual machine by using one of the following methods:
Create a system-assigned identity for the virtual machine bwith the [az vm identity assign]/cli/azure/vm/identity?view=azure-cli-latest#az-vm-identity-assign) command:
112
110
113
111
```azurecli
@@ -123,24 +121,26 @@ Note the system-assigned identity that's displayed in the following code. The ou
123
121
}
124
122
```
125
123
126
-
####Assign permissions to the VM identity
124
+
### Assign permissions to the VM identity
127
125
Assign the previously created identity permissions to your key vault with the [az keyvault set-policy](/cli/azure/keyvault?view=azure-cli-latest#az-keyvault-set-policy) command:
128
126
129
127
```azurecli
130
128
az keyvault set-policy --name '<YourKeyVaultName>' --object-id <VMSystemAssignedIdentity> --secret-permissions get list
131
129
```
132
130
133
-
####Log on to the virtual machine
131
+
### Log on to the virtual machine
134
132
135
133
To log on to the virtual machine, follow the instructions in [Connect and log on to an Azure virtual machine running Windows](https://docs.microsoft.com/azure/virtual-machines/windows/connect-logon).
136
134
137
135
## Set up the console app
138
136
139
-
## Install .NET Core
137
+
Create a console app and install the required packages using the `dotnet` command.
138
+
139
+
### Install .NET Core
140
140
141
141
To install .NET Core, go to the [.NET downloads](https://www.microsoft.com/net/download) page.
0 commit comments