Skip to content

Change Get-​Azure​Rm​Web​App​Publishing​Profile -OutputFile mandatory to option. #4827

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 8 commits into from
Nov 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,13 @@ function Test-WebAppSlotPublishingProfile

# Assert
Assert-True { $fileZillaProfile.Name -eq $appWithSlotName3 }

# Get web app publishing profile without OutputFile
[xml]$profile = Get-AzureRmWebAppSlotPublishingProfile -ResourceGroupName $rgname -Name $appname -Slot $slotname

# Assert
Assert-NotNull $profile

}
finally
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,13 @@ function Test-WebAppPublishingProfile

# Assert
Assert-True { $fileZillaProfile.Name -eq $appName }

# Get web app publishing profile without OutputFile
[xml]$profile = Get-AzureRmWebAppPublishingProfile -ResourceGroupName $rgname -Name $appName

# Assert
Assert-NotNull $profile

}
finally
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1407,6 +1407,78 @@
},
"StatusCode": 200
},
{
"RequestUri": "/subscriptions/4adb32ad-8327-4cbb-b775-b84b4465bb38/resourceGroups/onesdk6956/providers/Microsoft.Web/sites/onesdk6609/slots/staging/publishxml?api-version=2015-08-01",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNGFkYjMyYWQtODMyNy00Y2JiLWI3NzUtYjg0YjQ0NjViYjM4L3Jlc291cmNlR3JvdXBzL29uZXNkazY5NTYvcHJvdmlkZXJzL01pY3Jvc29mdC5XZWIvc2l0ZXMvb25lc2RrNjYwOS9zbG90cy9zdGFnaW5nL3B1Ymxpc2h4bWw/YXBpLXZlcnNpb249MjAxNS0wOC0wMQ==",
"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": [
"6bbd4fc4-567f-49e2-b58d-7541a99a4576"
],
"accept-language": [
"en-US"
],
"User-Agent": [
"Microsoft.Azure.Management.WebSites.WebSiteManagementClient/0.9.0.0"
],
"Accept": [
"application/json"
]
},
"ResponseBody": "<publishData>\r\n <publishProfile profileName=\"onesdk6609-staging - Web Deploy\" publishMethod=\"MSDeploy\" publishUrl=\"onesdk6609-staging.scm.azurewebsites.net:443\" msdeploySite=\"onesdk6609__staging\" userName=\"$onesdk6609__staging\" userPWD=\"pQMzRbaWQJhshregGenljb9Gy16gYSFRBw0HG7jtKQMwA7M7zyW7e44nMfSD\" destinationAppUrl=\"http://onesdk6609-staging.azurewebsites.net\" SQLServerDBConnectionString=\"\" mySQLDBConnectionString=\"\" hostingProviderForumLink=\"\" controlPanelLink=\"\" webSystem=\"WebSites\">\r\n <databases />\r\n </publishProfile>\r\n <publishProfile profileName=\"onesdk6609-staging - FTP\" publishMethod=\"FTP\" publishUrl=\"ftp://waws-prod-cq1-001.ftp.azurewebsites.windows.net/site/wwwroot\" ftpPassiveMode=\"True\" userName=\"onesdk6609__staging\\$onesdk6609__staging\" userPWD=\"pQMzRbaWQJhshregGenljb9Gy16gYSFRBw0HG7jtKQMwA7M7zyW7e44nMfSD\" destinationAppUrl=\"http://onesdk6609-staging.azurewebsites.net\" SQLServerDBConnectionString=\"\" mySQLDBConnectionString=\"\" hostingProviderForumLink=\"\" controlPanelLink=\"\" webSystem=\"WebSites\">\r\n <databases />\r\n </publishProfile>\r\n</publishData>",
"ResponseHeaders": {
"Content-Length": [
"1052"
],
"Content-Type": [
"application/xml"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"x-ms-ratelimit-remaining-subscription-writes": [
"1172"
],
"x-ms-request-id": [
"afdfe6d6-479b-4d3b-b789-b15beba9456a"
],
"x-ms-correlation-request-id": [
"afdfe6d6-479b-4d3b-b789-b15beba9456a"
],
"x-ms-routing-request-id": [
"WESTUS:20151026T231512Z:afdfe6d6-479b-4d3b-b789-b15beba9456a"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Mon, 26 Oct 2015 23:15:12 GMT"
],
"Server": [
"Microsoft-IIS/8.0"
],
"X-AspNet-Version": [
"4.0.30319"
],
"X-Powered-By": [
"ASP.NET"
]
},
"StatusCode": 200
},
{
"RequestUri": "/subscriptions/4adb32ad-8327-4cbb-b775-b84b4465bb38/resourceGroups/onesdk6956/providers/Microsoft.Web/sites/onesdk6609/slots/staging/newpassword?api-version=2015-08-01",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNGFkYjMyYWQtODMyNy00Y2JiLWI3NzUtYjg0YjQ0NjViYjM4L3Jlc291cmNlR3JvdXBzL29uZXNkazY5NTYvcHJvdmlkZXJzL01pY3Jvc29mdC5XZWIvc2l0ZXMvb25lc2RrNjYwOS9zbG90cy9zdGFnaW5nL25ld3Bhc3N3b3JkP2FwaS12ZXJzaW9uPTIwMTUtMDgtMDE=",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,79 @@
},
"StatusCode": 200
},
{
"RequestUri": "/subscriptions/4adb32ad-8327-4cbb-b775-b84b4465bb38/resourceGroups/onesdk8077/providers/Microsoft.Web/sites/onesdk6930/publishxml?api-version=2015-08-01",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNGFkYjMyYWQtODMyNy00Y2JiLWI3NzUtYjg0YjQ0NjViYjM4L3Jlc291cmNlR3JvdXBzL29uZXNkazgwNzcvcHJvdmlkZXJzL01pY3Jvc29mdC5XZWIvc2l0ZXMvb25lc2RrNjkzMC9wdWJsaXNoeG1sP2FwaS12ZXJzaW9uPTIwMTUtMDgtMDE=",
"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": [
"e353aec7-bb13-4bc8-8465-928483f547cb"
],
"accept-language": [
"en-US"
],
"User-Agent": [
"Microsoft.Azure.Management.WebSites.WebSiteManagementClient/0.9.0.0"
],
"Accept": [
"application/json"
]
},
"ResponseBody": "<publishData>\r\n <publishProfile profileName=\"onesdk6930 - Web Deploy\" publishMethod=\"MSDeploy\" publishUrl=\"onesdk6930.scm.azurewebsites.net:443\" msdeploySite=\"onesdk6930\" userName=\"$onesdk6930\" userPWD=\"tYrdZt5XqK5y8imerjX26WZmkRdDftbvThl34vX1JA4HgjjtbXw5YhJxcq3F\" destinationAppUrl=\"http://onesdk6930.azurewebsites.net\" SQLServerDBConnectionString=\"\" mySQLDBConnectionString=\"\" hostingProviderForumLink=\"\" controlPanelLink=\"\" webSystem=\"WebSites\">\r\n <databases />\r\n </publishProfile>\r\n <publishProfile profileName=\"onesdk6930 - FTP\" publishMethod=\"FTP\" publishUrl=\"ftp://waws-prod-cq1-001.ftp.azurewebsites.windows.net/site/wwwroot\" ftpPassiveMode=\"True\" userName=\"onesdk6930\\$onesdk6930\" userPWD=\"tYrdZt5XqK5y8imerjX26WZmkRdDftbvThl34vX1JA4HgjjtbXw5YhJxcq3F\" destinationAppUrl=\"http://onesdk6930.azurewebsites.net\" SQLServerDBConnectionString=\"\" mySQLDBConnectionString=\"\" hostingProviderForumLink=\"\" controlPanelLink=\"\" webSystem=\"WebSites\">\r\n <databases />\r\n </publishProfile>\r\n</publishData>",
"ResponseHeaders": {
"Content-Length": [
"976"
],
"Content-Type": [
"application/xml"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"x-ms-ratelimit-remaining-subscription-resource-requests": [
"11998"
],
"x-ms-request-id": [
"d9128a68-dcf4-4319-9564-9e3b509efaed"
],
"x-ms-correlation-request-id": [
"d9128a68-dcf4-4319-9564-9e3b509efaed"
],
"x-ms-routing-request-id": [
"WESTUS:20151026T225346Z:d9128a68-dcf4-4319-9564-9e3b509efaed"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Mon, 26 Oct 2015 22:53:46 GMT"
],
"Server": [
"Microsoft-IIS/8.0"
],
"X-AspNet-Version": [
"4.0.30319"
],
"X-Powered-By": [
"ASP.NET"
]
},
"StatusCode": 200
},

