You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
throw"No subscription name was specified, and no variable asset with name 'Default Azure Subscription' was found. Either specify an Azure subscription name or define the default using a variable setting"
Write-Output"Attempting to authenticate as: [$($azureCredential.UserName)]"
305
+
}
306
+
else
289
307
{
290
-
throw"No automation credential name was specified, and no credential asset with name 'Default Automation Credential' was found. Either specify a stored credential name or define the default using a credential asset"
308
+
throw"No automation credential name was specified, and no credential asset with name 'Default Automation Credential' was found. Either specify a stored credential name or define the default using a credential asset"
291
309
}
292
310
}
293
311
else
@@ -306,27 +324,13 @@ try
306
324
# Check for returned userID, indicating successful authentication
Write-Output"Successfully authenticated as user: $($azureCredential.UserName)"
327
+
Write-Output"Successfully authenticated as user: [$($azureCredential.UserName)]"
310
328
}
311
329
else
312
330
{
313
331
throw"Authentication failed for credential [$($azureCredential.UserName)]. Ensure a valid Azure Active Directory user account is specified which is configured as a co-administrator (using classic portal) and subscription owner (modern portal) on the target subscription. Verify you can log into the Azure portal using these credentials."
314
332
}
315
333
316
-
# Retrieve subscription name from variable asset if not specified
throw"No subscription name was specified, and no variable asset with name 'Default Azure Subscription' was found. Either specify an Azure subscription name or define the default using a variable setting"
0 commit comments