Azure Lei Zhang的博客

weibo: LeiZhang的微博/QQ: 185165016/QQ群:319036205/邮箱:leizhang1984@outlook.com/TeL:139-161-22926

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
  489 随笔 :: 0 文章 :: 417 评论 :: 70万 阅读
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

  《Windows Azure Platform 系列文章目录

 

  在上一节内容中,笔者介绍了如何使用Visual Studio来编辑ARM Template。

  但是在某些时候,Visual Studio安装起来太庞大了。本章将介绍使用VS Code来编辑Azure Template。

  

  1.VS Code的下载地址:https://code.visualstudio.com/

  2.运行VS Code,然后安装Azure ARM Extension。我们点击查看,扩展

  

  3.搜索azurerm,然后安装Extension。如下图:

  

 

  4.安装完毕后,选择文件,首选项,用户代码片段。如下图:

  

 

  5.然后选择JSON。

  

 

  6.新建JSON文件,然后输入以下内容:

复制代码
{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
    },
    "variables": {
    },
    "resources": [
    ],
    "outputs": {
    }
}
复制代码

 

  7.我们点击resources节点,在后面增加花括号{},然后再花括号中,写第一个字母a

  系统会进行自动提示apiVersion,我们直接按回车即可:

  

 

  8.依次输入其他内容,如下图:

  

 

  9.部署完毕后,我们还可以通过以下方式部署Azure Template

复制代码
# 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/resource-manager-vs-code/

 

posted on   Lei Zhang的博客  阅读(780)  评论(0编辑  收藏  举报
编辑推荐:
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
历史上的今天:
2013-10-31 [SDK2.2]Windows Azure Storage (15) 使用WCF服务,将本地图片上传至Azure Storage (上) 服务器端代码
点击右上角即可分享
微信分享提示