![](/img/trans.png)
[英]Azure Resource Manager Template: How to get connection string for a resource in a different ResourceGroup?
[英]How to get the applications of the resourcegroup the Azure workbook is in?
我有一個包含一些功能應用程序和 Azure 監視器工作簿的資源組。
在此工作簿中,我想列出所有應用程序。
這個怎么做? 我只設法獲得訂閱中的所有應用程序,這太多了。
首先,我創建了一個參數來獲取正確的資源組:
resourcecontainers
| where type =~ "microsoft.resources/subscriptions/resourcegroups"
| where name startswith "foo"
| project name
然后是應用程序的參數:
resources
| where type == "microsoft.web/sites"
| where resourceGroup == "{ResourceGroup}"
這是可行的,但我想擺脫 ResourceGroup 參數中的硬編碼部分: foo
我正在尋找這樣的東西:
resources
| where type == "microsoft.web/sites"
| where resourceGroup == "{_CurrentResourceGroup}"
沒有這樣的“內置”參數。 是保存“鏈接”到特定資源的工作簿,還是保存到不是完整資源的“Azure Monitor”之類的地方。
如果將其保存為鏈接到真實資源,則可以通過使用“擁有資源”選項創建資源參數來將該“擁有”資源作為參數:
該參數將始終是工作簿鏈接到的資源的值。 然后你可以用來獲取資源組/資源信息。 像{linkedToResource:resourceGroup}
或{linkedToResource:subscriptionId}
或其他什么?
因為工作簿可能不會被保存(它可能是你剛開始但從未保存過的臨時東西,它可能是一個模板等)並且在它被保存之前,工作簿本身沒有資源 ID,所以它不屬於到資源組。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.