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

[Example] Function App on Consumption Plan with Custom Domain and App Serivce Managed Certificate #971

Conversation

miqm
Copy link
Collaborator

@miqm miqm commented Nov 22, 2020

Bicep Example usage of creating Azure Function App with Custom Domain and Managed Certificate.

This requires module usage, as we need to modify Microsoft.Web/sites/hostNameBindings twice - first time to add the custom domain (which is required for certificate generation), second - to assign the generated certificate.

@ghost
Copy link

ghost commented Nov 22, 2020

CLA assistant check
All CLA requirements met.

@miqm miqm changed the title Function App on Consumption Plan with Custom Domain and App Serivce Managed Certificate [Example] Function App on Consumption Plan with Custom Domain and App Serivce Managed Certificate Nov 22, 2020
@miqm
Copy link
Collaborator Author

miqm commented Nov 22, 2020

The tests are failing because there's a property password missing, however it's not required when enabling manged certificate - it's required only when uploading custom one.

Even in the ARM quickstarts - https://github.com/Azure/azure-quickstart-templates/blob/master/201-web-app-custom-domain-and-ssl/azuredeploy.json password property is not provided.

@miqm miqm force-pushed the example/function-app-with-custom-domain-managed-certificate branch from f8b2508 to 6455099 Compare November 22, 2020 19:54
@miqm
Copy link
Collaborator Author

miqm commented Nov 25, 2020

@alex-frankel How we can merge this example? do we need to wait for some warning suppression mechanism first?

@alex-frankel
Copy link
Collaborator

apologies for missing this one - I think you need to do a few things to get the test to pass:

  • pull the latest from main
  • use the any() function (doc) to get rid of the warning:
resource functionAppCustomHostCertificate 'Microsoft.Web/certificates@2020-06-01' = {
  name: '${applicationName}.${dnsZone}'
  location: location
  dependsOn: [
    functionAppCustomHost
  ]
  properties: any({
    serverFarmId: hostingPlan.id
    canonicalName: '${applicationName}.${dnsZone}'
  })
}
  • add a blank line to the end of the .bicep files

@miqm
Copy link
Collaborator Author

miqm commented Dec 2, 2020

Thanks @alex-frankel , I thought about the any function, but I didn't thought about putting all properties in it. I updated the PR.

Copy link
Collaborator

@alex-frankel alex-frankel left a comment

Choose a reason for hiding this comment

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

great! I do now see there is a conflict in the examples.ts - can you get that resolved and then we can merge

@anthony-c-martin
Copy link
Member

FWIW looks like the fix to swagger for the non-required password field is being tracked by Azure/azure-rest-api-specs#5029

@miqm
Copy link
Collaborator Author

miqm commented Dec 3, 2020

Conflict resolved. We probably would need some build-time task to generate that file to avoid such conflicts...

Regarding the password field, seems it's not likely for it to be out in swagger anytime soon...

@alex-frankel alex-frankel merged commit e580066 into Azure:main Dec 3, 2020
@miqm miqm deleted the example/function-app-with-custom-domain-managed-certificate branch December 20, 2020 22:34
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