azure-powershell

shell.azure.com is failing in configuration

試著忘記壹切 提交于 2020-04-17 20:28:51
问题 While doing something I got option to execute shell commands from azure portal. It required to configure shell.azure.com first time. In first step it is giving option of selecting Subscription & create storage. When I select required subscription & click on create storage, it is giving error: Error: 409 {"error":{"code":"StorageAccountAlreadyTaken", "message":"The storage account named ... is already taken"}} Can't create a storage account. Please try again. I tried multiple times but no

How to create a Linux AppService Plan with New-AzAppServicePlan?

℡╲_俬逩灬. 提交于 2020-04-16 05:53:51
问题 What is the equivalient of this code using New-AzAppServicePlan ? az appservice plan create --resource-group $ServerFarmResourceGroupName ` --name $AppServicePlanName ` --is-linux ` --location $ResourceGroupLocation ` --sku $AppServicePlanTier ` --number-of-workers $NumberOfWorkers Is there really no way to create an App Service Plan using Az Powershell? Why can it only be done via Azure CLI or ARM? I only found this answer, which basically uses ARM directly: How do I use Powershell to create

import Azure Devops pipeline variables from json file

∥☆過路亽.° 提交于 2020-03-21 03:39:27
问题 I want to use json file to store variables used by powershell script. In azure devops I have configured pipeline, pipeline contains powershell script with a list of variables in it. I would like to use json file and store in this file all variables. I want to store json file in Azure repo, and use it once pipeline is started. I dont want to use variable groups. I found this solution [ Json to Variable ]https://marketplace.visualstudio.com/items?itemName=OneLuckiDev.json2variable&targetId

Powershell error Remove-AzureStorageBlob Method not found: 'Void

為{幸葍}努か 提交于 2020-03-05 05:53:05
问题 Getting Error while calling Remove-AzureStorageBlob Powershell Remove-AzureStorageBlob -Container $ConName -Blob $BlobName -Context $Ctx Remove-AzureStorageBlob : Method not found: 'Void Microsoft.WindowsAzure.Storage.OperationContext.set_StartTime(System.DateTime)'. At line:1 char:1 + Remove-AzureStorageBlob -Container $ConName -Blob $BlobName -Context ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : CloseError: (:) [Remove-AzureStorageBlob],

How to hide warnings from Azure powershell command lets

和自甴很熟 提交于 2020-02-23 10:21:07
问题 Am getting warnings when i invoke some azure commandlets. Example: Get-AzureStorageAccount -StorageAccountName $storageName -ErrorAction SilentlyContinue -WarningAction SilentlyContinue -verbose:$false New-AzureStorageAccount -StorageAccountName $storageName -Location $storageLocation -ErrorAction Stop -WarningAction SilentlyContinue -verbose:$false WARNING : GeoReplicationEnabled property will be deprecated in a future release of Azure PowerShell. The value will be merged into the

How to unpack or fetch a value of a nested variable stored in Azure DevOps Build Piplines' Variables group?

…衆ロ難τιáo~ 提交于 2020-02-22 05:36:10
问题 Is it possible to use variable inside a variable in Powershell script with Azure Pipelines variables? SCENARIO Two variables are set in Azure Pipelines Variable group - DeploymentCredentials a. DeployUATApiPassword = "123456" b. DeployPRODApiPassword = "789654" Another variable is set in the Variables section of the pipeline as DeploymentEnvironment At runtime, the value of the DeploymentEnvironment variable is set as either UAT or PROD Based on the enviornment, I want to fetch the password

The term 'New-AzureRmServiceBusNamespace' is not recognized as the name of a cmdlet, function, script file, or operable program

 ̄綄美尐妖づ 提交于 2020-01-24 16:57:29
问题 I was getting below error The term ' New-AzureRmServiceBusNamespace ' is not recognized as the name of a cmdlet, function, script file, or operable program. If i try to run Import-Module AzureRM.ServiceBus I get below error The member 'FormatsToProcess' in the module manifest is not valid: Cannot find path 'C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager\AzureRM.ServiceBus.\Microsoft.Azure.Commands.ServiceBus.format.ps1xml' because it does not exist

Azure Powershell - Check to see if resource exists

萝らか妹 提交于 2020-01-24 02:42:08
问题 I'm using Powershell to automate setting up my Azure environment - to create storage account, database, website, etc. In development, I want to provision and a tear down a lot. Very often, I want to run my provisioning script and create a azure asset if it doesn't already exist However, I haven't found an elegant way of doing this. Some of the "Get" cmdlets throw exceptions if the item doesn't exist, and catching it is a bit of a hack: try { $storageAcct = Get-AzureStorageAccount

How to start Azure VM(Deallocated) use REST API

a 夏天 提交于 2020-01-16 02:14:38
问题 I found a very strange problem here: In Azure powershell, we can use Start-AzureVM -ServiceName "mypc" -Name "mypc" for both VM state= stop or stop(Deallocated). But for Azure Mangement API We can use start role only for VM state= stop VM state=stop(deallocated) can't use that API.. How can I use REST API to start VM with State=Stop(deallocated)? Thanks. 回答1: The Windows Azure PowerShell cmdlets use the Service Management REST API - but it uses an undocumented 2013-06-01 version. It is

Unable to Add Azure DB Firewall Rule to Allow Build Server to Run Tests

落花浮王杯 提交于 2020-01-14 08:55:29
问题 We use a Visual Studio Online-hosted build server to automate our build process. As part of this I'm looking into adding unit and integration tests into this process. These tests require access to our SQL Azure DBs (2 of them, both on the same server), which in turn requires access through the DB server's firewall. I have a PowerShell script which uses New-AzureRmSqlServerFirewallRule to add IP addresses to the DB server, and these firewall rules are successfully showing up in the Azure