azure-cli

ARM Templates for Azure Functions with many appSettings for different environments and slots

▼魔方 西西 提交于 2020-01-10 05:34:08
问题 I've got two Azure Function apps that use deployment slots, stage and production. These two Azure Function apps have about 50~ key:value pairs in Application Settings to define various API keys, application behavior, connection strings, etc. I want to deploy these two Azure Function apps to five different environments (CI, DEV, QA, STG, PROD). I believe that deploying these resources to Azure using ARM templates is the better choice over Azure CLI. I will create tasks in my Azure DevOps

Cosmos DB - Indexing Policy Settings

故事扮演 提交于 2020-01-06 08:13:02
问题 I am using the azure cli in order to set my indexing policy. I am using the following JSON: { "indexingMode": "consistent", "automatic": true, "includedPaths": [ { "path": "/ttl/?", "indexes": [ { "kind": "Range", "dataType": "Number", "precision": -1 } ] } ], "excludedPaths": [ { "path": "/*" } ] } The script reports no errors have occurred, however when I log into the portal and look at the indexing policy, it shows the following: { "indexingMode": "consistent", "automatic": true,

az login fails wih Azure DevOps Pipelines

旧街凉风 提交于 2020-01-05 08:36:08
问题 Since Today all our build pipelines on Azure Devops fail, when trying to execute the follwoing command: az acr helm push ... The pipeline fails with following error: ERROR: Please run 'az login' to setup account. We are running on Microsoft hosted agents using Hosted Ubuntu 1604 . Checking the latest commits for the Ubuntu image shows, that there has been a version update from 2.0.52 to 2.0.55 of the azure cli tool. https://github.com/Microsoft/azure-pipelines-image-generation/commit

Unable to create image using Azure VM

自古美人都是妖i 提交于 2019-12-25 09:20:17
问题 I need to generalize and capture a linux virtual machine. I deployed the VM using ARM template. In ARM template, I used the following to get VHD stored in storage account "storageProfile": { "imageReference": { "publisher": "[variables('imagePublisher')]", "offer": "[variables('imageOffer')]", "sku": "[variables('imageSku')]", "version": "latest" }, "osDisk": { "name": "[parameters('virtualMachineName')]", "createOption": "fromImage", "vhd": { "uri": "[concat(concat(reference(resourceId

What is the equivalent script in powershell for image-copy-extension extension from Azure CLI

旧街凉风 提交于 2019-12-25 02:15:53
问题 I need to create a VM in locationA from Image ImageB which is in locationB using powershell. Since I'm not able to do it I'm trying to create a copy of ImageB into locationA , so that it will easy for me to create the VM. I have searched for scripts to copy the images and got many results. I found one particular link which has simple script to copy images. But it is AzureCLI cmdlets. I need powershell scripts to do the job as the tool I'm using understands only powershell scripts. I have

Why does 'az vm secret format' command fail when prepping SSL cert of Linux VM deployment?

…衆ロ難τιáo~ 提交于 2019-12-25 01:07:54
问题 I am trying to prepare an SSL certificate for deployment to Linux VM hosted on Azure following the instructions provided at: HTTPS access to Azure ubuntu Virtual Machine The first line: $secret=$(az keyvault secret list-versions --vault-name myVaultName --name myCertName --query "[?attributes.enabled].id" --output tsv) executes fine, and $secret contains the expected value. However when I execute the second line: $vm_secret=$(az vm secret format --secret "$secret") I get an error: unable to

Creating more than one user while provisioning azure linux vm via CLI

风格不统一 提交于 2019-12-24 23:20:15
问题 I'm trying to create a linux virtual machine on azure via terraform and my requirement is to setup multiple user accounts on OS. I'm relatively new to Azure Cloud and went through some basic documentation but couldn't find what i was looking for. I want to automate the process either via terraform or shell scripting by taking advantage of azure-cli . If anybody has anything relevant to my use case or point me towards direction for any alternative way to achieve this task then that would be

Azure CLI : bash script to upload files in parallel

走远了吗. 提交于 2019-12-24 21:55:18
问题 Is there a Azure CLI upload option to parallel upload files to blob storage. There is folder with lots of files. Currently the only option I have is do a for loop with below command and upload is sequentially. az storage blob upload --file $f --container-name $CONTAINERNAME --name $FILEINFO 回答1: For now, it is not possible. With the Azure CLI 2.0 there is no option or argument to upload the contents of a specified directory to Blob storage recursively. So, Azure CLi 2.0 does not support

Azure PowerShell or CLI command to Provide a User with Owner access to a specific Web Application

穿精又带淫゛_ 提交于 2019-12-24 19:52:59
问题 I have around 100 Azure Web Apps and Azure Functions which I created using Azure PowerShell and CLI, now I need to assign Owner Access to these Web Apps to users (Separate users for each Web Apps) I am unable to find any sample for this, most sample are pointing to Assigning Resource Group Level Access, but not to the Specific Resource. The task is achievable in the Azure Portal, just need the PowerShell or CLI command to assign users owner or contributor rights to these specific resources.

Deploy Code from GitLab Repository to Azure Web App using PowerShell and Azure CLI

旧城冷巷雨未停 提交于 2019-12-24 08:58:42
问题 I would like to setup continuous deployment from a GitLab repository to an Azure App using a PowerShell script and the Azure CLI. There is already an answer for doing this using the Azure RM module and Windows PowerShell, but as these are now deprecated, I am looking specifically for a solution that uses the new Az module and PowerShelll Core. The solution should give a a PowerShell (Core) script to setup a Continuous Deployment directly from GitLab to Azure. It must make use of the Az module