azure-resource-manager

Referencing a Managed Service Identity in ARM-template deploy

半城伤御伤魂 提交于 2019-12-03 11:07:12
问题 When deploying a Microsoft.Web resource with the new MSI feature the principleId GUID for the created user is visible after deployment. Screenshot below shows the structure in the ARM-template. What would be the best way to fetch this GUID later in the pipeline to be able to assign access rights in (for instance) Data Lake Store? Is it possible to use any of the existing ARM template functions to do so? 回答1: I just struggled with this myself. The solution that worked for me was found deep in

Why are Azure Resource Groups associated with a specific region?

我的梦境 提交于 2019-12-03 09:36:55
I'm new to Azure architecture and am trying to understand why Azure Resource Groups, which are logical deployment buckets for applications built on Azure, are associated with a region when they are defined. At first I thought it was to provide global distribution for disaster recovery or geographic redundancy, but then I realized that a single Resource Group can contain web apps in different regions, which can provide those features via Traffic Manager. I suppose that using separate Resource Groups would help better identify which resources are in which region, but other than for

Referencing a Managed Service Identity in ARM-template deploy

我们两清 提交于 2019-12-03 02:36:54
When deploying a Microsoft.Web resource with the new MSI feature the principleId GUID for the created user is visible after deployment. Screenshot below shows the structure in the ARM-template. What would be the best way to fetch this GUID later in the pipeline to be able to assign access rights in (for instance) Data Lake Store? Is it possible to use any of the existing ARM template functions to do so? I just struggled with this myself. The solution that worked for me was found deep in the comments here . Essentially, you create a variable targeting the resource you are creating with the MSI

Authenticating to Azure Resource Manager with a Service Principal in Azure Automation

半腔热情 提交于 2019-12-02 21:28:01
问题 So there's now a documented workaround to use ARM in Azure Automation, and it's also well documented how to authenticate to ARM using a Service Principal. But even after following these steps I still cannot get the combination of those to work. Running my runbook in Automation with a Service Principal always gives the following error: New-AzureTag : Your Azure credentials have not been set up or have expired, please run Add-AzureAccount to set up your Azure credentials. At Add

Azure rest apis to ListKeys of classic storage account

一个人想着一个人 提交于 2019-12-02 17:38:28
问题 I wanted to retrieve the access keys of classic storage account. I found this online POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys?api-version=2016-12-01 But this is not applicable for classic storage account. When I replace the Microsoft.Storage to Microsoft.ClassicStorage, it throws the following error { "error": { "code": "InvalidRequestUri", "message": "The request uri

Azure rest apis to ListKeys of classic storage account

一世执手 提交于 2019-12-02 10:26:35
I wanted to retrieve the access keys of classic storage account. I found this online POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys?api-version=2016-12-01 But this is not applicable for classic storage account. When I replace the Microsoft.Storage to Microsoft.ClassicStorage, it throws the following error { "error": { "code": "InvalidRequestUri", "message": "The request uri is invalid. The requested path '/subscriptions/{subscriptionID}/resourceGroups/{myresourcegroup}

Azure Marketplace: Is it possible to use images in Managed Application offer?

只谈情不闲聊 提交于 2019-12-02 08:35:28
问题 I created Azure Managed Application. I used managed images in mainTemplate.json to create new VMs, like in example: { "type": "Microsoft.Compute/images", "apiVersion": "2018-04-01", "name": "front-image", "location": "[parameters('location')]", "properties": { "storageProfile": { "osDisk": { "osType": "linux", "osState": "Generalized", "blobUri": "[concat('https://sdfasdfasdf.blob.core.windows.net/images/myserver.vhd')]", "caching": "ReadWrite", "storageAccountType": "Standard_LRS" } } } }, {

Azure Marketplace: Is it possible to use images in Managed Application offer?

半世苍凉 提交于 2019-12-02 07:06:47
I created Azure Managed Application. I used managed images in mainTemplate.json to create new VMs, like in example: { "type": "Microsoft.Compute/images", "apiVersion": "2018-04-01", "name": "front-image", "location": "[parameters('location')]", "properties": { "storageProfile": { "osDisk": { "osType": "linux", "osState": "Generalized", "blobUri": "[concat('https://sdfasdfasdf.blob.core.windows.net/images/myserver.vhd')]", "caching": "ReadWrite", "storageAccountType": "Standard_LRS" } } } }, { "apiVersion": "2016-04-30-preview", "type": "Microsoft.Compute/virtualMachines", "name": "myserver",

Can Secrets From Objects Created in ARM Templates Get Auto Added to Key Vault

夙愿已清 提交于 2019-12-02 03:56:47
If I have an Azure ARM template that can create: Azure Container Registry Azure Key Vault Is there a way for the username and password for the Azure Container Registry to be automatically be added to the Azure Key Vault using ARM templates? Is there some way to refer to the Azure Container Registry username and password secrets in ARM templates for this purpose? UPDATE @EdBoykin's answer is correct, this is what I ended up with: { "type": "Microsoft.KeyVault/vaults/secrets", "name": "[concat(parameters('key_vault_name'), '/AzureContainerRegistryKey1')]", "apiVersion": "2015-06-01", "properties

Delete Azure Resource Groups with no resources in it

帅比萌擦擦* 提交于 2019-12-01 23:58:51
I am trying to find all the Azure RM resource groups with no resources in it and delete those resource groups using PowerShell. Deleting using Portal is so time consuming. Using powershell I was able to accomplish by using the following code. Is there a better way of achieving this in powershell? $allResourceGroups = Get-AzureRmResourceGroup $resourceGroupsWithResources = Get-AzureRMResource | Group-Object ResourceGroupName $allResourceGroups | % { $r1 = $_ [bool]$hasResource = $false $resourceGroupsWithResources | % { if($r1.ResourceGroupName -eq $_.Name){ $hasResource = $true } } if(