diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/src/test/java/com/azure/resourcemanager/providerhub/ProviderHubManagerTests.java b/sdk/providerhub/azure-resourcemanager-providerhub/src/test/java/com/azure/resourcemanager/providerhub/ProviderHubManagerTests.java index 29a254c6f3cc..8c2e787d8a2e 100644 --- a/sdk/providerhub/azure-resourcemanager-providerhub/src/test/java/com/azure/resourcemanager/providerhub/ProviderHubManagerTests.java +++ b/sdk/providerhub/azure-resourcemanager-providerhub/src/test/java/com/azure/resourcemanager/providerhub/ProviderHubManagerTests.java @@ -10,10 +10,10 @@ import com.azure.core.management.Region; import com.azure.core.management.profile.AzureProfile; import com.azure.core.test.TestBase; -import com.azure.core.test.annotation.DoNotRecord; +import com.azure.core.test.annotation.LiveOnly; import com.azure.core.util.Configuration; import com.azure.core.util.CoreUtils; -import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.identity.AzurePowerShellCredentialBuilder; import com.azure.resourcemanager.providerhub.fluent.models.OperationsDefinitionInner; import com.azure.resourcemanager.providerhub.models.OperationsContent; import com.azure.resourcemanager.providerhub.models.OperationsDefinitionDisplay; @@ -35,7 +35,7 @@ public class ProviderHubManagerTests extends TestBase { @Override public void beforeTest() { - final TokenCredential credential = new DefaultAzureCredentialBuilder().build(); + final TokenCredential credential = new AzurePowerShellCredentialBuilder().build(); final AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); providerHubManager = ProviderHubManager @@ -66,7 +66,7 @@ protected void afterTest() { } @Test - @DoNotRecord(skipInPlayback = true) + @LiveOnly public void testCreateOperation() { OperationsContent operationsContent = null; String spaceName = "Microsoft.Contoso" + randomPadding(); diff --git a/sdk/providerhub/test-resources.bicep b/sdk/providerhub/test-resources.bicep index 2250946806c0..528b295d5e32 100644 --- a/sdk/providerhub/test-resources.bicep +++ b/sdk/providerhub/test-resources.bicep @@ -7,9 +7,6 @@ param testApplicationId string @description('This is the object id of the service principal used to run tests.') param testApplicationOid string -@description('The application client secret used to run tests.') -param testApplicationSecret string - var contributorRoleId = '/subscriptions/${subscription().subscriptionId}/providers/Microsoft.Authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c' resource contributorRoleId_name 'Microsoft.Authorization/roleAssignments@2022-04-01' = { @@ -22,6 +19,5 @@ resource contributorRoleId_name 'Microsoft.Authorization/roleAssignments@2022-04 output AZURE_TENANT_ID string = tenantId output AZURE_CLIENT_ID string = testApplicationId -output AZURE_CLIENT_SECRET string = testApplicationSecret output AZURE_SUBSCRIPTION_ID string = subscription().subscriptionId output AZURE_RESOURCE_GROUP_NAME string = resourceGroup().name diff --git a/sdk/providerhub/tests.mgmt.yml b/sdk/providerhub/tests.mgmt.yml index fbcee5621ccb..3f09c11e5329 100644 --- a/sdk/providerhub/tests.mgmt.yml +++ b/sdk/providerhub/tests.mgmt.yml @@ -11,6 +11,7 @@ extends: groupId: com.azure.resourcemanager safeName: azureresourcemanagerproviderhub Clouds: 'Public' + UseFederatedAuth: true # Only run tests on Windows to save cost. MatrixFilters: - pool=.*(win).*