Remove-Azureaccount (Can't get Azure credentials to stick in Powershel)
2014-12-30 17:42
267 查看
https://social.technet.microsoft.com/forums/azure/en-US/260df055-7c4e-4ce2-8f8d-190ad20a4b76/cant-get-azure-credentials-to-stick-in-powershell?forum=windowsazuresecurity
Hi all,
I am wanting to use Powershell (v4) to automate backup and restore of
SQL Azure DB to Azure Storage. I am using certificate method....download
publishsettings file for my subscription and import via PS console
command Import-AzurePublishSettingsFile. I have
verified that the cert is imported and registered on machine Get-Item
cert:\\CurrentUser\My\$thumbprint. Script is failing with
"Get-AzureSqlDatabaseServer : Your Windows Azure credential in the
Windows PowerShell session has expired. Please use
Add-AzureAccount to login again." message. If I authenticate in the
console using Add-AzureAccount it all starts working again. Then if I
close the session or let it time out and try to run it I get the
prompt/error again. This obviously does not
work for automating with scripts and I am in need of some help in
solving this issue. Any help appreciated.
Regards,
Frank Silano
Developer/Architect
BBI
Moved by
Bill_Stewart
Thursday, April 24, 2014 8:11 PM
Move to more appropriate forum
Thursday, April 24, 2014 8:03 PM
Reply
|
Quote
Frank Silano
Bloomin Brands, Inc.
0 Points
0
Sign in to vote
I'd try this:
- Run REMOVE-AZUREACCOUNT first, before you start running your
scripts, make sure you get rid of that azure account from your PS
Session
Then run your script using the publish settings file and cert mgmt.
This should work. If you use Add-azureaccount it overwrites certificate
authorization. If you remove-azureaccount it will fall back to
certficiate authorization.
Let me know how it goes - Matt Sampson
R. Matt Sampson
Hi all,
I am wanting to use Powershell (v4) to automate backup and restore of
SQL Azure DB to Azure Storage. I am using certificate method....download
publishsettings file for my subscription and import via PS console
command Import-AzurePublishSettingsFile. I have
verified that the cert is imported and registered on machine Get-Item
cert:\\CurrentUser\My\$thumbprint. Script is failing with
"Get-AzureSqlDatabaseServer : Your Windows Azure credential in the
Windows PowerShell session has expired. Please use
Add-AzureAccount to login again." message. If I authenticate in the
console using Add-AzureAccount it all starts working again. Then if I
close the session or let it time out and try to run it I get the
prompt/error again. This obviously does not
work for automating with scripts and I am in need of some help in
solving this issue. Any help appreciated.
Regards,
Frank Silano
Developer/Architect
BBI
Moved by
Bill_Stewart
Thursday, April 24, 2014 8:11 PM
Move to more appropriate forum
Thursday, April 24, 2014 8:03 PM
Reply
|
Quote
Frank Silano
Bloomin Brands, Inc.
0 Points
Answers
0
Sign in to vote
I'd try this:
- Run REMOVE-AZUREACCOUNT first, before you start running your
scripts, make sure you get rid of that azure account from your PS
Session
Then run your script using the publish settings file and cert mgmt.
This should work. If you use Add-azureaccount it overwrites certificate
authorization. If you remove-azureaccount it will fall back to
certficiate authorization.
Let me know how it goes - Matt Sampson
R. Matt Sampson
相关文章推荐
- How to get a high quality system in the developing process?
- Using Explorer to get files in the GAC
- How to get request_id of previous request in a request set?
- How to get MetaData on client side in WCF?如何在客户端获取WCF service的元数据
- how to get the space size of some tables in one database?
- How to get operating system info in .NET
- How to get persons who have responsed to a survey in MOSS?
- Setup Was Unable to Create a DCOM User Account" Error Message in Visual Studio 6.0
- 【摘自Devx】How to pass parameters to Thread in Windows Forms -- and get results back
- How to change service accounts and service account passwords in SharePoint Server 2007 and in Windows SharePoint Services 3.0
- using WebRequest to get resource in the internet
- How to get projects list in eclipse
- A macro to get all interior colorindex has been used in thisworkbook
- To Register a Free Premium Account in Rapidshare Download & Install this
- How to get the content of the 'identity' section in web.config
- How to get IOleSite interface of the WebBrowser in an ActiveX control
- How to remove ^M in the file
- Using SOM to get a feature in a file
- How to use GET and POST methods in HTTP from a MIDlet
- HOW-TO: Remove embedded HTML in CQWP roll-ups