-
Notifications
You must be signed in to change notification settings - Fork 16.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modifying template to dynamically generate the WebApp endpoints #2571
Conversation
Hi @dilukose, I'm your friendly neighborhood Azure Pull Request Bot (You can call me AZPRBOT). Thanks for your contribution!
TTYL, AZPRBOT; |
"resources": [ | ||
{ | ||
"apiVersion": "[variables('apiVersion')]", | ||
"name": "[concat('DemoAppServicePlan', copyIndex())]", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a better practice here would be to concat the location name - use the format for location that doesn't have spaces..
concat('DemoAppServicePlan-', variables('webAppLocations')[copyIndex()])
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed this change it since its not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there are reason we cannot do this? the sample uses geo location for demonstrating TM - would we expect developers to refer to resources by index or by location in this case (customer templates I've seen are more descriptive when labeling resources)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
want to keep this simple
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, simplify it further by removing the uniqueDnsNameForWebApp (and generate the name) and we should be good to go...
"farmName": "default" | ||
}, | ||
"variables": { | ||
"tmApiVersion": "2015-11-01", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use literal values for apiVersions - otherwise schema validation cannot be done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
}, | ||
{ | ||
"apiVersion": "[variables('apiVersion')]", | ||
"name": "[concat(parameters('uniqueDnsNameForWebApp'), copyIndex())]", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment as on serverFarm above...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed this change it since its not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there are reason we cannot do this? the sample uses geo location for demonstrating TM - would we expect developers to refer to resources by index or by location in this case (customer templates I've seen are more descriptive when labeling resources)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
want to keep this simple
"tmApiVersion": "2015-11-01", | ||
"apiVersion": "2015-08-01", | ||
"webAppLocations": [ "West US", "East US" ], | ||
"farmName": "default" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
variable is not used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
}, | ||
"uniqueDnsNameForWebApp": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since TM is the endpoint, do we need to have the user supply a name? Or can we just generate one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the user needs to specify a DNS name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why, what's the scenario that requires the user input here?
] | ||
} | ||
"monitorConfig": { | ||
"protocol": "http", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
schema is expecting HTTP here (all caps)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
} | ||
}, | ||
{ | ||
"apiVersion": "[variables('tmApiVersion')]", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make this a child resource...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed this to be a literal. not sure what you mean by child resource
"count": "[length(variables('webAppLocations'))]" | ||
}, | ||
"properties": { | ||
"targetResourceId": "[resourceId('Microsoft.Web/sites/',concat(parameters('uniqueDnsNameForWebApp'), copyIndex()))]", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add whitespace after comma
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
"value": "GEN-UNIQUE" | ||
} | ||
"uniqueDnsName": { | ||
"value": "GEN-UNIQUE-1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the -1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Contributing guide
https://github.com/Azure/azure-quickstart-templates/blob/master/1-CONTRIBUTION-GUIDE/README.md
Changelog
Description of the change