Giter Site home page Giter Site logo

azure / azure-resource-manager-schemas Goto Github PK

View Code? Open in Web Editor NEW
603.0 67.0 514.0 44.45 MB

Schemas used to author and validate Resource Manager Templates. These schemas power the intellisense and syntax completion in our ARM Tools VSCode extension, as well as the Export Template API

License: MIT License

TypeScript 95.10% C# 3.88% Shell 0.34% JavaScript 0.69%

azure-resource-manager-schemas's Introduction

azure-resource-manager-schemas

Warning

The schemas in this repository are designed for best-effort validation, and should NOT be relied upon for accuracy or programmatic consumption. If you have a current (or potential new) dependency that you would like to discuss alternatives for, please raise an issue.

This is the repo for template deployment schemas hosted under https://schema.management.azure.com/schemas. Please see below for information on contributing and publishing updated schemas.

Updating Schemas

Note

We only publish template schemas for resource providers that are publicly available. This means that there should be no restrictions (private preview, internal-only allowlisting) on who can call your APIs. As a general rule, if there is not an API definition in the Public API Specs Repo, we will not consider a PR.

Schemas are generated and updated automatically, and should not require any action from RP teams.

Generating Locally

If you want to preview or troubleshoot generation locally, you can use the generator in this repo to generate a schema from a swagger spec checked into the azure-rest-api-specs repo.

Instructions

  1. Clone azure-rest-api-specs.
  2. Fork this repo, and clone it locally.
  3. Update submodules and build dependencies:
    git submodule update --init --recursive
    npm --prefix bicep-types-az/bicep-types/src/bicep-types ci
    npm --prefix bicep-types-az/bicep-types/src/bicep-types run build
    npm --prefix bicep-types-az/src/autorest.bicep ci
    npm --prefix bicep-types-az/src/autorest.bicep run build
  4. Run the following commands, replacing ../azure-rest-api-specs with your relative path to the swagger repo, and myprovider/resource-manager with the base path (discovered with npm --prefix generator run list-basepaths)
    npm --prefix generator ci
    npm --prefix generator run generate-single -- --specs-dir ../azure-rest-api-specs --base-path myprovider/resource-manager

Runing Unit Tests

Use the following commands to execute the test suite locally:

npm --prefix tools ci
npm --prefix tools test

Manual testing with a local schema server

This repo contains a command to run a schema web server which will host files directly from your local repo. This can be useful if you want to validate schemas against a particular tool - for example if you want to verify VSCode autocompletion and syntax highlighting. By default this will listen on port 3000, but this can be modified by editing tools/server.ts. To start an instance you can use the following commands:

npm --prefix tools ci
npm --prefix tools run serve

Once this is running, you can create a basic template with the following structure (replacing the sections between < and > as appropriate for your scenario):

{
  "$schema": "http://<hostname>:<port>/schemas/2019-04-01/deploymentTemplate.json",
  "resources": [
    {
      "type": "<providerNamespace>/<resourceType>",
      "apiVersion": "<apiVersion>",
      "properties": {
      }
    }
  ]
}

NOTE Many client tools will cache responses from schema servers, so you may need to clear this cache if you are testing modifications, or alternatively, change the port between retries.

RP Schemas Repo Issues Bot Notifications

To get quickly notified on GitHub issues for your RP's schema, please update the rp-label-to-contact.md by submitting a PR with the desired GitHub handle(s) and label for your RP.


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.

azure-resource-manager-schemas's People

Contributors

anthony-c-martin avatar anton-evseev avatar astauben avatar azcloudfarmer avatar blueww avatar dependabot[bot] avatar descatles avatar docohe avatar evgenyagafonchikov avatar gbowerman avatar grizzlytheodore avatar haitsongmsft avatar hunmix avatar jaredmoo avatar jorgecotillo avatar leni-msft avatar mabhard avatar mikhailtryakhov avatar pilor avatar quasarse avatar radennis avatar rileymckenna avatar rkmanda avatar solankisamir avatar thbagley avatar tiano2017 avatar waynekuo avatar wenwu449 avatar xynoclafe avatar yangl900 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  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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

azure-resource-manager-schemas's Issues

Proposal: Merge common definitions to single file.

Currently, if a schema is added, it must be added in two places: schemas\2014-04-01-preview\deploymentTemplate.json and schemas\2015-01-01\deploymentTemplate.json. It is an easy thing to miss.

