-
Notifications
You must be signed in to change notification settings - Fork 455
Getting started Check NamePrefix availability
CARMLPipelinePrincipal edited this page Aug 29, 2022
·
6 revisions
The 'Test-NamePrefixAvailability'
function provides you with the capability to test if the namePrefix
, specified in the settings.yml
file, conflicts with any existing resource.
You can find the script under utilities/tools/Test-NamePrefixAvailability.ps1
.
When invoked, the script
- Fetches all module test files for modules that require unique names. For example
'Microsoft.Storage/storageAccounts'
'Microsoft.ContainerRegistry/registries'
'Microsoft.KeyVault/vaults'
- Replace any tokens contained in the module test files with the key-value pairs provided in the
Tokens
input parameter. - Search for each resource resource type if the final name would be taken.
- Return the result for each resource alongside a final recommendation to use / not use the chosen
'namePrefix'
.
Note: You'll need to have an active Azure login. If not connected, you can do so via the
Connect-AzAccount
cmdlet (from theAz.Resources
PowerShell module).
Note: The script must be loaded ('dot-sourced') before the function can be invoked.
For details on how to use the function, please refer to the script's local documentation.