azure-resource-group

Delete Azure Resource Groups with no resources in it

久未见 提交于 2019-12-20 03:32:41
问题 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

Azure Policy Deny :if one of the tag not present in the resource group name

耗尽温柔 提交于 2019-12-11 17:45:47
问题 I've created an Azure Policy, i wanted to deny the resource group creation if user doesn't specify tag with key "Env" or "use" But when i create the resource group with Env tag it blocks me, it only allows me when i add both the tag which is env and use. As per my understanding "anyof" in azure policy is used as "OR" but my code isn't behaving the same wa { "if": { "allOf": [ { "field": "type", "equals": "Microsoft.Resources/subscriptions/resourceGroups" }, { "anyof": [ { "field": "tags.Env",

How can I divide an existing template into linked Templates

一个人想着一个人 提交于 2019-12-11 07:32:20
问题 Auto generated arm templates aren't meant to be production ready, they need refinement. that is expected. How can a Devops staff divide auto generated ARM templates into Linked templates? References Linked Templates https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-linked-templates Azure ARM template deployment https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-overview#template-deployment 回答1: How can a Devops staff divide auto generated

What does “hidden-link:” mean in Azure Resource Manager Tags

有些话、适合烂在心里 提交于 2019-12-10 12:38:49
问题 I exported an Azure Resource Manager JSON template from my resource group on Azure. I see a bunch of tags in the generated file like: "tags": { "hidden-link:/subscriptions/[my-subscription-id-here]/resourceGroups/[my-resource-group]/providers/Microsoft.Sql/servers/[my-database-server-name]/databases/[my-database-name]": "Resource" }, The only documentation I can find on it is from Using tags to organize your Azure resources, which says: You may see tags that start with "hidden-" and "link:".

How to use an Environment variable in an Azure Resource Management Template

淺唱寂寞╮ 提交于 2019-12-07 21:57:50
问题 I have searched and read the documentation of Resource Management Template, but i couldn't find any information over Environment variables. I tried to define 2 environment variables in a variable object, but it didn't work. variables": { "mailPass": "TYUl5491", "SlackToken": "hrtu-12546233785-55454578422-56454412348-87845155121ht5621552521er55547123" } Is there any way to define environment variables in an Azure Resource Management Template and then use it for the web app or api app? 回答1: Yes

How to use an Environment variable in an Azure Resource Management Template

半世苍凉 提交于 2019-12-06 15:55:00
I have searched and read the documentation of Resource Management Template, but i couldn't find any information over Environment variables. I tried to define 2 environment variables in a variable object, but it didn't work. variables": { "mailPass": "TYUl5491", "SlackToken": "hrtu-12546233785-55454578422-56454412348-87845155121ht5621552521er55547123" } Is there any way to define environment variables in an Azure Resource Management Template and then use it for the web app or api app? Yes, for a WebApp you can do that, here's the snippet of a full WebApp resource, replace values and names with

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": [ "

Deployment slot specific appsettin in ARM template?

情到浓时终转凉″ 提交于 2019-12-04 05:12:21
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? Tom Sun - MSFT 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": [ "[resourceId('Microsoft.Web/Sites/Slots', variables('webSiteName'), 'Staging')]" ], "properties"

Update WadCfg “only” of existing Azure Service Fabric cluster?

那年仲夏 提交于 2019-12-04 04:59:20
问题 I want to monitor Perfomance metrics of a existing Service Fabric Cluster. Here is the link of Performance metrics - https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-diagnostics-event-generation-perf I went through this Microsoft documentation - https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-diagnostics-perf-wad My problem is, The ARM template I downloaded during Service Fabric creation time is quite big and contains lot of params and I don't have the

Azure: share resource across multiple resource group

Deadly 提交于 2019-12-02 12:50:16
问题 Is it possible to share a particular resource (redis cache in my case) across multiple resource group? 回答1: Your redis cache could be used from any code you write, whether in the cloud, on-premises, or wherever, given proper uri + access key. As long as you have access keys/passwords/etc. to your resources, you can use your resources no matter what resource group they're in. This includes ssh keys, vm usernames/passwords, redis cache keys, storage keys, cosmos db keys, sql database logins,