azure-powershell

Check If Azure Resource Group Exist - Azure Powershell

霸气de小男生 提交于 2019-12-06 17:29:02
问题 I'm trying to verify if ResourceGroup exist or not so i thought that following code should return true or false, but it doesn't output anything. $RSGtest = Find-AzureRmResource | Format-List ResourceGroupName | get-unique $RSGtest -Match "$myResourceGroupName" Why am I not getting any output? 回答1: There is a Get-AzureRmResourceGroup cmdlet: Get-AzureRmResourceGroup -Name $myResourceGroupName -ErrorVariable notPresent -ErrorAction SilentlyContinue if ($notPresent) { # ResourceGroup doesn't

Add a Azure WebApp to an Existing VPN using a Point-to-Site connection (RM Powershell)

我的未来我决定 提交于 2019-12-06 11:58:55
问题 I have hunted around for an answer to this, but I am not having much luck. All the articles I can find are either setting up a Point-to-Site or are instructions for classic Azure, not Azure 2.0 (Resource Group) Currently, we are dialing up a whole new resource group everytime we do a new built. This consists of Web apps and SQL DBs. When we have a new build we start up the new and del the old resource group. Simple. To minimize the start-up time we have a static resource group that isn't

Powershell - Create Azure Deployment Package

蓝咒 提交于 2019-12-06 09:58:58
问题 I've a web solution with 4 web projects. On successful build I need to create a azure deployment package via powershell. Could someone help me whether we can create a azure deployment packages (cspkg, csdef and cscfg). Thanks. 回答1: Here is a good example: Windows Azure 4: Deploying via PowerShell Also: Publish a Package using a Powershell Script This describe the process in detail. 回答2: For this, your solution must contain cloud projects so that your projects are enabled to be deployed in

Calling Set-AzureServiceDiagnosticsExtension with Role parameter fails

旧街凉风 提交于 2019-12-06 05:09:07
问题 I'm trying to set Azure diagnostics on a deployed cloud service using the Azure Powershell cmdlets and the Set-AzureServiceDiagnosticsExtension command: Set-AzureServiceDiagnosticsExtension -StorageContext $storageContext -DiagnosticsConfigurationPath $diagnosticsConfiguration.FullName -ServiceName $serviceName -Slot Production -Role "MyService.Web"-Verbose Doing so I get the following error Exception: Microsoft.WindowsAzure.CloudException: BadRequest: The extension ID MyService.Web

Create AD application with VSTS task

跟風遠走 提交于 2019-12-06 04:32:18
I am trying to create a VSTS task, which should create an AD application. Taken the DeployAzureResouceGroup as a sample, I have created to following script: [CmdletBinding()] param() Trace-VstsEnteringInvocation $MyInvocation Import-VstsLocStrings "$PSScriptRoot\Task.json" $connectedServiceNameSelector = Get-VstsInput -Name "connectedServiceNameSelector" -Require $connectedServiceName = Get-VstsInput -Name "connectedServiceName" $connectedServiceNameClassic = Get-VstsInput -Name "connectedServiceNameClassic" $domains = (Get-VstsInput -Name "domains").Split(";") $appName = Get-VstsInput -Name

Deployment slot specific appsettin in ARM template?

我们两清 提交于 2019-12-05 23:08:11
问题 I'm trying to get into that Visual Studio Resource Group template. So far it's looking good, and I have added some appsettings for a web app, but my question is, how can I make them deployment slot specific? Is there something in the json for the template or the parameter file? 回答1: Please have a try to add the json code snipped in the ARM template. I have tested it. It works successfully. "resources": [ { "apiVersion": "2015-08-01", "name": "appsettings", "type": "config", "dependsOn": [ "

How does Azure PowerShell work with username/password based auth?

大兔子大兔子 提交于 2019-12-05 21:54:26
问题 I want to understand how Azure PowerShell makes Azure API calls using AAD username/password based credentials. My understanding is that an app needs a client-id before it can make Azure API calls. This client ID must be registered with a user’s account. Does Azure PowerShell have a client-id? If so, how does it work without explicitly registering it with Azure accounts? Is it a special id that has been whitelisted across accounts? 回答1: You don't need to create an application registration in

Login-AzureRmAccount from VS Code terminal

随声附和 提交于 2019-12-05 18:18:05
问题 When I try to login to Azure RM from VS Code terminal it just hangs. No prompt with login / password is shown. Is there any way to get logged in from that terminal? Otherwise running / debugging Azure PS scripts becomes more complicated than it should be :) 回答1: The login window pops-up in the background... if you minimize all your windows you'll eventually find it. 回答2: You need to wait for a moment, then you could see the login page. According to your description, I suggest you could select

Add a Azure WebApp to an Existing VPN using a Point-to-Site connection (RM Powershell)

◇◆丶佛笑我妖孽 提交于 2019-12-04 16:48:41
I have hunted around for an answer to this, but I am not having much luck. All the articles I can find are either setting up a Point-to-Site or are instructions for classic Azure, not Azure 2.0 (Resource Group) Currently, we are dialing up a whole new resource group everytime we do a new built. This consists of Web apps and SQL DBs. When we have a new build we start up the new and del the old resource group. Simple. To minimize the start-up time we have a static resource group that isn't deleted that houses the VPN connection to our on Prem resources. The problem I'm having is when I add the

Azure Web App: Delete all files before publish

孤者浪人 提交于 2019-12-04 13:47:41
When publishing to our Azure Web App using the following Powershell script, we often have issues whereby files from the previous publish cause runtime errors. param($websiteName, $packOutput) $website = Get-AzureWebsite -Name $websiteName # get the scm url to use with MSDeploy. By default this will be the second in the array $msdeployurl = $website.EnabledHostNames[1] $publishProperties = @{'WebPublishMethod'='MSDeploy'; 'MSDeployServiceUrl'=$msdeployurl; 'DeployIisAppPath'=$website.Name; 'Username'=$website.PublishingUsername; 'Password'=$website.PublishingPassword} Write-Output "Stopping web