Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connect-AzureRmAccount : Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx). #6159

Closed
uday31in opened this issue May 8, 2018 · 5 comments

Comments

@uday31in
Copy link
Member

uday31in commented May 8, 2018

PS C:\WINDOWS\system32> Connect-AzureRmAccount -ServicePrincipal -Credential $cred -tenantid <guid>
Connect-AzureRmAccount : Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
At line:1 char:1
+ Connect-AzureRmAccount -ServicePrincipal -Credential $cred -tenantid  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Connect-AzureRmAccount], FormatException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand



PS C:\WINDOWS\system32> Connect-AzureRmAccount -TenantId <aadtenat>.onmicrosoft.com  -ServicePrincipal -Credential $cred
Connect-AzureRmAccount : Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
At line:1 char:1
+ Connect-AzureRmAccount -TenantId virtualdatacenteroutlook.onmicrosoft ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Connect-AzureRmAccount], FormatException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand


PS C:\WINDOWS\system32> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.17134.1
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17134.1
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

PS C:\WINDOWS\system32> Get-Module AzureRM -ListAvailable


    Directory: C:\Program Files\WindowsPowerShell\Modules


ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     6.0.1      AzureRM

@cormacpayne
Copy link
Member

This appears to be a duplicate of #3974 (user can only specify tenant id and not the domain). Closing this issue in favor of the other one.

@uday31in
Copy link
Member Author

uday31in commented May 8, 2018

It is failing when specifying GUID too.

PS C:\WINDOWS\system32> Connect-AzureRmAccount -ServicePrincipal -Credential $cred -tenantid <guid>
Connect-AzureRmAccount : Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
At line:1 char:1
+ Connect-AzureRmAccount -ServicePrincipal -Credential $cred -tenantid  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Connect-AzureRmAccount], FormatException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand



@cormacpayne
Copy link
Member

