Skip to content

Issue #16094 - Updated New-AzAppServicePlan to create an app service plan with host environment id. #16645

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

Merged
merged 3 commits into from
Jan 17, 2022

Conversation

samlin-msft-zz
Copy link

@samlin-msft-zz samlin-msft-zz commented Dec 15, 2021

Description

Checklist

  • I have read the Submitting Changes section of CONTRIBUTING.md
  • The title of the PR is clear and informative
  • The appropriate ChangeLog.md file(s) has been updated:
    • For any service, the ChangeLog.md file can be found at src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
    • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header -- no new version header should be added
  • The PR does not introduce breaking changes
  • If applicable, the changes made in the PR have proper test coverage
  • For public API changes to cmdlets:
    • a cmdlet design review was approved for the changes in this repository (Microsoft internal only)
      • {Please put the link here}
    • the markdown help files have been regenerated using the commands listed here

@samlin-msft-zz samlin-msft-zz requested a review from madsd December 15, 2021 19:37
@samlin-msft-zz samlin-msft-zz force-pushed the websites-dev branch 4 times, most recently from ff361eb to a8af780 Compare December 21, 2021 12:40
Copy link
Contributor

@madsd madsd left a comment

Choose a reason for hiding this comment

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

Looks good - only a few changes needed.

@@ -52,6 +52,9 @@ public static class CmdletHelpers
private static readonly Regex KeyVaultResourceIdRegex =
new Regex(@"^\/subscriptions\/(?<subscriptionName>[^\/]+)\/resourceGroups\/(?<resourceGroupName>[^\/]+)\/providers\/Microsoft.KeyVault\/vaults\/(?<vaultName>[^\/]+)$", RegexOptions.IgnoreCase);

private static readonly Regex HostingEnvironmentResourceIdRegex =
Copy link
Contributor

Choose a reason for hiding this comment

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

Lets keep the AppServiceEnvironment naming consistent instead of HostingEnvironment (of course except when needed for ARM naming)

@@ -269,6 +272,24 @@ internal static string BuildMetricFilter(DateTime? startTime, DateTime? endTime,
return false;
}

internal static bool TryParseHostingEnvironmentMetadataFromResourceId(string resourceId, out string resourceGroupName,
Copy link
Contributor

Choose a reason for hiding this comment

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

Change method name

internal static bool TryParseHostingEnvironmentMetadataFromResourceId(string resourceId, out string resourceGroupName,
out string aseName)
{
var match = AppServicePlanResourceIdRegex.Match(resourceId);
Copy link
Contributor

Choose a reason for hiding this comment

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

Wrong RegEx object, so it actually never succeeds.

public SwitchParameter Linux { get; set; }

public override void ExecuteCmdlet()
{
if (HyperV.IsPresent &&
if (HyperV.IsPresent &&
(Tier != "PremiumContainer" && Tier != "PremiumV3"))
Copy link
Contributor

Choose a reason for hiding this comment

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

HyperV is also allowed for ASEv3, so please add: && Tier != "IsolatedV2"

and modify the exception text.

@samlin-msft-zz samlin-msft-zz marked this pull request as ready for review January 11, 2022 18:11
Copy link
Contributor

@madsd madsd left a comment

Choose a reason for hiding this comment

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

Looks good to me - worked with Sam directly on this change.

@wyunchi-ms
Copy link
Contributor

/azp run azure-powershell - security-tools

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 1 pipeline(s).

@wyunchi-ms wyunchi-ms merged commit 16b9c5d into Azure:main Jan 17, 2022
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