Skip to content
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

Merged
merged 4 commits into from
Oct 11, 2016

Conversation

dilukose
Copy link
Contributor

@azurecla
Copy link

Hi @dilukose, I'm your friendly neighborhood Azure Pull Request Bot (You can call me AZPRBOT). Thanks for your contribution!


It looks like you're working at Microsoft (dilukose). If you're full-time, we DON'T require a contribution license agreement.



If you are a vendor, DO please sign the electronic contribution license agreement. It will take 2 minutes and there's no faxing! https://cla.azure.com.

TTYL, AZPRBOT;

"resources": [
{
"apiVersion": "[variables('apiVersion')]",
"name": "[concat('DemoAppServicePlan', copyIndex())]",
Copy link
Collaborator

@bmoore-msft bmoore-msft Oct 5, 2016

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()])

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor Author

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

Copy link
Collaborator

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)

Copy link
Contributor Author

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

Copy link
Collaborator

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",
Copy link
Collaborator

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

Copy link
Contributor Author

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())]",
Copy link
Collaborator

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...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor Author

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

Copy link
Collaborator

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)

Copy link
Contributor Author

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"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

variable is not used

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

},
"uniqueDnsNameForWebApp": {
Copy link
Collaborator

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?

Copy link
Contributor Author

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

Copy link
Collaborator

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",
Copy link
Collaborator

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)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

}
},
{
"apiVersion": "[variables('tmApiVersion')]",
Copy link
Collaborator

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...

Copy link
Contributor Author

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()))]",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add whitespace after comma

Copy link
Contributor Author

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"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the -1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@bmoore-msft bmoore-msft merged commit dfb62bd into Azure:master Oct 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants