azure-powershell

Azure: Powershell: Set-AzureRmWebApp: How to set the “alwaysOn” property

拥有回忆 提交于 2020-01-03 08:53:12
问题 I am running Powershell 5 and trying to manipulate my Azure WebApp object using Set-AzureRmWebApp (and NOT Set-AzureResource) to set the "Always On" property of the web app. My basic code snippet starts with a running web app named "myWebApp" , and looks like this: $name = "myWebApp" $resourceGroupName = "myResourceGroup" $app_settings = @{"WEBSITE_LOAD_CERTIFICATES"="*";"CommonDatabase"="Common";"WEBSITE_NODE_DEFAULT_VERSION"="0.10.32"} $result1 = Set-AzureRmWebApp -ResourceGroupName

Why does Azure Application Gateway require an empty subnet

一个人想着一个人 提交于 2020-01-01 11:45:11
问题 When I try to execute New-AzureRmApplicationGatewayIPConfiguration to create an application gateway, I get an exception: Subnet xxx cannot be used for application gateway yyy since subnet is not empty. I encountered this error when I tried to add the application gateway to the same subnet as the backend servers. Why is this not an option? Does each gateway require a separate subnet? What is the recommended configuration? Related questions: The documentation says backend servers can be added

Fatal: Could not read password for 'https://OrganizationName@dev.azure.com': terminal prompts disabled

喜你入骨 提交于 2019-12-31 03:44:35
问题 I'm trying to merge the develop branch to the master branch when building with Azure Pipelines PowerShell task. But while executing the command git push , I'm getting this error: Fatal: Could not read password for 'https://OrganizationName@dev.azure.com': terminal prompts disabled The code repository is "Azure Repos Git". git checkout -b master git config --global user.email "xxxxxxx@xxxx.xxx" git config --global user.name "xxxxx" git merge origin/develop git push origin master After

Issue with KeyVault reference in ARM template

流过昼夜 提交于 2019-12-31 02:54:07
问题 I am trying to create a master key vault, which will contain all certificates to authenticate as a certain user. I have 2 service principals => One for my app, One for deployment. The idea is that the deploy service principal gets access to the Key Vault and adds the certificate located there to the Store of the web applications. I have created the service principal and I have given him all permissions on the key vault. Also I have enabled access secrets in ARM templates for that key vault.

Azure Custom Script Extension. Execute script as another user

走远了吗. 提交于 2019-12-31 02:41:52
问题 I'm using command1.ps1 script to install Azure Custom Script Extension on the target VM and execute command2.ps1. command2.ps1 is supposed to run a script (that is inside ScriptBlock) as domain administrator (hence -Credential $Credentials ). When I run command2.ps1 manually and input $domainAdminName and $domainAdminPassword it works, but when running it through command1.ps1 it doesn't work. Maybe the problem is cause by Azure Custom Script Extension running command2.ps1 as System account?

How to I connect to AAD using powershell

﹥>﹥吖頭↗ 提交于 2019-12-25 09:46:49
问题 I have an hotmail account myaccount123@hotmail.com associated with Azure subscription and AAD (Default Directory - myaccount123hotmail.onmicrosoft.com). When I execute Connect-MsolService in Microsoft AAD module for PowerShell, a login popup appears, but I'm not able to login with my hotmail credentials. Login says: hotmail.com isn't in our system 回答1: I have the same setup as you where my hotmail account (Microsoft account) is also associated with Azure subscription and AAD. Here's the

Unable to copy files using Azure Custom script extension

你离开我真会死。 提交于 2019-12-24 23:14:39
问题 I want to install tools like NAGIOS inside an Azure virtual machine once it is provisioned. I want to use "Azure Custom Script" to install the tools. Below is the code that I am using. Powershell script that is being sent as custom script: new-item "C:\newfile.txt" -Type file copy-item -Path "\\xxx.xx.x.x\c$\Nagios for windows" -Destination "C:\nagios" -Recurse Start-Process "c:\nagios\NSCP-0.4.3.143-x64.msi" /qn -Wait Problem: The first line of code is working (I have it as a sanity check to

Azure automation: Authentication succeeds but no subscriptions are returned, works in local powershell though

倖福魔咒の 提交于 2019-12-24 19:19:49
问题 Having a problem with creating an azure automation runbook that will copy a database on demand; I've created a credential and stored the u/p of the account I use to log into the portal in it. Password was written in notepad and pasted in to ensure correct. $Cred = Get-AutomationPSCredential -Name 'automationCredential' Write-Output "UN: $($Cred.Username)" Write-Output "PW: $($Cred.Password.Length)" Add-AzureRmAccount -Credential $Cred Write-Output "Deleting the old $TargetDatabaseName" Remove

How to execute more than one power shell command in a single .ps1 file

核能气质少年 提交于 2019-12-24 13:30:35
问题 I am trying to run more than one powershell command(with parameters in each command) in a single .ps1 file. i.e. In the Azure powershell i need to run these 3 commands sequentially Set-ExecutionPolicy -Scope LocalMachine -ExecutionPolicy Bypass -Force Import-AzurePublishSettingsFile New-AzureService All the above 3 command receive different parameters. I wanted to keep them in a single .ps1 file. I am trying as bellow, it is not working although not giving any exception using (PowerShell ps =

Cannot deserialize JSON array into type 'Microsoft.WindowsAzure.ResourceStack.Frontdoor.Templates.Schema.TemplateResourceCopy'

妖精的绣舞 提交于 2019-12-24 10:45:29
问题 The aim of the template is to add subnets to an existing Vnet but when executing it using the powershell command New-AzureRmResourceGroupDeployment -Name testing -ResourceGroupName rgname -TemplateFile C:\Test\deploy.json -TemplateParameterFile C:\Test\parameterfile.json The following error is displayed and I really cant understand what it means.Here is the error * "Error: Code=InvalidRequestContent; Message=The request content was invalid and could not be deserialized: 'Cannot populate JSON