If these were extracted out to a common file, say, schemas\common.json, this would ensure both deployment templates always kept up-to-date. Also, if a new version of deploymentTemplate is added, it will simplify maintenance.

It could also serve as a home for common definitions found across files that are highly unlikely to changes (GUID definition, for example)

(I'm happy to hack on this, but wanted to see what thoughts were first)

Missing schemas for Microsoft.Web Resource Provider

The schema of resource type 'Microsoft.Web/connections' is not available. Resources of this type will not be exported to the template. (Code: ResourceTypeSchemaNotFound)

Could not get resources of the type 'Microsoft.Web/sites/config'. Resources of this type will not be exported. (Code: ExportTemplateProviderError)

Could not get resources of the type 'Microsoft.Web/sites/extensions'. Resources of this type will not be exported. (Code: ExportTemplateProviderError)

image

Cheers,
Trevor Sullivan
https://trevorsullivan.net
https://twitter.com/pcgeek86

Microsoft.Authorization apiVersion is outdated in the schema

The schema for Microsoft.Authorization Resource Provider lists only the 2015-01-01 apiVersion, but this version is not supported by the platform. We need an updated schema to match platform support.

screen shot 2016-03-08 at 8 45 11 am

screen shot 2016-03-08 at 8 32 33 am

Cheers,
Trevor Sullivan
Microsoft MVP: PowerShell

Is Azure Cloud Services dead?

Since there is no schema to create a Cloud Service with the Azure RM, one start to wonder if Azure Cloud Services are dead, and you just moved on without telling anyone about it like you did with SilverLight?

Top-level resource's Resource Type is showing as invalid

Problem

While authoring a very simple ARM JSON Template in Visual Studio Code 0.10.2 on Mac OS X El Capitan 10.11.1, I came across a bug in the ARM JSON Template validation, where I'm being told that Microsoft.Storage/storageAccounts isn't a valid top-level ARM Resource Type, and instead, am being told that it must be set to Microsoft.Network/publicIPAddresses.

screen shot 2015-12-01 at 2 18 10 pm

# Expected Result

I would expect that this ARM JSON Template would validate, in its current form, with the exception that I may need to specify additional properties on the Storage Account resource itself. This template, in its current form, has nothing to do with the Microsoft.Network ARM Resource Provider, and really should have no reason to reference the publicIPAddresses Resource Type.

Should I also report this on the VSCode GitHub repository?

Cheers,
Trevor Sullivan
Microsoft MVP: PowerShell

Microsoft.Web/sites/extensions VS2015 Errors

Should the connectionString property support an empty string?
Should the setParameters property support expression values?

"name": "MSDeploy",
"type": "extensions",
"location": "[resourceGroup().location]",
"apiVersion": "2015-08-01",
"properties": {
  "connectionString": "",
  "setParameters": {
    "IIS Web Application Name": "[variables('appServiceName')]"
  }

Both of these are reported as schema errors in VS2015

String must be at least 1 characters long and at most 2147483647
Value must be one of the following types: string

Request: "Update causes" information

Hi. I have been searching for information related to deployment updates on existing resource groups, but the information I'm looking for does not seem to exist. With other orchestration APIs, they will provide information within the documentation to specify the expected behavior when properties of a resource are modified. For example, when the availability zone property of a compute resource is modified in CFN or HEAT, the resource will be replaced. This is noted in the documentation as seen below:

Would it be possible to include this type of information within the defined schemas for services? Without this information, updates to existing resources within a group remains a guessing game around life cycle and availability of specific resources.

Thanks!

Api app schema

Will there be a schema available with the new release of api app? We're using them but can't find a schema for creating them.

Microsoft.ClassicCompute/domainNames where is it?

I downloaded the template Microsoft.CloudService.1.0.1 from the gallery with Save-AzureResourceGroupGalleryTemplate and would like to see the scheme for it. Specifically if it's possible to point to a cloud package and configuration from the template to have it deployed as part of creating the resource group.

Thanks in advance.

Deploy a node.js site using Azure Resourse Manager

I'm struggling with a ARM deployment script for my node.js application. If I point to a repo with an MVC application it all works fine, but not using an node.js app.

Are there any specific settings for node.js sites? Here is the resource part of my script:

{
      "apiVersion": "2015-08-01",
      "name": "[parameters('nodeName')]",
      "type": "Microsoft.Web/sites",
      "location": "[resourceGroup().location]",
      "tags": {
        "[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('nodeName'))]": "Resource",
        "displayName": "Website"
      },
      "dependsOn": [
        "[concat('Microsoft.Web/serverfarms/', parameters('nodeName'))]"
      ],
      "resources": [
        {
          "apiVersion": "2015-08-01",
          "name": "web",
          "type": "sourcecontrols",
          "dependsOn": [
            "[resourceId('Microsoft.Web/Sites', concat(parameters('nodeName')))]"
          ],
          "properties": {
            "repoUrl": "https://github.com/microServiceBus/microservicebus.node.git",
            "branch": "master",
            "IsManualIntegration": true
          }
        }
      ],
      "properties": {
        "name": "[parameters('nodeName')]",
        "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('nodeName'))]",
        "siteConfig": {
          "appSettings": [
            {
              "Name": "hubUri",
              "Value": "[parameters('hubUri')]"
            },
            {
              "Name": "nodeName",
              "Value": "[parameters('nodeName')]"
            },
            {
              "Name": "organizationaId",
              "Value": "[parameters('organizationaId')]"
            }
          ]
        }
      }
    }

Re-synchronize against repo when deploying

I have a web app being hooked up to a repo like this:

                {
                    "apiVersion": "2015-04-01",
                    "name": "web",
                    "type": "sourcecontrols",
                    "dependsOn": [
                        "[resourceId('Microsoft.Web/Sites', parameters('name'))]",
                        "[resourceId('Microsoft.Web/Sites/config', parameters('name'), 'appsettings')]"
                    ],
                    "properties": {
                        "RepoUrl": "[parameters('repoUrl')]",
                        "branch": "[parameters('branch')]",
                        "IsManualIntegration": true
                    }
                }

Although I have full control over the repo, I've set IsManualIntegration because I don't want the web app to be updated every time I push to this branch. Instead, I'd like it to be updated against the latest commit in the repo whenever I re-deploy the template.

However, this doesn't happen when I re-deploy the template - it is stuck on the commit I originally deployed, even if I have made more commits since then. This happens regardless of if I set --mode Complete when deploying. However, if I disconnect the repo in the Azure portal and THEN re-deploy, it gets synced to the latest commit.

Is it possible for my desired behavior to be implemented?

Microsoft.Web/sites/{name}/config/web

Looking at a schema, only "netFrameworkVersion" and "phpVersion" are available on 2015-08-01 and 2014-06-01. Is it possible to extend other parameters available through resources.azure.com like virtual applications/directories and remote debugging?

Is there any guidance on how to make pull requests?

mixed types in parameters make templates difficult to parse with statically typed languages

related to #115

Since the ARM template parameters are a hash, parsing them with a statically typed language (in my case Go) is needlessly difficult. I appreciate that there is a "type" field, however, since every parameters object is a hash element, there's not an easy way to unmarshal the parameters in JSON because the some of the parameter values could be either strings or integers.

Example, given this simple parameters json:

{
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0",
  "parameters": {
    "name": {
      "type": "string",
      "minLength": 4,
      "maxLength": 20,
      "defaultValue": "myServer",
      "metadata": {
        "description": "Unique name for instance(s) and their network/storage resources"
      }
    },
    "numberOfInstances": {
      "type": "int",
      "minValue": 1,
      "maxValue": 20,
      "defaultValue": 1,
      "metadata": {
        "description": "The number of instances to be created in this request."
      }
    }
  }
}

Because of the non-idiomatic use of JSON to store parameters objects in a hash rather than an array, It's not possible to easily parse this data structure with a statically typed language, e.g., in Go my structs look like this:

type azureArmParamObject struct {
    Type          string
    DefaultValue  string
    AllowedValues []string
    MinValue      int
    MaxValue      int
    MinLength     int
    MaxLength     int
    Metadata      struct{ Description string }
}
type azureArmJson struct {
    Parameters map[string]azureArmParamObject
}

However, since the defaultvalue can either be an int or a string, and each params object is being stored as a key in the params hash, it's not possible to parse this json using my example struct.

I have to instead write a lot of extra code to work around this issue.

(*removed my editorial ๐Ÿ’ฏ )

Schema tests fail on linux (case-sensitivity issue)

Hello,

Current master branch (9986a2c) fails when launching node runSchemaTests.js under linux.
(I'd guess most of you are working on Windows ;)

The correction is minor and involves right case-sensitivity:

root@fc3277b8d5d9:/home/vagrant/azure/azure-resource-manager-schemas/tools# git diff
diff --git a/tools/ResourceMetaSchema.tests.json b/tools/ResourceMetaSchema.tests.json
index 26af7e6..702d6b4 100644
--- a/tools/ResourceMetaSchema.tests.json
+++ b/tools/ResourceMetaSchema.tests.json
@@ -303,7 +303,7 @@

     {
       "name": "resource/properties/type - Not 'object'",
-      "definition": "./ResourceMetaSChema.json#/definitions/resource/properties/type",
+      "definition": "./ResourceMetaSchema.json#/definitions/resource/properties/type",
       "expectedErrors": [
         {
           "message": "No enum match for: \"number\"",
@@ -315,7 +315,7 @@

     {
       "name": "resource/properties/type - 'object'",
-      "definition": "./ResourceMetaSChema.json#/definitions/resource/properties/type",
+      "definition": "./ResourceMetaSchema.json#/definitions/resource/properties/type",
       "json": "object"
     },

Update: corresponding pull-request #126

Paramters should be objects, not a big hash

I'm writing software that dynamically generates ARM JSON code.

JavaScriptObjectNotation is all about objects. The parameters are essentially all objects, and so the parameters section of the ARM template should be a list rather than a hash.

The resources section in ARM templates is correct, idiomatic JSON, while the parameters section is unusual, which makes it harder to work with.

I'm using Go for my program, which is a strictly typed language. To parse the params ARM code, I have to write structs that look like this:

type AzureArmParamObject struct {
    Type          string
    DefaultValue  string
    AllowedValues []string
    MinValue      int
    MaxValue      int
    MinLength     int
    MaxLength     int
    Metadata      struct{ Description string }
}

type AzureArmJson struct {
    Parameters map[string]AzureArmParamObject
} 

Usually, when working with JSON APIs, a data structure like parameters would be implemented as a list instead of a hash, and so I would write structs like this:

type AzureArmParamObject struct {
    Type          string
    Name       string // I would prefer 'Name' to be a field on the parameter object
    DefaultValue  string
    AllowedValues []string
    MinValue      int
    MaxValue      int
    MinLength     int
    MaxLength     int
    Metadata      struct{ Description string }
}

type AzureArmJson struct {
    Parameters []AzureArmParamObject
}

Since each parameter object is lacking it's name, I have to manually add it after parsing the JSON.

Microsoft.DevTestLab - can't find resource provider location

I got the following error message when trying to create a custom image under DevTestLab:

New-AzureResourceGroupDeployment : 12:47:48 - Resource Microsoft.DevTestLab/labs/virtualMachines 'testlab/lab2' failed with message 'No registered resource provider found for location 'westeurope' and API version '2015-05-01-preview' for type 'labs/virtualMachines'. The supported api-versions are '2015-05-21-preview'. The supported locations are 'eastus, westus, westeurope, eastasia, eastus2, japaneast, japanwest, centralus'.'

If I try the suggested API version I get pretty much the same error.

Microsoft.Network/dnsZones

Is this missing? I see reference for it here
https://msdn.microsoft.com/en-us/library/azure/mt163590.aspx

I see examples of using it here
https://github.com/Azure/azure-quickstart-templates/tree/master/101-azure-dns-new-zone

But when I attempt to view if from inside the schema listed in that example or the current schema available I don't see it.

"id": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",

              { "$ref": "http://schema.management.azure.com/schemas/2015-08-01/Microsoft.Network.json#/resourceDefinitions/publicIPAddresses" },
              { "$ref": "http://schema.management.azure.com/schemas/2015-08-01/Microsoft.Network.json#/resourceDefinitions/virtualNetworks" },
              { "$ref": "http://schema.management.azure.com/schemas/2015-08-01/Microsoft.Network.json#/resourceDefinitions/loadBalancers" },
              { "$ref": "http://schema.management.azure.com/schemas/2015-08-01/Microsoft.Network.json#/resourceDefinitions/networkSecurityGroups" },
              { "$ref": "http://schema.management.azure.com/schemas/2015-08-01/Microsoft.Network.json#/resourceDefinitions/networkInterfaces" },
              { "$ref": "http://schema.management.azure.com/schemas/2015-08-01/Microsoft.Network.json#/resourceDefinitions/routeTables" },
              { "$ref": "http://schema.management.azure.com/schemas/2015-11-01/Microsoft.Network.json#/resourceDefinitions/trafficManagerProfiles" },

I think this is why i'm getting an error when I attempt to deploy dns recordsets to azure in my templates.

my template, I use nested templates and dynamically build the template I push to azure, when I get to this step the deployment fails with the following

New-AzureRmResourceGroupDeployment : DeploymentNotFound: Deployment 'DnsTemplate' could not be found.
At F:\Projects\Lowes\ops\Azure\Templates\ServiceDeployment\Scripts\Deploy-AzureResourceGroup.ps1:144 char:1

  • New-AzureRmResourceGroupDeployment -Name $Name -ResourceGroupName $Re ...
  • - CategoryInfo          : NotSpecified: (:) [New-AzureRmResourceGroupDeployment], CloudException
    - FullyQualifiedErrorId : Hyak.Common.CloudException,Microsoft.Azure.Commands.Resources.NewAzureResourceGroupDeploymentCommand
    
    

{
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json",
"contentVersion": "1.0.0.0",
"parameters": {
"ZoneName": {
"type": "string",
"metadata": {
"description": "The name of the DNS zone to be created."
}
},
"RecordName": {
"type": "string",
"metadata": {
"description": "The name of the DNS record to be created. The name is relative to the zone, not the FQDN."
}
},
"IpAddress": {
"type": "string"
}
},
"resources": [
{
"type": "Microsoft.Network/dnsZones",
"name": "[concat('/',parameters('ZoneName'), concat('/A/', parameters('RecordName')))]",
"apiVersion": "2015-05-04-preview",
"location": "global",
"properties": {
"TTL": 3600,
"ARecords": [
{
"ipv4Address": "[parameters('IpAddress')]"
},
]
},
"dependsOn": [
]
}
]
}

Azure Traffic Manager Profile isn't appearing in Resource "Type"

The Azure Traffic Manager Profiles (Microsoft.Network/trafficManagerProfiles) are not showing up in the Intellisense for the Resource type property. I'm using Visual Studio Code 0.10.2 on Mac OS X El Capitan 10.11.1.

screen shot 2015-11-26 at 8 28 12 pm

There are several Azure "Quick Start" samples that demonstrate the use of this Resource Type.

https://github.com/Azure/azure-quickstart-templates/search?utf8=%E2%9C%93&q=traffic

Cheers,
Trevor Sullivan
Microsoft MVP: PowerShell

ApiVersion 2015-06-15 for Microsoft.Storage does it work?

If i try to create a storage account with the following:

{
             //Add Azure storage account  
            "apiVersion": "2015-06-15",
            "location": "[parameters('siteLocation')]",
            "name": "[parameters('newStorageAccountName')]",
            "type": "Microsoft.Storage/storageAccounts",
            "properties": {
                "accountType": "[parameters('storageAccountType')]"
            }            
        }

I get
New-AzureResourceGroup : 18:41:07 - Resource Microsoft.Storage/storageAccounts 'azuredkwebsitestorage' failed with mess
age 'No registered resource provider found for location 'westeurope' and API version '2015-06-15' for type 'storageAcco
unts'. The supported api-versions are '2015-05-01-preview, 2014-12-01-preview'. The supported locations are 'eastus, ea
stus2, westus, westeurope, eastasia, southeastasia, japaneast, japanwest, northcentralus, southcentralus, centralus, no
rtheurope'

But if I try to get the versions supported by the provider:

providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]

I actually get version 2015-06-15 , is this on purpose?

It is not a big issue as I just use an older API version but, it's not logical to me.

Microsoft.Compute missing DiagnosticsProfile schema

The diagnostic profile section of a virtual machine is missing from the schema:

"diagnosticsProfile": {
  "bootDiagnostics": {
    "enabled": "true",
    "storageUri": "[concat('http://',variables('storageAccountName'),'.blob.core.windows.net')]"
  }
}

Need schema for Microsoft.ServiceBus

The schema are missing for Microsoft.ServiceBus provider for the following resource types:

namespaces:

  • 2014-09-01

checkNamespaceAvailability:

  • 2014-09-01
  • 2015-08-01

operations:

  • 2014-09-01
  • 2015-08-01

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.