《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. Dubbo框架选型

    一.为什么会是dubbo 1.Dubbo是一个分布式服务框架,提供RPC(远程过程调用协议,它是一种通过网络从远程计算机程序上请求服务,而不需要了解底层网络技术的协议.) 远程服务调用方案,以及SOA ...

  2. NancyFx开发-Razor视图using外部Dll解决方案

    问题:NancyFx框架 Razor视图无法using 其他项目DLL   解决方案: Nancyfx框架Razor需要在web.config 中声明要引入的命名空间(包括system这些)   &l ...

  3. ASP.NET 5系列教程 (一):领读新特性

    近期微软发布了ASP.NET 5.0,本次发布的新特性需求源于大量用户的反馈和需求,例如灵活的跨平台运行时和自主部署能力使ASP.NET应用不再受限于IIS.Cloud-ready环境配置降低了云端部 ...

  4. 我的ORM之一 -- 查询

    我的ORM索引 概述 http://code.taobao.org/svn/MyOql/ 这是我自己写的开源ORM教程,我想先从场景示例中切入介绍,先有一个感性的认识,以小见大,触类旁通,有了这个认识 ...

  5. 来看看Windows9到底是什么

    今天有新闻一直在说windows 8.2 windows9,还给出了一张很有趣的图 我们就假设这张图是真的. 这张图透漏出两个信息 其一:开始菜单真的回来了. 不过还是不死心,绝不放弃开始屏,确实,开 ...

  6. [ZigBee] 6、ZigBee基础实验——定时器3和定时器4(8 位定时器)

    上一节讲了16位定时器1,本节讲8位定时器3和定时器4! 1.综述 Timer 3 and Timer 4 are two 8-bit timers(8位定时器). Each timer has tw ...

  7. 在Mongoose中使用嵌套的populate处理数据

    假设有如下mongodb的schema定义: drawApply = new Schema({ salesId: { type: Schema.ObjectId, ref: 'sales' }, mo ...

  8. QT屏蔽qDebug的方法

    在工程文件.pro里面添加 DEFINES += QT_NO_WARNING_OUTPUT\                   QT_NO_DEBUG_OUTPUT 然后rebuild all.这样 ...

  9. 内存角度探寻C++面向对象 之 继承、多态

    一,简单继承: #include <iostream> class TableTennisPlayer { private: int id; public: TableTennisPlay ...

  10. IBatisNet:让insert操作返回新增记录的主键值

    项目引用ibatis包: IBatisNet.Common.dll --文件版本1.6.2.0 IBatisNet.DataAccess.dll IBatisNet.DataMapper.dll 项目 ...