arm-template

Attach public ip to nic base on parameter like public or privateonly with multiple VM'S [closed]

泪湿孤枕 提交于 2019-12-11 08:58:04
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 10 months ago . How to attach public ip based on parameter privateonly or public, trying to create it with multiple vms. I am giving here full template which i am running. { "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "location": {

Passing credentials to DSC script from arm template

你说的曾经没有我的故事 提交于 2019-12-11 06:26:29
问题 I am trying to deploy a VM with a DSC extension from an ARM template. According to various sources, and even this SO question, I am following the correct way to pass a credential object to my script: "properties": { "publisher": "Microsoft.Powershell", "type": "DSC", "typeHandlerVersion": "2.19", "autoUpgradeMinorVersion": true, "settings": { "modulesUrl": "[concat(parameters('_artifactsLocation'), '/', variables('ConfigureRSArchiveFolder'), '/', variables('ConfigureRSArchiveFileName'), '/',

Pass Powershell switch to an Azure Resource Manager Template (ARM)

你离开我真会死。 提交于 2019-12-11 04:52:57
问题 How can I directly pass a powershell switch (System.Management.Automation.SwitchParameter) to an ARM template (which will be used as a condition in the template itself)? Currently I am using the workaround of converting the switch to an string. 回答1: Lets say your switch is called fullversion: param( ... [switch]$fullversion ) and your parameterfile also contains a parameter called fullversion then you can pass it like: New-AzureRmResourceGroupDeployment -fullversion $fullversion.IsPresent 来源:

How to check if name already exists? Azure Ressource Manager Template

倾然丶 夕夏残阳落幕 提交于 2019-12-11 04:39:38
问题 is it possible to check , in an ARM Template, if the name for my Virtual Machine already exists ? I am developing a Solution Template for the Azure Marketplace. Maybe it is possible to set a paramter in the UiDefinition uniqe? The goal is to reproduce this green Hook 回答1: A couple notes... VM Names only need to be unique within a resourceGroup, not within the subscription Solution Templates must be deployed to empty resourceGroups, so collisions with existing resources aren't possible For

Set an appsetting value conditionally in an ARM template

余生长醉 提交于 2019-12-11 04:26:11
问题 We have an Azure ARM template, which is adding appsettings for a Microsoft.Web/site. "resources": [ { "apiVersion": "2016-03-01", "name": "myazurefunction", "type": "Microsoft.Web/sites", "properties": { "name": "myazurefunction", "siteConfig": { "appSettings": [ { "name": "MY_SERVICE_URL", "value": "[concat('https://myservice-', parameters('env'), '.domain.ca')]" } ] } } } ] We also have four parameters.environment.json files. For instance, this is the content of parameters.dev.json . { "

Is there a way to enable application logging to blob for azure app service using PowerShell or ARM template?

江枫思渺然 提交于 2019-12-11 04:11:05
问题 We enable application logging to blob for azure app service in the Azure portal. Is there a way to do this using PowerShell or ARM template. If yes, please provide sample code. 回答1: Is there a way to do this using PowerShell or ARM template. If yes, please provide sample code. We use the powershell command Set-AzureRmResource -Properties to do that. We also could get the command from https://resources.azure.com/ . It works correctly on my side. Login-AzureRmAccount # get the log setting

How the if() function executes in Azure Resource Manager Templates

。_饼干妹妹 提交于 2019-12-11 02:45:32
问题 I am using if() functions in my ARM template to conditionally set some connection string values in my Web App resource. The current condition looks like this. "[if(equals(parameters('isProduction'), 'Yes'), concat(variables('redisCacheName'),'.redis.cache.windows.net:6380|', listKeys(resourceId('Microsoft.Cache/Redis', variables('redisCacheName')), '2015-08-01').primaryKey, '|', variables('resourcePrefix')), parameters('redisSessionStateConnection'))]" To simplify it, the condition looks like

Private IP address in reserved subnet range

筅森魡賤 提交于 2019-12-11 02:21:50
问题 I have an arm template that has a vNet with 2 subnets. I am trying to deploy a Nic to one of these with a static private IP address. It used to be dynamic, and it worked fine. Now it is static, I have set the IP I want the nic to have, but when I deploy, it says the IP is invalid. I tried changing the IP I set, but it still doesn't work... Extracts from my template: (subnetPart is a parameterised number as we have several vnets that will be connected, but the subnets need to not clash)

How to use secureObject or securestring returned from a linked ARM template

天涯浪子 提交于 2019-12-10 23:45:36
问题 How do I use the value of a returned securestring or secureObject that is returned from a linked ARM template? For example, one child linked template named CreateStorage creates an Azure storage account creates blob containers on that account creates a SAS key for the container returns the SAS key in the templates outputs section. e.g. returning SAS in the templates outputs: "outputs": { "createdContainerSas": { "type": "string", "value": "[concat('https://', variables('storageAccountName'),

Azure Functions: how to set CORS via automation?

时光毁灭记忆、已成空白 提交于 2019-12-10 18:12:30
问题 I have an azure function app that I would like to set up in repeatable (automated) manner so that I can duplicate it in different environments/resource groups. I'm able to create the function app via the azure cli, but I also need to configure the CORS options such that I can call it from a browser. I've found where to do that in the azure portal web ui, in the 'Platform Features' tab(https://docs.microsoft.com/en-us/azure/azure-functions/functions-how-to-use-azure-function-app-settings#cors)