《Windows Azure Platform 系列文章目录

  

  之前介绍的ARM Template,都是使用文本编辑器来编辑JSON文件的。

  文本讲介绍如何使用Visual Studio,编辑JSON Template。

  本文使用Visual Studio 2015 with Update 3进行编辑,安装了Azure SDK 2.9。

  如果读者使用的是Visual Studio 2013和Azure SDK 2.9,大部门的界面是和笔者的截图类似。笔者强烈建议安装最新的Visual Studio和Azure SDK。

  前提:

  1.安装Visual Studio 2015 with Update 3

  2.安装Azure SDK 2.9

  1.运行Visual Studio 2015 with Update 3

  2.创建一个Azure Resource Group项目。如下图:

  

  

  3.模板选择Blank Template

  

  

  4.项目创建完毕后,不包含任何项目,我们选择Templates,双击 azuredeploy.json

  

  

  5.显示如下图的JSON Outline,我们可以添加新的资源,点击resources,邮件,Add New Resource。如下图:

  

  6.在弹出的界面中,输入Storage Account,然后色织storage account name (必须为小写英文),如下图:

  

  7.修改Visual Studio项目中的azuredeploy.json文件,内容如下:

{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"leinewstorageType": {
"type": "string",
"defaultValue": "Standard_LRS",
"allowedValues": [
"Standard_LRS",
"Standard_ZRS",
"Standard_GRS",
"Standard_RAGRS",
"Premium_LRS"
]
},
"storageAccounts_leistorageaccount_name": {
"defaultValue": "leistorageaccount",
"type": "String"
}
},
"variables": { },
"resources": [
{
"name": "[parameters('storageAccounts_leistorageaccount_name')]",
"type": "Microsoft.Storage/storageAccounts",
"location": "[resourceGroup().location]",
"apiVersion": "2015-06-15",
"dependsOn": [],
"tags": {
"displayName": "leinewstorage"
},
"properties": {
"accountType": "[parameters('leinewstorageType')]"
}
}
],
"outputs": {
}
}

  8.修改azuredeploy.parameters.json文件,内容如下:

{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"storageAccounts_leistorageaccount_name": {
"value": "leinewstorageaccount"
}
}
}

  最后通过Azure PowerShell进行发布,命令如下:

# sign in
Write-Host "Logging in...";
Add-AzureRmAccount -EnvironmentName AzureChinaCloud; # select subscription
Write-Host "Selecting subscription '$subscriptionId'";
Select-AzureRmSubscription -SubscriptionID $subscriptionId; #创建Resource Group
New-AzureRmResourceGroup -Name $resourceGroupName -Location $resourceGroupLocation #部署Template
New-AzureRmResourceGroupDeployment -ResourceGroupName "[ResourceGroupName]" -TemplateFile "[FilePath]" -TemplateParameterFile ["ParameterFilePath"];

  参考资料:https://azure.microsoft.com/en-us/documentation/articles/vs-azure-tools-resource-groups-deployment-projects-create-deploy/

  

Azure ARM (7) ARM Template - 使用Visual Studio编辑的更多相关文章

  1. Azure - Create your first function using Visual Studio

    Azure Functions lets you execute your code in a serverless environment without having to first creat ...

  2. AngularJS SPA Template For Visual Studio

    单页面应用程序(SPA)[使用JavaScript.CSS和HTML强大的功能,可以构建一个单页面应用程序(SPAs)],它提供了丰富的用户体验页面.导航技术和AJAX提供必要的功能,而不用重新加载页 ...

  3. How to export a template in Visual Studio?

    Create a customize template file: 1.template arguments introduction like: 上图只是其中一部分,更多请查看文后的参考资源 tem ...

  4. ASP.NET Core + Angular 2 Template for Visual Studio

    多个月以来,我和多个Github上的社区贡献者一起建立支持库.包,我们最终的目的是希望完成这样一个作为起点的模板,也就是基于把Typescript代码和Angular2宿主在ASP.NET Core项 ...

  5. Visual Studio编辑类模板的位置

    VS的版本一直在不断更新,每个版本的安装目录都是有一点变化,所以模板文件的位置也是不一样的,下面是从StackOverflow看到的一个大合集,转发记录一下: Extract, edit and re ...

  6. 用Visual Studio编辑Linux代码

    估计很多人都是用惯了Visual Studio的主,怎么也不适应Linux的一套编辑器,比如vim.source insight这些东西,可视化的eclipse效果还好点,但一般以远程共享一台Linu ...

  7. visual studio 编辑窗口 设置固定选项卡 使窗口选项卡多行显示

    工具>选项> 确定后 如图就可以多行显示了.

  8. Visual studio 编辑combobox程序卡死的问题

    问题描述:使用vs2017开发一个winform小程序,一用combobox就卡死. 问题解决:关闭有道词典的取词功能. 软件开多了,就容易有冲突啊!

  9. Visual Studio 编辑代码量大的文件时分屏技巧

随机推荐

  1. Java Spring IOC用法

    Java Spring IOC用法 Spring IoC 在前两篇文章中,我们讲了java web环境搭建 和 java web项目搭建,现在看下spring ioc在java中的运用,开发工具为In ...

  2. 双击防止网页放大缩小HTML5

    幕双击放大或缩小.即相当于这样设置 <meta name="viewport" content="width=device-width, initial-scale ...

  3. Yii2 中自定义实例名称

    Yii2高级模板中,以frontend 和backeend的模式来分离前后台,这样的优势是 工程可以独立开发和部署.很大程度上起到解耦作用. 如果我们希望再增加名为 [api]一个过程怎么办? 第一步 ...

  4. 让人一用钟情的VS插件系列之一——Web Essentials(Web开发必备利器)

    返回VS插件总目录 本篇目录 初识Web Essentials 看国外大牛如何评价Web Essentials Web Essentials下载与安装 Web Essentials涉及到了哪些内容 初 ...

  5. js中的深复制和浅复制

    在实际情况中经常会遇到对对象复制的问题.比如在处理项目中的一笔多结构的数据存储或者调用,这个时候你就要对对象(json)进行操作,而不同的操作根据不同的需求来定义.其中最常见最普遍的是对对象的复制,重 ...

  6. 论checkbox和radio的样式美化问题

    如果你下定决心要改变现有的默认的checkbox和radio的样式,那么我目前有两种办法: 1.自己动手写一个,也就是自己写代码实现将input的checkbox和radio默认的样式隐藏掉,使用绝对 ...

  7. mysql: error while loading shared libraries: libmysqlclient.so.16

    [root@host_41 mysql]# mysqlmysql: error while loading shared libraries: libmysqlclient.so.16: cannot ...

  8. CSS的两个小知识点 伪类选择器和display:table-cell

    li:first-child {color:red} li:nth-child(3n) {color: red} 在对nth-child传参的时候,已经直接用公式,3n就表示3的倍数.多用伪类和伪元素 ...

  9. salesforce 零基础学习(三十八)Translate 的使用(国际化处理)

    本篇参考:http://resources.docs.salesforce.com/200/17/en-us/sfdc/pdf/salesforce_workbench_cheatsheet.pdf ...

  10. salesforce 零基础学习(三十六)通过Process Builder以及Apex代码实现锁定记录( Lock Record)

    上一篇内容是通过Process Builder和Approval Processes实现锁定记录的功能,有的时候,往往锁定一条记录需要很多的限制条件,如果通过Approval Processes的条件 ...