azure-powershell

Upgrade AzureRM Powershell on Hosted 2017 Agent (VSTS - Visual Studio Team Services)

Deadly 提交于 2019-11-30 12:49:00
I am using release management through Visual Studio Teams Services (online). We use Hosted build Agents and I really want to avoid the overhead of managing custom agents. One item I do need is the AzureRM PowerShell module. Versions up to 5.1.1 are available on the agent but I need 6.0.0. What I would like to do is use a step in my release process (PowerShell) to aquire version 6.0.0 and use thart instead, however I cant quite get it to work. I have tried a few approaches that have all come unstuck, the current one is: Write-Output "------------------ Install package provider -----------------

Azure automation - credentials delivered by Get-PSAutomationCredential don't work with Add-AzureAccount?

∥☆過路亽.° 提交于 2019-11-30 10:01:47
问题 I'm modifying a gallery runbook that copies a live database to a test database on a schedule. It's failing at the first hurdle; authenticating and selecting the relevatn azure subscription The runbook looks like this: $Cred = Get-AutomationPSCredential -Name 'automationCredential' Write-Output "UN: $($Cred.Username)" Add-AzureAccount -Credential $Cred I've used the portal credentials blade to create a credential named "automationCredential". For the username and password I supplied the

No default subscription has been designated. Use Select-AzureSubscription -Default <subscriptionName> to set the default subscription

半腔热情 提交于 2019-11-30 02:44:35
问题 I’m keep getting the above error when trying to execute Start-AzureService. Following information prompted when executing Get-AzureAccount: Id Type Subscriptions Tenants -- ---- ------------- ------- Me@outlook.com User 12345678-1234-5678-9012-345678901235 {12345678-1234-5678-9012-345678901235} And following information prompted when executing Get-AzureSubscription: SubscriptionId : 12345678-1234-5678-9012-345678901235 SubscriptionName : My Production (Pay-As-You-Go) Environment : MyCloud

Azure automation - credentials delivered by Get-PSAutomationCredential don't work with Add-AzureAccount?

我是研究僧i 提交于 2019-11-29 18:14:06
I'm modifying a gallery runbook that copies a live database to a test database on a schedule. It's failing at the first hurdle; authenticating and selecting the relevatn azure subscription The runbook looks like this: $Cred = Get-AutomationPSCredential -Name 'automationCredential' Write-Output "UN: $($Cred.Username)" Add-AzureAccount -Credential $Cred I've used the portal credentials blade to create a credential named "automationCredential". For the username and password I supplied the username/pw that I log into the azure portal with. Note: this is NOT a school/work microsoft account, but a

Upgrade AzureRM Powershell on Hosted 2017 Agent (VSTS - Visual Studio Team Services)

送分小仙女□ 提交于 2019-11-29 18:01:59
问题 I am using release management through Visual Studio Teams Services (online). We use Hosted build Agents and I really want to avoid the overhead of managing custom agents. One item I do need is the AzureRM PowerShell module. Versions up to 5.1.1 are available on the agent but I need 6.0.0. What I would like to do is use a step in my release process (PowerShell) to aquire version 6.0.0 and use thart instead, however I cant quite get it to work. I have tried a few approaches that have all come

Use Automation RunAs service principal to connect to Azure Analysis Services and process

橙三吉。 提交于 2019-11-29 16:29:58
TL;DR In summary the steps are: Use the correct code (the last code in this post) Manually add your app id in SSMS as either a server administrator or a database administrator and then you can process an Azure Analysis Services cube from an Azure Automation Account without needing to create another seperate service account Actual Question: I am trying to process an Azure Analysis Services cube using the Azure Automation RunAs Service Principal. This is run within an Azure automation account This code #Get the existing AzureRunAsConnection connection $Conn = Get-AutomationConnection -Name

Azure AD - enable the service principal as a an application administrator

試著忘記壹切 提交于 2019-11-29 12:12:58
I'd like to know how to have a ServicePrincipal in Azure AD that will be able to alter app registrations that it doesn't own , like remove an app or rotate its keys. I was told that if SP has "Application administrator" role then it should have enough permissions to do so. So how would I be able to achieve this in Powershell? Martin Brandl I think you are looking for the Add-AzureADDirectoryRoleMember PowerShell cmdlet. Here is an example: # Fetch role instance $role = Get-AzureADDirectoryRole | Where-Object {$_.displayName -eq 'Application Administrator'} # If role instance does not exist,

How to include “Plan information” when creating ARM VM from a captured image using Powershell?

半城伤御伤魂 提交于 2019-11-29 11:18:56
I have a ARM VM created from a Marketplace: bitnami LAMP (Ubuntu) I've successfully captured an image. During the capture I've saved the json template. Using a template based on that I can successfully create new VMs via the portal's Template Deployment facility interactively. (so the captured image is OK). Please note: That json template do include plan information, see below However my original goal is to create new ARM VMs based on the captured image using Powershell All seems to work however in the last command New-AzureRmVM returns and error stating: Creating a virtual machine from

Install-Module : The term 'Install-Module' is not recognized as the name of a cmdlet

戏子无情 提交于 2019-11-29 01:01:32
I was trying to install Azure using Install-Module Azure in PowerShell. I got the following error: PS C:\Windows\system32> Install-Module Azure Install-Module : The term 'Install-Module' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is corre ct and try again. At line:1 char:1 + Install-Module Azure + ~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Install-Module:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException Why is PS not recognizing

KeyVault generated certificate with exportable private key

ぃ、小莉子 提交于 2019-11-28 21:36:03
I'm attempting to create a self signed certificate in KeyVault using the "Self" issuer. $policy = New-AzureKeyVaultCertificatePolicy -SubjectName "CN=$($certificateName)" -IssuerName "Self" -ValidityInMonths 12 $policy.Exportable = $true Add-AzureKeyVaultCertificate -VaultName $vaultName -Name $certificateName -CertificatePolicy $policy However, when getting the certificate back it doesn't appear to have a private key. Creating certificates directly in KeyVault doesn't seem hugely covered online, after digging into the rest API documentation and source code for the powershell cmdlets, I'm