有没有办法在模板中使用条件语句?
例如,我正在构建模板,该模板将在QA和Production上具有包含数据磁盘的vms,但在Dev上没有数据磁盘.另一种情况是,只有一些扩展只需要安装在prod虚拟机中,但不能安装在其他地方.
任何帮助表示赞赏.
我有一个鸡和蛋问题,将我的Web应用程序部署Application Insights到Azure.在ARM模板中,Application Insights模块依赖于应用程序ID的Web站点(请参阅下面的ARM模板中的依赖项).另一方面,为了完全检测Web应用程序,我需要Application Insights模块中的检测键.怎么绕过这个?
门户网站中的应用程序洞察视图
用于Web App的ARM模板
应用程序洞察的ARM模板
azure azure-web-sites azure-resource-manager azure-application-insights azure-rm-template
我正在尝试从Release Management部署一个ARM模板,其中包含一个"Microsoft.Web/certificates"资源,该资源引用存储在密钥库中的证书.当密钥保管库存在于与我部署到的资源组相同的订阅中时,此方法可以正常工作.但是当密钥保管库存在于不同的订阅中时,我收到以下错误.
资源Microsoft.Web /证书的"证书名称"失败并显示消息
{
"Code": "BadRequest",
"Message": "The parameter Properties.KeyVaultId has an invalid value.",
"Target": null,
"Details": [
{
"Message": "The parameter Properties.KeyVaultId has an invalid value."
},
{
"Code": "BadRequest"
},
{
"ErrorEntity": {
"Code": "BadRequest",
"Message": "The parameter Properties.KeyVaultId has an invalid value.",
"ExtendedCode": "51008",
"MessageTemplate": "The parameter {0} has an invalid value.",
"Parameters": [
"Properties.KeyVaultId"
],
"InnerErrors": null
}
}
],
"Innererror": null
}'
Run Code Online (Sandbox Code Playgroud)
证书资源在我的模板中定义如下.
{
"type":"Microsoft.Web/certificates",
"name": "SomeName",
"location": "East US 2",
"apiVersion": "2016-03-01",
"properties": …Run Code Online (Sandbox Code Playgroud) 在Azure门户(ARM)中为VM设置Azure DSC扩展时,我们会找到以下表单.突出显示的文本字段中有什么内容,它要求我指定哪个模块?xPSDesiredStateConfiguration模块?这不起作用,我想不出任何其他.
该条目必须与正则表达式匹配: "^[^\\]+\\[^\\]+$"
将鼠标悬停在信息按钮上会显示:"模块定义配置功能,功能以'模块\功能'为格式".
我在Azure上有一个Ubuntu虚拟机(资源组,而不是经典虚拟机),所有这些都是开箱即用的.我最近尝试使用Putty SSH进入VM,但我不能.
我收到错误:Network Error: Connection Timed out.
我已确保在VM入站规则中为SSH打开了端口22.
我在大约2个月前进行了一个侧面项目的虚拟机设置,当时我能够轻松地进行SSH设置而没有任何麻烦.现在我做不到.我错过了什么吗?
PS:HTTP工作正常.我在网站上运行它,它显示在浏览器中.此外,我尝试使用基于浏览器的SSH客户端,它能够SSH到VM.
ssh virtual-machine azure azure-vm-role azure-resource-manager
我正在部署一个ARM模板,其中包括:azure函数+逻辑应用程序.
以下链接我创建了一个简单的流程:来自azure函数的方法之一调用逻辑应用程序.我们将方法命名为"A".逻辑应用程序为"B":
一个电话B.
逻辑应用程序(B)包含"回调URL".方法(A)需要有一个回调URL到逻辑应用程序(B).我需要通过"复制"这个值来设置这个变量:
在我的azure app功能中,我需要将此值设置为应用程序设置.
现在,我的ARM看起来(越来越少)像这样:
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
//(...)
},
"variables": {
//(...)
},
"resources": [
{
"type": "Microsoft.Storage/storageAccounts",
//(...)
},
{
"type": "Microsoft.Web/serverfarms",
//(...)
},
{
"apiVersion": "2015-08-01",
"type": "Microsoft.Web/sites",
"name": "[variables('functionAppName')]",
"location": "[resourceGroup().location]",
"kind": "functionapp",
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanName'))]",
"[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]"
],
"resources": [
{
"apiVersion": "2015-08-01",
"name": "web",
"type": "sourcecontrols",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', variables('functionAppName'))]"
],
"properties": {
"RepoUrl": "[parameters('repoURL')]",
"branch": "[variables('branch')]",
"IsManualIntegration": true
}
}
],
"properties": {
"serverFarmId": …Run Code Online (Sandbox Code Playgroud) azure azure-resource-manager azure-logic-apps azure-functions
我知道如何仅在Azure门户中手动设置Https.导航到我的Web应用程序>自定义域在Azure的门户开放自定义域窗格中,其中有一个"仅HTTPS"选项.将此选项设置为"On"可启用我要查找的功能.我在Benjamin Perkins博客上找到了如何手动执行此操作.遗憾的是,它不包含如何使用ARM模板以自动方式解决问题的说明.
如何在我的ARM模板中设置此"仅Https"标志,以便我可以在部署中自动执行此设置?假设我已经有一个有效的ARM部署,只需要知道为此设置专门添加到模板的位置和内容.
我想保留基于ARM模板的方法的答案.
谢谢你的时间!
azure azure-web-sites azure-resource-manager azure-web-app-service
有没有办法在 ARM 模板中检索 Application Insights(驻留在另一个资源组中)的仪器密钥?
我已经使用以下代码使用 ARM 模板创建了一个 appInsights,
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"AppInsightsName": { "type": "string" },
"Location": { "type": "string", "defaultValue": "westeurope" }
},
"variables": {
//"apiVersion": "2018-02-01-preview",
"apiVersion": "2016-08-01",
"location": "[parameters('Location')]",
"ApplicationInsightsName": "[parameters('AppInsightsName')]"
},
"resources": [
{
"apiVersion": "2014-04-01",
"type": "Microsoft.Insights/components",
"name": "[variables('ApplicationInsightsName')]",
"location": "[variables('location')]",
"kind": "other",
"properties": {
"applicationId": "[variables('ApplicationInsightsName')]"
}
}
]
}
Run Code Online (Sandbox Code Playgroud)
现在我尝试将在另一个资源组中运行的 azure 函数应用程序与此 appInsights 链接。
下面是我尝试过的代码,
{
"name": "APPINSIGHTS_INSTRUMENTATIONKEY",
"value": "[reference(resourceId(variables('AppInsightsResourceGroup'),'Microsoft.Insights/components', variables('ApplicationInsightsName'))).InstrumentationKey]"
}
Run Code Online (Sandbox Code Playgroud)
但我收到以下错误,
有人可以提供一些如何破解这个的想法吗?
azure azure-resource-manager azure-application-insights azure-rm-template
我正在为 Azure 数据工厂开发一个 ARM 模板,其中包含 SQL Server 和 Azure Datalake 的托管专用终结点。但是,当 ARM 模板完成执行时,托管专用端点将处于“待处理”状态。如何配置托管专用端点,以便在使用 ARM 模板完全配置 ADF 后将其配置为“已批准”。以下是我的 template.json 文件:
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"environment": {
"type": "string",
"metadata": {
"description": "name of environment for deployment"
}
},
"project": {
"type": "string",
"metadata": {
"description": "name of the project for building the name of resources"
}
},
"location": {
"defaultValue": "eastus",
"type": "string"
},
"adfFactoryName": {
"type": "string"
},
"adfVersion": {
"type": "string"
},
"tags": {
"type": "object", …Run Code Online (Sandbox Code Playgroud) azure azure-resource-manager azure-data-factory azure-data-lake infrastructure-as-code
我有一个逻辑应用程序(标准逻辑应用程序),可以调用cosmos DB。我需要将“连接运行时Url”存储在逻辑应用程序的配置下。
当我从逻辑应用设计器创建连接时,该连接具有此属性。但是,当我使用 ARM 模板部署相同的连接时,该连接不具有此属性。
有人知道如何获得或生成该属性吗?如果可能的话,稍后如何在 ARM 模板中调用它
谢谢
azure azure-resource-manager azure-bicep azure-logic-app-standard