Skip to content

Commit

Permalink
make communiation and support ticket properties required in readme, e…
Browse files Browse the repository at this point in the history
…dit get operation file name, edit calling internal cmdlets for file upload
  • Loading branch information
grhuangmsft committed Mar 5, 2024
1 parent de3fcf5 commit 194a139
Show file tree
Hide file tree
Showing 11 changed files with 105 additions and 169 deletions.
2 changes: 1 addition & 1 deletion src/Support/Support.Autorest/Az.Support.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
DotNetFrameworkVersion = '4.7.2'
RequiredAssemblies = './bin/Az.Support.private.dll'
FormatsToProcess = './Az.Support.format.ps1xml'
FunctionsToExport = 'Get-AzSupportChatTranscript', 'Get-AzSupportChatTranscriptsNoSubscription', 'Get-AzSupportCommunication', 'Get-AzSupportCommunicationsNoSubscription', 'Get-AzSupportFile', 'Get-AzSupportFilesNoSubscription', 'Get-AzSupportFileWorkspace', 'Get-AzSupportFileWorkspacesNoSubscription', 'Get-AzSupportOperation', 'Get-AzSupportProblemClassification', 'Get-AzSupportService', 'Get-AzSupportTicket', 'Get-AzSupportTicketChatTranscriptsNoSubscription', 'Get-AzSupportTicketCommunicationsNoSubscription', 'Get-AzSupportTicketsNoSubscription', 'New-AzSupportCommunication', 'New-AzSupportCommunicationsNoSubscription', 'New-AzSupportFileAndUpload', 'New-AzSupportFileAndUploadNoSubscription', 'New-AzSupportFileWorkspace', 'New-AzSupportFileWorkspacesNoSubscription', 'New-AzSupportTicket', 'New-AzSupportTicketsNoSubscription', 'Test-AzSupportCommunicationNameAvailability', 'Test-AzSupportCommunicationsNoSubscriptionNameAvailability', 'Test-AzSupportTicketNameAvailability', 'Test-AzSupportTicketsNoSubscriptionNameAvailability', 'Update-AzSupportCommunication', 'Update-AzSupportCommunicationsNoSubscription', 'Update-AzSupportTicket', 'Update-AzSupportTicketsNoSubscription'
FunctionsToExport = 'Get-AzSupportChatTranscript', 'Get-AzSupportChatTranscriptsNoSubscription', 'Get-AzSupportCommunication', 'Get-AzSupportCommunicationsNoSubscription', 'Get-AzSupportFile', 'Get-AzSupportFilesNoSubscription', 'Get-AzSupportFileWorkspace', 'Get-AzSupportFileWorkspacesNoSubscription', 'Get-AzSupportOperation', 'Get-AzSupportProblemClassification', 'Get-AzSupportService', 'Get-AzSupportTicket', 'Get-AzSupportTicketChatTranscriptsNoSubscription', 'Get-AzSupportTicketCommunicationsNoSubscription', 'Get-AzSupportTicketsNoSubscription', 'New-AzSupportCommunication', 'New-AzSupportCommunicationsNoSubscription', 'New-AzSupportFileAndUpload', 'New-AzSupportFileAndUploadNoSubscription', 'New-AzSupportFileWorkspace', 'New-AzSupportFileWorkspacesNoSubscription', 'New-AzSupportTicket', 'New-AzSupportTicketsNoSubscription', 'Test-AzSupportCommunicationNameAvailability', 'Test-AzSupportCommunicationsNoSubscriptionNameAvailability', 'Test-AzSupportTicketNameAvailability', 'Test-AzSupportTicketsNoSubscriptionNameAvailability', 'Update-AzSupportTicket', 'Update-AzSupportTicketsNoSubscription'
PrivateData = @{
PSData = @{
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Support'
Expand Down
7 changes: 7 additions & 0 deletions src/Support/Support.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,13 @@ directive:
verb: Update
subject: CommunicationsNoSubscription
remove: true
- from: swagger-document
where: $.definitions.CommunicationDetails
transform: $.required = ['properties']
- from: swagger-document
where: $.definitions.SupportTicketDetails
transform: $.required = ['properties']

# Following are common directives which are normally required in all the RPs
# 1. Remove the unexpanded parameter set
# 2. For New-* cmdlets, ViaIdentity is not required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ Lists all the available Microsoft Support REST API operations.
.Outputs
Microsoft.Azure.PowerShell.Cmdlets.Support.Models.IOperation
.Link
https://learn.microsoft.com/powershell/module/az.support/new-azsupportfile
https://learn.microsoft.com/powershell/module/az.support/get-azsupportoperation
#>
function Get-AzSupportOperation_List {
function Get-AzSupportOperation {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Support.Models.IOperation])]
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
param(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,15 @@ process {
}

$PSBoundParameters.Remove('FilePath') | Out-Null
New-AzSupportFile -ErrorAction Stop -Name $FileName -FileSize $FileSize -ChunkSize $ChunkSize -NumberOfChunk $NumberOfChunks @PSBoundParameters
Az.Support.internal\New-AzSupportFile -ErrorAction Stop -Name $FileName -FileSize $FileSize -ChunkSize $ChunkSize -NumberOfChunk $NumberOfChunks @PSBoundParameters

$chunkIndex = 0
$startIndex = 0
$endIndex = $ChunkSize - 1

while($chunkIndex -lt $NumberOfChunks){
$FileContent = [convert]::ToBase64String($FileContentByteArray[$startIndex..$endIndex])
Invoke-AzSupportUploadFile -ErrorAction Stop -FileName $FileName -ChunkIndex $chunkIndex -Content $FileContent @PSBoundParameters
Az.Support.internal\Invoke-AzSupportUploadFile -ErrorAction Stop -FileName $FileName -ChunkIndex $chunkIndex -Content $FileContent @PSBoundParameters
$chunkIndex++
$startIndex = $endIndex + 1
$endIndex = $FileSize - 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,15 @@ process {
}

$PSBoundParameters.Remove('FilePath') | Out-Null
New-AzSupportFilesNoSubscription -ErrorAction Stop -Name $FileName -FileSize $FileSize -ChunkSize $ChunkSize -NumberOfChunk $NumberOfChunks @PSBoundParameters
Az.Support.internal\New-AzSupportFilesNoSubscription -ErrorAction Stop -Name $FileName -FileSize $FileSize -ChunkSize $ChunkSize -NumberOfChunk $NumberOfChunks @PSBoundParameters

$chunkIndex = 0
$startIndex = 0
$endIndex = $ChunkSize - 1

while($chunkIndex -lt $NumberOfChunks){
$FileContent = [convert]::ToBase64String($FileContentByteArray[$startIndex..$endIndex])
Invoke-AzSupportUploadFilesNoSubscription -ErrorAction Stop -FileName $FileName -ChunkIndex $chunkIndex -Content $FileContent @PSBoundParameters
Az.Support.internal\Invoke-AzSupportUploadFilesNoSubscription -ErrorAction Stop -FileName $FileName -ChunkIndex $chunkIndex -Content $FileContent @PSBoundParameters
$chunkIndex++
$startIndex = $endIndex + 1
$endIndex = $FileSize - 1
Expand Down
6 changes: 0 additions & 6 deletions src/Support/Support.Autorest/docs/Az.Support.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,6 @@ This API should be used to check the uniqueness of the name for support ticket c
Check the availability of a resource name.
This API should be used to check the uniqueness of the name for support ticket creation for the selected subscription.

### [Update-AzSupportCommunication](Update-AzSupportCommunication.md)
Adds a new customer communication to an Azure support ticket.

### [Update-AzSupportCommunicationsNoSubscription](Update-AzSupportCommunicationsNoSubscription.md)
Adds a new customer communication to an Azure support ticket.

### [Update-AzSupportTicket](Update-AzSupportTicket.md)
This API allows you to update the severity level, ticket status, advanced diagnostic consent and your contact information in the support ticket.\<br/\>\<br/\>Note: The severity levels cannot be changed if a support ticket is actively being worked upon by an Azure support engineer.
In such a case, contact your support engineer to request severity update by adding a new communication using the Communications API.
Expand Down
6 changes: 3 additions & 3 deletions src/Support/Support.Autorest/docs/Get-AzSupportOperation.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Get-AzSupportOperation [-DefaultProfile <PSObject>] [<CommonParameters>]
```

## DESCRIPTION

Lists all the available Microsoft Support REST API operations.

## EXAMPLES

Expand Down Expand Up @@ -46,7 +46,8 @@ Lists all the available Microsoft Support REST API operations.
## PARAMETERS

### -DefaultProfile

The DefaultProfile parameter is not functional.
Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.

```yaml
Type: System.Management.Automation.PSObject
Expand All @@ -63,7 +64,6 @@ Accept wildcard characters: False
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
Expand Down
10 changes: 5 additions & 5 deletions src/Support/Support.Autorest/docs/New-AzSupportCommunication.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ Adds a new customer communication to an Azure support ticket.
## SYNTAX

```
New-AzSupportCommunication -Name <String> -SupportTicketName <String> [-SubscriptionId <String>]
[-Body <String>] [-Sender <String>] [-Subject <String>] [-DefaultProfile <PSObject>] [-AsJob] [-NoWait]
[-Confirm] [-WhatIf] [<CommonParameters>]
New-AzSupportCommunication -Name <String> -SupportTicketName <String> -Body <String> -Subject <String>
[-SubscriptionId <String>] [-Sender <String>] [-DefaultProfile <PSObject>] [-AsJob] [-NoWait] [-Confirm]
[-WhatIf] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -69,7 +69,7 @@ Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Expand Down Expand Up @@ -146,7 +146,7 @@ Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Adds a new customer communication to an Azure support ticket.

```
New-AzSupportCommunicationsNoSubscription -CommunicationName <String> -SupportTicketName <String>
[-Body <String>] [-Sender <String>] [-Subject <String>] [-DefaultProfile <PSObject>] [-AsJob] [-NoWait]
-Body <String> -Subject <String> [-Sender <String>] [-DefaultProfile <PSObject>] [-AsJob] [-NoWait]
[-Confirm] [-WhatIf] [<CommonParameters>]
```

Expand Down Expand Up @@ -70,7 +70,7 @@ Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Expand Down Expand Up @@ -147,7 +147,7 @@ Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Expand Down
113 changes: 40 additions & 73 deletions src/Support/Support.Autorest/docs/New-AzSupportTicket.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ The auxiliary token will be from the Cloud solution provider (CSP) partner tenan
## SYNTAX

```
New-AzSupportTicket -Name <String> [-SubscriptionId <String>] [-AdvancedDiagnosticConsent <String>]
[-ContactDetailAdditionalEmailAddress <String[]>] [-ContactDetailCountry <String>]
[-ContactDetailFirstName <String>] [-ContactDetailLastName <String>] [-ContactDetailPhoneNumber <String>]
[-ContactDetailPreferredContactMethod <String>] [-ContactDetailPreferredSupportLanguage <String>]
[-ContactDetailPreferredTimeZone <String>] [-ContactDetailPrimaryEmailAddress <String>]
[-Description <String>] [-FileWorkspaceName <String>] [-ProblemClassificationId <String>]
[-ProblemScopingQuestion <String>] [-ProblemStartTime <DateTime>]
[-QuotaTicketDetailQuotaChangeRequest <IQuotaChangeRequest[]>]
New-AzSupportTicket -Name <String> -ContactDetailCountry <String> -ContactDetailFirstName <String>
-ContactDetailLastName <String> -ContactDetailPreferredContactMethod <String>
-ContactDetailPreferredSupportLanguage <String> -ContactDetailPreferredTimeZone <String>
-ContactDetailPrimaryEmailAddress <String> -Description <String> -ProblemClassificationId <String>
-ServiceId <String> -Severity <String> -Title <String> [-SubscriptionId <String>]
[-AdvancedDiagnosticConsent <String>] [-ContactDetailAdditionalEmailAddress <String[]>]
[-ContactDetailPhoneNumber <String>] [-FileWorkspaceName <String>] [-ProblemScopingQuestion <String>]
[-ProblemStartTime <DateTime>] [-QuotaTicketDetailQuotaChangeRequest <IQuotaChangeRequest[]>]
[-QuotaTicketDetailQuotaChangeRequestSubType <String>] [-QuotaTicketDetailQuotaChangeRequestVersion <String>]
[-Require24X7Response] [-SecondaryConsent <ISecondaryConsent[]>] [-ServiceId <String>] [-Severity <String>]
[-SupportPlanId <String>] [-SupportTicketId <String>] [-TechnicalTicketDetailResourceId <String>]
[-Title <String>] [-DefaultProfile <PSObject>] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [<CommonParameters>]
[-Require24X7Response] [-SecondaryConsent <ISecondaryConsent[]>] [-SupportPlanId <String>]
[-SupportTicketId <String>] [-TechnicalTicketDetailResourceId <String>] [-DefaultProfile <PSObject>] [-AsJob]
[-NoWait] [-Confirm] [-WhatIf] [<CommonParameters>]
```

## DESCRIPTION
Expand All @@ -44,60 +44,27 @@ The auxiliary token will be from the Cloud solution provider (CSP) partner tenan

## EXAMPLES

### Example 1: Creates support ticket at subscription level
### Example 1: {{ Add title here }}
```powershell
New-AzSupportTicket -Name "test12345678" -AdvancedDiagnosticConsent "no" -ContactDetailPrimaryEmailAddress "[email protected]" -ContactDetailFirstName "test" -ContactDetailLastName "test" -ContactDetailPreferredContactMethod "email" -ContactDetailPreferredTimeZone "Pacific Standard Time" -ContactDetailPreferredSupportLanguage "en-US" -ContactDetailCountry "usa" -Description "test ticket - please ignore and close" -Severity "minimal" -Title "test ticket - please ignore and close" -ServiceId "/providers/Microsoft.Support/services/517f2da6-78fd-0498-4e22-ad26996b1dfc" -ProblemClassificationId "/providers/Microsoft.Support/services/517f2da6-78fd-0498-4e22-ad26996b1dfc/problemClassifications/3ec1a070-f242-9ecf-5a7c-e1a88ce029ef"
{{ Add code here }}
```

```output
AdvancedDiagnosticConsent : No
ContactDetailAdditionalEmailAddress :
ContactDetailCountry : USA
ContactDetailFirstName : test
ContactDetailLastName : test
ContactDetailPhoneNumber :
ContactDetailPreferredContactMethod : Email
ContactDetailPreferredSupportLanguage : en-US
ContactDetailPreferredTimeZone : Pacific Standard Time
ContactDetailPrimaryEmailAddress : [email protected]
CreatedDate : 2/22/2024 6:48:38 AM
Description : test ticket - please ignore and close
EnrollmentId :
FileWorkspaceName : 2402220010002574
Id : /subscriptions/76cb77fa-8b17-4eab-9493-b65dace99813/providers/Microsoft.Su
pport/supportTickets/test12345678
ModifiedDate : 2/22/2024 6:48:50 AM
Name : test12345678
ProblemClassificationDisplayName : Add or update VAT, tax id, PO number or profile information
ProblemClassificationId : /providers/Microsoft.Support/services/517f2da6-78fd-0498-4e22-ad26996b1dfc
/problemClassifications/3ec1a070-f242-9ecf-5a7c-e1a88ce029ef
ProblemScopingQuestion :
ProblemStartTime :
QuotaTicketDetailQuotaChangeRequest :
QuotaTicketDetailQuotaChangeRequestSubType :
QuotaTicketDetailQuotaChangeRequestVersion :
Require24X7Response : False
ResourceGroupName :
SecondaryConsent :
ServiceDisplayName : Billing
ServiceId : /providers/Microsoft.Support/services/517f2da6-78fd-0498-4e22-ad26996b1dfc
ServiceLevelAgreementExpirationTime : 2/22/2024 10:00:00 PM
ServiceLevelAgreementSlaMinute : 480
ServiceLevelAgreementStartTime : 2/22/2024 6:48:38 AM
Severity : Minimal
Status : Open
SupportEngineerEmailAddress :
SupportPlanDisplayName : Azure Support Plan - Internal
SupportPlanId : U291cmNlOkVBLFN1YnNjcmlwdGlvbklkOjc2Q0I3N0ZBLThCMTctNEVBQi05NDkzLUI2NURBQ0
U5OTgxMyxPZmZlcklkOk1TLUFaUi0wMDE1UCxTb3ZlcmVpZ25DbG91ZDpQdWJsaWMs
SupportPlanType : Azure Internal
SupportTicketId : 2402220010002574
TechnicalTicketDetailResourceId :
Title : test ticket - please ignore and close
Type : Microsoft.Support/supportTickets
```

Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription
{{ Add output here (remove the output block if the example doesn't have an output) }}
```

{{ Add description here }}

### Example 2: {{ Add title here }}
```powershell
{{ Add code here }}
```

```output
{{ Add output here (remove the output block if the example doesn't have an output) }}
```

{{ Add description here }}

## PARAMETERS

Expand Down Expand Up @@ -155,7 +122,7 @@ Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Expand All @@ -170,7 +137,7 @@ Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Expand All @@ -185,7 +152,7 @@ Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Expand Down Expand Up @@ -216,7 +183,7 @@ Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Expand All @@ -235,7 +202,7 @@ Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Expand All @@ -251,7 +218,7 @@ Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Expand All @@ -266,7 +233,7 @@ Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Expand Down Expand Up @@ -297,7 +264,7 @@ Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Expand Down Expand Up @@ -358,7 +325,7 @@ Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Expand Down Expand Up @@ -480,7 +447,7 @@ Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Expand All @@ -496,7 +463,7 @@ Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Expand Down Expand Up @@ -571,7 +538,7 @@ Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Expand Down
Loading

0 comments on commit 194a139

Please sign in to comment.