zoukankan      html  css  js  c++  java
  • Remove-Azureaccount (Can't get Azure credentials to stick in Powershel)

    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:\CurrentUserMy$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
    Avatar of Frank Silano
    Bloomin Brands, Inc.
     
    0 Points
     

    Answers

    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

  • 相关阅读:
    [转]P2P原理和常见实现方法
    google naming
    【转】CvArr、Mat、CvMat、IplImage、BYTE转换(总结而来)
    Ubuntu 下 JDK7.0和eclipse安装
    BSP模型简单介绍
    2012最受企业欢迎的开发技能Top10 转
    Social Network Analysis
    python操作mysql
    ASP、ASP.NET、JSP、PHP等网页服务器语言的比较
    mysql 正则表达式 regexp
  • 原文地址:https://www.cnblogs.com/flysun0311/p/4194170.html
Copyright © 2011-2022 走看看