Git Product home page Git Product logo

azure-docs-json-samples's Introduction

JSON samples in Azure documentation

This repository contains JavaScript Object Notation (JSON) samples that are used in Azure Resource Manager (ARM) documentation. There are samples that show the syntax, such as an array function or deploy a single resource such as storage account. There are also samples that deploy multiple resources needed to complete a tutorial.

Directory structure

The following table describes the repository's contents with links to the directories. The directories have readme.md files with links to articles that use the samples. When practical, direct links are used to a sample's first occurence in an article.

Directory Purpose
application-insights Azure Application Insights Profiler for Service Fabric, virtual machines, or virtual machine scale sets.
azure-resource-manager ARM syntax examples: functions, linked and nested templates, multiple instances, scope, template specs, and what-if.
container-instances Container Instances that mount a volume with an empty directory, Git repository, or a secret.
custom-providers Deploy a custom resource provider in Azure.
deployment-script Use Azure CLI or PowerShell to run scripts in templates.
event-grid Deploy Azure resources to migrate Event Hubs data to Synapse Analytics.
get-started-deployment Templates deployed from local computer, linked templates, or use Azure Pipelines.
get-started-with-templates Templates used in the ARM tutorial series Beginner JSON templates.
linked-template-relpath Use a relative path for linked templates.
managed-app-existing-vnet Template and UI definition that defines a managed application to integrate with a virtual network.
management-level-deployment Deploy resources at the management group level. For example, policies or role assignments.
tutorial-sql-extension Use SQL extensions to import a SQL BACPAC file into a SQL database.
tutorial-vm-extension PowerShell script that's linked in an article.
tutorials-use-key-vault Template to deploy a key vault that's linked in a tutorial.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Legal Notices

Microsoft and any contributors grant you a license to the Microsoft documentation and other content in this repository under the Creative Commons Attribution 4.0 International Public License, see the LICENSE file, and grant you a license to any code in the repository under the MIT License, see the LICENSE-CODE file.

Microsoft, Windows, Microsoft Azure and/or other Microsoft products and services referenced in the documentation may be either trademarks or registered trademarks of Microsoft in the United States and/or other countries. The licenses for this project do not grant you rights to use any Microsoft names, logos, or trademarks. Microsoft's general trademark guidelines can be found at http://go.microsoft.com/fwlink/?LinkID=254653.

Privacy information can be found at https://privacy.microsoft.com/en-us/

Microsoft and any contributors reserve all others rights, whether under their respective copyrights, patents, or trademarks, whether by implication, estoppel or otherwise.

azure-docs-json-samples's People

Contributors

davidsmatlak avatar dlepow avatar kumudd avatar lastcoolnameleft avatar mgblythe avatar microsoft-github-policy-service[bot] avatar microsoftopensource avatar mmacy avatar monikareddy-msft avatar msftgits avatar mumian avatar pckls avatar pierreroman avatar sheisanchez avatar smurawski avatar spelluru avatar swathidhanwada-msft avatar tfitzmac avatar tvuylsteke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

azure-docs-json-samples's Issues

symbolic name for bicep resources

@mumian - I think using the symbolic name shown below sends the wrong message:

resource provide_unique_name 'Microsoft.Storage/storageAccounts@2019-06-01' = {

Shouldn't provide_unique_name be just a simple name for the resource like stg ? If users try to reference the storage account somewhere else in the template they would have use the long name.

shouldn't use reference function

@mumian - a resource deployed in a template shouldn't use the reference function to get the properties.

I see:
output storageEndpoint object = reference(storageAccountName).primaryEndpoints

It should be more like:
output storageEndpoint object = stg.primaryEndpoints

Issue with deployment() function documentation

Visual studio flags this syntax as incorrect

uri(deployment().properties.templateLink.uri

I'm unclear what's wrong with it, as I have lifted it directly from the site above. There seems to be no valid way, at least from the perspective of VisualStudio to correctly leverage this function.

uri(deployment().templateLink

According to VisualStudio the above is 100% correct, but the error returned from the deployment is that templateLink is not valid, only name and properties are valid. Yet, NEITHER of those two things show up when I attempt to use them. When I put them in manually it shows me the red wavy that means it's wrong.

It's difficult to leverage some of these when I'm unable to fully understand why the provided MS examples don't work. Can we get a full breakdown of all available properties for all functions in the documentation please?

Use parameters inside string

How can I use these parameters inside a string?

For example I have the following line in my template

"path": "/v2/datasets/@{encodeURIComponent(encodeURIComponent(parameters('sql_2_server')))},@{encodeURIComponent(encodeURIComponent(parameters('sql_2_database')))}/query/sql"

As I have tried, I want to pass two parameters sql_2_server and sql_2_database inside this.

What's the syntax for this??

ARM split() documentation - splitting an empty string results in an unexpected array.

When using split to create an array from an empty string, the result is an array with one string that has no value. While it's possible to work around this (below), it was unexpected behaviour - maybe I'm wrong, but personally I would have expected an empty array with a length of 0.

It would be helpful if this behaviour was mentioned in the documentation.

Workaround...

"variables": {
    "containers": "[if(equals(length(parameters('containersString')), 0), json('[]'), split(parameters('containersString'), ','))]"
},

Dynamic names output

Not an issue, but it would be nice to have generation of dynamic names output.
Someting like this

  "outputs": {
    "networks": {
      "type": "array",
      "copy": {
        "count": "[length(variables('networks'))]",
        "input": "[variables('networks')[copyIndex()]]",
        "name": "[concat('some', variables('networks')[copyIndex()])]"
      }
    }
  }

So, this code just expand array, and 'networks' property is not put to the output

Azure Firewall OMS template has wrong/outdated queries.

I imported the Azure Firewall OMS template but it seems the strings changed values and now
Unique Source IPS show up empty in addition to Denied Application URLS.

Can anybody update it? I tried but coudn't figure out the syntax to the query.

shouldn't use concat with bicep

@mumian - we shouldn't use the concat function in bicep.

I see:
var storageAccountName_var = concat(projectName, uniqueString(resourceGroup().id))

Which I believe can be:
var storageAccountName_var = '${projectName}${uniqueString(resourceGroup().id)}'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.