@uday31in would you mind providing the following information:

  • the versions of the AzureRM* modules you have installed (you can get this information with Get-Module -Name AzureRM* -ListAvailable
  • the debug output when running this command (you can get this by setting $DebugPreference="Continue" and then running the command again)

@uday31in
Copy link
Member Author

uday31in commented May 8, 2018


PS C:\git\bp> Get-Module -Name AzureRM* -ListAvailable


    Directory: C:\Program Files\WindowsPowerShell\Modules


ModuleType Version    Name                                ExportedCommands             
---------- -------    ----                                ----------------             
Script     6.0.1      AzureRM                                                          
Script     0.6.7      AzureRM.AnalysisServices            {Resume-AzureRmAnalysisSer...
Script     6.0.0      AzureRM.ApiManagement               {Add-AzureRmApiManagementR...
Script     0.1.4      AzureRM.ApplicationInsights         {Get-AzureRmApplicationIns...
Script     5.0.0      AzureRM.Automation                  {Get-AzureRMAutomationHybr...
Script     4.0.5      AzureRM.Backup                      {Backup-AzureRmBackupItem,...
Script     4.0.7      AzureRM.Batch                       {Remove-AzureRmBatchAccoun...
Script     0.14.2     AzureRM.Billing                     {Get-AzureRmBillingInvoice...
Script     5.0.0      AzureRM.Cdn                         {Get-AzureRmCdnProfile, Ge...
Script     0.9.5      AzureRM.CognitiveServices           {Get-AzureRmCognitiveServi...
Script     5.0.0      AzureRM.Compute                     {Remove-AzureRmAvailabilit...
Script     0.3.2      AzureRM.Consumption                 Get-AzureRmConsumptionUsag...
Script     0.2.6      AzureRM.ContainerInstance           {New-AzureRmContainerGroup...
Script     1.0.5      AzureRM.ContainerRegistry           {New-AzureRmContainerRegis...
Script     5.0.0      AzureRM.DataFactories               {Remove-AzureRmDataFactory...
Script     0.5.4      AzureRM.DataFactoryV2               {Set-AzureRmDataFactoryV2,...
Script     5.0.0      AzureRM.DataLakeAnalytics           {Get-AzureRmDataLakeAnalyt...
Script     6.0.0      AzureRM.DataLakeStore               {Get-AzureRmDataLakeStoreT...
Script     4.0.5      AzureRM.DevTestLabs                 {Get-AzureRmDtlAllowedVMSi...
Script     5.0.0      AzureRM.Dns                         {Get-AzureRmDnsRecordSet, ...
Script     0.3.3      AzureRM.EventGrid                   {New-AzureRmEventGridTopic...
Script     0.6.4      AzureRM.EventHub                    {New-AzureRmEventHubNamesp...
Script     4.1.3      AzureRM.HDInsight                   {Get-AzureRmHDInsightJob, ...
Script     5.0.0      AzureRM.Insights                    {Get-AzureRmMetricDefiniti...
Script     3.1.3      AzureRM.IotHub                      {Add-AzureRmIotHubKey, Get...
Script     5.0.0      AzureRM.KeyVault                    {Add-AzureKeyVaultCertific...
Script     4.0.4      AzureRM.LogicApp                    {Get-AzureRmIntegrationAcc...
Script     0.18.0     AzureRM.MachineLearning             {Move-AzureRmMlCommitmentA...
Script     0.4.3      AzureRM.MachineLearningCompute      {Get-AzureRmMlOpCluster, G...
Script     0.0.1      AzureRM.ManagementGroups            {Get-AzureRmManagementGrou...
Script     0.2.2      AzureRM.MarketplaceOrdering         {Get-AzureRmMarketplaceTer...
Script     0.10.0     AzureRM.Media                       {Sync-AzureRmMediaServiceS...
Script     6.0.0      AzureRM.Network                     {Add-AzureRmApplicationGat...
Script     5.0.0      AzureRM.NotificationHubs            {Get-AzureRmNotificationHu...
Script     5.0.0      AzureRM.OperationalInsights         {New-AzureRmOperationalIns...
Script     4.1.5      AzureRM.PowerBIEmbedded             {Remove-AzureRmPowerBIWork...
Script     5.0.1      AzureRM.profile                     {Disable-AzureRmDataCollec...
Script     4.1.3      AzureRM.RecoveryServices            {Get-AzureRmRecoveryServic...
Script     4.1.3      AzureRM.RecoveryServices.Backup     {Backup-AzureRmRecoverySer...
Script     0.2.5      AzureRM.RecoveryServices.SiteRec... {Edit-AzureRmRecoveryServi...
Script     5.0.0      AzureRM.RedisCache                  {Remove-AzureRmRedisCacheP...
Script     0.3.4      AzureRM.Relay                       {New-AzureRmRelayNamespace...
Script     6.0.0      AzureRM.Resources                   {Get-AzureRmProviderOperat...
Script     0.16.4     AzureRM.Scheduler                   {Disable-AzureRmSchedulerJ...
Script     0.6.5      AzureRM.ServiceBus                  {New-AzureRmServiceBusName...
Script     0.3.5      AzureRM.ServiceFabric               {Add-AzureRmServiceFabricA...
Script     4.4.1      AzureRM.Sql                         {Get-AzureRmSqlDatabaseTra...
Script     5.0.0      AzureRM.Storage                     {Get-AzureRmStorageAccount...
Script     4.0.5      AzureRM.StreamAnalytics             {Get-AzureRmStreamAnalytic...
Script     0.2.1      AzureRM.Subscription                New-AzureRmSubscription      
Script     0.2.0      AzureRM.Subscription                New-AzureRmSubscription      
Script     4.0.2      AzureRM.Tags                        {Remove-AzureRmTag, Get-Az...
Script     4.0.4      AzureRM.TrafficManager              {Disable-AzureRmTrafficMan...
Script     4.0.3      AzureRM.UsageAggregates             Get-UsageAggregates          
Script     5.0.1      AzureRM.Websites                    {Get-AzureRmAppServicePlan...


@uday31in
Copy link
Member Author

uday31in commented May 8, 2018

Connect-AzureRmAccount -ServicePrincipal -Credential $cred -tenantid $tenantid <this is GUID>

Connect-AzureRmAccount : Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
At line:1 char:1
+ Connect-AzureRmAccount -ServicePrincipal -Credential $cred -tenantid  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Connect-AzureRmAccount], FormatException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand
 
DEBUG: AzureQoSEvent: CommandName - Connect-AzureRmAccount; IsSuccess - False; Duration - 00:00:00.5267248; Exception - Sys
tem.FormatException: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
   at System.Guid.GuidResult.SetFailure(ParseFailureKind failure, String failureMessageID, Object failureMessageFormatArgum
ent, String failureArgumentName, Exception innerException)
   at System.Guid.TryParseGuidWithNoStyle(String guidString, GuidResult& result)
   at System.Guid.TryParseGuid(String g, GuidStyles flags, GuidResult& result)
   at System.Guid..ctor(String g)
   at Microsoft.Azure.Commands.Common.Authentication.Abstractions.AzureTenantExtensions.GetId(IAzureTenant tenant)
   at Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile.<>c__DisplayClass45_0.<TryFindContext>b__0(KeyVa
luePair`2 c)
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
   at Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile.TryFindContext(IAzureContext context, String& na
me)
   at Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile.TrySetDefaultContext(IAzureContext context)
   at Microsoft.Azure.Commands.Common.Authentication.ResourceManager.AzureRmAutosaveProfile.TrySetDefaultContext(IAzureCont
ext context)
   at Microsoft.Azure.Commands.Common.Authentication.ResourceManager.AzureRmAutosaveProfile.TrySetDefaultContext(String nam
e, IAzureContext context)
   at Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient.Login(IAzureAccount account, IAzureEnvironment enviro
nment, String tenantId, String subscriptionId, String subscriptionName, SecureString password, Boolean skipValidation, Acti
on`1 promptAction, String name)
   at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.<>c__DisplayClass83_0.<ExecuteCmdlet>b__0(AzureRmProfil
e localProfile, RMProfileClient profileClient, String name)
   at Microsoft.Azure.Commands.Profile.Common.AzureContextModificationCmdlet.ModifyContext(Action`2 contextAction)
   at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.SetContextWithOverwritePrompt(Action`3 setContextAction
)
   at Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand.ExecuteCmdlet()
   at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord();
DEBUG: Finish sending metric.
DEBUG: 16:44:32 - ConnectAzureRmAccountCommand end processing.
DEBUG: 16:44:32 - ConnectAzureRmAccountCommand end processing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants