eGIS uses Azure Key Vault to store secrets such as passwords. Only users who have been given access to a key vault can store and retrieve secrets from the key vault. This document describes how to store and retrieve secrets from an Azure Key Vault.
Retrieve a Secret using Azure Portal
Open the Microsoft Azure Portal.
In the search box, type Key Vault.
Click Key Vaults in the results list.
Click EgisKeyVault to open the eGIS key vault. EgisKeyVault is in the TC-Script-ArcGIS-RG resource group in the TC-Sandbox subscription.
Underneath Settings, click Secrets.
In the list of secrets, click the name of the secret that you want to retrieve.
Underneath Current Version, click the instance of the secret.
Click Show Secret Value to reveal the secret value. Alternatively, click the Copy icon to copy the secret’s value to the clipboard.
Create a Secret using Azure Portal
Follow steps 1 through 5 above to open the Secrets blade of EgisKeyVault.
Click Generate/Import.
Specify a Name and Value for the new secret.
Click Create.
The new secret is created in the key vault.
Retrieve a Secret in a DevOps Pipeline
In some cases, it may be necessary to retrieve a secret, such as a password, from within an Azure DevOps pipeline.
Add the Secret to the Pipeline Library
In eGIS DevOps, a library for eGIS passwords has been created. It allows tasks within Azure DevOps pipelines to use secrets from EgisKeyVault.
In Azure DevOps portal, expand the Pipelines menu, then click Library.
Click the EGIS passwords variable group.
In the list of variables, check if the secret that you want to retrieve is already present. If not, click Add.
Check the boxes next to the names of the secrets that you wish to retrieve, then click OK.
Click Save.
In your release pipeline, click the Variables tab.
Click Variable Groups.
Click Link variable group.
Click EGIS passwords from the list of variable groups. By default, the variable group is available to the entire pipeline. To limit the scope to specific stages, click Stages, then choose the specific stages from the dropdown list.
Click Link.
The secrets are now defined in the pipeline’s environment, and can be retrieved in several ways. Refer to the Azure Pipelines documentation on Variable Groups and Secrets for more information.
Retrieve a Secret in an Azure Python Function App
Refer to the documentation on Python Function Apps DevOps Pipelines for information on accessing an Azure Key Vault secret from wtihin an Azure Python Function App.