Elenchi tutti i ticket di supporto per una sottoscrizione di Azure. È anche possibile filtrare i ticket di supporto per Stato, CreateDate, ServiceId e ProblemClassificationId usando il parametro $filter. L'output sarà un risultato a pagina con nextLink, usando il quale è possibile recuperare il successivo set di ticket di supporto.
I dati del ticket di supporto sono disponibili per 18 mesi dopo la creazione del ticket. Se un ticket è stato creato più di 18 mesi fa, una richiesta di dati potrebbe causare un errore.
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets?api-version=2020-04-01
With optional parameters:
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets?$top={$top}&$filter={$filter}&api-version=2020-04-01
Parametri dell'URI
Nome |
In |
Necessario |
Tipo |
Descrizione |
subscriptionId
|
path |
True
|
string
|
ID sottoscrizione di Azure.
|
api-version
|
query |
True
|
string
|
Versione dell'API.
|
$filter
|
query |
|
string
|
Filtro da applicare all'operazione. La semantica del filtro 'odata v4.0' è supportata. Altre informazioni I filtri Status, ServiceId e ProblemClassificationId possono essere usati solo con l'operatore Equals ('eq'). Per il filtro CreateDate , gli operatori supportati sono maggiori di ('gt') e maggiore di o uguali ('ge'). Quando si usano entrambi i filtri, combinarli usando l'oggetto 'AND' logico.
|
$top
|
query |
|
integer
int32
|
Numero di valori da restituire nella raccolta. Il valore predefinito è 25 e max è 100.
|
Risposte
Nome |
Tipo |
Descrizione |
200 OK
|
SupportTicketsListResult
|
Recuperate correttamente i ticket di supporto.
|
Other Status Codes
|
ExceptionResponse
|
Risposta di errore che descrive perché l'operazione non è riuscita.
|
Sicurezza
azure_auth
Flusso OAuth2 di Azure Active Directory.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Nome |
Descrizione |
user_impersonation
|
rappresentare l'account utente
|
Esempio
List support tickets created on or after a certain date and in open state for a subscription
Sample Request
GET https://management.azure.com/subscriptions/subid/providers/Microsoft.Support/supportTickets?$filter=createdDate ge 2020-03-10T22:08:51Z and status eq 'Open'&api-version=2020-04-01
/** Samples for SupportTickets List. */
public final class Main {
/*
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsCreatedOnOrAfterAndInOpenStateBySubscription.json
*/
/**
* Sample code: List support tickets created on or after a certain date and in open state for a subscription.
*
* @param manager Entry point to SupportManager.
*/
public static void listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenStateForASubscription(
com.azure.resourcemanager.support.SupportManager manager) {
manager
.supportTickets()
.list(null, "createdDate ge 2020-03-10T22:08:51Z and status eq 'Open'", com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.support import MicrosoftSupport
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-support
# USAGE
python list_support_tickets_created_on_or_after_a_certain_date_and_in_open_state_for_a_subscription.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = MicrosoftSupport(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.support_tickets.list()
for item in response:
print(item)
# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsCreatedOnOrAfterAndInOpenStateBySubscription.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armsupport_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsCreatedOnOrAfterAndInOpenStateBySubscription.json
func ExampleTicketsClient_NewListPager_listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenStateForASubscription() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsupport.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewTicketsClient().NewListPager(&armsupport.TicketsClientListOptions{Top: nil,
Filter: to.Ptr("createdDate ge 2020-03-10T22:08:51Z and status eq 'Open'"),
})
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page.TicketsListResult = armsupport.TicketsListResult{
// Value: []*armsupport.TicketDetails{
// {
// Name: to.Ptr("testticket"),
// Type: to.Ptr("Microsoft.Support/supportTickets"),
// ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Support/supportTickets/testticket"),
// Properties: &armsupport.TicketDetailsProperties{
// Description: to.Ptr("my description"),
// ContactDetails: &armsupport.ContactProfile{
// Country: to.Ptr("usa"),
// FirstName: to.Ptr("abc"),
// LastName: to.Ptr("xyz"),
// PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail),
// PreferredSupportLanguage: to.Ptr("en-US"),
// PreferredTimeZone: to.Ptr("Pacific Standard Time"),
// PrimaryEmailAddress: to.Ptr("abc@contoso.com"),
// },
// CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-11T21:36:18.000Z"); return t}()),
// ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-12T21:36:23.000Z"); return t}()),
// ProblemClassificationDisplayName: to.Ptr("Connectivity / Cannot connect to virtual machine by using RDP or SSH"),
// ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/virtual_machine_service_guid/problemClassifications/problemClassification_guid"),
// Require24X7Response: to.Ptr(false),
// ServiceDisplayName: to.Ptr("Virtual Machine running Linux"),
// ServiceID: to.Ptr("/providers/Microsoft.Support/services/virtual_machine_service_guid"),
// ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{
// ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-12T17:36:18.000Z"); return t}()),
// SLAMinutes: to.Ptr[int32](240),
// StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-11T21:36:18.000Z"); return t}()),
// },
// Severity: to.Ptr(armsupport.SeverityLevelModerate),
// Status: to.Ptr("Open"),
// SupportEngineer: &armsupport.Engineer{
// EmailAddress: to.Ptr("xyz@contoso.com"),
// },
// SupportPlanType: to.Ptr("Premier"),
// SupportTicketID: to.Ptr("119120321001170"),
// TechnicalTicketDetails: &armsupport.TechnicalTicketDetails{
// ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/test/providers/Microsoft.Compute/virtualMachines/testserver"),
// },
// Title: to.Ptr("my title"),
// },
// },
// {
// Name: to.Ptr("testticket2"),
// Type: to.Ptr("Microsoft.Support/supportTickets"),
// ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Support/supportTickets/testticket2"),
// Properties: &armsupport.TicketDetailsProperties{
// Description: to.Ptr("This is a test - please ignore"),
// ContactDetails: &armsupport.ContactProfile{
// Country: to.Ptr("USA"),
// FirstName: to.Ptr("abc"),
// LastName: to.Ptr("xyz"),
// PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail),
// PreferredSupportLanguage: to.Ptr("en-US"),
// PreferredTimeZone: to.Ptr("Pacific Standard Time"),
// PrimaryEmailAddress: to.Ptr("abc@contoso.com"),
// },
// CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-11T21:36:18.000Z"); return t}()),
// ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-12T21:36:18.000Z"); return t}()),
// ProblemClassificationDisplayName: to.Ptr("Add or Edit VAT, TAX ID, or PO Number"),
// ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/problemClassification_guid"),
// Require24X7Response: to.Ptr(false),
// ServiceDisplayName: to.Ptr("Subscription management"),
// ServiceID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid"),
// ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{
// ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-12T17:36:18.000Z"); return t}()),
// SLAMinutes: to.Ptr[int32](240),
// StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-11T21:36:18.000Z"); return t}()),
// },
// Severity: to.Ptr(armsupport.SeverityLevelMinimal),
// Status: to.Ptr("Open"),
// SupportEngineer: &armsupport.Engineer{
// EmailAddress: to.Ptr("xyz@contoso.com"),
// },
// SupportPlanType: to.Ptr("Premier"),
// SupportTicketID: to.Ptr("118032014183771"),
// Title: to.Ptr("Test - please ignore"),
// },
// }},
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { MicrosoftSupport } = require("@azure/arm-support");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with _nextLink_, using which you can retrieve the next set of support tickets. <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error.
*
* @summary Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with _nextLink_, using which you can retrieve the next set of support tickets. <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error.
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsCreatedOnOrAfterAndInOpenStateBySubscription.json
*/
async function listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenStateForASubscription() {
const subscriptionId = process.env["SUPPORT_SUBSCRIPTION_ID"] || "subid";
const filter = "createdDate ge 2020-03-10T22:08:51Z and status eq 'Open'";
const options = { filter };
const credential = new DefaultAzureCredential();
const client = new MicrosoftSupport(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.supportTickets.list(options)) {
resArray.push(item);
}
console.log(resArray);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Support;
using Azure.ResourceManager.Support.Models;
// Generated from example definition: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsCreatedOnOrAfterAndInOpenStateBySubscription.json
// this example is just showing the usage of "SupportTickets_List" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SubscriptionResource created on azure
// for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource
string subscriptionId = "subid";
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
// get the collection of this SupportTicketResource
SupportTicketCollection collection = subscriptionResource.GetSupportTickets();
// invoke the operation and iterate over the result
string filter = "createdDate ge 2020-03-10T22:08:51Z and status eq 'Open'";
await foreach (SupportTicketResource item in collection.GetAllAsync(filter: filter))
{
// the variable item is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SupportTicketData resourceData = item.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
Console.WriteLine($"Succeeded");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"value": [
{
"id": "/subscriptions/subid/providers/Microsoft.Support/supportTickets/testticket",
"name": "testticket",
"type": "Microsoft.Support/supportTickets",
"properties": {
"supportTicketId": "119120321001170",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/virtual_machine_service_guid/problemClassifications/problemClassification_guid",
"problemClassificationDisplayName": "Connectivity / Cannot connect to virtual machine by using RDP or SSH",
"severity": "moderate",
"require24X7Response": false,
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"primaryEmailAddress": "abc@contoso.com",
"preferredTimeZone": "Pacific Standard Time",
"country": "usa",
"preferredSupportLanguage": "en-US"
},
"technicalTicketDetails": {
"resourceId": "/subscriptions/subid/resourceGroups/test/providers/Microsoft.Compute/virtualMachines/testserver"
},
"serviceLevelAgreement": {
"startTime": "2020-03-11T21:36:18Z",
"expirationTime": "2020-03-12T17:36:18Z",
"slaMinutes": 240
},
"supportEngineer": {
"emailAddress": "xyz@contoso.com"
},
"supportPlanType": "Premier",
"title": "my title",
"serviceId": "/providers/Microsoft.Support/services/virtual_machine_service_guid",
"serviceDisplayName": "Virtual Machine running Linux",
"status": "Open",
"createdDate": "2020-03-11T21:36:18Z",
"modifiedDate": "2020-03-12T21:36:23Z"
}
},
{
"id": "/subscriptions/subid/providers/Microsoft.Support/supportTickets/testticket2",
"name": "testticket2",
"type": "Microsoft.Support/supportTickets",
"properties": {
"supportTicketId": "118032014183771",
"description": "This is a test - please ignore",
"problemClassificationId": "/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/problemClassification_guid",
"problemClassificationDisplayName": "Add or Edit VAT, TAX ID, or PO Number",
"severity": "minimal",
"require24X7Response": false,
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"primaryEmailAddress": "abc@contoso.com",
"preferredTimeZone": "Pacific Standard Time",
"country": "USA",
"preferredSupportLanguage": "en-US"
},
"serviceLevelAgreement": {
"startTime": "2020-03-11T21:36:18Z",
"expirationTime": "2020-03-12T17:36:18Z",
"slaMinutes": 240
},
"supportEngineer": {
"emailAddress": "xyz@contoso.com"
},
"supportPlanType": "Premier",
"title": "Test - please ignore",
"serviceId": "/providers/Microsoft.Support/services/subscription_management_service_guid",
"serviceDisplayName": "Subscription management",
"status": "Open",
"createdDate": "2020-03-11T21:36:18Z",
"modifiedDate": "2020-03-12T21:36:18Z"
}
}
]
}
List support tickets for a subscription
Sample Request
GET https://management.azure.com/subscriptions/subid/providers/Microsoft.Support/supportTickets?api-version=2020-04-01
/** Samples for SupportTickets List. */
public final class Main {
/*
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsBySubscription.json
*/
/**
* Sample code: List support tickets for a subscription.
*
* @param manager Entry point to SupportManager.
*/
public static void listSupportTicketsForASubscription(com.azure.resourcemanager.support.SupportManager manager) {
manager.supportTickets().list(null, null, com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.support import MicrosoftSupport
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-support
# USAGE
python list_support_tickets_for_a_subscription.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = MicrosoftSupport(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.support_tickets.list()
for item in response:
print(item)
# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsBySubscription.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armsupport_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsBySubscription.json
func ExampleTicketsClient_NewListPager_listSupportTicketsForASubscription() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsupport.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewTicketsClient().NewListPager(&armsupport.TicketsClientListOptions{Top: nil,
Filter: nil,
})
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page.TicketsListResult = armsupport.TicketsListResult{
// Value: []*armsupport.TicketDetails{
// {
// Name: to.Ptr("testticket"),
// Type: to.Ptr("Microsoft.Support/supportTickets"),
// ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Support/supportTickets/testticket"),
// Properties: &armsupport.TicketDetailsProperties{
// Description: to.Ptr("my description"),
// ContactDetails: &armsupport.ContactProfile{
// Country: to.Ptr("usa"),
// FirstName: to.Ptr("abc"),
// LastName: to.Ptr("xyz"),
// PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail),
// PreferredSupportLanguage: to.Ptr("en-US"),
// PreferredTimeZone: to.Ptr("Pacific Standard Time"),
// PrimaryEmailAddress: to.Ptr("abc@contoso.com"),
// },
// CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()),
// ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()),
// ProblemClassificationDisplayName: to.Ptr("Connectivity / Cannot connect to virtual machine by using RDP or SSH"),
// ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/virtual_machine_service_guid/problemClassifications/problemClassification_guid"),
// Require24X7Response: to.Ptr(false),
// ServiceDisplayName: to.Ptr("Virtual Machine running Linux"),
// ServiceID: to.Ptr("/providers/Microsoft.Support/services/virtual_machine_service_guid"),
// ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{
// ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()),
// SLAMinutes: to.Ptr[int32](240),
// StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()),
// },
// Severity: to.Ptr(armsupport.SeverityLevelModerate),
// Status: to.Ptr("Open"),
// SupportEngineer: &armsupport.Engineer{
// EmailAddress: to.Ptr("xyz@contoso.com"),
// },
// SupportPlanType: to.Ptr("Premier"),
// SupportTicketID: to.Ptr("119120321001170"),
// TechnicalTicketDetails: &armsupport.TechnicalTicketDetails{
// ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/test/providers/Microsoft.Compute/virtualMachines/testserver"),
// },
// Title: to.Ptr("my title"),
// },
// },
// {
// Name: to.Ptr("testticket2"),
// Type: to.Ptr("Microsoft.Support/supportTickets"),
// ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Support/supportTickets/testticket2"),
// Properties: &armsupport.TicketDetailsProperties{
// Description: to.Ptr("This is a test - please ignore"),
// ContactDetails: &armsupport.ContactProfile{
// Country: to.Ptr("USA"),
// FirstName: to.Ptr("abc"),
// LastName: to.Ptr("xyz"),
// PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail),
// PreferredSupportLanguage: to.Ptr("en-US"),
// PreferredTimeZone: to.Ptr("Pacific Standard Time"),
// PrimaryEmailAddress: to.Ptr("abc@contoso.com"),
// },
// CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()),
// ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()),
// ProblemClassificationDisplayName: to.Ptr("Add or Edit VAT, TAX ID, or PO Number"),
// ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/problemClassification_guid"),
// Require24X7Response: to.Ptr(false),
// ServiceDisplayName: to.Ptr("Subscription management"),
// ServiceID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid"),
// ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{
// ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()),
// SLAMinutes: to.Ptr[int32](240),
// StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()),
// },
// Severity: to.Ptr(armsupport.SeverityLevelMinimal),
// Status: to.Ptr("Open"),
// SupportEngineer: &armsupport.Engineer{
// EmailAddress: to.Ptr("xyz@contoso.com"),
// },
// SupportPlanType: to.Ptr("Premier"),
// SupportTicketID: to.Ptr("118032014183771"),
// Title: to.Ptr("Test - please ignore"),
// },
// }},
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { MicrosoftSupport } = require("@azure/arm-support");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with _nextLink_, using which you can retrieve the next set of support tickets. <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error.
*
* @summary Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with _nextLink_, using which you can retrieve the next set of support tickets. <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error.
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsBySubscription.json
*/
async function listSupportTicketsForASubscription() {
const subscriptionId = process.env["SUPPORT_SUBSCRIPTION_ID"] || "subid";
const credential = new DefaultAzureCredential();
const client = new MicrosoftSupport(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.supportTickets.list()) {
resArray.push(item);
}
console.log(resArray);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Support;
using Azure.ResourceManager.Support.Models;
// Generated from example definition: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsBySubscription.json
// this example is just showing the usage of "SupportTickets_List" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SubscriptionResource created on azure
// for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource
string subscriptionId = "subid";
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
// get the collection of this SupportTicketResource
SupportTicketCollection collection = subscriptionResource.GetSupportTickets();
// invoke the operation and iterate over the result
await foreach (SupportTicketResource item in collection.GetAllAsync())
{
// the variable item is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SupportTicketData resourceData = item.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
Console.WriteLine($"Succeeded");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"value": [
{
"id": "/subscriptions/subid/providers/Microsoft.Support/supportTickets/testticket",
"name": "testticket",
"type": "Microsoft.Support/supportTickets",
"properties": {
"supportTicketId": "119120321001170",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/virtual_machine_service_guid/problemClassifications/problemClassification_guid",
"problemClassificationDisplayName": "Connectivity / Cannot connect to virtual machine by using RDP or SSH",
"severity": "moderate",
"require24X7Response": false,
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"primaryEmailAddress": "abc@contoso.com",
"preferredTimeZone": "Pacific Standard Time",
"country": "usa",
"preferredSupportLanguage": "en-US"
},
"technicalTicketDetails": {
"resourceId": "/subscriptions/subid/resourceGroups/test/providers/Microsoft.Compute/virtualMachines/testserver"
},
"serviceLevelAgreement": {
"startTime": "2020-03-20T21:36:18Z",
"expirationTime": "2020-03-21T17:36:18Z",
"slaMinutes": 240
},
"supportEngineer": {
"emailAddress": "xyz@contoso.com"
},
"supportPlanType": "Premier",
"title": "my title",
"serviceId": "/providers/Microsoft.Support/services/virtual_machine_service_guid",
"serviceDisplayName": "Virtual Machine running Linux",
"status": "Open",
"createdDate": "2020-03-20T21:36:18Z",
"modifiedDate": "2020-03-20T21:36:23Z"
}
},
{
"id": "/subscriptions/subid/providers/Microsoft.Support/supportTickets/testticket2",
"name": "testticket2",
"type": "Microsoft.Support/supportTickets",
"properties": {
"supportTicketId": "118032014183771",
"description": "This is a test - please ignore",
"problemClassificationId": "/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/problemClassification_guid",
"problemClassificationDisplayName": "Add or Edit VAT, TAX ID, or PO Number",
"severity": "minimal",
"require24X7Response": false,
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"primaryEmailAddress": "abc@contoso.com",
"preferredTimeZone": "Pacific Standard Time",
"country": "USA",
"preferredSupportLanguage": "en-US"
},
"serviceLevelAgreement": {
"startTime": "2020-03-20T21:36:18Z",
"expirationTime": "2020-03-21T17:36:18Z",
"slaMinutes": 240
},
"supportEngineer": {
"emailAddress": "xyz@contoso.com"
},
"supportPlanType": "Premier",
"title": "Test - please ignore",
"serviceId": "/providers/Microsoft.Support/services/subscription_management_service_guid",
"serviceDisplayName": "Subscription management",
"status": "Open",
"createdDate": "2020-03-20T21:36:18Z",
"modifiedDate": "2020-03-20T21:36:23Z"
}
}
]
}
List support tickets in open state for a subscription
Sample Request
GET https://management.azure.com/subscriptions/subid/providers/Microsoft.Support/supportTickets?$filter=status eq 'Open'&api-version=2020-04-01
/** Samples for SupportTickets List. */
public final class Main {
/*
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsInOpenStateBySubscription.json
*/
/**
* Sample code: List support tickets in open state for a subscription.
*
* @param manager Entry point to SupportManager.
*/
public static void listSupportTicketsInOpenStateForASubscription(
com.azure.resourcemanager.support.SupportManager manager) {
manager.supportTickets().list(null, "status eq 'Open'", com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.support import MicrosoftSupport
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-support
# USAGE
python list_support_tickets_in_open_state_for_a_subscription.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = MicrosoftSupport(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.support_tickets.list()
for item in response:
print(item)
# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsInOpenStateBySubscription.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armsupport_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsInOpenStateBySubscription.json
func ExampleTicketsClient_NewListPager_listSupportTicketsInOpenStateForASubscription() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsupport.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewTicketsClient().NewListPager(&armsupport.TicketsClientListOptions{Top: nil,
Filter: to.Ptr("status eq 'Open'"),
})
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page.TicketsListResult = armsupport.TicketsListResult{
// Value: []*armsupport.TicketDetails{
// {
// Name: to.Ptr("testticket"),
// Type: to.Ptr("Microsoft.Support/supportTickets"),
// ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Support/supportTickets/testticket"),
// Properties: &armsupport.TicketDetailsProperties{
// Description: to.Ptr("my description"),
// ContactDetails: &armsupport.ContactProfile{
// Country: to.Ptr("usa"),
// FirstName: to.Ptr("abc"),
// LastName: to.Ptr("xyz"),
// PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail),
// PreferredSupportLanguage: to.Ptr("en-US"),
// PreferredTimeZone: to.Ptr("Pacific Standard Time"),
// PrimaryEmailAddress: to.Ptr("abc@contoso.com"),
// },
// CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()),
// ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()),
// ProblemClassificationDisplayName: to.Ptr("Connectivity / Cannot connect to virtual machine by using RDP or SSH"),
// ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/virtual_machine_service_guid/problemClassifications/problemClassification_guid"),
// Require24X7Response: to.Ptr(false),
// ServiceDisplayName: to.Ptr("Virtual Machine running Linux"),
// ServiceID: to.Ptr("/providers/Microsoft.Support/services/virtual_machine_service_guid"),
// ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{
// ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()),
// SLAMinutes: to.Ptr[int32](240),
// StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()),
// },
// Severity: to.Ptr(armsupport.SeverityLevelModerate),
// Status: to.Ptr("Open"),
// SupportEngineer: &armsupport.Engineer{
// EmailAddress: to.Ptr("xyz@contoso.com"),
// },
// SupportPlanType: to.Ptr("Premier"),
// SupportTicketID: to.Ptr("119120321001170"),
// TechnicalTicketDetails: &armsupport.TechnicalTicketDetails{
// ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/test/providers/Microsoft.Compute/virtualMachines/testserver"),
// },
// Title: to.Ptr("my title"),
// },
// },
// {
// Name: to.Ptr("testticket2"),
// Type: to.Ptr("Microsoft.Support/supportTickets"),
// ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Support/supportTickets/testticket2"),
// Properties: &armsupport.TicketDetailsProperties{
// Description: to.Ptr("This is a test - please ignore"),
// ContactDetails: &armsupport.ContactProfile{
// Country: to.Ptr("USA"),
// FirstName: to.Ptr("abc"),
// LastName: to.Ptr("xyz"),
// PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail),
// PreferredSupportLanguage: to.Ptr("en-US"),
// PreferredTimeZone: to.Ptr("Pacific Standard Time"),
// PrimaryEmailAddress: to.Ptr("abc@contoso.com"),
// },
// CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()),
// ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()),
// ProblemClassificationDisplayName: to.Ptr("Add or Edit VAT, TAX ID, or PO Number"),
// ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/problemClassification_guid"),
// Require24X7Response: to.Ptr(false),
// ServiceDisplayName: to.Ptr("Subscription management"),
// ServiceID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid"),
// ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{
// ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()),
// SLAMinutes: to.Ptr[int32](240),
// StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()),
// },
// Severity: to.Ptr(armsupport.SeverityLevelMinimal),
// Status: to.Ptr("Open"),
// SupportEngineer: &armsupport.Engineer{
// EmailAddress: to.Ptr("xyz@contoso.com"),
// },
// SupportPlanType: to.Ptr("Premier"),
// SupportTicketID: to.Ptr("118032014183771"),
// Title: to.Ptr("Test - please ignore"),
// },
// }},
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { MicrosoftSupport } = require("@azure/arm-support");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with _nextLink_, using which you can retrieve the next set of support tickets. <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error.
*
* @summary Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_ or _CreatedDate_ using the $filter parameter. Output will be a paged result with _nextLink_, using which you can retrieve the next set of support tickets. <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error.
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsInOpenStateBySubscription.json
*/
async function listSupportTicketsInOpenStateForASubscription() {
const subscriptionId = process.env["SUPPORT_SUBSCRIPTION_ID"] || "subid";
const filter = "status eq 'Open'";
const options = { filter };
const credential = new DefaultAzureCredential();
const client = new MicrosoftSupport(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.supportTickets.list(options)) {
resArray.push(item);
}
console.log(resArray);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Support;
using Azure.ResourceManager.Support.Models;
// Generated from example definition: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsInOpenStateBySubscription.json
// this example is just showing the usage of "SupportTickets_List" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SubscriptionResource created on azure
// for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource
string subscriptionId = "subid";
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
// get the collection of this SupportTicketResource
SupportTicketCollection collection = subscriptionResource.GetSupportTickets();
// invoke the operation and iterate over the result
string filter = "status eq 'Open'";
await foreach (SupportTicketResource item in collection.GetAllAsync(filter: filter))
{
// the variable item is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SupportTicketData resourceData = item.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
Console.WriteLine($"Succeeded");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"value": [
{
"id": "/subscriptions/subid/providers/Microsoft.Support/supportTickets/testticket",
"name": "testticket",
"type": "Microsoft.Support/supportTickets",
"properties": {
"supportTicketId": "119120321001170",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/virtual_machine_service_guid/problemClassifications/problemClassification_guid",
"problemClassificationDisplayName": "Connectivity / Cannot connect to virtual machine by using RDP or SSH",
"severity": "moderate",
"require24X7Response": false,
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"primaryEmailAddress": "abc@contoso.com",
"preferredTimeZone": "Pacific Standard Time",
"country": "usa",
"preferredSupportLanguage": "en-US"
},
"technicalTicketDetails": {
"resourceId": "/subscriptions/subid/resourceGroups/test/providers/Microsoft.Compute/virtualMachines/testserver"
},
"serviceLevelAgreement": {
"startTime": "2020-03-20T21:36:18Z",
"expirationTime": "2020-03-21T17:36:18Z",
"slaMinutes": 240
},
"supportEngineer": {
"emailAddress": "xyz@contoso.com"
},
"supportPlanType": "Premier",
"title": "my title",
"serviceId": "/providers/Microsoft.Support/services/virtual_machine_service_guid",
"serviceDisplayName": "Virtual Machine running Linux",
"status": "Open",
"createdDate": "2020-03-20T21:36:18Z",
"modifiedDate": "2020-03-20T21:36:23Z"
}
},
{
"id": "/subscriptions/subid/providers/Microsoft.Support/supportTickets/testticket2",
"name": "testticket2",
"type": "Microsoft.Support/supportTickets",
"properties": {
"supportTicketId": "118032014183771",
"description": "This is a test - please ignore",
"problemClassificationId": "/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/problemClassification_guid",
"problemClassificationDisplayName": "Add or Edit VAT, TAX ID, or PO Number",
"severity": "minimal",
"require24X7Response": false,
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"primaryEmailAddress": "abc@contoso.com",
"preferredTimeZone": "Pacific Standard Time",
"country": "USA",
"preferredSupportLanguage": "en-US"
},
"serviceLevelAgreement": {
"startTime": "2020-03-20T21:36:18Z",
"expirationTime": "2020-03-21T17:36:18Z",
"slaMinutes": 240
},
"supportEngineer": {
"emailAddress": "xyz@contoso.com"
},
"supportPlanType": "Premier",
"title": "Test - please ignore",
"serviceId": "/providers/Microsoft.Support/services/subscription_management_service_guid",
"serviceDisplayName": "Subscription management",
"status": "Open",
"createdDate": "2020-03-20T21:36:18Z",
"modifiedDate": "2020-03-20T21:36:23Z"
}
}
]
}
List support tickets with a certain problem classification id for a subscription
Sample Request
GET https://management.azure.com/subscriptions/subid/providers/Microsoft.Support/supportTickets?$filter=ProblemClassificationId eq 'compute_vm_problemClassification_guid'&api-version=2020-04-01
/** Samples for SupportTickets List. */
public final class Main {
/*
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsProblemClassificationIdEqualsForSubscription.json
*/
/**
* Sample code: List support tickets with a certain problem classification id for a subscription.
*
* @param manager Entry point to SupportManager.
*/
public static void listSupportTicketsWithACertainProblemClassificationIdForASubscription(
com.azure.resourcemanager.support.SupportManager manager) {
manager
.supportTickets()
.list(
null,
"ProblemClassificationId eq 'compute_vm_problemClassification_guid'",
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.support import MicrosoftSupport
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-support
# USAGE
python list_support_tickets_with_a_certain_problem_classification_id_for_a_subscription.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = MicrosoftSupport(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.support_tickets.list()
for item in response:
print(item)
# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsProblemClassificationIdEqualsForSubscription.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Support;
using Azure.ResourceManager.Support.Models;
// Generated from example definition: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsProblemClassificationIdEqualsForSubscription.json
// this example is just showing the usage of "SupportTickets_List" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SubscriptionResource created on azure
// for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource
string subscriptionId = "subid";
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
// get the collection of this SupportTicketResource
SupportTicketCollection collection = subscriptionResource.GetSupportTickets();
// invoke the operation and iterate over the result
string filter = "ProblemClassificationId eq 'compute_vm_problemClassification_guid'";
await foreach (SupportTicketResource item in collection.GetAllAsync(filter: filter))
{
// the variable item is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SupportTicketData resourceData = item.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
Console.WriteLine($"Succeeded");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"value": [
{
"id": "/subscriptions/subid/providers/Microsoft.Support/supportTickets/testTicket1",
"name": "testTicket1",
"type": "Microsoft.Support/supportTickets",
"properties": {
"supportTicketId": "2205060010000072",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/service_guid/problemClassifications/compute_vm_problemClassification_guid",
"problemClassificationDisplayName": "Compute-VM (cores-vCPUs) subscription limit increases",
"severity": "minimal",
"require24X7Response": false,
"enrollmentId": "",
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"primaryEmailAddress": "abc@contoso.com",
"preferredTimeZone": "Pacific Standard Time",
"country": "usa",
"preferredSupportLanguage": "en-US"
},
"supportEngineer": {
"emailAddress": "xyz@contoso.com"
},
"supportPlanType": "Premier",
"title": "my title",
"serviceId": "/providers/Microsoft.Support/services/service_guid",
"serviceDisplayName": "service_displayName",
"status": "Open",
"createdDate": "2022-05-04T21:52:10Z",
"modifiedDate": "2022-05-12T23:05:19Z"
}
},
{
"id": "/subscriptions/subid/providers/Microsoft.Support/supportTickets/testTicket2",
"name": "testTicket2",
"type": "Microsoft.Support/supportTickets",
"properties": {
"supportTicketId": "2205040010000077",
"description": "This is a test - please ignore",
"problemClassificationId": "/providers/Microsoft.Support/services/service_guid/problemClassifications/compute_vm_problemClassification_guid",
"problemClassificationDisplayName": "Compute-VM (cores-vCPUs) subscription limit increases",
"severity": "minimal",
"require24X7Response": false,
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"primaryEmailAddress": "abc@contoso.com",
"preferredTimeZone": "Pacific Standard Time",
"country": "USA",
"preferredSupportLanguage": "en-US"
},
"supportEngineer": {
"emailAddress": "xyz@contoso.com"
},
"supportPlanType": "Premier",
"title": "Test - please ignore",
"serviceId": "/providers/Microsoft.Support/services/service_guid",
"serviceDisplayName": "service_displayName",
"status": "Open",
"createdDate": "2022-05-04T21:38:42Z",
"modifiedDate": "2022-05-04T21:39:14Z"
}
}
]
}
List support tickets with a certain service id for a subscription
Sample Request
GET https://management.azure.com/subscriptions/subid/providers/Microsoft.Support/supportTickets?$filter=ServiceId eq 'vm_windows_service_guid'&api-version=2020-04-01
/** Samples for SupportTickets List. */
public final class Main {
/*
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsServiceIdEqualsForSubscription.json
*/
/**
* Sample code: List support tickets with a certain service id for a subscription.
*
* @param manager Entry point to SupportManager.
*/
public static void listSupportTicketsWithACertainServiceIdForASubscription(
com.azure.resourcemanager.support.SupportManager manager) {
manager.supportTickets().list(null, "ServiceId eq 'vm_windows_service_guid'", com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.support import MicrosoftSupport
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-support
# USAGE
python list_support_tickets_with_a_certain_service_id_for_a_subscription.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = MicrosoftSupport(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.support_tickets.list()
for item in response:
print(item)
# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsServiceIdEqualsForSubscription.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Support;
using Azure.ResourceManager.Support.Models;
// Generated from example definition: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsServiceIdEqualsForSubscription.json
// this example is just showing the usage of "SupportTickets_List" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SubscriptionResource created on azure
// for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource
string subscriptionId = "subid";
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
// get the collection of this SupportTicketResource
SupportTicketCollection collection = subscriptionResource.GetSupportTickets();
// invoke the operation and iterate over the result
string filter = "ServiceId eq 'vm_windows_service_guid'";
await foreach (SupportTicketResource item in collection.GetAllAsync(filter: filter))
{
// the variable item is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SupportTicketData resourceData = item.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
Console.WriteLine($"Succeeded");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"value": [
{
"id": "/subscriptions/subid/providers/Microsoft.Support/supportTickets",
"name": "testticket1",
"type": "Microsoft.Support/supportTickets",
"properties": {
"supportTicketId": "2205040010000082",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/vm_windows_service_guid/problemClassifications/problemClassification_guid",
"problemClassificationDisplayName": "problemClassification_displayName",
"severity": "minimal",
"require24X7Response": false,
"enrollmentId": "",
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"primaryEmailAddress": "abc@contoso.com",
"preferredTimeZone": "Pacific Standard Time",
"country": "usa",
"preferredSupportLanguage": "en-US"
},
"supportEngineer": {
"emailAddress": "xyz@contoso.com"
},
"supportPlanType": "Premier",
"title": "my title",
"serviceId": "/providers/Microsoft.Support/services/vm_windows_service_guid",
"serviceDisplayName": "Virtual Machine running Windows",
"status": "Open",
"createdDate": "2022-05-04T21:52:10Z",
"modifiedDate": "2022-05-12T23:05:19Z"
}
},
{
"id": "/subscriptions/subid/providers/Microsoft.Support/supportTickets",
"name": "testticket2",
"type": "Microsoft.Support/supportTickets",
"properties": {
"supportTicketId": "2205040010000080",
"description": "This is a test - please ignore",
"problemClassificationId": "/providers/Microsoft.Support/services/vm_windows_service_guid/problemClassifications/problemClassification_guid",
"problemClassificationDisplayName": "problemClassification_displayName",
"severity": "minimal",
"require24X7Response": false,
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"primaryEmailAddress": "abc@contoso.com",
"preferredTimeZone": "Pacific Standard Time",
"country": "USA",
"preferredSupportLanguage": "en-US"
},
"supportEngineer": {
"emailAddress": "xyz@contoso.com"
},
"supportPlanType": "Premier",
"title": "Test - please ignore",
"serviceId": "/providers/Microsoft.Support/services/vm_windows_service_guid",
"serviceDisplayName": "Virtual Machine running Windows",
"status": "Open",
"createdDate": "2022-05-04T21:38:42Z",
"modifiedDate": "2022-05-04T21:39:14Z"
}
}
]
}
Definizioni
Nome |
Descrizione |
ContactProfile
|
Informazioni di contatto associate al ticket di supporto.
|
ExceptionResponse
|
Errore dell'API.
|
PreferredContactMethod
|
Metodo di contatto preferito.
|
QuotaChangeRequest
|
Questa proprietà è necessaria per fornire l'area e i nuovi limiti di quota.
|
QuotaTicketDetails
|
Set aggiuntivo di informazioni necessarie per aumentare il ticket di supporto per determinati tipi di quota, ad esempio core di macchine virtuali. Ottenere dettagli completi sulla richiesta di supporto del payload quota insieme ad esempi alla richiesta di quota di supporto.
|
ServiceError
|
Dettagli dell'errore dell'API.
|
ServiceErrorDetail
|
Dettagli dell'errore.
|
ServiceLevelAgreement
|
Dettagli del Contratto di servizio per un ticket di supporto.
|
SeverityLevel
|
Valore che indica l'urgenza del caso, che a sua volta determina il tempo di risposta in base al contratto di servizio del piano di supporto tecnico in uso con Azure. Nota: "Massimo impatto critico", noto anche come livello di "emergenza - Grave impatto" nel portale di Azure è riservato solo ai nostri clienti Premium.
|
SupportEngineer
|
Informazioni sul tecnico di supporto.
|
SupportTicketDetails
|
Oggetto che rappresenta la risorsa SupportTicketDetails.
|
SupportTicketsListResult
|
Oggetto che rappresenta una raccolta di risorse SupportTicket.
|
TechnicalTicketDetails
|
Informazioni aggiuntive per il ticket di supporto tecnico.
|
Informazioni di contatto associate al ticket di supporto.
Nome |
Tipo |
Descrizione |
additionalEmailAddresses
|
string[]
|
Gli indirizzi di posta elettronica aggiuntivi elencati verranno copiati in qualsiasi corrispondenza relativa al ticket di supporto.
|
country
|
string
|
Paese dell'utente. Si tratta del codice alfa-3166-1 ISO 3.
|
firstName
|
string
|
Nome.
|
lastName
|
string
|
Cognome.
|
phoneNumber
|
string
|
Numero di telefono. Questo è necessario se il metodo di contatto preferito è telefono.
|
preferredContactMethod
|
PreferredContactMethod
|
Metodo di contatto preferito.
|
preferredSupportLanguage
|
string
|
Linguaggio preferito del supporto da Azure. Le lingue di supporto variano in base alla gravità scelta per il ticket di supporto. Altre informazioni su Gravità e velocità di risposta di Azure. Usare il codice del paese di lingua standard. I valori validi sono "en-us" per inglese, 'zh-hans' per cinese, 'es-es' per spagnolo, 'fr-fr' per francese, 'ja-jp' per giapponese, 'ko-kr' per coreano, 'ru-ru' per russo, 'pt-br' per portoghese, 'it-it' per italiano, 'zh-tw' per cinese e 'de-de' per tedesco.
|
preferredTimeZone
|
string
|
Fuso orario dell'utente. Si tratta del nome del fuso orario dai valori di indice del fuso orario microsoft.
|
primaryEmailAddress
|
string
|
Indirizzo di posta elettronica primario.
|
ExceptionResponse
Errore dell'API.
Nome |
Tipo |
Descrizione |
error
|
ServiceError
|
Dettagli dell'errore dell'API.
|
Metodo di contatto preferito.
Nome |
Tipo |
Descrizione |
email
|
string
|
|
phone
|
string
|
|
QuotaChangeRequest
Questa proprietà è necessaria per fornire l'area e i nuovi limiti di quota.
Nome |
Tipo |
Descrizione |
payload
|
string
|
Payload della richiesta di aumento della quota.
|
region
|
string
|
Area per cui viene effettuata la richiesta di aumento della quota.
|
QuotaTicketDetails
Set aggiuntivo di informazioni necessarie per aumentare il ticket di supporto per determinati tipi di quota, ad esempio core di macchine virtuali. Ottenere dettagli completi sulla richiesta di supporto del payload quota insieme ad esempi alla richiesta di quota di supporto.
Nome |
Tipo |
Descrizione |
quotaChangeRequestSubType
|
string
|
Obbligatorio per determinati tipi di quota quando è presente un sottotipo, ad esempio Batch, per il quale si richiede un aumento della quota.
|
quotaChangeRequestVersion
|
string
|
Versione della richiesta di modifica quota.
|
quotaChangeRequests
|
QuotaChangeRequest[]
|
Questa proprietà è necessaria per fornire l'area e i nuovi limiti di quota.
|
ServiceError
Dettagli dell'errore dell'API.
Nome |
Tipo |
Descrizione |
code
|
string
|
Codice di errore.
|
details
|
ServiceErrorDetail[]
|
Elenco dei dettagli dell'errore.
|
message
|
string
|
Messaggio di errore.
|
target
|
string
|
Destinazione dell'errore.
|
ServiceErrorDetail
Dettagli dell'errore.
Nome |
Tipo |
Descrizione |
code
|
string
|
Codice di errore.
|
message
|
string
|
Messaggio di errore.
|
target
|
string
|
Destinazione dell'errore.
|
ServiceLevelAgreement
Dettagli del Contratto di servizio per un ticket di supporto.
Nome |
Tipo |
Descrizione |
expirationTime
|
string
|
Ora UTC (formato ISO 8601) alla scadenza del contratto di servizio.
|
slaMinutes
|
integer
|
Contratto di servizio in minuti.
|
startTime
|
string
|
Ora UTC (formato ISO 8601) all'avvio del contratto di servizio.
|
SeverityLevel
Valore che indica l'urgenza del caso, che a sua volta determina il tempo di risposta in base al contratto di servizio del piano di supporto tecnico in uso con Azure. Nota: "Massimo impatto critico", noto anche come livello di "emergenza - Grave impatto" nel portale di Azure è riservato solo ai nostri clienti Premium.
Nome |
Tipo |
Descrizione |
critical
|
string
|
|
highestcriticalimpact
|
string
|
|
minimal
|
string
|
|
moderate
|
string
|
|
SupportEngineer
Informazioni sul tecnico di supporto.
Nome |
Tipo |
Descrizione |
emailAddress
|
string
|
Email indirizzo del tecnico del supporto di Azure assegnato al ticket di supporto.
|
SupportTicketDetails
Oggetto che rappresenta la risorsa SupportTicketDetails.
Nome |
Tipo |
Descrizione |
id
|
string
|
ID della risorsa.
|
name
|
string
|
Nome della risorsa.
|
properties.contactDetails
|
ContactProfile
|
Informazioni di contatto dell'utente che richiede di creare un ticket di supporto.
|
properties.createdDate
|
string
|
Ora UTC (formato ISO 8601) quando è stato creato il ticket di supporto.
|
properties.description
|
string
|
Descrizione dettagliata della domanda o del problema.
|
properties.enrollmentId
|
string
|
ID registrazione associato al ticket di supporto.
|
properties.modifiedDate
|
string
|
Ora UTC (formato ISO 8601) quando il ticket di supporto è stato modificato.
|
properties.problemClassificationDisplayName
|
string
|
Nome localizzato della classificazione dei problemi.
|
properties.problemClassificationId
|
string
|
Ogni servizio di Azure ha un proprio set di categorie di problemi, note anche come classificazione dei problemi. Questo parametro è l'ID univoco per il tipo di problema riscontrato.
|
properties.problemStartTime
|
string
|
Ora UTC (formato ISO 8601) all'avvio del problema.
|
properties.quotaTicketDetails
|
QuotaTicketDetails
|
Dettagli aggiuntivi del ticket associati a una richiesta di ticket di supporto quota.
|
properties.require24X7Response
|
boolean
|
Indica se richiede una risposta 24x7 da Azure.
|
properties.serviceDisplayName
|
string
|
Nome localizzato del servizio di Azure.
|
properties.serviceId
|
string
|
Si tratta dell'ID risorsa della risorsa del servizio di Azure associata al ticket di supporto.
|
properties.serviceLevelAgreement
|
ServiceLevelAgreement
|
Informazioni sul contratto di servizio per questo ticket di supporto.
|
properties.severity
|
SeverityLevel
|
Valore che indica l'urgenza del caso, che a sua volta determina il tempo di risposta in base al contratto di servizio del piano di supporto tecnico in uso con Azure. Nota: "Massimo impatto critico", noto anche come livello di "emergenza - Grave impatto" nel portale di Azure è riservato solo ai nostri clienti Premium.
|
properties.status
|
string
|
Stato del ticket di supporto.
|
properties.supportEngineer
|
SupportEngineer
|
Informazioni sul tecnico di supporto che lavora su questo ticket di supporto.
|
properties.supportPlanType
|
string
|
Tipo di piano di supporto associato al ticket di supporto.
|
properties.supportTicketId
|
string
|
ID del ticket di supporto generato dal sistema che è univoco.
|
properties.technicalTicketDetails
|
TechnicalTicketDetails
|
Dettagli aggiuntivi sui ticket associati a una richiesta di ticket di supporto tecnico.
|
properties.title
|
string
|
Titolo del ticket di supporto.
|
type
|
string
|
Tipo della risorsa 'Microsoft.Support/supportTickets'.
|
SupportTicketsListResult
Oggetto che rappresenta una raccolta di risorse SupportTicket.
Nome |
Tipo |
Descrizione |
nextLink
|
string
|
URI per recuperare la pagina successiva delle risorse di SupportTicket.
|
value
|
SupportTicketDetails[]
|
Elenco delle risorse di SupportTicket.
|
TechnicalTicketDetails
Informazioni aggiuntive per il ticket di supporto tecnico.
Nome |
Tipo |
Descrizione |
resourceId
|
string
|
Si tratta dell'ID risorsa della risorsa del servizio di Azure, ad esempio una risorsa macchina virtuale o una risorsa HDInsight, per cui viene creato il ticket di supporto.
|