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:\\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

Remove-Azureaccount (Can't get Azure credentials to stick in Powershel)

时间: 2024-08-28 17:03:37

Remove-Azureaccount (Can't get Azure credentials to stick in Powershel)的相关文章

Azure Storage Blob Go SDK示例

简介 前面一篇博客介绍了关于Azure ManagerAPI Go SDK的使用,本篇继续介绍使用Blob Go SDK 操作中国区Azure Blob. SDK下载: go get github.com/Azure/azure-storage-blob-go/2016-05-31/azblob 示例程序: package main import ( "bufio" "bytes" "context" "fmt" "

Android窗口管理服务WindowManagerService对壁纸窗口(Wallpaper Window)的管理分析

文章转载至CSDN社区罗升阳的安卓之旅,原文地址:http://blog.csdn.net/luoshengyang/article/details/8550820 Android系统中,壁纸窗口和输入法窗口一样,都是一种特殊类型的窗口,而且它们都是喜欢和一个普通的Activity窗口缠绵在一起.大家可 以充分地想象这样的一个3W场景:输入法窗口在上面,壁纸窗口在下面,Activity窗口夹在它们的中间.在前面一篇文章中,我们已经分析过输入法窗口 是如何压在Activity窗口上面的了.在这篇文

Azure平台 对Twitter 推文关键字进行实时大数据分析

Learn how to do real-time sentiment analysis of big data using HBase in an HDInsight (Hadoop) cluster. Social web sites are one of the major driving forces for Big Data adoption. Public APIs provided by sites like Twitter are a useful source of data

一个使用微软Azure blob实现文件下载功能的实例-附带源文件

Running the sample Please follow the steps below. Step 1: Open the CSAzureServeFilesFromBlobStorage.sln as Administrator. Expand the CSAzureServeFilesFromBlobStorage application and set CSAzureServeFilesFromBlobStorage azure application as the startu

Windows azure下的Linux vm密码重置

上一篇我们介绍了windows azure下的windows vm下的密码忘记重置,今天介绍一下,在windows azure下的linux vm的密码重置. 密码忘记有两种方式,一种是知道需要重置的账户密码,一一种是不知道需要重置的密码. 比如上届管理员创建完后工作没交接就走了,本届管理员不知道密码,不知道重置那个密码,所以windows azure就用覆盖的方法来完成从重置密码操作. 先决条件 微软 Azure Linux 代理 2.0.5 或更高版本.请注意,大多数 Azure 虚拟机 L

How to install and configure Azure PowerShell

https://azure.microsoft.com/en-us/documentation/articles/powershell-install-configure/ In this article: How to: Install Azure PowerShell How to: Connect to your subscription How to use the cmdlets: An example Getting Help Additional Resources 11 Comm

远程调试 Azure 上的 Website

让我们先检查一下使用的 Azure SDK 版本和 Visual Studio 版本.根据MSDN的介绍,Azure 的远程调试功能是在 Azure SDK 2.2 中加入的,所以请确保您的机器上安装了2.2或者是更新的 Azure SDK. 关于 Visual Studio 的版本问题,MSDN上的描述也很有趣.大意是使用 Visual Studio 2012 已经可以远程调试 Azure 上的 Website 了,但是 Visual Studio 2013 又对此做了很多的提升.个人理解最好

Azure运维系列 3:安装和使用Azure PowerShell管理云

前面讲到了很多的管理方式,包括Azure中国最近更新的预览版管理门户和Azure云助理,都是非常不错的管理Azure的方式,今天我们再来介绍一种更加高效的管理方式Azure PowerShell.熟悉命令行的朋友都知道,Linux之所以那么好用是因为其强大的命令行工具,可以简单直接的管理我们的服务器.应用等.然而在很早之前微软也推出了自己的命令行渠道,没错就是我们大名鼎鼎的PowerShell. 为什么说PowerShell那么强大呢?因为从Windows 8之后的产品.2007之后的服务端系统

azure Machine learing studio 使用示例之 - 使用线性回归算法完成预测评估

本文演示如何使用azure studio基于云测试数据创建第一个machine learning的experiment,算法选择是线性回归.首先要有一个azure studio账号,登录后进入dashboard. 创建一个BLANK的Experiment 添加测试数据 , 搜索Price, 选择Automibile price data(Raw) 把这个模块拖到右边的data item位置 搜索Project column模块,拖到右边,在Project columns中点击 'Launch c