Reputation: 307
We are getting the following exception when Importing the AzurePublishSettingsFile:
PS C:\Users\xxx> Import-AzurePublishSettingsFile "C:\xyz\azure.publishsettings" Import-AzurePublishSettingsFile : Exception of type 'System.Exception' was thrown. At line:1 char:1 + Import-AzurePublishSettingsFile "C:\xyz\azure.publishsettings" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : CloseError: (:) [Import-AzurePublishSettingsFile], Exception + FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.Subscription.ImportAzurePublishSettingsCommand
Please let me know how to resolve this.
Upvotes: 3
Views: 2344
Reputation: 665
I had the same problem and I removed the spaces in the filename and worked fine :D
Upvotes: 0
Reputation: 329
I had the same problem when I tried my first line for Azure:
PS C:\Windows\system32> Import-AzurePublishSettingsFile –PublishSettingsFile "C:\azure\1.publishsettings"
Import-AzurePublishSettingsFile : Exception of type 'System.Exception' was thrown.
At line:1 char:1
+ Import-AzurePublishSettingsFile –PublishSettingsFile "C:\ubuntu\azure\1.publishs ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Import-AzurePublishSettingsFile], Exception
+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.Profile.ImportAzurePublishSettingsCommand
Turned out I had the wrong filename.
I think
"Import-AzurePublishSettingsFile : Exception of type 'System.Exception' was thrown. At line:1 char:1"
could means the cmdlet didn't find the setting file ( this is the case for me).
If I run
Import-AzurePublishSettingsFile –PublishSettingsFile "C:\notexist.publishsettings"
It shows the same error.
Have to say this is a very unclear error message.
Upvotes: 3
Reputation: 6281
Try to run the Power Shell as administrator, it resolved similar error for me
Upvotes: -1
Reputation: 836
I get the same problem if I load the Azure module into a 64 bit version of Powershell. If I stick with the 32 bit version, the problem disappears. Is it possible that is the problem on your end?
Upvotes: 0