[12:06:47][Step 3/3] Get-Item : Cannot find path
[12:06:47][Step 3/3] 'Cert:\CurrentUser\My\<MyThumbnail>' because it
[12:06:47][Step 3/3] does not exist.
[12:06:47][Step 3/3] At line:1 char:12
[12:06:47][Step 3/3] + $status = (Get-Item cert:\\CurrentUser\My\$thumbprint).HasPrivateKey
[12:06:47][Step 3/3] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[12:06:47][Step 3/3] + CategoryInfo : ObjectNotFound: (Cert:\CurrentUs...7E5B1B37AFE6B
[12:06:47][Step 3/3] E5:String) [Get-Item], ItemNotFoundException
[12:06:47][Step 3/3] + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetIt
[12:06:47][Step 3/3] emCommand
[12:06:47][Step 3/3]
[12:06:47][Step 3/3] Ceritificate Exist :
[12:06:47][Step 3/3] Get-ChildItem : Cannot find path
[12:06:47][Step 3/3] '\CurrentUser\My\<MyThumbnail>' because it does not
[12:06:47][Step 3/3] exist.
[12:06:47][Step 3/3] At line:1 char:15
[12:06:47][Step 3/3] + $myCert1 = ( Get-ChildItem -Path cert:\CurrentUser\My\$thumbprint )
[12:06:47][Step 3/3] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[12:06:47][Step 3/3] + CategoryInfo : ObjectNotFound: (\CurrentUser\My...7E5B1B37AFE6B
[12:06:47][Step 3/3] E5:String) [Get-ChildItem], ItemNotFoundException
[12:06:47][Step 3/3] + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetCh
[12:06:47][Step 3/3] ildItemCommand
[12:06:47][Step 3/3]
[12:06:48][Step 3/3] Set-AzureSubscription : The term 'Set-AzureSubscription' is not recognized as
[12:06:48][Step 3/3] the name of a cmdlet, function, script file, or operable program. Check the
[12:06:48][Step 3/3] spelling of the name, or if a path was included, verify that the path is
[12:06:48][Step 3/3] correct and try again.
[12:06:48][Step 3/3] At line:1 char:1
[12:06:48][Step 3/3] + Set-AzureSubscription ?SubscriptionName $localSubName ?SubscriptionId
[12:06:48][Step 3/3] $subID - ...
[12:06:48][Step 3/3] + ~~~~~~~~~~~~~~~~~~~~~
[12:06:48][Step 3/3] + CategoryInfo : ObjectNotFound: (Set-AzureSubscription:String) [
[12:06:48][Step 3/3] ], CommandNotFoundException
[12:06:48][Step 3/3] + FullyQualifiedErrorId : CommandNotFoundException
[12:06:48][Step 3/3]
[12:06:48][Step 3/3] Set-AzureSubscription : The term 'Set-AzureSubscription' is not recognized as
[12:06:48][Step 3/3] the name of a cmdlet, function, script file, or operable program. Check the
[12:06:48][Step 3/3] spelling of the name, or if a path was included, verify that the path is
[12:06:48][Step 3/3] correct and try again.
[12:06:48][Step 3/3] At line:1 char:1
[12:06:48][Step 3/3] + Set-AzureSubscription -SubscriptionName $localSubName
[12:06:48][Step 3/3] -CurrentStorageAccount $ ...
[12:06:48][Step 3/3] + ~~~~~~~~~~~~~~~~~~~~~
[12:06:48][Step 3/3] + CategoryInfo : ObjectNotFound: (Set-AzureSubscription:String) [
[12:06:48][Step 3/3] ], CommandNotFoundException
[12:06:48][Step 3/3] + FullyQualifiedErrorId : CommandNotFoundException
[12:06:48][Step 3/3]
[12:06:48][Step 3/3] Select-AzureSubscription : The term 'Select-AzureSubscription' is not
[12:06:48][Step 3/3] recognized as the name of a cmdlet, function, script file, or operable
[12:06:48][Step 3/3] program. Check the spelling of the name, or if a path was included, verify
[12:06:48][Step 3/3] that the path is correct and try again.
[12:06:48][Step 3/3] At line:1 char:1
[12:06:48][Step 3/3] + Select-AzureSubscription ?Current $localSubName
[12:06:48][Step 3/3] + ~~~~~~~~~~~~~~~~~~~~~~~~
[12:06:48][Step 3/3] + CategoryInfo : ObjectNotFound: (Select-AzureSubscription:String
[12:06:48][Step 3/3] ) [], CommandNotFoundException
[12:06:48][Step 3/3] + FullyQualifiedErrorId : CommandNotFoundException
[12:06:48][Step 3/3]
[12:06:48][Step 3/3] Get-AzureSubscription : The term 'Get-AzureSubscription' is not recognized as
[12:06:48][Step 3/3] the name of a cmdlet, function, script file, or operable program. Check the
[12:06:48][Step 3/3] spelling of the name, or if a path was included, verify that the path is
[12:06:48][Step 3/3] correct and try again.
[12:06:48][Step 3/3] At line:1 char:2
[12:06:48][Step 3/3] + (Get-AzureSubscription -Current).SubscriptionName
[12:06:48][Step 3/3] + ~~~~~~~~~~~~~~~~~~~~~
[12:06:48][Step 3/3] + CategoryInfo : ObjectNotFound: (Get-AzureSubscription:String) [
[12:06:48][Step 3/3] ], CommandNotFoundException
[12:06:48][Step 3/3] + FullyQualifiedErrorId : CommandNotFoundException
This is weird. I had created a VM on Azure and automating deploying the apps thro' teamcity.
When I try
(Get-ChildItem -Path cert:\CurrentUser\My\135316F9CBC79ADFD48E62F007E5B1B37AFE6BE5 )
on powershell on this VM it returns the thnmbprint and CN.
but the same line does not work when run in Teamcity powershell.
On this Same VM it deployes the app to azure whn ran manually but not with TeamCity.
Can any one pls help me to get this working ?
Here the deployment do not work When run on Teamcity
and works on Powershell when run directly
Attachment(s):
Directly on Powershell.png
TeamnCityRun.png
Please make sure that user who runs teamcity build agent has all nesessary permissions.
I had logged in with Administator and the the permission set are same for both the user.
Does Teamcity uses some cetificate to comunicate with Azure Cloud ?
Because this issue came when i deleted Certificates on Azure.
I finally got the cause (wierd)
On VM PowerShell when i ran get-AzureSubscription it returned me "Windows Azure for BizSpark Plus"
And when I ran the same by Teamcity if got me "Windows Azure BizSpark 1111"
So I changed the subscription name in my scripts and error went off.