Skip to content

Commit

Permalink
Merge pull request #220 from FBoucher/main
Browse files Browse the repository at this point in the history
Update vNext
  • Loading branch information
FBoucher authored Nov 22, 2020
2 parents aeb1b33 + 640d9f6 commit 4af4aaa
Show file tree
Hide file tree
Showing 14 changed files with 143 additions and 21 deletions.
10 changes: 10 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,16 @@
"contributions": [
"doc"
]
},
{
"login": "jasonhand",
"name": "Jason Hand",
"avatar_url": "https://avatars0.githubusercontent.com/u/1173344?v=4",
"profile": "http://www.jasonhand.com",
"contributions": [
"doc",
"infra"
]
}
]
}
18 changes: 0 additions & 18 deletions .dependabot/config.yml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "nuget"
directory: "/src/shortenerTools"
schedule:
interval: "monthly"
assignees:
- "fboucher"
reviewers:
- "fboucher"
labels:
- dependencies
- Serverless-Backend
- package-ecosystem: "nuget"
directory: "/src/adminTools/adminBlazorWebsite/src"
schedule:
interval: "monthly"
assignees:
- "fboucher"
reviewers:
- "fboucher"
labels:
- dependencies
- frontend
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![GLO Board](https://img.shields.io/badge/with-GLO_Board-orange/?color=05887F&logoWidth=15&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFgAAABMCAMAAADeDICLAAAABlBMVEX///8A/+Bm7Mx0AAAAAXRSTlMAQObYZgAAAXlJREFUeNrV2NGOwjAMRNH4/396X5Cm26twww5IrF9CXfvUSlskWPuYOUh4kJ25HzN3RsOBi+SrMolLINu7hFx2t5dROgicLVyRC1fkwgWssru9zJZzuXFd7l2/gT3MXndL+ZEw12VO+lg6OA5gcV3OkitNBxMiDNdk7oXsRLkXzcDswfJJeHVwkIgfhOfL4ZDXzzV8nRIwZHUdNtldhym7SzgZkdWNhokpu8uJvxRep7DLPvC/hte7YfnahOzu3Zr4m0KYXs+FdZCTRD3EbeGzn2MGr/fBkXCdAia034t5GY6HBGXePLgcUEfehw8cWGRxoWDXSQtLxEZ2WAxkHTaX6UEHHzeBJR94s5z0z/aMw3jZKGd1WFzZZofpAoasMN3kVXZ4bgObPGfwYJ69nE8Os8VlUlw2rsvzBJ6h63JoiDjn7v3GOcwel22rWaTy78ItjHIPlBKu/kCe2cKs+xNN2FmnBzCft5fpBN+MsB0dGGxt47AOwsvjB19NCt1bbfikAAAAAElFTkSuQmCC)](https://app.gitkraken.com/glo/board/XnI94exk8AARj-ph)
[![Serverless Library](https://img.shields.io/badge/Serverless%20Library-%E2%9C%94%EF%B8%8Fyes-blue?style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAACx1BMVEUAAAAAAAAAAP8Af38AVaoAf78AVaoAbbYAXLkAc7kAZqoAWqUAY7gAZrIAZa4AYKwAY7QAZ7YAZ7MAZ7UAZLMAY7MAZLUAZrIAZLcAY7QAZrIAZLMAZLYAZ7YAZLYAZrcAZbgAZLMAZ7YAZbIAZLQAYrMAY7UAZLUAZLYAZbQAZrcAZbMAZbgAZbQAZrQAZrgAZrcAZbgAaLkAZbUAZbYAZ7YAZbUAZrUAZ7YAZ7cAZbcAZrcAZ7cAZrcAZ7cAZrcAZrcAZbcAZ7YAZ7cAZrcAZrYAZrcAZbYAZrcAZ7cAZrYAZrcAZrcAZ7cAZ7gAZrcAZrcAZ7cAZ7gAZ7gBaLcCaLcDabgEaLYFabUGarQGa7oHarMIbLoKbbsMbrsOb7wPcLwQcb0Rcb0SbawTcr0Xdb4Ydb8Zdr8dc6UeecEfdKQgcqMhe8Eic6IkdqEkfcIndJ4of8MqeJ0rgcQsd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LyJ1gTF3jvTnxod5Trh0xQTKmZIjABh1MXzil30Y86Oc0CazGCWDcOy+OQBXp0JiNcZxbTpe1SVVRr9gmLoZV1df8SoRwOxebuhQRNLIXq8dVnCrGlklnfyVGjZpUD6vuP4DQn3cxeG842QAAAAASUVORK5CYII=)](https://serverlesslibrary.net/sample/1c809aa2-2d4f-4fee-bc27-0c2c36844ac8)
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-11-orange.svg?style=flat-square)](#contributors-)
[![All Contributors](https://img.shields.io/badge/all_contributors-12-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->


Expand Down Expand Up @@ -134,6 +134,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center"><a href="http://www.lexplore.com"><img src="https://avatars0.githubusercontent.com/u/3719489?v=4" width="100px;" alt=""/><br /><sub><b>Erik Alsmyr</b></sub></a><br /><a href="https://github.com/FBoucher/AzUrlShortener/issues?q=author%3Aalsmyr" title="Bug reports">🐛</a> <a href="https://github.com/FBoucher/AzUrlShortener/commits?author=alsmyr" title="Documentation">📖</a></td>
<td align="center"><a href="https://jawn.net"><img src="https://avatars3.githubusercontent.com/u/1705112?v=4" width="100px;" alt=""/><br /><sub><b>Bernard Vander Beken</b></sub></a><br /><a href="https://github.com/FBoucher/AzUrlShortener/commits?author=jawn" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/IronManion"><img src="https://avatars0.githubusercontent.com/u/36028632?v=4" width="100px;" alt=""/><br /><sub><b>IronManion</b></sub></a><br /><a href="https://github.com/FBoucher/AzUrlShortener/commits?author=IronManion" title="Documentation">📖</a></td>
<td align="center"><a href="http://www.jasonhand.com"><img src="https://avatars0.githubusercontent.com/u/1173344?v=4" width="100px;" alt=""/><br /><sub><b>Jason Hand</b></sub></a><br /><a href="https://github.com/FBoucher/AzUrlShortener/commits?author=jasonhand" title="Documentation">📖</a> <a href="#infra-jasonhand" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
</tr>
</table>

Expand Down
Binary file added medias/AddCustomDomain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added medias/AddCustomDomainDetails.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added medias/Rule1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added medias/cf_DNS_Rules.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added medias/cf_addSite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added medias/cf_rules_details.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added medias/cl_dns_details.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added medias/domainProviderDNS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added medias/domainValidated.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
104 changes: 102 additions & 2 deletions post-deployment-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,97 @@

## Add a Custom Domain

To know how to add a custom domain to your Azure Function. (coming soon)
(or check [Microsoft docs](https://docs.microsoft.com/en-ca/azure/app-service/app-service-web-tutorial-custom-domain?WT.mc_id=azurlshortener-github-frbouche))
Of course the beauty of a URL shortener is to have short link and this is done the best by a naked domain (domain.com). To realized this you would need to by an expensive certificate with a wild card, and this doesn't fit in the goals of this project. We will achieve it nervertheless by having a secure www.domain.com and doing a dynamic forward of domain.com to www.domain.com.

### 1- Assign a Domain to the Azure Function

Let`s start by Adding a domain to the App Service.

![AddCustomDomain][AddCustomDomain]

From the Azure portal (portal.azure.com), open the ShortnerTools App Service (Azure Function). From the left panel select *Custom domains*. Then Click the **Add custom domain** button in the middle of the screen.

![AddCustomDomainDetails][AddCustomDomainDetails]

This will open a tab where you will need to enter your domain with the `www` sub-domain. In our case it was www.07f.ca.

You will now need to validate the domain with you proviver (in our case it's GoDaddy.com). Navigate to the domain provider and create two new DNS record (TXT + CNAME) like explained in the bottom of the panel in the Azure portal.

Here an exemple from godaddy where:
- The CNAME was created with the URL of the Azure function.
- The TXT was created with the Custom Domain Verification ID provided on the Azure portal page.

![domainProviderDNS][domainProviderDNS]

Once all that is enter. Click the validate button on the Azure portal. If you don't have the green check beside Hostname availability and Domain ownership, be patient as it can take up to 48 hours. (You can always double check that you didn't do any typo any where ;P )

![domainValidated][domainValidated]

When you have it gree you ready for the next step.

### 2- Adding a certificate

The custom domain has been added, we now first need to create a certificate before we can add the binding

![4_AddBinding](https://user-images.githubusercontent.com/52791126/83807076-c81db100-a6b2-11ea-8cc4-1facc50d6dd4.png)

Create a **free** App Service managed certificate as described in the documentation [Secure a custom DNS name with a TLS/SSL binding in Azure App Service](https://docs.microsoft.com/en-us/azure/app-service/configure-ssl-bindings?WT.mc_id=azurlshortener-github-frbouche)


From the left navigation of your Azure Function (same page as before), select **TLS/SSL settings**. Then from the top of the new panel, click on **Private Key Certificates (.pfx)** and then **Create App Service Managed Certificate**.

![Create free certificate in App Service](https://docs.microsoft.com/en-us/azure/app-service/media/configure-ssl-certificate/create-free-cert.png)

Select the custom domain to create a free certificate for and select Create. You can create only one certificate for each supported custom domain.

When the operation completes, you see the certificate in the Private Key Certificates list.

![Create free certificate finished](https://docs.microsoft.com/en-us/azure/app-service/media/configure-ssl-certificate/create-free-cert-finished.png)

Go back to the **Custom domain** panel. Click the **Add binding** link beside the big red "Not Secure" label.

Select your custom domain, the created certificate thumbprint which has been created in step 5 and "SNI SSL" as the SSL Binding

![7_create_certificate_binding](https://user-images.githubusercontent.com/52791126/83808893-d5886a80-a6b5-11ea-9cf0-c3268b57d250.png)

Voila! You can now call your azURLShortener from your custom domain! ✔

> If you are using Version 1, you need to change the URL in the App Service configuration (it's in the admin "App Service") so you can copy the URLs from the Blazor UI
![8_change_azFunctionUrl](https://user-images.githubusercontent.com/52791126/83810560-9c9dc500-a6b8-11ea-9c1c-da2d99f2a79f.png)



### 3- Remove the www sub-domain

This next section is to "fake" a naked domain.

![cf_addSite][cf_addSite]

Create an account in cloudflare.com and add a site for your domain. We will need to customized the DNS and create some Page Rules.

![cf_DNS_Rules][cf_DNS_Rules]

On the cloudflare.com note the 2 nameservers adresses. Go to the origin name provider (in my case godaddy) and replace the nameservers names with the value found on cloudflare.

![cl_dns_details][cl_dns_details]

Now let's create a rules that will redirect all the incoming traffic from the naked-domain to www.domain. On the option on the top, click the **Pages Rules** (B). Then Click the Button **Create Page Rule**

![Rule1][Rule1]

In the field for **If the URL matches:** enter the naked-domain follow by `/*`. That will match everything coming from that URL

For the **settings** select `Forwarding URL` and `301- Permanent Redirect`. Then the destination url should be `https://www.` with your domain and `/$1`.

The URL shortener is now completly configured, and your users will be pleased. There only one last step to make YOUR experience more enjoyable.


### 4- Add A Page Rule for your Admin page (TinyBlazorAdmin)

The TinyBlazorAdmin is the place to manage all your URLs. Create a new Page rule to redirect all call to your domain and the prefix of your choice. ( ex: admin.07f.ca, manager.07f.ca, new.07f.ca, etc)

Congradulation, you are all set!

---

Expand Down Expand Up @@ -39,3 +127,15 @@ And finally, click the **Copy** button to get the URL of your function _with the
[getURL]: medias/getURL.png
[AddCustomDomain]: medias/AddCustomDomain.png
[AddCustomDomainDetails]: medias/AddCustomDomainDetails.png
[domainProviderDNS]: medias/domainProviderDNS.png
[domainValidated]: medias/domainValidated.png
[cf_addSite]: medias/cf_addSite.png
[cf_DNS_Rules]: medias/cf_DNS_Rules.png
[cl_dns_details]: medias/cl_dns_details.png
[cf_rules_details]: medias/cf_rules_details.png
[Rule1]: medias/Rule1.png

0 comments on commit 4af4aaa

Please sign in to comment.