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
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
Reply
Quote
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
Remove-Azureaccount (Can't get Azure credentials to stick in Powershel)的更多相关文章
- Credentials(Rails5.2新) 很基础的知识点,具体还要实操。
Credentials(Rails5.2新) 增加config/credentials.yml.enc 憎加config/master.key 移除了5.1使用的config/secrets.yml, ...
- Azure Storage Blob Go SDK示例
简介 前面一篇博客介绍了关于Azure ManagerAPI Go SDK的使用,本篇继续介绍使用Blob Go SDK 操作中国区Azure Blob. SDK下载: go get github.c ...
- 【Azure Developer】调用SDK的runPowerShellScript方法,在Azure VM中执行PowerShell脚本示例
当需要通过代码的方式执行PowerShell脚本时,可以参考以下的示例. Azure SDK中提供了两个方法来执行PowerShell脚本 (SDK Source Code: https://gith ...
- 【Azure Developer】使用Java代码启动Azure VM(虚拟机)
问题描述 在使用Java的启动Azure VM的过程中,遇见了com.azure.core.management.exception.ManagementException: Status code ...
- 【Azure Developer】使用Java SDK代码创建Azure VM (包含设置NSG,及添加数据磁盘SSD)
在参考Azure官方文档进行VM创建时,发现其中没有包含如何设置NSG的内容,以及如何在创建时就添加数据磁盘的代码(设置磁盘为SSD类型).本文的内容以"使用 Java 创建和管理 Azur ...
- windows环境:idea或者eclipse指定用户名操作hadoop集群
方法 在系统的环境变量或java JVM变量添加HADOOP_USER_NAME(具体值视情况而定). 比如:idea里面可以如下添加HADOOP_USER_NAME=hdfs 原理:直接看源码 /h ...
- Android窗口管理服务WindowManagerService对壁纸窗口(Wallpaper Window)的管理分析
文章转载至CSDN社区罗升阳的安卓之旅,原文地址:http://blog.csdn.net/luoshengyang/article/details/8550820 Android系统中,壁纸窗口和输 ...
- 【Azure Developer】【Python 】使用 azure.identity 和 azure.common.credentials 获取Azure AD的Access Token的两种方式
问题描述 使用Python代码,展示如何从Azure AD 中获取目标资源的 Access Token. 如要了解如何从AAD中获取 client id,client secret,tenant id ...
- How to install and configure Azure PowerShell
https://azure.microsoft.com/en-us/documentation/articles/powershell-install-configure/ In this artic ...
随机推荐
- [转]RMAN检测数据库坏块
backup validate check logical database; select * from v$database_block_corruption; RMAN> backup v ...
- ubuntu下mediawiki的使用
wiki语法确实比较麻烦 终于找到一种简单的方法,LibreOffice可以直接导出为wiki格式 https://apps.ubuntu.com/cat/applications/libreoffi ...
- 使用PowerShell读取SharePoint里列表的内容
1. 在https://www.microsoft.com/en-us/download/details.aspx?id=42038这里下载SharePoint Online Client Compo ...
- Neil·Zou 语录一
1 既然选择了远方 Since I’ve chosen to go far 便只顾风雨兼程 I will just walk down the path I chose step by ste ...
- 微信小程序wafer
1.Centos 重启nginx systemctl restart|stop|start|status nginx.service status是状态,可以看出nginx是否正在运行! system ...
- [工具分享]JetBrains ReSharper 9.0 正式版和注册码
话不多说.直接上百度云盘分享链接.有需要的盆友去下载吧. 百度云盘:http://pan.baidu.com/s/1kTKIQhh 注册码这里提供一个.有需要的自己拿走.或者可以使用压缩包里面的key ...
- iOS - + initialize 与 +load
一.+ initialize 方法和+load 调用时机 首先说一下 + initialize 方法:苹果官方对这个方法有这样的一段描述:这个方法会在 第一次初始化这个类之前 被调用,我们用它来初始化 ...
- 线程中调用python win32com
在python的线程中,调用win32com.client.Dispatch 调用windows下基于COM组件的应用接口, 需要在调用win32com.client.Dispatch前,调用pyth ...
- Python开发程序:选课系统-改良版
程序名称: 选课系统 角色:学校.学员.课程.讲师要求:1. 创建北京.上海 2 所学校2. 创建linux , python , go 3个课程 , linux\py 在北京开, go 在上海开3. ...
- 使用CTE减少统计子查询
Set Statistics IO ON SET STATISTICS TIME ON --/*--原来语句 DECLARE @CkNo nvarchar(4000),@ProWarn int,@Sk ...