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 ...
随机推荐
- 前端开发与SEO
前端开发中通过一些小习惯,可以有利于SEO,本着蚊子再小也是肉的原则,能抓住自然不能忽略. 1.控制首页链接数量,不能过多,也不要太少.更不要为了凑数而添加 2.扁平化层次,力争跳转三次可以到任何页面 ...
- springmvc HandlerInterceptoer WebRequestInterceptor MethodInterceptor使用
HandlerInterceptoer拦截的是请求地址,所以针对请求地址做一些验证.预处理等操作比较合适.
- 手机端布局rem 与vm的使用
手机端原来的时候,在项目中使用js判断出html的字体,然后根据rem设置字体,但是js本着少用的原则,考虑用vm,vh等(顺带说一句,vm vh是网页可视区域宽度 高度 即浏览器宽度减去约16px) ...
- Request 、Response 与Server的使用
纯属记录总结,以下图片都是来自 ASP.NET笔记之 Request .Response 与Server的使用 Request Response Server 关于Server.MapPath 方法看 ...
- Gradle 刷新依赖
$ ./gradlew build --refresh-dependencies
- SpringMVC的几种返回方式
package com.boventech.learning.controller; import java.util.HashMap; import java.util.Map; import or ...
- php构造方法与析构方法
1. 构造方法 <?php //构造方法 __construct() 是在实例化对象时被自动调用 //用途:可以用于初始化程序(可以给成员属性赋值,也可以调用成员方法) //语法:[修饰符] f ...
- JavaScript增强AJAX基础
<title>js类型</title> <meta http-equiv="content-type" content="text/html ...
- Issue 3:数据处理基本认识
介绍 传统数据库对数据处理一般都分成两类:OLTP和OLAP. 数据分析(OLAP)的前提条件是要准备数据. 然后才是具体的数据分析,对此,可以分为统计型的数据分析和挖掘性的数据分析. 最后对分析结果 ...
- Java class,Object,Class的区别
代码: http://www.cnblogs.com/hongdada/p/6060487.html package com.company; public class Main { public s ...