diff --git a/src/ResourceManager/Common/Commands.Common.Strategies.UnitTest/AsyncCmdletExtensionsTest.cs b/src/ResourceManager/Common/Commands.Common.Strategies.UnitTest/AsyncCmdletExtensionsTest.cs index 2b776257d465..1854238c3ec8 100644 --- a/src/ResourceManager/Common/Commands.Common.Strategies.UnitTest/AsyncCmdletExtensionsTest.cs +++ b/src/ResourceManager/Common/Commands.Common.Strategies.UnitTest/AsyncCmdletExtensionsTest.cs @@ -37,7 +37,7 @@ public string Location public async Task> CreateConfigAsync() => new ResourceConfig( new ResourceStrategy( - null, + null, async (c, p) => new RG(), null, null, @@ -51,7 +51,7 @@ public async Task> CreateConfigAsync() class AsyncCmdlet : IAsyncCmdlet { - public CancellationToken CancellationToken { get; } + public CancellationToken CancellationToken { get; } = new CancellationToken(); public IEnumerable> Parameters @@ -89,6 +89,11 @@ public void WriteVerbose(string message) { Assert.Equal("Str = \"str\"", message); } + + public void WriteWarning(string message) + { + throw new NotImplementedException(); + } } [Fact] @@ -102,4 +107,4 @@ public async Task TestVerboseStream() await client.RunAsync("subscriptionId", parameters, asyncCmdlet); } } -} +} \ No newline at end of file diff --git a/src/ResourceManager/Common/Commands.Common.Strategies/AsyncCmdletExtensions.cs b/src/ResourceManager/Common/Commands.Common.Strategies/AsyncCmdletExtensions.cs index 7d9f183658e2..2192b89cc3c1 100644 --- a/src/ResourceManager/Common/Commands.Common.Strategies/AsyncCmdletExtensions.cs +++ b/src/ResourceManager/Common/Commands.Common.Strategies/AsyncCmdletExtensions.cs @@ -191,6 +191,9 @@ public AsyncCmdlet(ICmdlet cmdlet) public void WriteVerbose(string message) => Scheduler.BeginInvoke(() => Cmdlet.WriteVerbose(message)); + public void WriteWarning(string message) + => Scheduler.BeginInvoke(() => Cmdlet.WriteWarning(message)); + public Task ShouldProcessAsync(string target, string action) => Scheduler.Invoke(() => Cmdlet.ShouldProcess(target, action)); @@ -199,8 +202,6 @@ public void WriteObject(object value) public void ReportTaskProgress(ITaskProgress taskProgress) => Scheduler.BeginInvoke(() => TaskProgressList.Add(taskProgress)); - - } } } \ No newline at end of file diff --git a/src/ResourceManager/Common/Commands.Common.Strategies/Commands.Common.Strategies.csproj b/src/ResourceManager/Common/Commands.Common.Strategies/Commands.Common.Strategies.csproj index feac05592eb4..cca5befc18dc 100644 --- a/src/ResourceManager/Common/Commands.Common.Strategies/Commands.Common.Strategies.csproj +++ b/src/ResourceManager/Common/Commands.Common.Strategies/Commands.Common.Strategies.csproj @@ -8,7 +8,7 @@ Library Properties Microsoft.Azure.Commands.Common.Strategies - Microsoft.Azure.Commands.Common.Strategies.3 + Microsoft.Azure.Commands.Common.Strategies.4 v4.5.2 512 diff --git a/src/ResourceManager/Common/Commands.Common.Strategies/Common.Strategies.Netcore.csproj b/src/ResourceManager/Common/Commands.Common.Strategies/Common.Strategies.Netcore.csproj index def43c8dd476..0817c93d7c89 100644 --- a/src/ResourceManager/Common/Commands.Common.Strategies/Common.Strategies.Netcore.csproj +++ b/src/ResourceManager/Common/Commands.Common.Strategies/Common.Strategies.Netcore.csproj @@ -4,7 +4,7 @@ netcoreapp2.0 - Microsoft.Azure.Commands.Common.Strategies + Microsoft.Azure.Commands.Common.Strategies.4 Microsoft.Azure.Commands.Common.Strategies false diff --git a/src/ResourceManager/Common/Commands.Common.Strategies/IAsyncCmdlet.cs b/src/ResourceManager/Common/Commands.Common.Strategies/IAsyncCmdlet.cs index 6d887071734c..b8dc1f7bebb0 100644 --- a/src/ResourceManager/Common/Commands.Common.Strategies/IAsyncCmdlet.cs +++ b/src/ResourceManager/Common/Commands.Common.Strategies/IAsyncCmdlet.cs @@ -29,9 +29,10 @@ public interface IAsyncCmdlet IEnumerable> Parameters { get; } /// + /// Log additional information. /// Thread-safe `WriteVerbose` function. /// - /// + /// The additional information to log void WriteVerbose(string message); /// @@ -40,11 +41,17 @@ public interface IAsyncCmdlet Task ShouldProcessAsync(string target, string action); /// - /// Thread-safe `WriteVerbose` function. + /// Thread-safe `WriteObject` function. /// /// void WriteObject(object value); + /// + /// Thread-safe `WriteWarning` function. + /// + /// + void WriteWarning(string message); + /// /// Report task progress. The function is used to report current task and cmdlet progress. /// @@ -61,4 +68,4 @@ public interface IAsyncCmdlet /// CancellationToken CancellationToken { get; } } -} +} \ No newline at end of file diff --git a/src/ResourceManager/Common/Commands.Common.Strategies/ICmdlet.cs b/src/ResourceManager/Common/Commands.Common.Strategies/ICmdlet.cs index 7539a6018e0b..e8ff2a9e7a0f 100644 --- a/src/ResourceManager/Common/Commands.Common.Strategies/ICmdlet.cs +++ b/src/ResourceManager/Common/Commands.Common.Strategies/ICmdlet.cs @@ -41,6 +41,12 @@ public interface ICmdlet /// void WriteObject(object value); + /// + /// See also PowerShell `WriteWarning`. + /// + /// + void WriteWarning(string message); + /// /// See also PowerShell `WriteProgress`. /// @@ -64,4 +70,4 @@ void WriteProgress( /// IEnumerable> Parameters { get; } } -} +} \ No newline at end of file diff --git a/src/ResourceManager/Compute/AzureRM.Compute.Netcore.psd1 b/src/ResourceManager/Compute/AzureRM.Compute.Netcore.psd1 index 46d9d123f938..740799c1e1db 100644 --- a/src/ResourceManager/Compute/AzureRM.Compute.Netcore.psd1 +++ b/src/ResourceManager/Compute/AzureRM.Compute.Netcore.psd1 @@ -55,7 +55,7 @@ RequiredModules = @(@{ModuleName = 'AzureRM.Profile.Netcore'; ModuleVersion = '0 # Assemblies that must be loaded prior to importing this module RequiredAssemblies = '.\AutoMapper.dll', - '.\Microsoft.Azure.Commands.Common.Strategies.dll', + '.\Microsoft.Azure.Commands.Common.Strategies.4.dll', '.\Microsoft.Azure.Management.Compute.dll', '.\Microsoft.Azure.Management.KeyVault.dll' diff --git a/src/ResourceManager/Compute/AzureRM.Compute.psd1 b/src/ResourceManager/Compute/AzureRM.Compute.psd1 index 5cc7347844d1..60c433e448e0 100644 --- a/src/ResourceManager/Compute/AzureRM.Compute.psd1 +++ b/src/ResourceManager/Compute/AzureRM.Compute.psd1 @@ -62,7 +62,7 @@ RequiredAssemblies = '.\AutoMapper.dll', '.\Microsoft.Azure.Management.Compute.d '.\Microsoft.WindowsAzure.Commands.Sync.dll', '.\Microsoft.WindowsAzure.Commands.Tools.Vhd.dll', '.\Microsoft.WindowsAzure.Storage.dll', '.\System.Spatial.dll', - '.\Microsoft.Azure.Commands.Common.Strategies.3.dll' + '.\Microsoft.Azure.Commands.Common.Strategies.4.dll' # Script files (.ps1) that are run in the caller's environment prior to importing this module. # ScriptsToProcess = @() diff --git a/src/ResourceManager/Compute/Commands.Compute/Strategies/AsyncCmdletExtensions.cs b/src/ResourceManager/Compute/Commands.Compute/Strategies/AsyncCmdletExtensions.cs index 1066b0947ba9..fd107c200094 100644 --- a/src/ResourceManager/Compute/Commands.Compute/Strategies/AsyncCmdletExtensions.cs +++ b/src/ResourceManager/Compute/Commands.Compute/Strategies/AsyncCmdletExtensions.cs @@ -84,6 +84,9 @@ public void WriteProgress( CurrentOperation = currentOperation, PercentComplete = percentComplete, }); + + public void WriteWarning(string message) + => _Cmdlet.WriteWarning(message); } } } \ No newline at end of file diff --git a/src/ResourceManager/Websites/AzureRM.Websites.Netcore.psd1 b/src/ResourceManager/Websites/AzureRM.Websites.Netcore.psd1 index b2dd58ed2bd7..0ed64ec6cfb4 100644 --- a/src/ResourceManager/Websites/AzureRM.Websites.Netcore.psd1 +++ b/src/ResourceManager/Websites/AzureRM.Websites.Netcore.psd1 @@ -54,7 +54,7 @@ PowerShellVersion = '5.1' RequiredModules = @(@{ModuleName = 'AzureRM.Profile.Netcore'; ModuleVersion = '0.11.0'; }) # Assemblies that must be loaded prior to importing this module -RequiredAssemblies = '.\Microsoft.Azure.Management.Websites.dll', '.\Microsoft.Azure.Commands.Common.Strategies.dll' +RequiredAssemblies = '.\Microsoft.Azure.Management.Websites.dll', '.\Microsoft.Azure.Commands.Common.Strategies.4.dll' # Script files (.ps1) that are run in the caller's environment prior to importing this module. # ScriptsToProcess = @() diff --git a/src/ResourceManager/Websites/AzureRM.Websites.psd1 b/src/ResourceManager/Websites/AzureRM.Websites.psd1 index 17d6617080ea..0e5fada5294d 100644 --- a/src/ResourceManager/Websites/AzureRM.Websites.psd1 +++ b/src/ResourceManager/Websites/AzureRM.Websites.psd1 @@ -55,7 +55,7 @@ RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; ModuleVersion = '5.1.0'; } # Assemblies that must be loaded prior to importing this module RequiredAssemblies = '.\Microsoft.Azure.Management.Websites.dll', - '.\Microsoft.Azure.Commands.Common.Strategies.3.dll' + '.\Microsoft.Azure.Commands.Common.Strategies.4.dll' # Script files (.ps1) that are run in the caller's environment prior to importing this module. # ScriptsToProcess = @() diff --git a/src/ResourceManager/Websites/ChangeLog.md b/src/ResourceManager/Websites/ChangeLog.md index 5dcb1b6f8bf9..434aa8059801 100644 --- a/src/ResourceManager/Websites/ChangeLog.md +++ b/src/ResourceManager/Websites/ChangeLog.md @@ -18,6 +18,7 @@ - Additional information about change #1 --> ## Current Release +* `New-AzureRMWebApp` is updated to use common algorithms from the Strategy library. ## Version 5.0.1 * Set minimum dependency of module to PowerShell 5.0 diff --git a/src/ResourceManager/Websites/Commands.Websites.Test/Commands.Websites.Test.csproj b/src/ResourceManager/Websites/Commands.Websites.Test/Commands.Websites.Test.csproj index 5f5f62bb1548..19bcf64cca36 100644 --- a/src/ResourceManager/Websites/Commands.Websites.Test/Commands.Websites.Test.csproj +++ b/src/ResourceManager/Websites/Commands.Websites.Test/Commands.Websites.Test.csproj @@ -259,6 +259,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest diff --git a/src/ResourceManager/Websites/Commands.Websites.Test/ScenarioTests/WebAppTests.cs b/src/ResourceManager/Websites/Commands.Websites.Test/ScenarioTests/WebAppTests.cs index 1a398d3f20c0..45038c3e9ba6 100644 --- a/src/ResourceManager/Websites/Commands.Websites.Test/ScenarioTests/WebAppTests.cs +++ b/src/ResourceManager/Websites/Commands.Websites.Test/ScenarioTests/WebAppTests.cs @@ -44,6 +44,13 @@ public void TestCreateNewAppOnAse() WebsitesController.NewInstance.RunPsTest("Test-CreateNewWebAppOnAse"); } + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestCreateNewWebAppSimple() + { + WebsitesController.NewInstance.RunPsTest("Test-CreateNewWebAppSimple"); + } + [Fact(Skip = "Needs investigation. Fails running playback")] [Trait(Category.AcceptanceType, Category.CheckIn)] public void TestGetWebApp() diff --git a/src/ResourceManager/Websites/Commands.Websites.Test/ScenarioTests/WebAppTests.ps1 b/src/ResourceManager/Websites/Commands.Websites.Test/ScenarioTests/WebAppTests.ps1 index c3007f4029f6..efdfd787e593 100644 --- a/src/ResourceManager/Websites/Commands.Websites.Test/ScenarioTests/WebAppTests.ps1 +++ b/src/ResourceManager/Websites/Commands.Websites.Test/ScenarioTests/WebAppTests.ps1 @@ -768,4 +768,23 @@ function Test-WebAppPublishingProfile Remove-AzureRmAppServicePlan -ResourceGroupName $rgname -Name $planName -Force Remove-AzureRmResourceGroup -Name $rgname -Force } +} + +<# +.SYNOPSIS +Tests creating a web app with a simple parameterset. +#> +function Test-CreateNewWebAppSimple +{ + $appName = Get-WebsiteName + try + { + $webapp = New-AzureRmWebApp -Name $appName + + Assert-AreEqual $appName $webapp.Name + } + finally + { + Remove-AzureRmResourceGroup $appName + } } \ No newline at end of file diff --git a/src/ResourceManager/Websites/Commands.Websites.Test/SessionRecords/Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppTests/TestCreateNewWebAppSimple.json b/src/ResourceManager/Websites/Commands.Websites.Test/SessionRecords/Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppTests/TestCreateNewWebAppSimple.json new file mode 100644 index 000000000000..88c0d3366a5f --- /dev/null +++ b/src/ResourceManager/Websites/Commands.Websites.Test/SessionRecords/Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppTests/TestCreateNewWebAppSimple.json @@ -0,0 +1,1533 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/providers/Microsoft.Web/checknameavailability?api-version=2016-03-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvN2ZkMDhkY2MtYTY1My00YjBmLThmOGMtNGRhYzg4OWZkZGE0L3Byb3ZpZGVycy9NaWNyb3NvZnQuV2ViL2NoZWNrbmFtZWF2YWlsYWJpbGl0eT9hcGktdmVyc2lvbj0yMDE2LTAzLTAx", + "RequestMethod": "POST", + "RequestBody": "{\r\n \"name\": \"ps8566\",\r\n \"type\": \"Site\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "43" + ], + "x-ms-client-request-id": [ + "9adc9c8c-17e8-464a-8801-c4da25084418" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.3101.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.17134", + "Microsoft.Azure.Management.WebSites.WebSiteManagementClient/1.7.0" + ] + }, + "ResponseBody": "{\r\n \"nameAvailable\": true,\r\n \"reason\": \"\",\r\n \"message\": \"\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "47" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-request-id": [ + "15463696-2e64-406a-843c-ed3de12dc5fc" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14999" + ], + "x-ms-correlation-request-id": [ + "c9d91a62-28e8-4cd1-bb39-f84db3ab69dd" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180514T202821Z:c9d91a62-28e8-4cd1-bb39-f84db3ab69dd" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 May 2018 20:28:20 GMT" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resources?$filter=resourceType%20eq%20'Microsoft.Web%2FserverFarms'&api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvN2ZkMDhkY2MtYTY1My00YjBmLThmOGMtNGRhYzg4OWZkZGE0L3Jlc291cmNlcz8kZmlsdGVyPXJlc291cmNlVHlwZSUyMGVxJTIwJ01pY3Jvc29mdC5XZWIlMkZzZXJ2ZXJGYXJtcycmYXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "5a753c8b-7bec-436b-898c-4ca8b3cccf0a" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.3101.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.17134", + "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/4.1.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/cleanupservice/providers/Microsoft.Web/serverFarms/clnb5adf364-ea36-46a4-9d4b-0c8f71002f68\",\r\n \"name\": \"clnb5adf364-ea36-46a4-9d4b-0c8f71002f68\",\r\n \"type\": \"Microsoft.Web/serverFarms\",\r\n \"sku\": {\r\n \"name\": \"S1\",\r\n \"tier\": \"Standard\",\r\n \"size\": \"S1\",\r\n \"family\": \"S\",\r\n \"capacity\": 1\r\n },\r\n \"kind\": \"app\",\r\n \"location\": \"westus\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "371" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14995" + ], + "x-ms-request-id": [ + "a468eb60-2918-4a1f-a91c-fa306528766b" + ], + "x-ms-correlation-request-id": [ + "a468eb60-2918-4a1f-a91c-fa306528766b" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180514T202821Z:a468eb60-2918-4a1f-a91c-fa306528766b" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 May 2018 20:28:21 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resources?$filter=resourceType%20eq%20'Microsoft.Web%2FserverFarms'&api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvN2ZkMDhkY2MtYTY1My00YjBmLThmOGMtNGRhYzg4OWZkZGE0L3Jlc291cmNlcz8kZmlsdGVyPXJlc291cmNlVHlwZSUyMGVxJTIwJ01pY3Jvc29mdC5XZWIlMkZzZXJ2ZXJGYXJtcycmYXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "a9b1910c-d82b-4061-9249-bc1b80bfde89" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.3101.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.17134", + "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/4.1.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/cleanupservice/providers/Microsoft.Web/serverFarms/clnb5adf364-ea36-46a4-9d4b-0c8f71002f68\",\r\n \"name\": \"clnb5adf364-ea36-46a4-9d4b-0c8f71002f68\",\r\n \"type\": \"Microsoft.Web/serverFarms\",\r\n \"sku\": {\r\n \"name\": \"S1\",\r\n \"tier\": \"Standard\",\r\n \"size\": \"S1\",\r\n \"family\": \"S\",\r\n \"capacity\": 1\r\n },\r\n \"kind\": \"app\",\r\n \"location\": \"westus\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "371" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14993" + ], + "x-ms-request-id": [ + "66295ece-ef7a-4272-8933-6573b615a536" + ], + "x-ms-correlation-request-id": [ + "66295ece-ef7a-4272-8933-6573b615a536" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180514T202822Z:66295ece-ef7a-4272-8933-6573b615a536" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 May 2018 20:28:22 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/cleanupservice/providers/Microsoft.Web/serverfarms/clnb5adf364-ea36-46a4-9d4b-0c8f71002f68?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvN2ZkMDhkY2MtYTY1My00YjBmLThmOGMtNGRhYzg4OWZkZGE0L3Jlc291cmNlR3JvdXBzL2NsZWFudXBzZXJ2aWNlL3Byb3ZpZGVycy9NaWNyb3NvZnQuV2ViL3NlcnZlcmZhcm1zL2NsbmI1YWRmMzY0LWVhMzYtNDZhNC05ZDRiLTBjOGY3MTAwMmY2OD9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "45ab61b6-1860-4b73-8465-d769d73363d9" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.3101.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.17134", + "Microsoft.Azure.Management.WebSites.WebSiteManagementClient/1.7.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/cleanupservice/providers/Microsoft.Web/serverfarms/clnb5adf364-ea36-46a4-9d4b-0c8f71002f68\",\r\n \"name\": \"clnb5adf364-ea36-46a4-9d4b-0c8f71002f68\",\r\n \"type\": \"Microsoft.Web/serverfarms\",\r\n \"kind\": \"app\",\r\n \"location\": \"West US\",\r\n \"properties\": {\r\n \"serverFarmId\": 7374,\r\n \"name\": \"clnb5adf364-ea36-46a4-9d4b-0c8f71002f68\",\r\n \"workerSize\": \"Default\",\r\n \"workerSizeId\": 0,\r\n \"workerTierName\": null,\r\n \"numberOfWorkers\": 1,\r\n \"currentWorkerSize\": \"Default\",\r\n \"currentWorkerSizeId\": 0,\r\n \"currentNumberOfWorkers\": 1,\r\n \"status\": \"Ready\",\r\n \"webSpace\": \"cleanupservice-WestUSwebspace\",\r\n \"subscription\": \"7fd08dcc-a653-4b0f-8f8c-4dac889fdda4\",\r\n \"adminSiteName\": null,\r\n \"hostingEnvironment\": null,\r\n \"hostingEnvironmentProfile\": null,\r\n \"maximumNumberOfWorkers\": 10,\r\n \"planName\": \"VirtualDedicatedPlan\",\r\n \"adminRuntimeSiteName\": null,\r\n \"computeMode\": \"Dedicated\",\r\n \"siteMode\": null,\r\n \"geoRegion\": \"West US\",\r\n \"perSiteScaling\": false,\r\n \"numberOfSites\": 1,\r\n \"hostingEnvironmentId\": null,\r\n \"isSpot\": false,\r\n \"spotExpirationTime\": null,\r\n \"tags\": null,\r\n \"kind\": \"app\",\r\n \"resourceGroup\": \"cleanupservice\",\r\n \"reserved\": false,\r\n \"isXenon\": false,\r\n \"mdmId\": \"waws-prod-bay-083_7374\",\r\n \"targetWorkerCount\": 0,\r\n \"targetWorkerSizeId\": 0,\r\n \"provisioningState\": \"Succeeded\",\r\n \"webSiteId\": null\r\n },\r\n \"sku\": {\r\n \"name\": \"S1\",\r\n \"tier\": \"Standard\",\r\n \"size\": \"S1\",\r\n \"family\": \"S\",\r\n \"capacity\": 1\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "1283" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-request-id": [ + "6b3f6b05-a643-4ac6-aa63-84a105b78a90" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14998" + ], + "x-ms-correlation-request-id": [ + "01f84589-f78d-486a-9404-47f912f5ce6c" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180514T202821Z:01f84589-f78d-486a-9404-47f912f5ce6c" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 May 2018 20:28:21 GMT" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/cleanupservice/providers/Microsoft.Web/serverfarms/clnb5adf364-ea36-46a4-9d4b-0c8f71002f68?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvN2ZkMDhkY2MtYTY1My00YjBmLThmOGMtNGRhYzg4OWZkZGE0L3Jlc291cmNlR3JvdXBzL2NsZWFudXBzZXJ2aWNlL3Byb3ZpZGVycy9NaWNyb3NvZnQuV2ViL3NlcnZlcmZhcm1zL2NsbmI1YWRmMzY0LWVhMzYtNDZhNC05ZDRiLTBjOGY3MTAwMmY2OD9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "2a08bb24-c277-40c4-8c75-f79ea0c78915" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.3101.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.17134", + "Microsoft.Azure.Management.WebSites.WebSiteManagementClient/1.7.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/cleanupservice/providers/Microsoft.Web/serverfarms/clnb5adf364-ea36-46a4-9d4b-0c8f71002f68\",\r\n \"name\": \"clnb5adf364-ea36-46a4-9d4b-0c8f71002f68\",\r\n \"type\": \"Microsoft.Web/serverfarms\",\r\n \"kind\": \"app\",\r\n \"location\": \"West US\",\r\n \"properties\": {\r\n \"serverFarmId\": 7374,\r\n \"name\": \"clnb5adf364-ea36-46a4-9d4b-0c8f71002f68\",\r\n \"workerSize\": \"Default\",\r\n \"workerSizeId\": 0,\r\n \"workerTierName\": null,\r\n \"numberOfWorkers\": 1,\r\n \"currentWorkerSize\": \"Default\",\r\n \"currentWorkerSizeId\": 0,\r\n \"currentNumberOfWorkers\": 1,\r\n \"status\": \"Ready\",\r\n \"webSpace\": \"cleanupservice-WestUSwebspace\",\r\n \"subscription\": \"7fd08dcc-a653-4b0f-8f8c-4dac889fdda4\",\r\n \"adminSiteName\": null,\r\n \"hostingEnvironment\": null,\r\n \"hostingEnvironmentProfile\": null,\r\n \"maximumNumberOfWorkers\": 10,\r\n \"planName\": \"VirtualDedicatedPlan\",\r\n \"adminRuntimeSiteName\": null,\r\n \"computeMode\": \"Dedicated\",\r\n \"siteMode\": null,\r\n \"geoRegion\": \"West US\",\r\n \"perSiteScaling\": false,\r\n \"numberOfSites\": 1,\r\n \"hostingEnvironmentId\": null,\r\n \"isSpot\": false,\r\n \"spotExpirationTime\": null,\r\n \"tags\": null,\r\n \"kind\": \"app\",\r\n \"resourceGroup\": \"cleanupservice\",\r\n \"reserved\": false,\r\n \"isXenon\": false,\r\n \"mdmId\": \"waws-prod-bay-083_7374\",\r\n \"targetWorkerCount\": 0,\r\n \"targetWorkerSizeId\": 0,\r\n \"provisioningState\": \"Succeeded\",\r\n \"webSiteId\": null\r\n },\r\n \"sku\": {\r\n \"name\": \"S1\",\r\n \"tier\": \"Standard\",\r\n \"size\": \"S1\",\r\n \"family\": \"S\",\r\n \"capacity\": 1\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "1283" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-request-id": [ + "513f76d9-a5fa-4b4d-b309-9229057f88cb" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14995" + ], + "x-ms-correlation-request-id": [ + "b5456651-6b6c-496c-9a19-20e563f1bf4c" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180514T202822Z:b5456651-6b6c-496c-9a19-20e563f1bf4c" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 May 2018 20:28:21 GMT" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/ps8566/providers/Microsoft.Web/sites/ps8566?api-version=2016-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvN2ZkMDhkY2MtYTY1My00YjBmLThmOGMtNGRhYzg4OWZkZGE0L3Jlc291cmNlR3JvdXBzL3BzODU2Ni9wcm92aWRlcnMvTWljcm9zb2Z0LldlYi9zaXRlcy9wczg1NjY/YXBpLXZlcnNpb249MjAxNi0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "c6590c8e-f0e4-4509-8189-201be99a8594" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.3101.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.17134", + "Microsoft.Azure.Management.WebSites.WebSiteManagementClient/1.7.0" + ] + }, + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceGroupNotFound\",\r\n \"message\": \"Resource group 'ps8566' could not be found.\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "98" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-failure-cause": [ + "gateway" + ], + "x-ms-request-id": [ + "ebdee980-e00a-4319-b636-f4342ef43380" + ], + "x-ms-correlation-request-id": [ + "ebdee980-e00a-4319-b636-f4342ef43380" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180514T202822Z:ebdee980-e00a-4319-b636-f4342ef43380" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 May 2018 20:28:21 GMT" + ] + }, + "StatusCode": 404 + }, + { + "RequestUri": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourcegroups/ps8566?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvN2ZkMDhkY2MtYTY1My00YjBmLThmOGMtNGRhYzg4OWZkZGE0L3Jlc291cmNlZ3JvdXBzL3BzODU2Nj9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "13e7981f-6e25-4dfe-a052-a962211d1adf" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.3101.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.17134", + "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/4.1.0" + ] + }, + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceGroupNotFound\",\r\n \"message\": \"Resource group 'ps8566' could not be found.\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "98" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-failure-cause": [ + "gateway" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14994" + ], + "x-ms-request-id": [ + "f9b21742-1e00-4ebf-8a61-a06a25db793d" + ], + "x-ms-correlation-request-id": [ + "f9b21742-1e00-4ebf-8a61-a06a25db793d" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180514T202822Z:f9b21742-1e00-4ebf-8a61-a06a25db793d" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 May 2018 20:28:21 GMT" + ] + }, + "StatusCode": 404 + }, + { + "RequestUri": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/ps8566/providers/Microsoft.Web/serverfarms/ps8566?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvN2ZkMDhkY2MtYTY1My00YjBmLThmOGMtNGRhYzg4OWZkZGE0L3Jlc291cmNlR3JvdXBzL3BzODU2Ni9wcm92aWRlcnMvTWljcm9zb2Z0LldlYi9zZXJ2ZXJmYXJtcy9wczg1NjY/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "16abeab7-c551-4586-bc64-df2a8b36746e" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.3101.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.17134", + "Microsoft.Azure.Management.WebSites.WebSiteManagementClient/1.7.0" + ] + }, + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceGroupNotFound\",\r\n \"message\": \"Resource group 'ps8566' could not be found.\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "98" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-failure-cause": [ + "gateway" + ], + "x-ms-request-id": [ + "3abd7d64-a199-4cd2-ac6f-2969038a7181" + ], + "x-ms-correlation-request-id": [ + "3abd7d64-a199-4cd2-ac6f-2969038a7181" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180514T202822Z:3abd7d64-a199-4cd2-ac6f-2969038a7181" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 May 2018 20:28:21 GMT" + ] + }, + "StatusCode": 404 + }, + { + "RequestUri": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourcegroups/ps8566?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvN2ZkMDhkY2MtYTY1My00YjBmLThmOGMtNGRhYzg4OWZkZGE0L3Jlc291cmNlZ3JvdXBzL3BzODU2Nj9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"eastus\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "28" + ], + "x-ms-client-request-id": [ + "40a4541e-21b5-4c57-bda3-025ba80b0490" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.3101.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.17134", + "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/4.1.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/ps8566\",\r\n \"name\": \"ps8566\",\r\n \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "165" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-request-id": [ + "92d226e1-d4ce-4ea0-b186-3b21e98f1e5a" + ], + "x-ms-correlation-request-id": [ + "92d226e1-d4ce-4ea0-b186-3b21e98f1e5a" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180514T202823Z:92d226e1-d4ce-4ea0-b186-3b21e98f1e5a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 May 2018 20:28:23 GMT" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/ps8566/providers/Microsoft.Web/serverfarms/ps8566?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvN2ZkMDhkY2MtYTY1My00YjBmLThmOGMtNGRhYzg4OWZkZGE0L3Jlc291cmNlR3JvdXBzL3BzODU2Ni9wcm92aWRlcnMvTWljcm9zb2Z0LldlYi9zZXJ2ZXJmYXJtcy9wczg1NjY/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"sku\": {\r\n \"name\": \"B1\",\r\n \"tier\": \"Basic\",\r\n \"capacity\": 1\r\n },\r\n \"location\": \"eastus\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "106" + ], + "x-ms-client-request-id": [ + "9776070c-41d3-4659-acbb-1c43bdb60f59" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.3101.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.17134", + "Microsoft.Azure.Management.WebSites.WebSiteManagementClient/1.7.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/ps8566/providers/Microsoft.Web/serverfarms/ps8566\",\r\n \"name\": \"ps8566\",\r\n \"type\": \"Microsoft.Web/serverfarms\",\r\n \"kind\": \"app\",\r\n \"location\": \"East US\",\r\n \"properties\": {\r\n \"serverFarmId\": 23759,\r\n \"name\": \"ps8566\",\r\n \"workerSize\": \"Default\",\r\n \"workerSizeId\": 0,\r\n \"workerTierName\": null,\r\n \"numberOfWorkers\": 1,\r\n \"currentWorkerSize\": \"Default\",\r\n \"currentWorkerSizeId\": 0,\r\n \"currentNumberOfWorkers\": 1,\r\n \"status\": \"Ready\",\r\n \"webSpace\": \"ps8566-EastUSwebspace\",\r\n \"subscription\": \"7fd08dcc-a653-4b0f-8f8c-4dac889fdda4\",\r\n \"adminSiteName\": null,\r\n \"hostingEnvironment\": null,\r\n \"hostingEnvironmentProfile\": null,\r\n \"maximumNumberOfWorkers\": 3,\r\n \"planName\": \"VirtualDedicatedPlan\",\r\n \"adminRuntimeSiteName\": null,\r\n \"computeMode\": \"Dedicated\",\r\n \"siteMode\": null,\r\n \"geoRegion\": \"East US\",\r\n \"perSiteScaling\": false,\r\n \"numberOfSites\": 0,\r\n \"hostingEnvironmentId\": null,\r\n \"isSpot\": false,\r\n \"spotExpirationTime\": null,\r\n \"tags\": null,\r\n \"kind\": \"app\",\r\n \"resourceGroup\": \"ps8566\",\r\n \"reserved\": false,\r\n \"isXenon\": false,\r\n \"mdmId\": \"waws-prod-blu-037_23759\",\r\n \"targetWorkerCount\": 0,\r\n \"targetWorkerSizeId\": 0,\r\n \"provisioningState\": \"Succeeded\",\r\n \"webSiteId\": null\r\n },\r\n \"sku\": {\r\n \"name\": \"B1\",\r\n \"tier\": \"Basic\",\r\n \"size\": \"B1\",\r\n \"family\": \"B\",\r\n \"capacity\": 1\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "1158" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-request-id": [ + "2d65599f-5c2d-4d9c-b638-c46466938b7c" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "7aa81162-ba03-4efc-a509-e3c2f6a86d1a" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180514T202836Z:7aa81162-ba03-4efc-a509-e3c2f6a86d1a" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 May 2018 20:28:36 GMT" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/ps8566/providers/Microsoft.Web/sites/ps8566?api-version=2016-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvN2ZkMDhkY2MtYTY1My00YjBmLThmOGMtNGRhYzg4OWZkZGE0L3Jlc291cmNlR3JvdXBzL3BzODU2Ni9wcm92aWRlcnMvTWljcm9zb2Z0LldlYi9zaXRlcy9wczg1NjY/YXBpLXZlcnNpb249MjAxNi0wOC0wMQ==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"serverFarmId\": \"/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/ps8566/providers/Microsoft.Web/serverFarms/ps8566\"\r\n },\r\n \"location\": \"eastus\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "193" + ], + "x-ms-client-request-id": [ + "990559fc-6e7e-45ed-9884-fed47111a39e" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.3101.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.17134", + "Microsoft.Azure.Management.WebSites.WebSiteManagementClient/1.7.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/ps8566/providers/Microsoft.Web/sites/ps8566\",\r\n \"name\": \"ps8566\",\r\n \"type\": \"Microsoft.Web/sites\",\r\n \"kind\": \"app\",\r\n \"location\": \"eastus\",\r\n \"properties\": {\r\n \"name\": \"ps8566\",\r\n \"state\": \"Running\",\r\n \"hostNames\": [\r\n \"ps8566.azurewebsites.net\"\r\n ],\r\n \"webSpace\": \"ps8566-EastUSwebspace\",\r\n \"selfLink\": \"https://waws-prod-blu-037.api.azurewebsites.windows.net:454/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/webspaces/ps8566-EastUSwebspace/sites/ps8566\",\r\n \"repositorySiteName\": \"ps8566\",\r\n \"owner\": null,\r\n \"usageState\": \"Normal\",\r\n \"enabled\": true,\r\n \"adminEnabled\": true,\r\n \"enabledHostNames\": [\r\n \"ps8566.azurewebsites.net\",\r\n \"ps8566.scm.azurewebsites.net\"\r\n ],\r\n \"siteProperties\": {\r\n \"metadata\": null,\r\n \"properties\": [\r\n {\r\n \"name\": \"LinuxFxVersion\",\r\n \"value\": \"\"\r\n },\r\n {\r\n \"name\": \"WindowsFxVersion\",\r\n \"value\": null\r\n }\r\n ],\r\n \"appSettings\": null\r\n },\r\n \"availabilityState\": \"Normal\",\r\n \"sslCertificates\": null,\r\n \"csrs\": [],\r\n \"cers\": null,\r\n \"siteMode\": null,\r\n \"hostNameSslStates\": [\r\n {\r\n \"name\": \"ps8566.azurewebsites.net\",\r\n \"sslState\": \"Disabled\",\r\n \"ipBasedSslResult\": null,\r\n \"virtualIP\": null,\r\n \"thumbprint\": null,\r\n \"toUpdate\": null,\r\n \"toUpdateIpBasedSsl\": null,\r\n \"ipBasedSslState\": \"NotConfigured\",\r\n \"hostType\": \"Standard\"\r\n },\r\n {\r\n \"name\": \"ps8566.scm.azurewebsites.net\",\r\n \"sslState\": \"Disabled\",\r\n \"ipBasedSslResult\": null,\r\n \"virtualIP\": null,\r\n \"thumbprint\": null,\r\n \"toUpdate\": null,\r\n \"toUpdateIpBasedSsl\": null,\r\n \"ipBasedSslState\": \"NotConfigured\",\r\n \"hostType\": \"Repository\"\r\n }\r\n ],\r\n \"computeMode\": null,\r\n \"serverFarm\": null,\r\n \"serverFarmId\": \"/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/ps8566/providers/Microsoft.Web/serverfarms/ps8566\",\r\n \"reserved\": false,\r\n \"isXenon\": false,\r\n \"lastModifiedTimeUtc\": \"2018-05-14T20:28:38.15\",\r\n \"storageRecoveryDefaultState\": \"Running\",\r\n \"contentAvailabilityState\": \"Normal\",\r\n \"runtimeAvailabilityState\": \"Normal\",\r\n \"siteConfig\": null,\r\n \"deploymentId\": \"ps8566\",\r\n \"trafficManagerHostNames\": null,\r\n \"sku\": \"Basic\",\r\n \"scmSiteAlsoStopped\": false,\r\n \"targetSwapSlot\": null,\r\n \"hostingEnvironment\": null,\r\n \"hostingEnvironmentProfile\": null,\r\n \"clientAffinityEnabled\": true,\r\n \"clientCertEnabled\": false,\r\n \"hostNamesDisabled\": false,\r\n \"domainVerificationIdentifiers\": null,\r\n \"kind\": \"app\",\r\n \"outboundIpAddresses\": \"40.114.51.181,40.114.49.220,40.114.10.246,40.114.0.217\",\r\n \"possibleOutboundIpAddresses\": \"40.114.51.181,40.114.49.220,40.114.10.246,40.114.0.217\",\r\n \"containerSize\": 0,\r\n \"dailyMemoryTimeQuota\": 0,\r\n \"suspendedTill\": null,\r\n \"siteDisabledReason\": 0,\r\n \"functionExecutionUnitsCache\": null,\r\n \"maxNumberOfWorkers\": null,\r\n \"homeStamp\": \"waws-prod-blu-037\",\r\n \"cloningInfo\": null,\r\n \"hostingEnvironmentId\": null,\r\n \"tags\": null,\r\n \"resourceGroup\": \"ps8566\",\r\n \"defaultHostName\": \"ps8566.azurewebsites.net\",\r\n \"slotSwapStatus\": null,\r\n \"httpsOnly\": false\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "2569" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-request-id": [ + "aa6e9591-8fa8-4298-b6a6-345a41536c24" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-correlation-request-id": [ + "190080b5-09f8-43e6-880b-a9306802f3bf" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180514T202839Z:190080b5-09f8-43e6-880b-a9306802f3bf" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 May 2018 20:28:39 GMT" + ], + "ETag": [ + "\"1D3EBC22471D8E0\"" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/ps8566/providers/Microsoft.Web/sites/ps8566/config/web?api-version=2016-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvN2ZkMDhkY2MtYTY1My00YjBmLThmOGMtNGRhYzg4OWZkZGE0L3Jlc291cmNlR3JvdXBzL3BzODU2Ni9wcm92aWRlcnMvTWljcm9zb2Z0LldlYi9zaXRlcy9wczg1NjYvY29uZmlnL3dlYj9hcGktdmVyc2lvbj0yMDE2LTA4LTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "22879ad2-fb30-4e31-9ef5-2152b42bef72" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.3101.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.17134", + "Microsoft.Azure.Management.WebSites.WebSiteManagementClient/1.7.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/ps8566/providers/Microsoft.Web/sites/ps8566/config/web\",\r\n \"name\": \"ps8566\",\r\n \"type\": \"Microsoft.Web/sites/config\",\r\n \"location\": \"East US\",\r\n \"properties\": {\r\n \"numberOfWorkers\": 1,\r\n \"defaultDocuments\": [\r\n \"Default.htm\",\r\n \"Default.html\",\r\n \"Default.asp\",\r\n \"index.htm\",\r\n \"index.html\",\r\n \"iisstart.htm\",\r\n \"default.aspx\",\r\n \"index.php\",\r\n \"hostingstart.html\"\r\n ],\r\n \"netFrameworkVersion\": \"v4.0\",\r\n \"phpVersion\": \"5.6\",\r\n \"pythonVersion\": \"\",\r\n \"nodeVersion\": \"\",\r\n \"linuxFxVersion\": \"\",\r\n \"windowsFxVersion\": null,\r\n \"requestTracingEnabled\": false,\r\n \"remoteDebuggingEnabled\": false,\r\n \"remoteDebuggingVersion\": null,\r\n \"httpLoggingEnabled\": false,\r\n \"logsDirectorySizeLimit\": 35,\r\n \"detailedErrorLoggingEnabled\": false,\r\n \"publishingUsername\": \"$ps8566\",\r\n \"publishingPassword\": null,\r\n \"appSettings\": null,\r\n \"metadata\": null,\r\n \"connectionStrings\": null,\r\n \"machineKey\": null,\r\n \"handlerMappings\": null,\r\n \"documentRoot\": null,\r\n \"scmType\": \"None\",\r\n \"use32BitWorkerProcess\": true,\r\n \"webSocketsEnabled\": false,\r\n \"alwaysOn\": false,\r\n \"javaVersion\": null,\r\n \"javaContainer\": null,\r\n \"javaContainerVersion\": null,\r\n \"appCommandLine\": \"\",\r\n \"managedPipelineMode\": \"Integrated\",\r\n \"virtualApplications\": [\r\n {\r\n \"virtualPath\": \"/\",\r\n \"physicalPath\": \"site\\\\wwwroot\",\r\n \"preloadEnabled\": false,\r\n \"virtualDirectories\": null\r\n }\r\n ],\r\n \"winAuthAdminState\": 0,\r\n \"winAuthTenantState\": 0,\r\n \"customAppPoolIdentityAdminState\": false,\r\n \"customAppPoolIdentityTenantState\": false,\r\n \"runtimeADUser\": null,\r\n \"runtimeADUserPassword\": null,\r\n \"loadBalancing\": \"LeastRequests\",\r\n \"routingRules\": [],\r\n \"experiments\": {\r\n \"rampUpRules\": []\r\n },\r\n \"limits\": null,\r\n \"autoHealEnabled\": false,\r\n \"autoHealRules\": null,\r\n \"tracingOptions\": null,\r\n \"vnetName\": \"\",\r\n \"siteAuthEnabled\": false,\r\n \"siteAuthSettings\": {\r\n \"enabled\": null,\r\n \"unauthenticatedClientAction\": null,\r\n \"tokenStoreEnabled\": null,\r\n \"allowedExternalRedirectUrls\": null,\r\n \"defaultProvider\": null,\r\n \"clientId\": null,\r\n \"clientSecret\": null,\r\n \"issuer\": null,\r\n \"allowedAudiences\": null,\r\n \"additionalLoginParams\": null,\r\n \"isAadAutoProvisioned\": false,\r\n \"googleClientId\": null,\r\n \"googleClientSecret\": null,\r\n \"googleOAuthScopes\": null,\r\n \"facebookAppId\": null,\r\n \"facebookAppSecret\": null,\r\n \"facebookOAuthScopes\": null,\r\n \"twitterConsumerKey\": null,\r\n \"twitterConsumerSecret\": null,\r\n \"microsoftAccountClientId\": null,\r\n \"microsoftAccountClientSecret\": null,\r\n \"microsoftAccountOAuthScopes\": null\r\n },\r\n \"cors\": null,\r\n \"push\": null,\r\n \"apiDefinition\": null,\r\n \"autoSwapSlotName\": null,\r\n \"localMySqlEnabled\": false,\r\n \"managedServiceIdentityId\": null,\r\n \"xManagedServiceIdentityId\": null,\r\n \"ipSecurityRestrictions\": null,\r\n \"http20Enabled\": false,\r\n \"minTlsVersion\": \"1.0\",\r\n \"ftpsState\": \"AllAllowed\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "2440" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-request-id": [ + "3064b148-e30c-4d72-b892-1308e58d5f03" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14994" + ], + "x-ms-correlation-request-id": [ + "c5db9006-dabf-4a55-8462-61f2b363530f" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180514T202840Z:c5db9006-dabf-4a55-8462-61f2b363530f" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 May 2018 20:28:39 GMT" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/ps8566/providers/Microsoft.Web/sites/ps8566/config/appsettings/list?api-version=2016-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvN2ZkMDhkY2MtYTY1My00YjBmLThmOGMtNGRhYzg4OWZkZGE0L3Jlc291cmNlR3JvdXBzL3BzODU2Ni9wcm92aWRlcnMvTWljcm9zb2Z0LldlYi9zaXRlcy9wczg1NjYvY29uZmlnL2FwcHNldHRpbmdzL2xpc3Q/YXBpLXZlcnNpb249MjAxNi0wOC0wMQ==", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "07810d16-1a84-477c-aa38-321ad62936eb" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.3101.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.17134", + "Microsoft.Azure.Management.WebSites.WebSiteManagementClient/1.7.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/ps8566/providers/Microsoft.Web/sites/ps8566/config/appsettings\",\r\n \"name\": \"appsettings\",\r\n \"type\": \"Microsoft.Web/sites/config\",\r\n \"location\": \"East US\",\r\n \"properties\": {\r\n \"WEBSITE_NODE_DEFAULT_VERSION\": \"6.9.1\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "270" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-request-id": [ + "f0b8b940-94d1-43de-80d6-d2d898367f4e" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "11999" + ], + "x-ms-correlation-request-id": [ + "d57139c9-5038-400c-a390-83a39bafe149" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180514T202840Z:d57139c9-5038-400c-a390-83a39bafe149" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 May 2018 20:28:40 GMT" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/ps8566/providers/Microsoft.Web/sites/ps8566/config/connectionstrings/list?api-version=2016-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvN2ZkMDhkY2MtYTY1My00YjBmLThmOGMtNGRhYzg4OWZkZGE0L3Jlc291cmNlR3JvdXBzL3BzODU2Ni9wcm92aWRlcnMvTWljcm9zb2Z0LldlYi9zaXRlcy9wczg1NjYvY29uZmlnL2Nvbm5lY3Rpb25zdHJpbmdzL2xpc3Q/YXBpLXZlcnNpb249MjAxNi0wOC0wMQ==", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "df903997-a38d-4c65-8364-f480dff3e48c" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.3101.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.17134", + "Microsoft.Azure.Management.WebSites.WebSiteManagementClient/1.7.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/ps8566/providers/Microsoft.Web/sites/ps8566/config/connectionstrings\",\r\n \"name\": \"connectionstrings\",\r\n \"type\": \"Microsoft.Web/sites/config\",\r\n \"location\": \"East US\",\r\n \"properties\": {}\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "244" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-request-id": [ + "6bcef7dd-d58f-4e94-bc7e-f9da79f24faf" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "11998" + ], + "x-ms-correlation-request-id": [ + "2aedcc27-4795-4b88-9d2c-64671e3c7161" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180514T202840Z:2aedcc27-4795-4b88-9d2c-64671e3c7161" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 May 2018 20:28:40 GMT" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/ps8566/providers/Microsoft.Web/sites/ps8566/publishxml?api-version=2016-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvN2ZkMDhkY2MtYTY1My00YjBmLThmOGMtNGRhYzg4OWZkZGE0L3Jlc291cmNlR3JvdXBzL3BzODU2Ni9wcm92aWRlcnMvTWljcm9zb2Z0LldlYi9zaXRlcy9wczg1NjYvcHVibGlzaHhtbD9hcGktdmVyc2lvbj0yMDE2LTA4LTAx", + "RequestMethod": "POST", + "RequestBody": "{\r\n \"format\": \"WebDeploy\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "29" + ], + "x-ms-client-request-id": [ + "ac449569-4696-4074-9ec1-8afec2b12e56" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.3101.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.17134", + "Microsoft.Azure.Management.WebSites.WebSiteManagementClient/1.7.0" + ] + }, + "ResponseBody": "\r\n \r\n \r\n \r\n \r\n \r\n \r\n", + "ResponseHeaders": { + "Content-Length": [ + "988" + ], + "Content-Type": [ + "application/xml" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "11999" + ], + "x-ms-request-id": [ + "674fc890-5555-40b7-a996-c600bd4e281b" + ], + "x-ms-correlation-request-id": [ + "674fc890-5555-40b7-a996-c600bd4e281b" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180514T202841Z:674fc890-5555-40b7-a996-c600bd4e281b" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 May 2018 20:28:40 GMT" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourcegroups/ps8566?api-version=2016-02-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvN2ZkMDhkY2MtYTY1My00YjBmLThmOGMtNGRhYzg4OWZkZGE0L3Jlc291cmNlZ3JvdXBzL3BzODU2Nj9hcGktdmVyc2lvbj0yMDE2LTAyLTAx", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-deletes": [ + "14999" + ], + "x-ms-request-id": [ + "b2e1a342-948c-4d31-a5fa-e1bd742a18fd" + ], + "x-ms-correlation-request-id": [ + "b2e1a342-948c-4d31-a5fa-e1bd742a18fd" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180514T202842Z:b2e1a342-948c-4d31-a5fa-e1bd742a18fd" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 May 2018 20:28:41 GMT" + ], + "Location": [ + "https://management.azure.com/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QUzg1NjYtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-02-01" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QUzg1NjYtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-02-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvN2ZkMDhkY2MtYTY1My00YjBmLThmOGMtNGRhYzg4OWZkZGE0L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVXpnMU5qWXRSVUZUVkZWVElpd2lhbTlpVEc5allYUnBiMjRpT2lKbFlYTjBkWE1pZlE/YXBpLXZlcnNpb249MjAxNi0wMi0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2016-02-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14998" + ], + "x-ms-request-id": [ + "30567f5d-6a94-4dd9-9ad5-68e494db0177" + ], + "x-ms-correlation-request-id": [ + "30567f5d-6a94-4dd9-9ad5-68e494db0177" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180514T202842Z:30567f5d-6a94-4dd9-9ad5-68e494db0177" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 May 2018 20:28:41 GMT" + ], + "Location": [ + "https://management.azure.com/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QUzg1NjYtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-02-01" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QUzg1NjYtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-02-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvN2ZkMDhkY2MtYTY1My00YjBmLThmOGMtNGRhYzg4OWZkZGE0L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVXpnMU5qWXRSVUZUVkZWVElpd2lhbTlpVEc5allYUnBiMjRpT2lKbFlYTjBkWE1pZlE/YXBpLXZlcnNpb249MjAxNi0wMi0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2016-02-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14997" + ], + "x-ms-request-id": [ + "56694501-bfde-49ec-85b8-4a4abd2fd81f" + ], + "x-ms-correlation-request-id": [ + "56694501-bfde-49ec-85b8-4a4abd2fd81f" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180514T202857Z:56694501-bfde-49ec-85b8-4a4abd2fd81f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 May 2018 20:28:56 GMT" + ], + "Location": [ + "https://management.azure.com/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QUzg1NjYtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-02-01" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QUzg1NjYtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-02-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvN2ZkMDhkY2MtYTY1My00YjBmLThmOGMtNGRhYzg4OWZkZGE0L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVXpnMU5qWXRSVUZUVkZWVElpd2lhbTlpVEc5allYUnBiMjRpT2lKbFlYTjBkWE1pZlE/YXBpLXZlcnNpb249MjAxNi0wMi0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2016-02-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14996" + ], + "x-ms-request-id": [ + "b428d34f-0ff8-4226-8a80-ab9a8fb27766" + ], + "x-ms-correlation-request-id": [ + "b428d34f-0ff8-4226-8a80-ab9a8fb27766" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180514T202912Z:b428d34f-0ff8-4226-8a80-ab9a8fb27766" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 May 2018 20:29:12 GMT" + ], + "Location": [ + "https://management.azure.com/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QUzg1NjYtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-02-01" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QUzg1NjYtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-02-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvN2ZkMDhkY2MtYTY1My00YjBmLThmOGMtNGRhYzg4OWZkZGE0L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVXpnMU5qWXRSVUZUVkZWVElpd2lhbTlpVEc5allYUnBiMjRpT2lKbFlYTjBkWE1pZlE/YXBpLXZlcnNpb249MjAxNi0wMi0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2016-02-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14995" + ], + "x-ms-request-id": [ + "c0f1b011-2f9c-4166-ad2b-7c0ade803765" + ], + "x-ms-correlation-request-id": [ + "c0f1b011-2f9c-4166-ad2b-7c0ade803765" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180514T202927Z:c0f1b011-2f9c-4166-ad2b-7c0ade803765" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 May 2018 20:29:27 GMT" + ], + "Location": [ + "https://management.azure.com/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QUzg1NjYtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-02-01" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QUzg1NjYtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-02-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvN2ZkMDhkY2MtYTY1My00YjBmLThmOGMtNGRhYzg4OWZkZGE0L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVXpnMU5qWXRSVUZUVkZWVElpd2lhbTlpVEc5allYUnBiMjRpT2lKbFlYTjBkWE1pZlE/YXBpLXZlcnNpb249MjAxNi0wMi0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2016-02-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14994" + ], + "x-ms-request-id": [ + "d41042a7-2160-490a-808a-05442cd6ff54" + ], + "x-ms-correlation-request-id": [ + "d41042a7-2160-490a-808a-05442cd6ff54" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180514T202943Z:d41042a7-2160-490a-808a-05442cd6ff54" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 May 2018 20:29:42 GMT" + ], + "Location": [ + "https://management.azure.com/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QUzg1NjYtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-02-01" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QUzg1NjYtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-02-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvN2ZkMDhkY2MtYTY1My00YjBmLThmOGMtNGRhYzg4OWZkZGE0L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVXpnMU5qWXRSVUZUVkZWVElpd2lhbTlpVEc5allYUnBiMjRpT2lKbFlYTjBkWE1pZlE/YXBpLXZlcnNpb249MjAxNi0wMi0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2016-02-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14993" + ], + "x-ms-request-id": [ + "ec9af0af-3a43-47e4-9418-bccbe67ad55a" + ], + "x-ms-correlation-request-id": [ + "ec9af0af-3a43-47e4-9418-bccbe67ad55a" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180514T202958Z:ec9af0af-3a43-47e4-9418-bccbe67ad55a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 May 2018 20:29:57 GMT" + ], + "Location": [ + "https://management.azure.com/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QUzg1NjYtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-02-01" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QUzg1NjYtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-02-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvN2ZkMDhkY2MtYTY1My00YjBmLThmOGMtNGRhYzg4OWZkZGE0L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVXpnMU5qWXRSVUZUVkZWVElpd2lhbTlpVEc5allYUnBiMjRpT2lKbFlYTjBkWE1pZlE/YXBpLXZlcnNpb249MjAxNi0wMi0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2016-02-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14992" + ], + "x-ms-request-id": [ + "4c95ef75-110e-4c38-8669-a266e1824aa4" + ], + "x-ms-correlation-request-id": [ + "4c95ef75-110e-4c38-8669-a266e1824aa4" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180514T203013Z:4c95ef75-110e-4c38-8669-a266e1824aa4" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 May 2018 20:30:12 GMT" + ], + "Location": [ + "https://management.azure.com/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QUzg1NjYtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-02-01" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QUzg1NjYtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-02-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvN2ZkMDhkY2MtYTY1My00YjBmLThmOGMtNGRhYzg4OWZkZGE0L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVXpnMU5qWXRSVUZUVkZWVElpd2lhbTlpVEc5allYUnBiMjRpT2lKbFlYTjBkWE1pZlE/YXBpLXZlcnNpb249MjAxNi0wMi0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2016-02-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14991" + ], + "x-ms-request-id": [ + "989c118f-ee7a-44ff-ba6d-b07ee06e1e21" + ], + "x-ms-correlation-request-id": [ + "989c118f-ee7a-44ff-ba6d-b07ee06e1e21" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180514T203028Z:989c118f-ee7a-44ff-ba6d-b07ee06e1e21" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 May 2018 20:30:28 GMT" + ] + }, + "StatusCode": 200 + } + ], + "Names": { + "Test-CreateNewWebAppSimple": [ + "ps8566" + ] + }, + "Variables": { + "SubscriptionId": "7fd08dcc-a653-4b0f-8f8c-4dac889fdda4" + } +} \ No newline at end of file diff --git a/src/ResourceManager/Websites/Commands.Websites/Cmdlets/WebApps/NewAzureWebApp.cs b/src/ResourceManager/Websites/Commands.Websites/Cmdlets/WebApps/NewAzureWebApp.cs index 7d3377b901b6..ff241c2959db 100644 --- a/src/ResourceManager/Websites/Commands.Websites/Cmdlets/WebApps/NewAzureWebApp.cs +++ b/src/ResourceManager/Websites/Commands.Websites/Cmdlets/WebApps/NewAzureWebApp.cs @@ -132,15 +132,18 @@ public void ExecuteCmdletActions(SessionState state) if (ParameterSetName == SimpleParameterSet) { ValidateWebAppName(Name); - if (ShouldProcess(string.Format(Microsoft.Azure.Commands.WebApps.Properties.Resources.SimpleWebAppCreateTarget, Name), Microsoft.Azure.Commands.WebApps.Properties.Resources.SimpleWebAppCreateAction)) + if (ShouldProcess( + string.Format(Properties.Resources.SimpleWebAppCreateTarget, Name), + Properties.Resources.SimpleWebAppCreateAction)) { - var adapter = new PSCmdletAdapter(this, state); - adapter.WaitForCompletion(CreateWithSimpleParameters); + this.StartAndWait(CreateWithSimpleParameters); } } else { - if (ShouldProcess(string.Format("WebApp '{0}' from WebApp '{1}'", Name, SourceWebApp?.Name), "Copy")) + if (ShouldProcess( + string.Format("WebApp '{0}' from WebApp '{1}'", Name, SourceWebApp?.Name), + "Copy")) { CreateWithClonedWebApp(); } @@ -153,7 +156,8 @@ private void ValidateWebAppName(string name) var available = WebsitesClient.WrappedWebsitesClient.CheckNameAvailability(name,"Site"); if (available.NameAvailable.HasValue && !available.NameAvailable.Value) { - throw new InvalidOperationException(string.Format("Website name '{0}' is not available. Please try a different name.", name)); + throw new InvalidOperationException(string.Format( + "Website name '{0}' is not available. Please try a different name.", name)); } } @@ -249,57 +253,82 @@ bool TryGetServerFarmFromResourceId(string serverFarm, out string resourceGroup, return result; } - public async Task CreateWithSimpleParameters(ICmdletAdapter adapter) + sealed class Parameters : IParameters { - ResourceGroupName = ResourceGroupName ?? Name; - AppServicePlan = AppServicePlan ?? Name; - string planResourceGroup = ResourceGroupName; - string planName = AppServicePlan; - var rgStrategy = ResourceGroupStrategy.CreateResourceGroupConfig(ResourceGroupName); - ResourceConfig planRG = rgStrategy; - if (MyInvocation.BoundParameters.ContainsKey(nameof(AppServicePlan))) + readonly NewAzureWebAppCmdlet _cmdlet; + + public Parameters(NewAzureWebAppCmdlet cmdlet) { - if (!TryGetServerFarmFromResourceId(AppServicePlan, out planResourceGroup, out planName)) - { - planResourceGroup = ResourceGroupName; - planName = AppServicePlan; - } + _cmdlet = cmdlet; + } + + public string DefaultLocation => "eastus"; - planRG = ResourceGroupStrategy.CreateResourceGroupConfig(planResourceGroup); + public string Location + { + get { return _cmdlet.Location; } + set { _cmdlet.Location = value; } } - else + + public async Task> CreateConfigAsync() { - var farm = await GetDefaultServerFarm(Location); - if (farm != null) + _cmdlet.ResourceGroupName = _cmdlet.ResourceGroupName ?? _cmdlet.Name; + _cmdlet.AppServicePlan = _cmdlet.AppServicePlan ?? _cmdlet.Name; + + var planResourceGroup = _cmdlet.ResourceGroupName; + var planName = _cmdlet.AppServicePlan; + + var rgStrategy = ResourceGroupStrategy.CreateResourceGroupConfig(_cmdlet.ResourceGroupName); + var planRG = rgStrategy; + if (_cmdlet.MyInvocation.BoundParameters.ContainsKey(nameof(AppServicePlan))) { - planResourceGroup = farm.ResourceGroup; - planName = farm.Name; + if (!_cmdlet.TryGetServerFarmFromResourceId(_cmdlet.AppServicePlan, out planResourceGroup, out planName)) + { + planResourceGroup = _cmdlet.ResourceGroupName; + planName = _cmdlet.AppServicePlan; + } + planRG = ResourceGroupStrategy.CreateResourceGroupConfig(planResourceGroup); } + else + { + var farm = await _cmdlet.GetDefaultServerFarm(Location); + if (farm != null) + { + planResourceGroup = farm.ResourceGroup; + planName = farm.Name; + planRG = ResourceGroupStrategy.CreateResourceGroupConfig(planResourceGroup); + } + } + var farmStrategy = planRG.CreateServerFarmConfig(planResourceGroup, planName); + return rgStrategy.CreateSiteConfig(farmStrategy, _cmdlet.Name); } + } - - var farmStrategy = planRG.CreateServerFarmConfig(planResourceGroup, planName); - var siteStrategy = rgStrategy.CreateSiteConfig(farmStrategy, Name); + public async Task CreateWithSimpleParameters(IAsyncCmdlet adapter) + { + var parameters = new Parameters(this); var client = new WebClient(DefaultContext); + var output = await client.RunAsync(client.SubscriptionId, parameters, adapter); - var current = await siteStrategy.GetStateAsync(client, default(CancellationToken)); - if (!MyInvocation.BoundParameters.ContainsKey(nameof(Location))) - { - Location = current.GetLocation(siteStrategy) ?? "East US"; - } - - var engine = new SdkEngine(DefaultContext.Subscription.Id); - var target = siteStrategy.GetTargetState(current, engine, Location); - var endState = await siteStrategy.UpdateStateAsync(client, target, default(CancellationToken), adapter, adapter.ReportTaskProgress); - var output = endState.Get(siteStrategy) ?? current.Get(siteStrategy); - output.SiteConfig = WebsitesClient.WrappedWebsitesClient.WebApps().GetConfiguration(output.ResourceGroup, output.Name).ConvertToSiteConfig(); + output.SiteConfig = WebsitesClient + .WrappedWebsitesClient + .WebApps() + .GetConfiguration(output.ResourceGroup, output.Name) + .ConvertToSiteConfig(); try { - var appSettings = WebsitesClient.WrappedWebsitesClient.WebApps().ListApplicationSettings(output.ResourceGroup, output.Name); - output.SiteConfig.AppSettings = appSettings.Properties.Select(s => new NameValuePair { Name = s.Key, Value = s.Value }).ToList(); - var connectionStrings = WebsitesClient.WrappedWebsitesClient.WebApps().ListConnectionStrings(output.ResourceGroup, output.Name); + var appSettings = WebsitesClient + .WrappedWebsitesClient + .WebApps() + .ListApplicationSettings(output.ResourceGroup, output.Name); + output.SiteConfig.AppSettings = appSettings + .Properties + .Select(s => new NameValuePair { Name = s.Key, Value = s.Value }) + .ToList(); + var connectionStrings = WebsitesClient.WrappedWebsitesClient.WebApps().ListConnectionStrings( + output.ResourceGroup, output.Name); output.SiteConfig.ConnectionStrings = connectionStrings .Properties .Select(s => new ConnStringInfo() @@ -332,18 +361,18 @@ public async Task CreateWithSimpleParameters(ICmdletAdapter adapter) GitRemotePassword = SecureStringExtensions.ConvertToSecureString(password) }; output = newOutput; - var git = new GitCommand(adapter.SessionState.Path, GitRepositoryPath); + var git = new GitCommand(SessionState.Path, GitRepositoryPath); var repository = await git.VerifyGitRepository(); if (repository != null) { if (!await git.CheckExistence()) { - adapter.WriteWarningAsync(git.InstallationInstructions); + adapter.WriteWarning(git.InstallationInstructions); } else if (!string.IsNullOrWhiteSpace(userName) && !string.IsNullOrWhiteSpace(password)) { await git.AddRemoteRepository("azure", $"https://{userName}:{password}@{scmHostName}"); - adapter.WriteVerboseAsync(Microsoft.Azure.Commands.WebApps.Properties.Resources.GitRemoteMessage); + adapter.WriteVerbose(Properties.Resources.GitRemoteMessage); newOutput.GitRemoteName = "azure"; } } @@ -352,10 +381,13 @@ public async Task CreateWithSimpleParameters(ICmdletAdapter adapter) catch (Exception exception) { // do not write errors for problems with adding git repository - var repoPath = GitRepositoryPath ?? adapter?.SessionState?.Path?.CurrentFileSystemLocation?.Path; - adapter.WriteWarningAsync(String.Format(Microsoft.Azure.Commands.WebApps.Properties.Resources.GitRemoteAddFailure, repoPath, exception.Message)); + var repoPath = GitRepositoryPath ?? SessionState?.Path?.CurrentFileSystemLocation?.Path; + adapter.WriteWarning(string.Format( + Properties.Resources.GitRemoteAddFailure, + repoPath, + exception.Message)); } - adapter.WriteObjectAsync(output); + adapter.WriteObject(output); } diff --git a/src/ResourceManager/Websites/Commands.Websites/Commands.Websites.csproj b/src/ResourceManager/Websites/Commands.Websites/Commands.Websites.csproj index 5c767f54043f..9705b4510b70 100644 --- a/src/ResourceManager/Websites/Commands.Websites/Commands.Websites.csproj +++ b/src/ResourceManager/Websites/Commands.Websites/Commands.Websites.csproj @@ -110,7 +110,6 @@ - diff --git a/src/ResourceManager/Websites/Commands.Websites/Strategies/ExternalCommand.cs b/src/ResourceManager/Websites/Commands.Websites/Strategies/ExternalCommand.cs index 62a08c0a2aed..78624f05d39c 100644 --- a/src/ResourceManager/Websites/Commands.Websites/Strategies/ExternalCommand.cs +++ b/src/ResourceManager/Websites/Commands.Websites/Strategies/ExternalCommand.cs @@ -12,7 +12,6 @@ // limitations under the License. // ---------------------------------------------------------------------------------- -using Microsoft.Azure.Commands.WebApps.Properties; using System; using System.Diagnostics; using System.IO; diff --git a/src/ResourceManager/Websites/Commands.Websites/Strategies/GitCommand.cs b/src/ResourceManager/Websites/Commands.Websites/Strategies/GitCommand.cs index 0fe0e040c581..26992304b322 100644 --- a/src/ResourceManager/Websites/Commands.Websites/Strategies/GitCommand.cs +++ b/src/ResourceManager/Websites/Commands.Websites/Strategies/GitCommand.cs @@ -13,14 +13,11 @@ // ---------------------------------------------------------------------------------- using System.Management.Automation; -using System; using System.Collections.Generic; using System.Linq; using System.Security.Permissions; -using System.Text; using System.Threading.Tasks; using System.IO; -using Microsoft.Azure.Commands.WebApps.Properties; namespace Microsoft.Azure.Commands.WebApps.Strategies { diff --git a/src/ResourceManager/Websites/Commands.Websites/Strategies/ICmdletAdapter.cs b/src/ResourceManager/Websites/Commands.Websites/Strategies/ICmdletAdapter.cs deleted file mode 100644 index 5c88b0bb03b7..000000000000 --- a/src/ResourceManager/Websites/Commands.Websites/Strategies/ICmdletAdapter.cs +++ /dev/null @@ -1,100 +0,0 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ---------------------------------------------------------------------------------- - -using Microsoft.Azure.Commands.Common.Strategies; -using System; -using System.Management.Automation; -using System.Threading.Tasks; - -namespace Microsoft.Azure.Commands.WebApps.Strategies -{ - public interface ICmdletAdapter : IShouldProcess - { - /// - /// Path information for the current running cmdlet - /// - SessionState SessionState { get; } - - /// - /// Given the target and description of a change, determine if the change should occur - /// - /// The resource that is changing - /// A description fo the proposed change - /// True if the change should proceeed, false otherwise - Task ShouldChangeAsync(string target, string action); - - /// - /// Given the target and prompt information describing a special condition for a change, determine whether the change should proceed - /// - /// A textual description of the special circumstances that require special confirmation - /// A summary description of the special condition that requires confirmation - /// True if the change shoudl proceed, false otherwise - Task ShouldContinueChangeAsync(string query, string caption); - - /// - /// Report an error - /// - /// The exception descriging the error - /// nothing - void WriteExceptionAsync(Exception exception); - - /// - /// Write an object to the ouput stream - /// - /// The oject to write - void WriteObjectAsync(object output); - - /// - /// Write an object to the outpit stream - /// - /// The object to write - /// Indicate whether write each element of a collection to the output stream - void WriteObjectAsync(object output, bool enumerateCollection); - - /// - /// Log additional information - /// - /// The additional information to log - /// nothing - void WriteVerboseAsync(string verboseMessage); - - /// - /// Log debugging information - /// - /// The debug information to log - /// nothing - void WriteDebugAsync(string debugMessage); - - /// - /// Log a warning message - /// - /// The warning to log - /// nothing - void WriteWarningAsync(string warningMessage); - - /// - /// Log the beginning of an activity - /// - /// A description of the activity that is starting - /// The inbitial status of the activity - /// An activity tracker - void ReportTaskProgress(ITaskProgress progress); - - /// - /// Complete all processing - /// - /// nothing - void Complete(); - } -} diff --git a/src/ResourceManager/Websites/Commands.Websites/Strategies/PSCmdletAdapter.cs b/src/ResourceManager/Websites/Commands.Websites/Strategies/PSCmdletAdapter.cs index ba3e1b9ef519..471d10c59d7c 100644 --- a/src/ResourceManager/Websites/Commands.Websites/Strategies/PSCmdletAdapter.cs +++ b/src/ResourceManager/Websites/Commands.Websites/Strategies/PSCmdletAdapter.cs @@ -12,246 +12,72 @@ // limitations under the License. // ---------------------------------------------------------------------------------- -using Microsoft.WindowsAzure.Commands.Utilities.Common; using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Linq; using System.Management.Automation; -using System.Text; -using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Commands.Common.Strategies; +using System.Collections.Generic; +using System.Linq; namespace Microsoft.Azure.Commands.WebApps.Strategies { - public class PSCmdletAdapter : ICmdletAdapter + static class PSCmdletAdapterExtension { + public static void StartAndWait( + this T cmdlet, Func createAndStartTask) + where T : PSCmdlet + => new Adapter(cmdlet).CmdletStartAndWait(createAndStartTask); - public PSCmdletAdapter(AzurePSCmdlet cmdlet, SessionState state) - { - this.CommandRuntime = cmdlet.CommandRuntime; - _sessionState = state; - } - - struct ShouldProcessPrompt - { - public string Target { get; set; } - public string Message { get; set; } - public TaskCompletionSource Completer { get; set; } - } - - struct ShouldContinuePrompt - { - public string Query { get; set; } - public string Caption { get; set; } - public TaskCompletionSource Completer { get; set; } - } - - struct CmdletOutput - { - public object Output { get; set; } - public bool Enumerate { get; set; } - } - - SessionState _sessionState; - ConcurrentQueue _output = new ConcurrentQueue(); - - ConcurrentQueue _debug = new ConcurrentQueue(); - - ConcurrentQueue _warning = new ConcurrentQueue(); - - ConcurrentQueue _verbose = new ConcurrentQueue(); - - ConcurrentQueue _error = new ConcurrentQueue(); - - ConcurrentQueue _process = new ConcurrentQueue(); - - ConcurrentQueue _continue = new ConcurrentQueue(); - - ConcurrentQueue _progress = new ConcurrentQueue(); - - ConcurrentDictionary _activity = new ConcurrentDictionary(); - - object _lock = new object(); - - ConcurrentDictionary _progressTasks = new ConcurrentDictionary(); - - //int _hasMessages = 0; - - protected int Retries { get; set; } - - public TimeSpan RetryInterval { get; set; } - - public SessionState SessionState { get { return _sessionState; } } - - public Task ShouldChangeAsync(string target, string action) - { - var process = new ShouldProcessPrompt { Target = target, Message = action, Completer = new TaskCompletionSource() }; - _process.Enqueue(process); - //_hasMessages = 1; - return process.Completer.Task; - } - - public Task ShouldContinueChangeAsync(string query, string caption) - { - var process = new ShouldContinuePrompt { Query = query, Caption = caption, Completer = new TaskCompletionSource() }; - _continue.Enqueue(process); - //_hasMessages = 1; - return process.Completer.Task; - } - - public void WriteExceptionAsync(Exception exception) - { - var error = new ErrorRecord(exception, "ExecutionException", ErrorCategory.InvalidOperation, exception.TargetSite); - _error.Enqueue(error); - //_hasMessages = 1; - } - - public void WriteVerboseAsync(string verboseMessage) + sealed class Adapter : ICmdlet + where T : PSCmdlet { - _verbose.Enqueue(verboseMessage); - //_hasMessages = 1; - } + readonly T _Cmdlet; - public void WriteDebugAsync(string debugMessage) - { - _debug.Enqueue(debugMessage); - //_hasMessages = 1; - } - - public void WriteWarningAsync(string warningMessage) - { - _warning.Enqueue(warningMessage); - //_hasMessages = 1; - } - - void WriteProgressAsync(ProgressRecord progress) - { - _progress.Enqueue(progress); - //_hasMessages = 1; - } - - public void ReportTaskProgress(ITaskProgress taskProgress) - { - var progress = taskProgress.GetProgress(); - var config = taskProgress.Config; - string key = config.Name + " " + config.Strategy.Type.Provider; - bool reportProgress = true; - if (_progressTasks.ContainsKey(taskProgress)) + public Adapter(T cmdlet) { - progress += _progressTasks[taskProgress]; - reportProgress = progress > _progressTasks[taskProgress]; + _Cmdlet = cmdlet; } - _progressTasks[taskProgress] = progress; - if (reportProgress && progress <= 1) + public IEnumerable> Parameters { - var percent = (int)(progress * 100.0); - var r = new[] { "|", "/", "-", "\\" }; - var x = r[DateTime.Now.Second % 4]; - WriteProgressAsync( - new ProgressRecord( - 0, - "Creating Azure resources", - percent + "% " + x) - { - CurrentOperation = !taskProgress.IsDone - ? $"Creating resource '{taskProgress.Config.Name}' of type '{taskProgress.Config?.Strategy?.Type?.Namespace}/{taskProgress.Config?.Strategy?.Type?.Provider}'" - : null, - PercentComplete = percent, - }); - } - } - - public void Complete() - { - } - - void PollForResults(bool drainQueues = false) - { - ShouldProcessPrompt process; - while (_process.TryDequeue(out process)) - { - process.Completer.TrySetResult(CommandRuntime.ShouldProcess(process.Target, process.Message)); - } - - ShouldContinuePrompt shouldContinue; - while (_continue.TryDequeue(out shouldContinue)) - { - shouldContinue.Completer.TrySetResult(CommandRuntime.ShouldContinue(shouldContinue.Query, shouldContinue.Caption)); + get + { + var psName = _Cmdlet.ParameterSetName; + return typeof(T) + .GetProperties() + .Where(p => p + .GetCustomAttributes(false) + .OfType() + .Any(a => a.ParameterSetName == psName + || a.ParameterSetName == null)) + .Select(p => new KeyValuePair(p.Name, p.GetValue(_Cmdlet))); + } } - ErrorRecord exception; - while (_error.TryDequeue(out exception)) - { - CommandRuntime.WriteError(exception); - } + public string VerbsNew => VerbsCommon.New; - CmdletOutput output; - while (_output.TryDequeue(out output)) - { - CommandRuntime.WriteObject(output.Output, output.Enumerate); - } + public bool ShouldProcess(string target, string action) + => _Cmdlet.ShouldProcess(target, action); - string logMessage; - while (_warning.TryDequeue(out logMessage)) - { - CommandRuntime.WriteWarning(logMessage); - } - - while (_verbose.TryDequeue(out logMessage)) - { - CommandRuntime.WriteVerbose(logMessage); - } - - while (_debug.TryDequeue(out logMessage)) - { - CommandRuntime.WriteDebug(logMessage); - } + public void WriteObject(object value) + => _Cmdlet.WriteObject(value); - ProgressRecord progress; - while (_progress.TryDequeue(out progress)) - { - CommandRuntime.WriteProgress(progress); - } - - foreach(var progressItem in _progressTasks.Keys) - { - ReportTaskProgress(progressItem); - } - - } - - public void WaitForCompletion(Func taskFactory) - { - var task = taskFactory(this); - while (!task.IsCompleted) - { - PollForResults(); - Thread.Yield(); - } - - PollForResults(true); - } - - public Task ShouldCreate(ResourceConfig config, TModel model) where TModel : class - { - return ShouldChangeAsync(config.Name, $"Create {config.Strategy.Type}"); - } - - public void WriteObjectAsync(object output) - { - WriteObjectAsync(output, false); - } + public void WriteProgress(string activity, string statusDescription, string currentOperation, int percentComplete) + => _Cmdlet.WriteProgress( + new ProgressRecord( + 0, + activity, + statusDescription) + { + CurrentOperation = currentOperation, + PercentComplete = percentComplete, + }); - public void WriteObjectAsync(object output, bool enumerateCollection) - { - _output.Enqueue(new CmdletOutput { Output = output, Enumerate = enumerateCollection }); - //_hasMessages = 1; + public void WriteVerbose(string message) + => _Cmdlet.WriteVerbose(message); + public void WriteWarning(string message) + => _Cmdlet.WriteWarning(message); } - - protected ICommandRuntime CommandRuntime { get; set; } } } diff --git a/src/ResourceManager/Websites/Commands.Websites/Strategies/ResourceGroupStrategy.cs b/src/ResourceManager/Websites/Commands.Websites/Strategies/ResourceGroupStrategy.cs index 3aba2817753f..abe1afe525ba 100644 --- a/src/ResourceManager/Websites/Commands.Websites/Strategies/ResourceGroupStrategy.cs +++ b/src/ResourceManager/Websites/Commands.Websites/Strategies/ResourceGroupStrategy.cs @@ -13,7 +13,6 @@ using Microsoft.Azure.Management.Internal.Resources.Models; using Microsoft.Azure.Management.Internal.Resources; -using System.Linq; namespace Microsoft.Azure.Commands.Common.Strategies.Resources { diff --git a/src/ResourceManager/Websites/Commands.Websites/Strategies/SiteStrategy.cs b/src/ResourceManager/Websites/Commands.Websites/Strategies/SiteStrategy.cs index 99b619d252bf..bf8ad29d5f3f 100644 --- a/src/ResourceManager/Websites/Commands.Websites/Strategies/SiteStrategy.cs +++ b/src/ResourceManager/Websites/Commands.Websites/Strategies/SiteStrategy.cs @@ -11,7 +11,6 @@ // limitations under the License. // ---------------------------------------------------------------------------------- -using System.Collections.Generic; using Microsoft.Azure.Management.WebSites; using Microsoft.Azure.Management.WebSites.Models; using Microsoft.Azure.Management.Internal.Resources.Models; diff --git a/src/ResourceManager/Websites/Commands.Websites/Strategies/WebClient.cs b/src/ResourceManager/Websites/Commands.Websites/Strategies/WebClient.cs index e109874b4368..785df3d62a65 100644 --- a/src/ResourceManager/Websites/Commands.Websites/Strategies/WebClient.cs +++ b/src/ResourceManager/Websites/Commands.Websites/Strategies/WebClient.cs @@ -20,12 +20,15 @@ namespace Microsoft.Azure.Commands.WebApps.Strategies { public class WebClient : IClient { + public string SubscriptionId => Context.Subscription.Id; + public WebClient(IAzureContext context) { Context = context; } - public IAzureContext Context { get; private set; } + public IAzureContext Context { get; } + public T GetClient() where T : ServiceClient { return AzureSession.Instance.ClientFactory.CreateArmClient(Context, AzureEnvironment.Endpoint.ResourceManager); diff --git a/src/ResourceManager/Websites/WebSites.sln b/src/ResourceManager/Websites/WebSites.sln index 5e16af5ddb3a..24f203f67ddf 100644 --- a/src/ResourceManager/Websites/WebSites.sln +++ b/src/ResourceManager/Websites/WebSites.sln @@ -44,6 +44,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Resources.Rest", " EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common.Compute", "..\..\Common\Commands.Common.Compute\Commands.Common.Compute.csproj", "{F6D508D1-BE2D-475D-AA0F-DFB5C615CC9D}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{54BA5DC4-3B2D-4904-9FB3-5193E64EFEE8}" + ProjectSection(SolutionItems) = preProject + ChangeLog.md = ChangeLog.md + EndProjectSection +EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common.WebSites", "..\..\Common\Commands.Common.Websites\Commands.Common.WebSites.csproj", "{592B3E1B-49E3-4F3C-BF6B-E5D4133B1443}" EndProject Global