Create NGINXaaS Dataplane API Key
The NGINXaaS dataplane API key is used to authenticate with your NGINXaaS deployment’s dataplane API. This key is required for various integrations including VMSS backend synchronization and Kubernetes load balancing.
The data plane API key has the following requirements:
- The key should have an expiration date. The default expiration date is six months from the date of creation. The expiration date cannot be longer than two years from the date of creation.
- The key should be at least 12 characters long.
- The key requires three out of four of the following types of characters:
- lowercase characters.
- uppercase characters.
- symbols.
- numbers.
A good example of an API key that will satisfy the requirements is UUIDv4.
The data plane API key can be created using the Azure CLI or portal.
- Go to your NGINXaaS for Azure deployment.
- Select NGINXaaS Loadbalancer for Kubernetes on the left blade.
- Select New API Key.
- Provide a name for the new API key in the right panel, and select an expiration date.
- Select the Add API Key button.
- Copy the value of the new API key.
Make sure to write down the key value in a safe location after creation, as you cannot retrieve it again. If you lose the generated value, delete the existing key and create a new one.
Set shell variables about the name of the NGINXaaS you’ve already created:
## Customize this to provide the details about my already created NGINXaaS deployment
nginxName=myNginx
nginxGroup=myNginxGroupGenerate a new random data plane API key:
# Generate a new random key or specify a value for it.
keyName=myKey
keyValue=$(uuidgen --random)Create the key for your NGINXaaS deployment:
az nginx deployment api-key create --name $keyName --secret-text $keyValue --deployment-name $nginxName --resource-group $nginxGroupThe data plane API endpoint can be retrieved using the Azure CLI or portal.
- Go to your NGINXaaS for Azure deployment.
- Select NGINXaaS Loadbalancer for Kubernetes on the left blade.
- The data plane API endpoint associated with the deployment is available at the top of the screen.
dataplaneAPIEndpoint=$(az nginx deployment show -g "$nginxGroup" -n "$nginxName" --query properties.dataplaneApiEndpoint -o tsv)Once you have created the dataplane API key and obtained the endpoint, you can use them in various NGINXaaS integrations: