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

appservice: Update steps and validation to support new domain name label scopes #1882

Open
wants to merge 23 commits into
base: main
Choose a base branch
from

Conversation

MicroFish91
Copy link
Contributor

@MicroFish91 MicroFish91 commented Feb 3, 2025

Here are the updated steps and validation for supporting the new domain label scopes, see here for more context.

New validation required for site names:

In general, here are the checks/validation that should be done depending on the customer’s selection:
 
* If global hostname selected (old format of “*.azurewebsites.net”), use these three (3) checks/validations prior to allowing customer to create site:
  1.      Global CheckNameAvailability (CNA) API (the one without providing region)
  2.      Regional CheckNameAvailability (CNA) API (the one where you need to provide region)
  3.      ARM ID Check / Check if a resource already exists with the same ARM ID
    a.      A “create” on a pre-existing resource with same ARM ID would result to an “update” of the site resource
    b.      We do this check by doing a GET on the site and if it results in:
        i.      Status 200 – this means that there is already a pre-existing site with the exact ARM ID, so you would need block user from creating the resource
        ii.      Status 404 – this means that no resource exists with the exact ARM ID, so you can allow user to create the resource
    
  Special case: If site name input (user input) is >=47 chars, ignore result of regional CNA because it inherently has a shorter character limit than Global CNA

* If regional hostname selected (new format of “*.<RegionName>.azurewebsites.net”), use these two (2) checks/validations prior to allowing customer to create site:
    1. Regional CNA
    2. ARM ID Check / Check if a resource already exists with the same ARM ID
 
"Global CNA" is the global (no region/location in the parameter) CheckNameAvailability API
"Regional CNA" is the regional (with region/location in the parameter) CheckNameAvailability API

Corresponding vscode-azureappservice PR: microsoft/vscode-azureappservice#2703

Edit: After some experimentation, I've found that selecting for the Tenant domain label scope actually fails if over 43 chars long, even though the validation says it's okay. This is the error:
image

Setting the limit to 43 chars instead seems to completely fix the issue. Verified portal has a similar limit.

@MicroFish91 MicroFish91 changed the title appservice: Add steps and validation to support the new domain label scopes appservice: Add steps and validation to support new domain label scopes Feb 3, 2025
@MicroFish91 MicroFish91 changed the title appservice: Add steps and validation to support new domain label scopes appservice: Update steps and validation to support new domain label scopes Feb 3, 2025
@MicroFish91 MicroFish91 changed the title appservice: Update steps and validation to support new domain label scopes appservice: Update steps and validation to support new domain name label scopes Feb 3, 2025
@MicroFish91 MicroFish91 marked this pull request as ready for review February 4, 2025 22:54
@MicroFish91 MicroFish91 requested a review from a team as a code owner February 4, 2025 22:54
appservice/src/index.ts Show resolved Hide resolved
appservice/src/index.ts Show resolved Hide resolved
appservice/package.json Show resolved Hide resolved
appservice/src/createAppService/SiteNameStep.ts Outdated Show resolved Hide resolved
appservice/src/createAppService/SiteNameStep.ts Outdated Show resolved Hide resolved
appservice/src/createAppService/SiteNameStep.ts Outdated Show resolved Hide resolved
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.

2 participants