Skip to content

Commit 517f39a

Browse files
timovvCopilot
authored andcommitted
Add some troubleshooting to test resource deployment
Co-authored-by: Copilot <copilot@github.com>
1 parent 0c077b2 commit 517f39a

1 file changed

Lines changed: 34 additions & 1 deletion

File tree

.github/skills/azsdk-common-live-and-recorded-tests/references/test-resource-deployment.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ eng/common/TestResources/New-TestResources.ps1 `
3333
-ServiceDirectory 'keyvault' `
3434
-SubscriptionId 'SUBSCRIPTION_ID' `
3535
-ResourceGroupName 'rg-mytest' `
36-
-Location 'eastus'
36+
-Location 'eastus' `
3737
-OutFile
3838
```
3939

@@ -46,3 +46,36 @@ Environment variables typically include credentials and resource endpoints neede
4646
## Additional Parameters
4747

4848
Some services require extra parameters (e.g., `-AdditionalParameters @{enableHsm=$true}` for Key Vault HSM tests). Check the service's `test-resources.bicep` or `test-resources.json` for required parameters.
49+
50+
## Troubleshooting
51+
52+
### Resource already exists / deployment conflict
53+
54+
If deployment fails because a resource or resource group already exists:
55+
56+
1. Check whether an existing deployment is present by running:
57+
```powershell
58+
Get-AzResourceGroup -Name '<resource-group-name>' -ErrorAction SilentlyContinue
59+
```
60+
2. Ask the user whether they want to **remove the existing deployment** and redeploy, or **deploy with a different resource group name**.
61+
3. If removing, run `Remove-TestResources.ps1` first (see [cleanup details](test-resource-cleanup.md)), then retry the deployment.
62+
4. If the conflict is on a specific resource (e.g., a Key Vault in soft-deleted state), purge it manually:
63+
```powershell
64+
Remove-AzKeyVault -VaultName '<vault-name>' -InRemovedState -Force -Location '<location>'
65+
```
66+
67+
### Authentication or authorization failure
68+
69+
- Verify the signed-in account has **Contributor** or **Owner** role on the target subscription: `Get-AzContext`.
70+
- If no context exists, run `Connect-AzAccount` and select the correct subscription with `Set-AzContext -SubscriptionId <id>`.
71+
- For the TME subscription, ensure the account has been granted access to subscription `4d042dc6-fe17-4698-a23f-ec6a8d1e98f4`.
72+
73+
### Deployment times out
74+
75+
- Some services (e.g., Cosmos DB, HDInsight) have long provisioning times.
76+
- Check the Azure portal for the resource group's deployment status to identify which resource is slow.
77+
78+
### Missing .env file after deployment
79+
80+
- Ensure `-OutFile` was passed to `New-TestResources.ps1`.
81+
- Verify the language repo's `eng/scripts/LanguageSettings.ps1` sets `$SupportsTestResourcesDotenv = $true`. If it does not, environment variables must be collected from the script's console output instead.

0 commit comments

Comments
 (0)