зеркало из
1
0
Форкнуть 0
A set of templates, snippets, and scripts that demonstrate creating and deploying Azure Resource Management Templates in cross-platform environments.
Перейти к файлу
microsoft-github-policy-service[bot] bf8d8c1acf
Microsoft mandatory file (#48)
Co-authored-by: microsoft-github-policy-service[bot] <77245923+microsoft-github-policy-service[bot]@users.noreply.github.com>
2022-10-18 11:28:45 -07:00
.vs New Snippets and Re-Order (#26) 2018-10-19 11:59:04 -07:00
Bash Resolve final code review comments 2016-01-11 11:42:35 -08:00
PowerShell Resolve final code review comments 2016-01-11 11:42:35 -08:00
VSCode Add snippet for APIM (#47) 2019-08-26 10:14:25 -07:00
.gitattributes Initialize cross-platform tooling samples 2015-12-16 18:25:40 -08:00
CONTRIBUTING.md Initialize cross-platform tooling samples 2015-12-16 18:25:40 -08:00
LICENSE Initialize cross-platform tooling samples 2015-12-16 18:25:40 -08:00
README.md Simplify VS Code snippets instructions 2019-07-22 12:02:11 -07:00
SECURITY.md Microsoft mandatory file (#48) 2022-10-18 11:28:45 -07:00

README.md

Microsoft Azure Cross-Platform Tooling Samples for Windows, Mac and Linux

A set of templates, snippets, and scripts that demonstrate creating and deploying Azure Resource Management Templates in cross-platform environments.

See Authoring Azure Resource Manager Templates for more information on how to author Azure Resource Group Templates.

Prerequisites

Windows

OSX/Linux

Configure Visual Studio Code to Use the JSON Snippets

  • Copy the contents of VSCode\armsnippets.json to the clipboard
  • In Visual Studio Code, navigate to File > Preferences > User Snippets > JSON.
  • Append (paste) the contents of VSCode\armsnippets.json into your user snippets file before the final "}".
  • Save and close the user snippets file.

Edit Sample Templates using Visual Studio Code

  • Launch Visual Studio Code.
  • Navigate to File > Open Folder and select either the Bash or PowerShell folder as appropriate.
  • Open *VirtualMachineSample.json and put the insertion point after the first "[" following "resources:".
  • Type "arm" and you'll see a list of available resource snippets. Choose one and it'll be inserted at the current cursor location. Freshly inserted snippets have tokens you can type in values for, and you can tab through the different tokens.
  • As you're editing the properties on objects in your template, IntelliSense dropdowns will appear to suggest available values. You can also select a value and hit Ctrl+Space to see the list of options.
  • Descriptions for properties are displayed as you edit the property or mouse over them (if a description is defined in the schema).
  • If you have any schema validation issues in your template you'll see squiggles in the editor. You can view the list of errors and warnings by hitting Ctrl+Shift+M or clicking the glyphs in the lower left status bar.

Deploy Sample Templates from the Command Line

Windows

  • Open a PowerShell command prompt and run Login-AzureRmAccount to login.
  • If the account has access to multiple subscriptions, use Select-AzureRmSubscription -SubscriptionId <Subscription Id> to switch to the one you want use.
  • Update the values in the PowerShell\WindowsVirtualMachineSample.parameters.json file.
  • Run the PowerShell script: .\PowerShell\Deploy-AzureRmResourceGroup.ps1 -TemplateFile .\PowerShell\WindowsVirtualMachineSample.json -Location <Azure Region>.

OSX/Linux

  • Open a terminal window and run azure login to login.
  • If the account has access to multiple subscriptions, use azure account set <subscriptionNameOrId> to switch to the one you want to use.
  • Update the values in the Bash/LinuxVirtualMachineSample.parameters.json file.
  • Run the bash Script: Bash/azure-rg-deploy.sh -f Bash/LinuxVirtualMachineSample.json -l <Azure Region>.

Feedback

If you have any feedback on this example, please file an issue in the Issues section of this project.