{
"RequestUri": "/subscriptions/4adb32ad-8327-4cbb-b775-b84b4465bb38/resourceGroups/onesdk8077/providers/Microsoft.Web/sites/onesdk6930/newpassword?api-version=2015-08-01",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNGFkYjMyYWQtODMyNy00Y2JiLWI3NzUtYjg0YjQ0NjViYjM4L3Jlc291cmNlR3JvdXBzL29uZXNkazgwNzcvcHJvdmlkZXJzL01pY3Jvc29mdC5XZWIvc2l0ZXMvb25lc2RrNjkzMC9uZXdwYXNzd29yZD9hcGktdmVyc2lvbj0yMDE1LTA4LTAx",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class GetAzureWebAppSlotPublishingProfileCmdlet : WebAppSlotBaseCmdlet
{
private const string DefaultFormat = "WebDeploy";

[Parameter(Position = 3, Mandatory = true, HelpMessage = "The file the publishing profile will we saved as")]
[Parameter(Position = 3, Mandatory = false, HelpMessage = "The file the publishing profile will we saved as")]
public string OutputFile { get; set; }

[Parameter(Position = 4, Mandatory = false, HelpMessage = "The format of the profile. Allowed values are [WebDeploy|FileZilla3|Ftp]. Default value is WebDeploy")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class GetAzureWebAppPublishingProfileCmdlet : WebAppBaseCmdlet
{
private const string DefaultFormat = "WebDeploy";

[Parameter(Position = 2, Mandatory = true, HelpMessage = "The file the publishing profile will we saved as")]
[Parameter(Position = 2, Mandatory = false, HelpMessage = "The file the publishing profile will we saved as")]
public string OutputFile { get; set; }

[Parameter(Position = 3, Mandatory = false, HelpMessage = "The format of the profile. Allowed values are [WebDeploy|FileZilla3|Ftp]. Default value is WebDeploy")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,10 @@ public string GetWebAppPublishingProfile(string resourceGroupName, string webSit
WrappedWebsitesClient.WebApps().ListSitePublishingProfileXmlSlot(resourceGroupName, webSiteName, options, slotName) :
WrappedWebsitesClient.WebApps().ListSitePublishingProfileXml(resourceGroupName, webSiteName, options));
var doc = XDocument.Load(publishingXml, LoadOptions.None);
doc.Save(outputFile, SaveOptions.OmitDuplicateNamespaces);
if (outputFile != null)
{
doc.Save(outputFile, SaveOptions.OmitDuplicateNamespaces);
}
return doc.ToString();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
external help file: Microsoft.Azure.Commands.Websites.dll-Help.xml
Module Name: AzureRM.Websites
ms.assetid: 38433470-CAFD-4B8F-980C-63D4B264B39F
online version:
schema: 2.0.0
Expand All @@ -14,14 +15,14 @@ Gets an Azure Web App publishing profile.

### S1
```
Get-AzureRmWebAppPublishingProfile [-OutputFile] <String> [[-Format] <String>] [-ResourceGroupName] <String>
[-Name] <String> [<CommonParameters>]
Get-AzureRmWebAppPublishingProfile [[-OutputFile] <String>] [[-Format] <String>] [-ResourceGroupName] <String>
[-Name] <String> [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
```

### S2
```
Get-AzureRmWebAppPublishingProfile [-OutputFile] <String> [[-Format] <String>] [-WebApp] <Site>
[<CommonParameters>]
Get-AzureRmWebAppPublishingProfile [[-OutputFile] <String>] [[-Format] <String>] [-WebApp] <Site>
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
```

## DESCRIPTION
Expand All @@ -39,6 +40,21 @@ This command gets the publishing profile in Ftp format for Web App ContosoWebApp

## PARAMETERS

### -DefaultProfile
The credentials, account, tenant, and subscription used for communication with azure.

```yaml
Type: IAzureContextContainer
Parameter Sets: (All)
Aliases: AzureRmContext, AzureCredential

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Format
Format

Expand Down Expand Up @@ -78,7 +94,7 @@ Type: String
Parameter Sets: (All)
Aliases:

Required: True
Required: False
Position: 2
Default value: None
Accept pipeline input: False
Expand Down Expand Up @@ -121,7 +137,6 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## INPUTS

### Site

Parameter 'WebApp' accepts value of type 'Site' from the pipeline

## OUTPUTS
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
external help file: Microsoft.Azure.Commands.Websites.dll-Help.xml
Module Name: AzureRM.Websites
ms.assetid: B2FDB54F-0318-4037-BC1D-6113E77DDE7E
online version:
schema: 2.0.0
Expand All @@ -14,14 +15,15 @@ Gets an Azure Web App slot publishing profile.

### S1
```
Get-AzureRmWebAppSlotPublishingProfile [-OutputFile] <String> [[-Format] <String>]
[-ResourceGroupName] <String> [-Name] <String> [-Slot] <String> [<CommonParameters>]
Get-AzureRmWebAppSlotPublishingProfile [[-OutputFile] <String>] [[-Format] <String>]
[-ResourceGroupName] <String> [-Name] <String> [-Slot] <String> [-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
```

### S2
```
Get-AzureRmWebAppSlotPublishingProfile [-OutputFile] <String> [[-Format] <String>] [-WebApp] <Site>
[<CommonParameters>]
Get-AzureRmWebAppSlotPublishingProfile [[-OutputFile] <String>] [[-Format] <String>] [-WebApp] <Site>
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
```

## DESCRIPTION
Expand All @@ -39,6 +41,21 @@ This command gets the publishing profile in Ftp format for slot Slot001 pertaini

## PARAMETERS

### -DefaultProfile
The credentials, account, tenant, and subscription used for communication with azure.

```yaml
Type: IAzureContextContainer
Parameter Sets: (All)
Aliases: AzureRmContext, AzureCredential

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Format
Format

Expand Down Expand Up @@ -78,7 +95,7 @@ Type: String
Parameter Sets: (All)
Aliases:

Required: True
Required: False
Position: 3
Default value: None
Accept pipeline input: False
Expand Down Expand Up @@ -136,7 +153,6 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## INPUTS

### Site

Parameter 'WebApp' accepts value of type 'Site' from the pipeline

## OUTPUTS
Expand Down