-
Notifications
You must be signed in to change notification settings - Fork 66
Refreshing Expired Secrets
From time to time you may need to update/refresh the client secret used in the Azure AD application of Request-a-team.
When you deploy Request-a-team, the secret generated for the Azure AD app has a default expiry of 1 year from the date the deployment script was executed.
It is advisable to note down the date when the secret will expire as once this has expired, the Logic Apps for creating teams will fail until a new secret is created and the key vault updated.
When the secret expires or shortly before this period, follow this process to create a new secret and update Request-a-team to use the new value:
- Open the Azure Portal.
- Navigate to Azure Active Directory.
- Click 'App registrations' on the left menu.
- Click 'All applications'.
- Locate your Request-a-team application and click on it.
- Click 'Certificates and secrets' on the left menu.
- Click 'New cient secret' under Client secrets.
- Enter a description for the secret and choose an expiry date.
- Copy the value of the secret. **Once you leave this blade, the value will be permanently hidden. **
- Execute the 'refreshclientsecret.ps1' PowerShell script.
The script requires the following parameters:
-
ClientId - Id of the request-a-team Azure AD Application. You can obtain this in the App registrations blade (copy the Application ID).
-
ClientSecret - Secret value that you copied earlier.
-
SubscriptionId - Azure subscription where request-a-team is deployed.
-
Location - Azure region you chose when deploying request-a-team. The internal name should be used e.g. uksouth. See Valid Azure Locations.
-
TenantId - Id of the tenant where request-a-team is deployed. (If you are not sure how to get Tenant ID, please check Azure Active Directory in Azure Portal. Under Manage, click Properties. The tenant ID is shown in the Directory ID box).
-
ResourceGroupName - Name for the resource group where request-a-team is deployed.
-
KeyVaultName - Name of your key vault that is used for request-a-team.
.\refreshclientsecret.ps1 -ClientId "xxxxxxxx-xxxx-xxx-xxxxxxxxxxx" -ClientSecret "xxxxxxxx-xxxx-xxx-xxxxxxxxxxx" -SubscriptionId 7ed1653b-228c-4d26-a0c0-2cd164xxxxxx -Location "westus" -TenantId "xxxxxxxx-xxxx-xxx-xxxxxxxxxxx" -ResourceGroupName "teamsgovernanceapp-rg" -KeyVaultName "requestateam-kv"
The script will prompt for authentication during execution. Please login using a Global Administrator account.
Once the script is complete, Request-a-team is now using the updated secret and will continue to operate as normal.