azure / azure-docs-json-samples Goto Github PK
View Code? Open in Web Editor NEWContains examples of JSON files that are included in Azure documentation.
License: Other
Contains examples of JSON files that are included in Azure documentation.
License: Other
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??
There are important files that Microsoft projects should all have that are not present in this repository. A pull request has been opened to add the missing file(s). When the pr is merged this issue will be closed automatically.
Microsoft teams can learn more about this effort and share feedback within the open source guidance available internally.
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
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'), ','))]"
},
@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
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.
As a developer using ARM templates to deploy a resource group I would like an optional tags parameter so that I can tag the resource group if required.
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?
@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)}'
@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.
I am trying to implement a linked template where a child template depends on a resource in the parent template. Is that possible?
https://github.com/Azure/azure-docs-json-samples/tree/master/deployment-script references a non-existing page: https://docs.microsoft.com/azure/azure-resource-manager/deployment-script-in-template (I couldn't find the proper link it should reference, in fact I couldn't find any mention of this feature except in some non-MS blog about Ignite 2019).
@tfitzmac, could you add expected output examples for crossresourcegroupproperties.json please?
Either here or here.
Thanks
As per https://github.com/Azure/azure-docs-json-samples/blob/master/azure-resource-manager/parameterswithfunctions.json, I tried using functions to set default value to parameters which is failing for me.
On setting a parameter as
..."virtualMachineName": { "defaultValue": "[concat('vm', uniqueString(resourceGroup().id))]", "type": "string" }, ...
default value is not as expected:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.