Vnet/IP ACL sample for Azure Key Vault using the Azure Node SDK
This sample repo demonstrates how to create an Azure Key Vault with access limited to specific IP ranges and Azure Virtual Networks.
How to run this sample
If you don't already have it, get node.js.
Clone the repo.
git clone https://github.com/Azure-Samples/key-vault-node-network-acl.git key-vault
Install the dependencies.
cd key-vault npm install
Create an Azure service principal, using one of the following:
This service principal is to run the sample on your Azure account.
Set the following environment variables using the information from the service principal that you created.
export AZURE_SUBSCRIPTION_ID={your subscription id} export AZURE_CLIENT_ID={your client id} export AZURE_CLIENT_SECRET={your client secret} export AZURE_TENANT_ID={your tenant id as a GUID} export AZURE_CLIENT_OID={Object id of the service principal}
On Windows, use
set
instead ofexport
.
Observe/update the definition of
networkAcls
innetwork_acl_sample.js
if you desire. By default, access from all IP addresses is allowed.Run the sample.
node network_acl_sample.js