我试图通过Azure资源管理器创建一个网站,然后从私有Github存储库进行部署.
我有一个适用于公共存储库的ARM模板.如果我然后将存储库设为私有,请通过Portal连接到它,一切正常.
如果我重新部署ARM模板,它将失败并显示消息
"Cannot find SourceControlToken with name GitHub."
Run Code Online (Sandbox Code Playgroud)
似乎当门户连接到私有仓库时,它将创建一个用于进行身份验证的ssh密钥.
ssh密钥似乎来自kudu,可以在部署站点后获得.
我也尝试过使用访问令牌,但无法使用访问令牌
所以简单的问题是,如何通过ARM模板部署私有仓库
我正在做一些清理,使用以下命令将一些Azure云服务移动到新创建的资源组
Find-AzureRmResource -ResourceNameContains "oldresourcename" |
Move-AzureRmResource -DestinationResourceGroupName "newresourcegroup" -Verbose
Run Code Online (Sandbox Code Playgroud)
一切都很顺利,但我跑的最后一个似乎需要很长时间.它是一个简单的CS,具有一个辅助角色,一个Web角色和小尺寸.
该命令已处于未完成状态超过一个小时,在Portal上,两个资源组在页面顶部都有紫色的"移动资源".我要等到明天才能看到它是否仍然存在,但它不应该花这么长时间.
有没有办法取消或停止此操作?关注的是两个资源组都被锁定,直到这个过程完成,这将是一个前进的问题.
azure azure-powershell azure-resource-manager azure-resource-group
我正在开发一个PowerShell脚本,它将创建一个资源组,将所包含的应用程序(在本例中为Web Api)注册到相关的AAD.但是,在调用尝试分配Reader权限时,它会继续失败.
我从Visual Studio(2015)中的AzureResourceGroup模板附带的基本部署*.ps1文件开始.
我正在运行以下代码:
#Requires -Version 3.0
#Requires -Module AzureRM.Resources
#Requires -Module Azure.Storage
Import-Module Azure -ErrorAction SilentlyContinue
Set-StrictMode -Version 3
Login-AzureRmAccount
$tenantWebSite = New-AzureRmADApplication -DisplayName "TheSiteName" -HomePage "http://MySignOnUrl" -IdentifierUris "http://MyIdentifierUrl" -Password "MyClientSecret"
$tenantWebSiteServicePrincipal = New-AzureRmADServicePrincipal -ApplicationId $tenantWebSite.ApplicationId
New-AzureRmRoleAssignment -RoleDefinitionName Reader -ServicePrincipalName $tenantWebSite.ApplicationId
Run Code Online (Sandbox Code Playgroud)
最后一个命令(New-AzureRmRoleAssignment)继续失败并出现以下错误:
09:58:26 - [ERROR] New-AzureRmRoleAssignment : PrincipalNotFound: Principal
09:58:26 - [ERROR] 50f3d430c68b485b8c11a63552171550 does not exist in the directory
09:58:26 - [ERROR] <MyTenantId>.
09:58:26 - [ERROR] At D:\dev_new_2010\cto\src\dev\d.tom.0\deploy\calidos.maat.deploy.azureresource
09:58:26 - [ERROR] group\Scripts\Deploy-AzureResourceGroup.ps1:115 char:1
09:58:26 …Run Code Online (Sandbox Code Playgroud) powershell azure azure-active-directory azure-resource-manager service-principal
我正在使用ARM模板部署到Azure Web Apps,该站点部署到许多环境,ARM模板为每个环境接受不同的参数.
其中一个要求是在某些环境中启用站点上的IP块,而不启用其他环境中的IP块.这可以通过web.config完成,但这并不理想,因为我通过ARM管理所有应用程序设置并执行压缩网站的web部署.为每个环境添加转换将是一件痛苦的事情,需要进行大量的返工.
我想在我的模板文件中指定类似的内容:
{
"type": "config",
"apiVersion": "2015-08-01",
"name": "web",
"properties": {
"ipSecurityRestrictions": {
"allowUnlisted": false,
"ipAddresses": [ "127.0.0.1", "127.0.0.2" ]
}
},
"dependsOn": [
"[concat('Microsoft.Web/sites/', parameters('nameofwebapp'))]"
]
}
Run Code Online (Sandbox Code Playgroud)
使用resources.azure.com浏览资源提供程序"Microsoft/Web"时,似乎这可能是因为"config/web"上存在"ipSecurityRestrictions"属性.
ARM Explorer代码在此处显示,并提示其用法.我也可以在.netSDK中找到它的过去使用情况(用完链接).
当我尝试使用resources.azure.com设置它时,我得不到任何反馈,它返回为null.
任何人都可以帮助我详细了解如何使用这个属性?
我试图在Azure中编写一堆资源的脚本,作为其中的一部分,我需要一个Web应用程序,以便能够通过vNet与VM上运行的服务进行通信.
我创建了一个模板,它似乎做了创建连接所需的一切,但由于某种原因没有建立连接.查看门户网站显示该站点已连接到vNet并且证书已同步,但vNet网关上的点对站配置未显示活动连接.
但是,如果我从vNet断开Web应用程序的连接,然后使用Azure门户中的设置按钮重新连接到同一个vNet,一切都可以正常工作.
我的模板中肯定会有一些东西丢失,但过去几个小时看起来我无法解决问题
这是我的ARM模板
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
},
"variables": {
},
"resources": [
{
"type": "Microsoft.Network/networkSecurityGroups",
"name": "[variables('nsgName')]",
"apiVersion": "2016-03-30",
"location": "[parameters('location')]",
"properties": {
"securityRules": []
},
"resources": [ ],
"dependsOn": [ ]
},
{
"type": "Microsoft.Network/networkSecurityGroups",
"name": "[variables('infrastructureNsgName')]",
"apiVersion": "2016-03-30",
"location": "[parameters('location')]",
"properties": {
"securityRules": []
},
"resources": [ ],
"dependsOn": [ ]
},
{
"type": "Microsoft.Network/virtualNetworks",
"name": "[variables('vnetName')]",
"apiVersion": "2016-03-30",
"location": "[parameters('location')]",
"properties": {
"addressSpace": {
"addressPrefixes": [
"10.1.0.0/16"
]
},
"subnets": [ …Run Code Online (Sandbox Code Playgroud) 我能够成功登录Login-AzureRmAccount.此外,我能够在Login-AzureRmAccount的返回值中看到我的订阅.但登录后,如果我键入Get-AzureSubscription它返回空.
找到下面的截图
我试图编写一个ARM模板,用新的静态网站(预览)功能创建一个存储帐户:
当我转到Automation Script刀片时,我在ARM模板中看不到任何相关设置:
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"storageAccounts_spastore_name": {
"defaultValue": "spastore",
"type": "String"
}
},
"variables": {},
"resources": [
{
"type": "Microsoft.Storage/storageAccounts",
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"kind": "StorageV2",
"name": "[parameters('storageAccounts_spastore_name')]",
"apiVersion": "2018-02-01",
"location": "westeurope",
"tags": {
"purpose": "example"
},
"scale": null,
"properties": {
"networkAcls": {
"bypass": "AzureServices",
"virtualNetworkRules": [],
"ipRules": [],
"defaultAction": "Allow"
},
"supportsHttpsTrafficOnly": false,
"encryption": {
"services": {
"file": {
"enabled": true
},
"blob": {
"enabled": true
}
},
"keySource": "Microsoft.Storage"
}, …Run Code Online (Sandbox Code Playgroud) azure azure-storage azure-storage-blobs azure-resource-manager
有没有办法通过 ARM 模板创建 Azure 存储队列?我可以找到一种创建容器的方法,但找不到与通过 ARM 创建存储队列相关的任何内容。
azure azure-storage azure-resource-manager azure-rm-template
如何通过资源类型和标识符识别 ARM 模板中是否存在 azure 资源
我有两个 Azure Function 应用程序,它们使用部署槽、阶段和生产。这两个 Azure Function 应用程序在应用程序设置中有大约 50 个键:值对,用于定义各种 API 密钥、应用程序行为、连接字符串等。
我想将这两个 Azure Function 应用程序部署到五个不同的环境(CI、DEV、QA、STG、PROD)。我相信使用 ARM 模板将这些资源部署到 Azure 是比 Azure CLI 更好的选择。我将在我的 Azure DevOps 发布管道中创建任务来实现这一点。
为了将 ARM 模板分解为易于维护的内容,我想为每个环境创建一个 ARM 模板参数文件。为 Azure 函数定义部署文件时,要定义的属性之一是siteConfig 对象,您可以在其中使用 NameValuePair 对象定义 appSettings 对象。对于每个环境,阶段和生产槽将具有不同的 API 密钥、连接字符串和应用程序行为。我的部署文件使用生产槽和阶段槽创建了 Azure Function 应用。在部署文件中,我必须两次提供 appSettings NameValuePair 对象。然后,我必须为每个环境创建 5 个不同的参数文件。乘以 2,因为我有两个插槽。
参数文件中定义的所有参数都必须在参数对象中的部署模板文件中定义也是如此吗?
我可以只从参数文件中传入一个带有 NameValuePairs 的对象数组,这样我就不必在顶部的部署文件中以及函数应用的 siteConfig.appSettings 下定义完整的参数列表吗?
此处的文档显示您只能提供字符串数组或具有多个键值的单个对象。但是 appSettings 是一个对象数组,其中每个对象都有 3 个键值对。
这就是资源在部署文件中的样子。我想简单地从参数文件中引用整个对象数组,但看起来文档说明我在部署文件的顶部定义了所有 50~ 个参数,然后参数文件在由 Azure CLI 或Azure DevOps 任务。
{
"type": "Microsoft.Web/sites",
"apiVersion": "2018-11-01",
"name": "[parameters('function-app-name')]",
"location": "[parameters('location')]",
"tags": …Run Code Online (Sandbox Code Playgroud) azure azure-resource-manager azure-cli azure-deployment-slots azure-functions