为指定的订阅创建订阅和服务限制(配额)、技术、计费和订阅管理问题的新支持票证。 了解创建支持票证所需的 先决条件。
始终调用 Services 和 ProblemClassifications API 以获取支持票证创建所需的最新服务和问题类别集。
目前不支持通过 API 添加附件。 若要将文件添加到现有支持票证,请访问 Azure 门户中 管理支持票证 页,选择支持票证,并使用文件上传控件添加新文件。
目前不支持通过 API 同意与 Azure 支持部门共享诊断信息。 如果问题需要从 Azure 资源收集诊断信息,则处理票证的 Azure 支持工程师将联系你同意。
为代表创建支持票证:包括 x-ms-authorization-auxiliary 标头,以便根据 文档提供辅助令牌。 主要令牌来自针对订阅(即云解决方案提供商(CSP)客户租户提出支持票证的租户。 辅助令牌来自云解决方案提供商(CSP)合作伙伴租户。
PUT https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}?api-version=2024-04-01
URI 参数
名称 |
在 |
必需 |
类型 |
说明 |
subscriptionId
|
path |
True
|
string
(uuid)
|
目标订阅的 ID。 该值必须是 UUID。
|
supportTicketName
|
path |
True
|
string
|
支持票证名称。
|
api-version
|
query |
True
|
string
minLength: 1
|
用于此操作的 API 版本。
|
请求正文
名称 |
必需 |
类型 |
说明 |
properties.advancedDiagnosticConsent
|
True
|
Consent
|
在支持票证上更新高级诊断同意。
|
properties.contactDetails
|
True
|
ContactProfile
|
请求创建支持票证的用户的联系信息。
|
properties.description
|
True
|
string
|
问题的详细描述。
|
properties.problemClassificationId
|
True
|
string
|
每个 Azure 服务都有自己的一组问题类别,也称为问题分类。 此参数是所遇到的问题类型的唯一 ID。
|
properties.serviceId
|
True
|
string
|
这是与支持票证关联的 Azure 服务资源的资源 ID。
|
properties.severity
|
True
|
SeverityLevel
|
一个值,指示案例的紧迫性,这反过来又根据与 Azure 签订的技术支持计划的服务级别协议来确定响应时间。 注意:“最高严重影响”,也称为 Azure 门户中的“紧急 - 严重影响”级别仅保留给高级客户。
|
properties.title
|
True
|
string
|
支持票证的标题。
|
properties.enrollmentId
|
|
string
|
与支持票证关联的注册 ID。
|
properties.fileWorkspaceName
|
|
string
|
文件工作区名称。
|
properties.problemScopingQuestions
|
|
string
|
与支持票证关联的问题范围问题。
|
properties.problemStartTime
|
|
string
(date-time)
|
问题开始的时间(ISO 8601 格式)。
|
properties.quotaTicketDetails
|
|
QuotaTicketDetails
|
与配额支持票证请求关联的其他票证详细信息。
|
properties.require24X7Response
|
|
boolean
|
指示这是否需要来自 Azure 的 24x7 响应。
|
properties.secondaryConsent
|
|
SecondaryConsent[]
|
此属性指示支持票证的辅助同意
|
properties.serviceLevelAgreement
|
|
ServiceLevelAgreement
|
此支持票证的服务级别协议信息。
|
properties.supportEngineer
|
|
SupportEngineer
|
有关处理此支持票证的支持工程师的信息。
|
properties.supportPlanId
|
|
string
|
与支持票证关联的支持计划 ID。
|
properties.supportTicketId
|
|
string
|
系统生成的支持票证 ID 是唯一的。
|
properties.technicalTicketDetails
|
|
TechnicalTicketDetails
|
与技术支持票证请求关联的其他票证详细信息。
|
响应
安全性
azure_auth
Azure Active Directory OAuth2 Flow。
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
名称 |
说明 |
user_impersonation
|
模拟用户帐户
|
示例
示例请求
PUT https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket?api-version=2024-04-01
{
"properties": {
"serviceId": "/providers/Microsoft.Support/services/billing_service_guid",
"title": "my title",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/billing_service_guid/problemClassifications/billing_problemClassification_guid",
"severity": "moderate",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"fileWorkspaceName": "6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066",
"advancedDiagnosticConsent": "No",
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"primaryEmailAddress": "abc@contoso.com",
"preferredContactMethod": "email",
"preferredTimeZone": "Pacific Standard Time",
"preferredSupportLanguage": "en-US",
"country": "usa"
}
}
}
import com.azure.resourcemanager.support.models.Consent;
import com.azure.resourcemanager.support.models.ContactProfile;
import com.azure.resourcemanager.support.models.PreferredContactMethod;
import com.azure.resourcemanager.support.models.SeverityLevel;
/**
* Samples for SupportTickets Create.
*/
public final class Main {
/*
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/
* CreateBillingSupportTicketForSubscription.json
*/
/**
* Sample code: Create a ticket for Billing related issues.
*
* @param manager Entry point to SupportManager.
*/
public static void createATicketForBillingRelatedIssues(com.azure.resourcemanager.support.SupportManager manager) {
manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId(
"/providers/Microsoft.Support/services/billing_service_guid/problemClassifications/billing_problemClassification_guid")
.withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.NO)
.withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz")
.withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com")
.withPreferredTimeZone("Pacific Standard Time").withCountry("usa")
.withPreferredSupportLanguage("en-US"))
.withTitle("my title").withServiceId("/providers/Microsoft.Support/services/billing_service_guid")
.withSupportPlanId(
"U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=")
.withFileWorkspaceName("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066").create();
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.support import MicrosoftSupport
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-support
# USAGE
python create_billing_support_ticket_for_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="132d901f-189d-4381-9214-fe68e27e05a1",
)
response = client.support_tickets.begin_create(
support_ticket_name="testticket",
create_support_ticket_parameters={
"properties": {
"advancedDiagnosticConsent": "No",
"contactDetails": {
"country": "usa",
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"preferredSupportLanguage": "en-US",
"preferredTimeZone": "Pacific Standard Time",
"primaryEmailAddress": "abc@contoso.com",
},
"description": "my description",
"fileWorkspaceName": "6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066",
"problemClassificationId": "/providers/Microsoft.Support/services/billing_service_guid/problemClassifications/billing_problemClassification_guid",
"serviceId": "/providers/Microsoft.Support/services/billing_service_guid",
"severity": "moderate",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"title": "my title",
}
},
).result()
print(response)
# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBillingSupportTicketForSubscription.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/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBillingSupportTicketForSubscription.json
func ExampleTicketsClient_BeginCreate_createATicketForBillingRelatedIssues() {
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)
}
poller, err := clientFactory.NewTicketsClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{
Properties: &armsupport.TicketDetailsProperties{
Description: to.Ptr("my description"),
AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentNo),
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"),
},
FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"),
ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/billing_service_guid/problemClassifications/billing_problemClassification_guid"),
ServiceID: to.Ptr("/providers/Microsoft.Support/services/billing_service_guid"),
Severity: to.Ptr(armsupport.SeverityLevelModerate),
SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="),
Title: to.Ptr("my title"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.TicketDetails = armsupport.TicketDetails{
// Name: to.Ptr("testticket"),
// Type: to.Ptr("Microsoft.Support/supportTickets"),
// ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"),
// Properties: &armsupport.TicketDetailsProperties{
// Description: to.Ptr("my description"),
// AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentNo),
// 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}()),
// FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"),
// ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()),
// ProblemClassificationDisplayName: to.Ptr("Refund request"),
// ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/billing_service_guid/problemClassifications/billing_problemClassification_guid"),
// Require24X7Response: to.Ptr(false),
// ServiceDisplayName: to.Ptr("Billing"),
// ServiceID: to.Ptr("/providers/Microsoft.Support/services/billing_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{
// },
// SupportPlanDisplayName: to.Ptr("Premier"),
// SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="),
// SupportPlanType: to.Ptr("Premier"),
// SupportTicketID: to.Ptr("119120321001170"),
// Title: to.Ptr("my title"),
// },
// }
}
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 Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.
*
* @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBillingSupportTicketForSubscription.json
*/
async function createATicketForBillingRelatedIssues() {
const subscriptionId =
process.env["SUPPORT_SUBSCRIPTION_ID"] || "132d901f-189d-4381-9214-fe68e27e05a1";
const supportTicketName = "testticket";
const createSupportTicketParameters = {
description: "my description",
advancedDiagnosticConsent: "No",
contactDetails: {
country: "usa",
firstName: "abc",
lastName: "xyz",
preferredContactMethod: "email",
preferredSupportLanguage: "en-US",
preferredTimeZone: "Pacific Standard Time",
primaryEmailAddress: "abc@contoso.com",
},
fileWorkspaceName: "6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066",
problemClassificationId:
"/providers/Microsoft.Support/services/billing_service_guid/problemClassifications/billing_problemClassification_guid",
serviceId: "/providers/Microsoft.Support/services/billing_service_guid",
severity: "moderate",
supportPlanId:
"U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
title: "my title",
};
const credential = new DefaultAzureCredential();
const client = new MicrosoftSupport(credential, subscriptionId);
const result = await client.supportTickets.beginCreateAndWait(
supportTicketName,
createSupportTicketParameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Support.Models;
using Azure.ResourceManager.Support;
// Generated from example definition: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBillingSupportTicketForSubscription.json
// this example is just showing the usage of "SupportTickets_Create" 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 = "132d901f-189d-4381-9214-fe68e27e05a1";
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
// get the collection of this SubscriptionSupportTicketResource
SubscriptionSupportTicketCollection collection = subscriptionResource.GetSubscriptionSupportTickets();
// invoke the operation
string supportTicketName = "testticket";
SupportTicketData data = new SupportTicketData(
"my description",
"/providers/Microsoft.Support/services/billing_service_guid/problemClassifications/billing_problemClassification_guid",
SupportSeverityLevel.Moderate,
AdvancedDiagnosticConsent.No,
new SupportContactProfile(
"abc",
"xyz",
PreferredContactMethod.Email,
"abc@contoso.com",
"Pacific Standard Time",
"usa",
"en-US"),
"my title",
"/providers/Microsoft.Support/services/billing_service_guid")
{
SupportPlanId = "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
FileWorkspaceName = "6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066",
};
ArmOperation<SubscriptionSupportTicketResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, supportTicketName, data);
SubscriptionSupportTicketResource result = lro.Value;
// the variable result 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 = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
示例响应
location: https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/operationResults/operationid?api-version=2024-04-01
azure-asyncoperation: https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/operationsStatus/operationid?api-version=2024-04-01
{
"id": "/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket",
"name": "testticket",
"type": "Microsoft.Support/supportTickets",
"properties": {
"supportTicketId": "119120321001170",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/billing_service_guid/problemClassifications/billing_problemClassification_guid",
"problemClassificationDisplayName": "Refund request",
"severity": "moderate",
"require24X7Response": false,
"advancedDiagnosticConsent": "No",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"fileWorkspaceName": "6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066",
"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": null
},
"supportPlanType": "Premier",
"supportPlanDisplayName": "Premier",
"title": "my title",
"serviceId": "/providers/Microsoft.Support/services/billing_service_guid",
"serviceDisplayName": "Billing",
"status": "Open",
"createdDate": "2020-03-20T21:36:18Z",
"modifiedDate": "2020-03-20T21:36:23Z"
}
}
示例请求
PUT https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket?api-version=2024-04-01
{
"properties": {
"serviceId": "/providers/Microsoft.Support/services/subscription_management_service_guid",
"title": "my title",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/subscription_management_problemClassification_guid",
"severity": "moderate",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"fileWorkspaceName": "6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066",
"advancedDiagnosticConsent": "No",
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"primaryEmailAddress": "abc@contoso.com",
"preferredContactMethod": "email",
"preferredTimeZone": "Pacific Standard Time",
"preferredSupportLanguage": "en-US",
"country": "usa"
}
}
}
import com.azure.resourcemanager.support.models.Consent;
import com.azure.resourcemanager.support.models.ContactProfile;
import com.azure.resourcemanager.support.models.PreferredContactMethod;
import com.azure.resourcemanager.support.models.SeverityLevel;
/**
* Samples for SupportTickets Create.
*/
public final class Main {
/*
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/
* CreateSubMgmtSupportTicketForSubscription.json
*/
/**
* Sample code: Create a ticket for Subscription Management related issues for a subscription.
*
* @param manager Entry point to SupportManager.
*/
public static void createATicketForSubscriptionManagementRelatedIssuesForASubscription(
com.azure.resourcemanager.support.SupportManager manager) {
manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId(
"/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/subscription_management_problemClassification_guid")
.withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.NO)
.withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz")
.withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com")
.withPreferredTimeZone("Pacific Standard Time").withCountry("usa")
.withPreferredSupportLanguage("en-US"))
.withTitle("my title")
.withServiceId("/providers/Microsoft.Support/services/subscription_management_service_guid")
.withSupportPlanId(
"U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=")
.withFileWorkspaceName("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066").create();
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.support import MicrosoftSupport
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-support
# USAGE
python create_sub_mgmt_support_ticket_for_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="132d901f-189d-4381-9214-fe68e27e05a1",
)
response = client.support_tickets.begin_create(
support_ticket_name="testticket",
create_support_ticket_parameters={
"properties": {
"advancedDiagnosticConsent": "No",
"contactDetails": {
"country": "usa",
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"preferredSupportLanguage": "en-US",
"preferredTimeZone": "Pacific Standard Time",
"primaryEmailAddress": "abc@contoso.com",
},
"description": "my description",
"fileWorkspaceName": "6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066",
"problemClassificationId": "/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/subscription_management_problemClassification_guid",
"serviceId": "/providers/Microsoft.Support/services/subscription_management_service_guid",
"severity": "moderate",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"title": "my title",
}
},
).result()
print(response)
# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSubMgmtSupportTicketForSubscription.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/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSubMgmtSupportTicketForSubscription.json
func ExampleTicketsClient_BeginCreate_createATicketForSubscriptionManagementRelatedIssuesForASubscription() {
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)
}
poller, err := clientFactory.NewTicketsClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{
Properties: &armsupport.TicketDetailsProperties{
Description: to.Ptr("my description"),
AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentNo),
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"),
},
FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"),
ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/subscription_management_problemClassification_guid"),
ServiceID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid"),
Severity: to.Ptr(armsupport.SeverityLevelModerate),
SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="),
Title: to.Ptr("my title"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.TicketDetails = armsupport.TicketDetails{
// Name: to.Ptr("testticket"),
// Type: to.Ptr("Microsoft.Support/supportTickets"),
// ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"),
// Properties: &armsupport.TicketDetailsProperties{
// Description: to.Ptr("my description"),
// AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentNo),
// 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}()),
// FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"),
// ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()),
// ProblemClassificationDisplayName: to.Ptr("Transfer ownership of my subscription"),
// ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/subscription_management_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.SeverityLevelModerate),
// Status: to.Ptr("Open"),
// SupportEngineer: &armsupport.Engineer{
// },
// SupportPlanDisplayName: to.Ptr("Premier"),
// SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="),
// SupportPlanType: to.Ptr("Premier"),
// SupportTicketID: to.Ptr("119120321001170"),
// Title: to.Ptr("my title"),
// },
// }
}
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 Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.
*
* @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSubMgmtSupportTicketForSubscription.json
*/
async function createATicketForSubscriptionManagementRelatedIssuesForASubscription() {
const subscriptionId =
process.env["SUPPORT_SUBSCRIPTION_ID"] || "132d901f-189d-4381-9214-fe68e27e05a1";
const supportTicketName = "testticket";
const createSupportTicketParameters = {
description: "my description",
advancedDiagnosticConsent: "No",
contactDetails: {
country: "usa",
firstName: "abc",
lastName: "xyz",
preferredContactMethod: "email",
preferredSupportLanguage: "en-US",
preferredTimeZone: "Pacific Standard Time",
primaryEmailAddress: "abc@contoso.com",
},
fileWorkspaceName: "6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066",
problemClassificationId:
"/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/subscription_management_problemClassification_guid",
serviceId: "/providers/Microsoft.Support/services/subscription_management_service_guid",
severity: "moderate",
supportPlanId:
"U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
title: "my title",
};
const credential = new DefaultAzureCredential();
const client = new MicrosoftSupport(credential, subscriptionId);
const result = await client.supportTickets.beginCreateAndWait(
supportTicketName,
createSupportTicketParameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Support.Models;
using Azure.ResourceManager.Support;
// Generated from example definition: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSubMgmtSupportTicketForSubscription.json
// this example is just showing the usage of "SupportTickets_Create" 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 = "132d901f-189d-4381-9214-fe68e27e05a1";
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
// get the collection of this SubscriptionSupportTicketResource
SubscriptionSupportTicketCollection collection = subscriptionResource.GetSubscriptionSupportTickets();
// invoke the operation
string supportTicketName = "testticket";
SupportTicketData data = new SupportTicketData(
"my description",
"/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/subscription_management_problemClassification_guid",
SupportSeverityLevel.Moderate,
AdvancedDiagnosticConsent.No,
new SupportContactProfile(
"abc",
"xyz",
PreferredContactMethod.Email,
"abc@contoso.com",
"Pacific Standard Time",
"usa",
"en-US"),
"my title",
"/providers/Microsoft.Support/services/subscription_management_service_guid")
{
SupportPlanId = "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
FileWorkspaceName = "6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066",
};
ArmOperation<SubscriptionSupportTicketResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, supportTicketName, data);
SubscriptionSupportTicketResource result = lro.Value;
// the variable result 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 = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
示例响应
location: https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/operationResults/operationid?api-version=2024-04-01
azure-asyncoperation: https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/operationsStatus/operationid?api-version=2024-04-01
{
"id": "/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket",
"name": "testticket",
"type": "Microsoft.Support/supportTickets",
"properties": {
"supportTicketId": "119120321001170",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/subscription_management_problemClassification_guid",
"problemClassificationDisplayName": "Transfer ownership of my subscription",
"severity": "moderate",
"require24X7Response": false,
"advancedDiagnosticConsent": "No",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"fileWorkspaceName": "6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066",
"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": null
},
"supportPlanType": "Premier",
"supportPlanDisplayName": "Premier",
"title": "my title",
"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"
}
}
示例请求
PUT https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket?api-version=2024-04-01
{
"properties": {
"serviceId": "/providers/Microsoft.Support/services/cddd3eb5-1830-b494-44fd-782f691479dc",
"title": "my title",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/virtual_machine_running_linux_service_guid/problemClassifications/problemClassification_guid",
"severity": "moderate",
"advancedDiagnosticConsent": "Yes",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"fileWorkspaceName": "6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066",
"problemScopingQuestions": "{\"articleId\":\"076846c1-4c0b-4b21-91c6-1a30246b3867\",\"scopingDetails\":[{\"question\":\"When did the problem begin?\",\"controlId\":\"problem_start_time\",\"orderId\":1,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"2023-08-31T18:55:00.739Z\",\"value\":\"2023-08-31T18:55:00.739Z\",\"type\":\"datetime\"}},{\"question\":\"API Type of the Cosmos DB account\",\"controlId\":\"api_type\",\"orderId\":2,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"Table\",\"value\":\"tables\",\"type\":\"string\"}},{\"question\":\"Table name\",\"controlId\":\"collection_name_table\",\"orderId\":11,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"Select Table Name\",\"value\":\"dont_know_answer\",\"type\":\"string\"}},{\"question\":\"Provide additional details about the issue you're facing\",\"controlId\":\"problem_description\",\"orderId\":12,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"test ticket, please ignore and close\",\"value\":\"test ticket, please ignore and close\",\"type\":\"string\"}}]}",
"secondaryConsent": [
{
"userConsent": "Yes",
"type": "virtualmachinerunninglinuxservice"
}
],
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"primaryEmailAddress": "abc@contoso.com",
"preferredContactMethod": "email",
"preferredTimeZone": "Pacific Standard Time",
"preferredSupportLanguage": "en-US",
"country": "usa"
},
"technicalTicketDetails": {
"resourceId": "/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/resourceGroups/test/providers/Microsoft.Compute/virtualMachines/testserver"
}
}
}
import com.azure.resourcemanager.support.models.Consent;
import com.azure.resourcemanager.support.models.ContactProfile;
import com.azure.resourcemanager.support.models.PreferredContactMethod;
import com.azure.resourcemanager.support.models.SecondaryConsent;
import com.azure.resourcemanager.support.models.SeverityLevel;
import com.azure.resourcemanager.support.models.TechnicalTicketDetails;
import com.azure.resourcemanager.support.models.UserConsent;
import java.util.Arrays;
/**
* Samples for SupportTickets Create.
*/
public final class Main {
/*
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/
* CreateTechnicalSupportTicketForSubscription.json
*/
/**
* Sample code: Create a ticket for Technical issue related to a specific resource for a subscription.
*
* @param manager Entry point to SupportManager.
*/
public static void createATicketForTechnicalIssueRelatedToASpecificResourceForASubscription(
com.azure.resourcemanager.support.SupportManager manager) {
manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId(
"/providers/Microsoft.Support/services/virtual_machine_running_linux_service_guid/problemClassifications/problemClassification_guid")
.withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES)
.withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz")
.withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com")
.withPreferredTimeZone("Pacific Standard Time").withCountry("usa")
.withPreferredSupportLanguage("en-US"))
.withTitle("my title")
.withServiceId("/providers/Microsoft.Support/services/cddd3eb5-1830-b494-44fd-782f691479dc")
.withProblemScopingQuestions(
"{\"articleId\":\"076846c1-4c0b-4b21-91c6-1a30246b3867\",\"scopingDetails\":[{\"question\":\"When did the problem begin?\",\"controlId\":\"problem_start_time\",\"orderId\":1,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"2023-08-31T18:55:00.739Z\",\"value\":\"2023-08-31T18:55:00.739Z\",\"type\":\"datetime\"}},{\"question\":\"API Type of the Cosmos DB account\",\"controlId\":\"api_type\",\"orderId\":2,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"Table\",\"value\":\"tables\",\"type\":\"string\"}},{\"question\":\"Table name\",\"controlId\":\"collection_name_table\",\"orderId\":11,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"Select Table Name\",\"value\":\"dont_know_answer\",\"type\":\"string\"}},{\"question\":\"Provide additional details about the issue you're facing\",\"controlId\":\"problem_description\",\"orderId\":12,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"test ticket, please ignore and close\",\"value\":\"test ticket, please ignore and close\",\"type\":\"string\"}}]}")
.withSupportPlanId(
"U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=")
.withFileWorkspaceName("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066")
.withTechnicalTicketDetails(new TechnicalTicketDetails().withResourceId(
"/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/resourceGroups/test/providers/Microsoft.Compute/virtualMachines/testserver"))
.withSecondaryConsent(Arrays.asList(
new SecondaryConsent().withUserConsent(UserConsent.YES).withType("virtualmachinerunninglinuxservice")))
.create();
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.support import MicrosoftSupport
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-support
# USAGE
python create_technical_support_ticket_for_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="132d901f-189d-4381-9214-fe68e27e05a1",
)
response = client.support_tickets.begin_create(
support_ticket_name="testticket",
create_support_ticket_parameters={
"properties": {
"advancedDiagnosticConsent": "Yes",
"contactDetails": {
"country": "usa",
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"preferredSupportLanguage": "en-US",
"preferredTimeZone": "Pacific Standard Time",
"primaryEmailAddress": "abc@contoso.com",
},
"description": "my description",
"fileWorkspaceName": "6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066",
"problemClassificationId": "/providers/Microsoft.Support/services/virtual_machine_running_linux_service_guid/problemClassifications/problemClassification_guid",
"problemScopingQuestions": '{"articleId":"076846c1-4c0b-4b21-91c6-1a30246b3867","scopingDetails":[{"question":"When did the problem begin?","controlId":"problem_start_time","orderId":1,"inputType":"static","answer":{"displayValue":"2023-08-31T18:55:00.739Z","value":"2023-08-31T18:55:00.739Z","type":"datetime"}},{"question":"API Type of the Cosmos DB account","controlId":"api_type","orderId":2,"inputType":"static","answer":{"displayValue":"Table","value":"tables","type":"string"}},{"question":"Table name","controlId":"collection_name_table","orderId":11,"inputType":"nonstatic","answer":{"displayValue":"Select Table Name","value":"dont_know_answer","type":"string"}},{"question":"Provide additional details about the issue you\'re facing","controlId":"problem_description","orderId":12,"inputType":"nonstatic","answer":{"displayValue":"test ticket, please ignore and close","value":"test ticket, please ignore and close","type":"string"}}]}',
"secondaryConsent": [{"type": "virtualmachinerunninglinuxservice", "userConsent": "Yes"}],
"serviceId": "/providers/Microsoft.Support/services/cddd3eb5-1830-b494-44fd-782f691479dc",
"severity": "moderate",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"technicalTicketDetails": {
"resourceId": "/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/resourceGroups/test/providers/Microsoft.Compute/virtualMachines/testserver"
},
"title": "my title",
}
},
).result()
print(response)
# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateTechnicalSupportTicketForSubscription.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/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateTechnicalSupportTicketForSubscription.json
func ExampleTicketsClient_BeginCreate_createATicketForTechnicalIssueRelatedToASpecificResourceForASubscription() {
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)
}
poller, err := clientFactory.NewTicketsClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{
Properties: &armsupport.TicketDetailsProperties{
Description: to.Ptr("my description"),
AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes),
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"),
},
FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"),
ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/virtual_machine_running_linux_service_guid/problemClassifications/problemClassification_guid"),
ProblemScopingQuestions: to.Ptr("{\"articleId\":\"076846c1-4c0b-4b21-91c6-1a30246b3867\",\"scopingDetails\":[{\"question\":\"When did the problem begin?\",\"controlId\":\"problem_start_time\",\"orderId\":1,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"2023-08-31T18:55:00.739Z\",\"value\":\"2023-08-31T18:55:00.739Z\",\"type\":\"datetime\"}},{\"question\":\"API Type of the Cosmos DB account\",\"controlId\":\"api_type\",\"orderId\":2,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"Table\",\"value\":\"tables\",\"type\":\"string\"}},{\"question\":\"Table name\",\"controlId\":\"collection_name_table\",\"orderId\":11,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"Select Table Name\",\"value\":\"dont_know_answer\",\"type\":\"string\"}},{\"question\":\"Provide additional details about the issue you're facing\",\"controlId\":\"problem_description\",\"orderId\":12,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"test ticket, please ignore and close\",\"value\":\"test ticket, please ignore and close\",\"type\":\"string\"}}]}"),
SecondaryConsent: []*armsupport.SecondaryConsent{
{
Type: to.Ptr("virtualmachinerunninglinuxservice"),
UserConsent: to.Ptr(armsupport.UserConsentYes),
}},
ServiceID: to.Ptr("/providers/Microsoft.Support/services/cddd3eb5-1830-b494-44fd-782f691479dc"),
Severity: to.Ptr(armsupport.SeverityLevelModerate),
SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="),
TechnicalTicketDetails: &armsupport.TechnicalTicketDetails{
ResourceID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/resourceGroups/test/providers/Microsoft.Compute/virtualMachines/testserver"),
},
Title: to.Ptr("my title"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.TicketDetails = armsupport.TicketDetails{
// Name: to.Ptr("testticket"),
// Type: to.Ptr("Microsoft.Support/supportTickets"),
// ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"),
// Properties: &armsupport.TicketDetailsProperties{
// Description: to.Ptr("my description"),
// AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes),
// 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}()),
// FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"),
// 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_running_linux_service_guid/problemClassifications/problemClassification_guid"),
// ProblemScopingQuestions: to.Ptr("{\"articleId\":\"076846c1-4c0b-4b21-91c6-1a30246b3867\",\"scopingDetails\":[{\"question\":\"When did the problem begin?\",\"controlId\":\"problem_start_time\",\"orderId\":1,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"2023-08-31T18:55:00.739Z\",\"value\":\"2023-08-31T18:55:00.739Z\",\"type\":\"datetime\"}},{\"question\":\"API Type of the Cosmos DB account\",\"controlId\":\"api_type\",\"orderId\":2,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"Table\",\"value\":\"tables\",\"type\":\"string\"}},{\"question\":\"Table name\",\"controlId\":\"collection_name_table\",\"orderId\":11,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"Select Table Name\",\"value\":\"dont_know_answer\",\"type\":\"string\"}},{\"question\":\"Provide additional details about the issue you're facing\",\"controlId\":\"problem_description\",\"orderId\":12,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"test ticket, please ignore and close\",\"value\":\"test ticket, please ignore and close\",\"type\":\"string\"}}]}"),
// Require24X7Response: to.Ptr(false),
// SecondaryConsent: []*armsupport.SecondaryConsent{
// {
// Type: to.Ptr("virtualmachinerunninglinuxservice"),
// UserConsent: to.Ptr(armsupport.UserConsentYes),
// }},
// ServiceDisplayName: to.Ptr("Virtual Machine running Linux"),
// ServiceID: to.Ptr("/providers/Microsoft.Support/services/virtual_machine_running_linux_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{
// },
// SupportPlanDisplayName: to.Ptr("Premier"),
// SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="),
// SupportPlanType: to.Ptr("Premier"),
// SupportTicketID: to.Ptr("119120321001170"),
// TechnicalTicketDetails: &armsupport.TechnicalTicketDetails{
// ResourceID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/resourceGroups/test/providers/Microsoft.Compute/virtualMachines/testserver"),
// },
// Title: to.Ptr("my title"),
// },
// }
}
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 Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.
*
* @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateTechnicalSupportTicketForSubscription.json
*/
async function createATicketForTechnicalIssueRelatedToASpecificResourceForASubscription() {
const subscriptionId =
process.env["SUPPORT_SUBSCRIPTION_ID"] || "132d901f-189d-4381-9214-fe68e27e05a1";
const supportTicketName = "testticket";
const createSupportTicketParameters = {
description: "my description",
advancedDiagnosticConsent: "Yes",
contactDetails: {
country: "usa",
firstName: "abc",
lastName: "xyz",
preferredContactMethod: "email",
preferredSupportLanguage: "en-US",
preferredTimeZone: "Pacific Standard Time",
primaryEmailAddress: "abc@contoso.com",
},
fileWorkspaceName: "6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066",
problemClassificationId:
"/providers/Microsoft.Support/services/virtual_machine_running_linux_service_guid/problemClassifications/problemClassification_guid",
problemScopingQuestions:
'{"articleId":"076846c1-4c0b-4b21-91c6-1a30246b3867","scopingDetails":[{"question":"When did the problem begin?","controlId":"problem_start_time","orderId":1,"inputType":"static","answer":{"displayValue":"2023-08-31T18:55:00.739Z","value":"2023-08-31T18:55:00.739Z","type":"datetime"}},{"question":"API Type of the Cosmos DB account","controlId":"api_type","orderId":2,"inputType":"static","answer":{"displayValue":"Table","value":"tables","type":"string"}},{"question":"Table name","controlId":"collection_name_table","orderId":11,"inputType":"nonstatic","answer":{"displayValue":"Select Table Name","value":"dont_know_answer","type":"string"}},{"question":"Provide additional details about the issue you\'re facing","controlId":"problem_description","orderId":12,"inputType":"nonstatic","answer":{"displayValue":"test ticket, please ignore and close","value":"test ticket, please ignore and close","type":"string"}}]}',
secondaryConsent: [{ type: "virtualmachinerunninglinuxservice", userConsent: "Yes" }],
serviceId: "/providers/Microsoft.Support/services/cddd3eb5-1830-b494-44fd-782f691479dc",
severity: "moderate",
supportPlanId:
"U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
technicalTicketDetails: {
resourceId:
"/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/resourceGroups/test/providers/Microsoft.Compute/virtualMachines/testserver",
},
title: "my title",
};
const credential = new DefaultAzureCredential();
const client = new MicrosoftSupport(credential, subscriptionId);
const result = await client.supportTickets.beginCreateAndWait(
supportTicketName,
createSupportTicketParameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Support.Models;
using Azure.ResourceManager.Support;
// Generated from example definition: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateTechnicalSupportTicketForSubscription.json
// this example is just showing the usage of "SupportTickets_Create" 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 = "132d901f-189d-4381-9214-fe68e27e05a1";
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
// get the collection of this SubscriptionSupportTicketResource
SubscriptionSupportTicketCollection collection = subscriptionResource.GetSubscriptionSupportTickets();
// invoke the operation
string supportTicketName = "testticket";
SupportTicketData data = new SupportTicketData(
"my description",
"/providers/Microsoft.Support/services/virtual_machine_running_linux_service_guid/problemClassifications/problemClassification_guid",
SupportSeverityLevel.Moderate,
AdvancedDiagnosticConsent.Yes,
new SupportContactProfile(
"abc",
"xyz",
PreferredContactMethod.Email,
"abc@contoso.com",
"Pacific Standard Time",
"usa",
"en-US"),
"my title",
"/providers/Microsoft.Support/services/cddd3eb5-1830-b494-44fd-782f691479dc")
{
ProblemScopingQuestions = "{\"articleId\":\"076846c1-4c0b-4b21-91c6-1a30246b3867\",\"scopingDetails\":[{\"question\":\"When did the problem begin?\",\"controlId\":\"problem_start_time\",\"orderId\":1,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"2023-08-31T18:55:00.739Z\",\"value\":\"2023-08-31T18:55:00.739Z\",\"type\":\"datetime\"}},{\"question\":\"API Type of the Cosmos DB account\",\"controlId\":\"api_type\",\"orderId\":2,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"Table\",\"value\":\"tables\",\"type\":\"string\"}},{\"question\":\"Table name\",\"controlId\":\"collection_name_table\",\"orderId\":11,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"Select Table Name\",\"value\":\"dont_know_answer\",\"type\":\"string\"}},{\"question\":\"Provide additional details about the issue you're facing\",\"controlId\":\"problem_description\",\"orderId\":12,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"test ticket, please ignore and close\",\"value\":\"test ticket, please ignore and close\",\"type\":\"string\"}}]}",
SupportPlanId = "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
FileWorkspaceName = "6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066",
TechnicalTicketDetailsResourceId = new ResourceIdentifier("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/resourceGroups/test/providers/Microsoft.Compute/virtualMachines/testserver"),
SecondaryConsent = {new SecondaryConsent
{
UserConsent = UserConsent.Yes,
SecondaryConsentType = "virtualmachinerunninglinuxservice",
}},
};
ArmOperation<SubscriptionSupportTicketResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, supportTicketName, data);
SubscriptionSupportTicketResource result = lro.Value;
// the variable result 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 = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
示例响应
location: https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/operationResults/operationid?api-version=2024-04-01
azure-asyncoperation: https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/operationsStatus/operationid?api-version=2024-04-01
{
"id": "/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket",
"name": "testticket",
"type": "Microsoft.Support/supportTickets",
"properties": {
"supportTicketId": "119120321001170",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/virtual_machine_running_linux_service_guid/problemClassifications/problemClassification_guid",
"problemClassificationDisplayName": "Connectivity / Cannot connect to virtual machine by using RDP or SSH",
"severity": "moderate",
"require24X7Response": false,
"advancedDiagnosticConsent": "Yes",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"fileWorkspaceName": "6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066",
"problemScopingQuestions": "{\"articleId\":\"076846c1-4c0b-4b21-91c6-1a30246b3867\",\"scopingDetails\":[{\"question\":\"When did the problem begin?\",\"controlId\":\"problem_start_time\",\"orderId\":1,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"2023-08-31T18:55:00.739Z\",\"value\":\"2023-08-31T18:55:00.739Z\",\"type\":\"datetime\"}},{\"question\":\"API Type of the Cosmos DB account\",\"controlId\":\"api_type\",\"orderId\":2,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"Table\",\"value\":\"tables\",\"type\":\"string\"}},{\"question\":\"Table name\",\"controlId\":\"collection_name_table\",\"orderId\":11,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"Select Table Name\",\"value\":\"dont_know_answer\",\"type\":\"string\"}},{\"question\":\"Provide additional details about the issue you're facing\",\"controlId\":\"problem_description\",\"orderId\":12,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"test ticket, please ignore and close\",\"value\":\"test ticket, please ignore and close\",\"type\":\"string\"}}]}",
"secondaryConsent": [
{
"userConsent": "Yes",
"type": "virtualmachinerunninglinuxservice"
}
],
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"primaryEmailAddress": "abc@contoso.com",
"preferredTimeZone": "Pacific Standard Time",
"country": "usa",
"preferredSupportLanguage": "en-US"
},
"technicalTicketDetails": {
"resourceId": "/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/resourceGroups/test/providers/Microsoft.Compute/virtualMachines/testserver"
},
"serviceLevelAgreement": {
"startTime": "2020-03-20T21:36:18Z",
"expirationTime": "2020-03-21T17:36:18Z",
"slaMinutes": 240
},
"supportEngineer": {
"emailAddress": null
},
"supportPlanType": "Premier",
"supportPlanDisplayName": "Premier",
"title": "my title",
"serviceId": "/providers/Microsoft.Support/services/virtual_machine_running_linux_service_guid",
"serviceDisplayName": "Virtual Machine running Linux",
"status": "Open",
"createdDate": "2020-03-20T21:36:18Z",
"modifiedDate": "2020-03-20T21:36:23Z"
}
}
Create a ticket to request Quota increase for Active Jobs and Job Schedules for a Batch account
示例请求
PUT https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket?api-version=2024-04-01
{
"properties": {
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"title": "my title",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid",
"severity": "moderate",
"advancedDiagnosticConsent": "Yes",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"primaryEmailAddress": "abc@contoso.com",
"preferredContactMethod": "email",
"preferredTimeZone": "Pacific Standard Time",
"preferredSupportLanguage": "en-US",
"country": "usa"
},
"quotaTicketDetails": {
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequestSubType": "Account",
"quotaChangeRequests": [
{
"region": "EastUS",
"payload": "{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"Jobs\"}"
}
]
}
}
}
import com.azure.resourcemanager.support.models.Consent;
import com.azure.resourcemanager.support.models.ContactProfile;
import com.azure.resourcemanager.support.models.PreferredContactMethod;
import com.azure.resourcemanager.support.models.QuotaChangeRequest;
import com.azure.resourcemanager.support.models.QuotaTicketDetails;
import com.azure.resourcemanager.support.models.SeverityLevel;
import java.util.Arrays;
/**
* Samples for SupportTickets Create.
*/
public final class Main {
/*
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/
* CreateBatchQuotaTicketForSpecificBatchAccountForActiveJobs.json
*/
/**
* Sample code: Create a ticket to request Quota increase for Active Jobs and Job Schedules for a Batch account.
*
* @param manager Entry point to SupportManager.
*/
public static void createATicketToRequestQuotaIncreaseForActiveJobsAndJobSchedulesForABatchAccount(
com.azure.resourcemanager.support.SupportManager manager) {
manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId(
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid")
.withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES)
.withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz")
.withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com")
.withPreferredTimeZone("Pacific Standard Time").withCountry("usa")
.withPreferredSupportLanguage("en-US"))
.withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid")
.withSupportPlanId(
"U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=")
.withQuotaTicketDetails(
new QuotaTicketDetails().withQuotaChangeRequestSubType("Account").withQuotaChangeRequestVersion("1.0")
.withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest().withRegion("EastUS")
.withPayload("{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"Jobs\"}"))))
.create();
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.support import MicrosoftSupport
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-support
# USAGE
python create_batch_quota_ticket_for_specific_batch_account_for_active_jobs.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="132d901f-189d-4381-9214-fe68e27e05a1",
)
response = client.support_tickets.begin_create(
support_ticket_name="testticket",
create_support_ticket_parameters={
"properties": {
"advancedDiagnosticConsent": "Yes",
"contactDetails": {
"country": "usa",
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"preferredSupportLanguage": "en-US",
"preferredTimeZone": "Pacific Standard Time",
"primaryEmailAddress": "abc@contoso.com",
},
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid",
"quotaTicketDetails": {
"quotaChangeRequestSubType": "Account",
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequests": [
{"payload": '{"AccountName":"test","NewLimit":200,"Type":"Jobs"}', "region": "EastUS"}
],
},
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"severity": "moderate",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"title": "my title",
}
},
).result()
print(response)
# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForActiveJobs.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/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForActiveJobs.json
func ExampleTicketsClient_BeginCreate_createATicketToRequestQuotaIncreaseForActiveJobsAndJobSchedulesForABatchAccount() {
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)
}
poller, err := clientFactory.NewTicketsClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{
Properties: &armsupport.TicketDetailsProperties{
Description: to.Ptr("my description"),
AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes),
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"),
},
ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid"),
QuotaTicketDetails: &armsupport.QuotaTicketDetails{
QuotaChangeRequestSubType: to.Ptr("Account"),
QuotaChangeRequestVersion: to.Ptr("1.0"),
QuotaChangeRequests: []*armsupport.QuotaChangeRequest{
{
Payload: to.Ptr("{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"Jobs\"}"),
Region: to.Ptr("EastUS"),
}},
},
ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"),
Severity: to.Ptr(armsupport.SeverityLevelModerate),
SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="),
Title: to.Ptr("my title"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.TicketDetails = armsupport.TicketDetails{
// Name: to.Ptr("testticket"),
// Type: to.Ptr("Microsoft.Support/supportTickets"),
// ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"),
// Properties: &armsupport.TicketDetailsProperties{
// Description: to.Ptr("my description"),
// AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes),
// 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}()),
// FileWorkspaceName: to.Ptr("testticket"),
// ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()),
// ProblemClassificationDisplayName: to.Ptr("Batch"),
// ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid"),
// QuotaTicketDetails: &armsupport.QuotaTicketDetails{
// QuotaChangeRequestSubType: to.Ptr("Account"),
// QuotaChangeRequestVersion: to.Ptr("1.0"),
// QuotaChangeRequests: []*armsupport.QuotaChangeRequest{
// {
// Payload: to.Ptr("{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"Jobs\"}"),
// Region: to.Ptr("EastUS"),
// }},
// },
// Require24X7Response: to.Ptr(false),
// ServiceDisplayName: to.Ptr("Service and subscription limits (quotas)"),
// ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_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{
// },
// SupportPlanDisplayName: to.Ptr("Premier"),
// SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="),
// SupportPlanType: to.Ptr("Premier"),
// SupportTicketID: to.Ptr("119120321001170"),
// Title: to.Ptr("my title"),
// },
// }
}
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 Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.
*
* @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForActiveJobs.json
*/
async function createATicketToRequestQuotaIncreaseForActiveJobsAndJobSchedulesForABatchAccount() {
const subscriptionId =
process.env["SUPPORT_SUBSCRIPTION_ID"] || "132d901f-189d-4381-9214-fe68e27e05a1";
const supportTicketName = "testticket";
const createSupportTicketParameters = {
description: "my description",
advancedDiagnosticConsent: "Yes",
contactDetails: {
country: "usa",
firstName: "abc",
lastName: "xyz",
preferredContactMethod: "email",
preferredSupportLanguage: "en-US",
preferredTimeZone: "Pacific Standard Time",
primaryEmailAddress: "abc@contoso.com",
},
problemClassificationId:
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid",
quotaTicketDetails: {
quotaChangeRequestSubType: "Account",
quotaChangeRequestVersion: "1.0",
quotaChangeRequests: [
{
payload: '{"AccountName":"test","NewLimit":200,"Type":"Jobs"}',
region: "EastUS",
},
],
},
serviceId: "/providers/Microsoft.Support/services/quota_service_guid",
severity: "moderate",
supportPlanId:
"U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
title: "my title",
};
const credential = new DefaultAzureCredential();
const client = new MicrosoftSupport(credential, subscriptionId);
const result = await client.supportTickets.beginCreateAndWait(
supportTicketName,
createSupportTicketParameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Support.Models;
using Azure.ResourceManager.Support;
// Generated from example definition: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForActiveJobs.json
// this example is just showing the usage of "SupportTickets_Create" 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 = "132d901f-189d-4381-9214-fe68e27e05a1";
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
// get the collection of this SubscriptionSupportTicketResource
SubscriptionSupportTicketCollection collection = subscriptionResource.GetSubscriptionSupportTickets();
// invoke the operation
string supportTicketName = "testticket";
SupportTicketData data = new SupportTicketData(
"my description",
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid",
SupportSeverityLevel.Moderate,
AdvancedDiagnosticConsent.Yes,
new SupportContactProfile(
"abc",
"xyz",
PreferredContactMethod.Email,
"abc@contoso.com",
"Pacific Standard Time",
"usa",
"en-US"),
"my title",
"/providers/Microsoft.Support/services/quota_service_guid")
{
SupportPlanId = "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
QuotaTicketDetails = new QuotaTicketDetails
{
QuotaChangeRequestSubType = "Account",
QuotaChangeRequestVersion = "1.0",
QuotaChangeRequests = {new SupportQuotaChangeContent
{
Region = "EastUS",
Payload = "{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"Jobs\"}",
}},
},
};
ArmOperation<SubscriptionSupportTicketResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, supportTicketName, data);
SubscriptionSupportTicketResource result = lro.Value;
// the variable result 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 = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
示例响应
location: https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/operationResults/operationid?api-version=2024-04-01
azure-asyncoperation: https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/operationsStatus/operationid?api-version=2024-04-01
{
"id": "/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket",
"name": "testticket",
"type": "Microsoft.Support/supportTickets",
"properties": {
"supportTicketId": "119120321001170",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid",
"problemClassificationDisplayName": "Batch",
"severity": "moderate",
"require24X7Response": false,
"advancedDiagnosticConsent": "Yes",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"fileWorkspaceName": "testticket",
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"primaryEmailAddress": "abc@contoso.com",
"preferredTimeZone": "Pacific Standard Time",
"country": "usa",
"preferredSupportLanguage": "en-US"
},
"quotaTicketDetails": {
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequestSubType": "Account",
"quotaChangeRequests": [
{
"region": "EastUS",
"payload": "{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"Jobs\"}"
}
]
},
"serviceLevelAgreement": {
"startTime": "2020-03-20T21:36:18Z",
"expirationTime": "2020-03-21T17:36:18Z",
"slaMinutes": 240
},
"supportEngineer": {
"emailAddress": null
},
"supportPlanType": "Premier",
"supportPlanDisplayName": "Premier",
"title": "my title",
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"serviceDisplayName": "Service and subscription limits (quotas)",
"status": "Open",
"createdDate": "2020-03-20T21:36:18Z",
"modifiedDate": "2020-03-20T21:36:23Z"
}
}
Create a ticket to request Quota increase for Azure SQL managed instance
示例请求
PUT https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket?api-version=2024-04-01
{
"properties": {
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"title": "my title",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_managedinstance_problemClassification_guid",
"severity": "moderate",
"advancedDiagnosticConsent": "Yes",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"primaryEmailAddress": "abc@contoso.com",
"preferredContactMethod": "email",
"preferredTimeZone": "Pacific Standard Time",
"preferredSupportLanguage": "en-US",
"country": "usa"
},
"quotaTicketDetails": {
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequestSubType": "SQLMI",
"quotaChangeRequests": [
{
"region": "EastUS",
"payload": "{\"NewLimit\":200, \"Metadata\":null, \"Type\":\"vCore\"}"
},
{
"region": "EastUS",
"payload": "{\"NewLimit\":200, \"Metadata\":null, \"Type\":\"Subnet\"}"
}
]
}
}
}
import com.azure.resourcemanager.support.models.Consent;
import com.azure.resourcemanager.support.models.ContactProfile;
import com.azure.resourcemanager.support.models.PreferredContactMethod;
import com.azure.resourcemanager.support.models.QuotaChangeRequest;
import com.azure.resourcemanager.support.models.QuotaTicketDetails;
import com.azure.resourcemanager.support.models.SeverityLevel;
import java.util.Arrays;
/**
* Samples for SupportTickets Create.
*/
public final class Main {
/*
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/
* CreateSqlManagedInstanceQuotaTicket.json
*/
/**
* Sample code: Create a ticket to request Quota increase for Azure SQL managed instance.
*
* @param manager Entry point to SupportManager.
*/
public static void createATicketToRequestQuotaIncreaseForAzureSQLManagedInstance(
com.azure.resourcemanager.support.SupportManager manager) {
manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId(
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_managedinstance_problemClassification_guid")
.withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES)
.withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz")
.withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com")
.withPreferredTimeZone("Pacific Standard Time").withCountry("usa")
.withPreferredSupportLanguage("en-US"))
.withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid")
.withSupportPlanId(
"U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=")
.withQuotaTicketDetails(
new QuotaTicketDetails().withQuotaChangeRequestSubType("SQLMI").withQuotaChangeRequestVersion("1.0")
.withQuotaChangeRequests(Arrays.asList(
new QuotaChangeRequest().withRegion("EastUS")
.withPayload("{\"NewLimit\":200, \"Metadata\":null, \"Type\":\"vCore\"}"),
new QuotaChangeRequest().withRegion("EastUS")
.withPayload("{\"NewLimit\":200, \"Metadata\":null, \"Type\":\"Subnet\"}"))))
.create();
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.support import MicrosoftSupport
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-support
# USAGE
python create_sql_managed_instance_quota_ticket.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="132d901f-189d-4381-9214-fe68e27e05a1",
)
response = client.support_tickets.begin_create(
support_ticket_name="testticket",
create_support_ticket_parameters={
"properties": {
"advancedDiagnosticConsent": "Yes",
"contactDetails": {
"country": "usa",
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"preferredSupportLanguage": "en-US",
"preferredTimeZone": "Pacific Standard Time",
"primaryEmailAddress": "abc@contoso.com",
},
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_managedinstance_problemClassification_guid",
"quotaTicketDetails": {
"quotaChangeRequestSubType": "SQLMI",
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequests": [
{"payload": '{"NewLimit":200, "Metadata":null, "Type":"vCore"}', "region": "EastUS"},
{"payload": '{"NewLimit":200, "Metadata":null, "Type":"Subnet"}', "region": "EastUS"},
],
},
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"severity": "moderate",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"title": "my title",
}
},
).result()
print(response)
# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlManagedInstanceQuotaTicket.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/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlManagedInstanceQuotaTicket.json
func ExampleTicketsClient_BeginCreate_createATicketToRequestQuotaIncreaseForAzureSqlManagedInstance() {
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)
}
poller, err := clientFactory.NewTicketsClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{
Properties: &armsupport.TicketDetailsProperties{
Description: to.Ptr("my description"),
AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes),
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"),
},
ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_managedinstance_problemClassification_guid"),
QuotaTicketDetails: &armsupport.QuotaTicketDetails{
QuotaChangeRequestSubType: to.Ptr("SQLMI"),
QuotaChangeRequestVersion: to.Ptr("1.0"),
QuotaChangeRequests: []*armsupport.QuotaChangeRequest{
{
Payload: to.Ptr("{\"NewLimit\":200, \"Metadata\":null, \"Type\":\"vCore\"}"),
Region: to.Ptr("EastUS"),
},
{
Payload: to.Ptr("{\"NewLimit\":200, \"Metadata\":null, \"Type\":\"Subnet\"}"),
Region: to.Ptr("EastUS"),
}},
},
ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"),
Severity: to.Ptr(armsupport.SeverityLevelModerate),
SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="),
Title: to.Ptr("my title"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.TicketDetails = armsupport.TicketDetails{
// Name: to.Ptr("testticket"),
// Type: to.Ptr("Microsoft.Support/supportTickets"),
// ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"),
// Properties: &armsupport.TicketDetailsProperties{
// Description: to.Ptr("my description"),
// AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes),
// 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}()),
// FileWorkspaceName: to.Ptr("testticket"),
// ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()),
// ProblemClassificationDisplayName: to.Ptr("SQL Database Managed Instance"),
// ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid"),
// QuotaTicketDetails: &armsupport.QuotaTicketDetails{
// QuotaChangeRequestSubType: to.Ptr("SQLMI"),
// QuotaChangeRequestVersion: to.Ptr("1.0"),
// QuotaChangeRequests: []*armsupport.QuotaChangeRequest{
// {
// Payload: to.Ptr("{\"NewLimit\":200, \"Metadata\":null, \"Type\":\"vCore\"}"),
// Region: to.Ptr("EastUS"),
// },
// {
// Payload: to.Ptr("{\"NewLimit\":200, \"Metadata\":null, \"Type\":\"Subnet\"}"),
// Region: to.Ptr("EastUS"),
// }},
// },
// Require24X7Response: to.Ptr(false),
// ServiceDisplayName: to.Ptr("Service and subscription limits (quotas)"),
// ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_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{
// },
// SupportPlanDisplayName: to.Ptr("Premier"),
// SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="),
// SupportPlanType: to.Ptr("Premier"),
// SupportTicketID: to.Ptr("119120321001170"),
// Title: to.Ptr("my title"),
// },
// }
}
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 Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.
*
* @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlManagedInstanceQuotaTicket.json
*/
async function createATicketToRequestQuotaIncreaseForAzureSqlManagedInstance() {
const subscriptionId =
process.env["SUPPORT_SUBSCRIPTION_ID"] || "132d901f-189d-4381-9214-fe68e27e05a1";
const supportTicketName = "testticket";
const createSupportTicketParameters = {
description: "my description",
advancedDiagnosticConsent: "Yes",
contactDetails: {
country: "usa",
firstName: "abc",
lastName: "xyz",
preferredContactMethod: "email",
preferredSupportLanguage: "en-US",
preferredTimeZone: "Pacific Standard Time",
primaryEmailAddress: "abc@contoso.com",
},
problemClassificationId:
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_managedinstance_problemClassification_guid",
quotaTicketDetails: {
quotaChangeRequestSubType: "SQLMI",
quotaChangeRequestVersion: "1.0",
quotaChangeRequests: [
{
payload: '{"NewLimit":200, "Metadata":null, "Type":"vCore"}',
region: "EastUS",
},
{
payload: '{"NewLimit":200, "Metadata":null, "Type":"Subnet"}',
region: "EastUS",
},
],
},
serviceId: "/providers/Microsoft.Support/services/quota_service_guid",
severity: "moderate",
supportPlanId:
"U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
title: "my title",
};
const credential = new DefaultAzureCredential();
const client = new MicrosoftSupport(credential, subscriptionId);
const result = await client.supportTickets.beginCreateAndWait(
supportTicketName,
createSupportTicketParameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Support.Models;
using Azure.ResourceManager.Support;
// Generated from example definition: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlManagedInstanceQuotaTicket.json
// this example is just showing the usage of "SupportTickets_Create" 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 = "132d901f-189d-4381-9214-fe68e27e05a1";
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
// get the collection of this SubscriptionSupportTicketResource
SubscriptionSupportTicketCollection collection = subscriptionResource.GetSubscriptionSupportTickets();
// invoke the operation
string supportTicketName = "testticket";
SupportTicketData data = new SupportTicketData(
"my description",
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_managedinstance_problemClassification_guid",
SupportSeverityLevel.Moderate,
AdvancedDiagnosticConsent.Yes,
new SupportContactProfile(
"abc",
"xyz",
PreferredContactMethod.Email,
"abc@contoso.com",
"Pacific Standard Time",
"usa",
"en-US"),
"my title",
"/providers/Microsoft.Support/services/quota_service_guid")
{
SupportPlanId = "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
QuotaTicketDetails = new QuotaTicketDetails
{
QuotaChangeRequestSubType = "SQLMI",
QuotaChangeRequestVersion = "1.0",
QuotaChangeRequests = {new SupportQuotaChangeContent
{
Region = "EastUS",
Payload = "{\"NewLimit\":200, \"Metadata\":null, \"Type\":\"vCore\"}",
}, new SupportQuotaChangeContent
{
Region = "EastUS",
Payload = "{\"NewLimit\":200, \"Metadata\":null, \"Type\":\"Subnet\"}",
}},
},
};
ArmOperation<SubscriptionSupportTicketResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, supportTicketName, data);
SubscriptionSupportTicketResource result = lro.Value;
// the variable result 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 = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
示例响应
location: https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/operationResults/operationid?api-version=2024-04-01
azure-asyncoperation: https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/operationsStatus/operationid?api-version=2024-04-01
{
"id": "/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket",
"name": "testticket",
"type": "Microsoft.Support/supportTickets",
"properties": {
"supportTicketId": "119120321001170",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid",
"problemClassificationDisplayName": "SQL Database Managed Instance",
"severity": "moderate",
"require24X7Response": false,
"advancedDiagnosticConsent": "Yes",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"fileWorkspaceName": "testticket",
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"primaryEmailAddress": "abc@contoso.com",
"preferredTimeZone": "Pacific Standard Time",
"country": "usa",
"preferredSupportLanguage": "en-US"
},
"quotaTicketDetails": {
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequestSubType": "SQLMI",
"quotaChangeRequests": [
{
"region": "EastUS",
"payload": "{\"NewLimit\":200, \"Metadata\":null, \"Type\":\"vCore\"}"
},
{
"region": "EastUS",
"payload": "{\"NewLimit\":200, \"Metadata\":null, \"Type\":\"Subnet\"}"
}
]
},
"serviceLevelAgreement": {
"startTime": "2020-03-20T21:36:18Z",
"expirationTime": "2020-03-21T17:36:18Z",
"slaMinutes": 240
},
"supportEngineer": {
"emailAddress": null
},
"supportPlanType": "Premier",
"supportPlanDisplayName": "Premier",
"title": "my title",
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"serviceDisplayName": "Service and subscription limits (quotas)",
"status": "Open",
"createdDate": "2020-03-20T21:36:18Z",
"modifiedDate": "2020-03-20T21:36:23Z"
}
}
Create a ticket to request Quota increase for Batch accounts for a subscription
示例请求
PUT https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket?api-version=2024-04-01
{
"properties": {
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"title": "my title",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid",
"severity": "moderate",
"advancedDiagnosticConsent": "Yes",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"primaryEmailAddress": "abc@contoso.com",
"preferredContactMethod": "email",
"preferredTimeZone": "Pacific Standard Time",
"preferredSupportLanguage": "en-US",
"country": "usa"
},
"quotaTicketDetails": {
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequestSubType": "Subscription",
"quotaChangeRequests": [
{
"region": "EastUS",
"payload": "{\"NewLimit\":200,\"Type\":\"Account\"}"
}
]
}
}
}
import com.azure.resourcemanager.support.models.Consent;
import com.azure.resourcemanager.support.models.ContactProfile;
import com.azure.resourcemanager.support.models.PreferredContactMethod;
import com.azure.resourcemanager.support.models.QuotaChangeRequest;
import com.azure.resourcemanager.support.models.QuotaTicketDetails;
import com.azure.resourcemanager.support.models.SeverityLevel;
import java.util.Arrays;
/**
* Samples for SupportTickets Create.
*/
public final class Main {
/*
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/
* CreateBatchQuotaTicketForSubscription.json
*/
/**
* Sample code: Create a ticket to request Quota increase for Batch accounts for a subscription.
*
* @param manager Entry point to SupportManager.
*/
public static void createATicketToRequestQuotaIncreaseForBatchAccountsForASubscription(
com.azure.resourcemanager.support.SupportManager manager) {
manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId(
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid")
.withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES)
.withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz")
.withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com")
.withPreferredTimeZone("Pacific Standard Time").withCountry("usa")
.withPreferredSupportLanguage("en-US"))
.withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid")
.withSupportPlanId(
"U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=")
.withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("Subscription")
.withQuotaChangeRequestVersion("1.0").withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest()
.withRegion("EastUS").withPayload("{\"NewLimit\":200,\"Type\":\"Account\"}"))))
.create();
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.support import MicrosoftSupport
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-support
# USAGE
python create_batch_quota_ticket_for_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="132d901f-189d-4381-9214-fe68e27e05a1",
)
response = client.support_tickets.begin_create(
support_ticket_name="testticket",
create_support_ticket_parameters={
"properties": {
"advancedDiagnosticConsent": "Yes",
"contactDetails": {
"country": "usa",
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"preferredSupportLanguage": "en-US",
"preferredTimeZone": "Pacific Standard Time",
"primaryEmailAddress": "abc@contoso.com",
},
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid",
"quotaTicketDetails": {
"quotaChangeRequestSubType": "Subscription",
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequests": [{"payload": '{"NewLimit":200,"Type":"Account"}', "region": "EastUS"}],
},
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"severity": "moderate",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"title": "my title",
}
},
).result()
print(response)
# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSubscription.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/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSubscription.json
func ExampleTicketsClient_BeginCreate_createATicketToRequestQuotaIncreaseForBatchAccountsForASubscription() {
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)
}
poller, err := clientFactory.NewTicketsClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{
Properties: &armsupport.TicketDetailsProperties{
Description: to.Ptr("my description"),
AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes),
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"),
},
ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid"),
QuotaTicketDetails: &armsupport.QuotaTicketDetails{
QuotaChangeRequestSubType: to.Ptr("Subscription"),
QuotaChangeRequestVersion: to.Ptr("1.0"),
QuotaChangeRequests: []*armsupport.QuotaChangeRequest{
{
Payload: to.Ptr("{\"NewLimit\":200,\"Type\":\"Account\"}"),
Region: to.Ptr("EastUS"),
}},
},
ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"),
Severity: to.Ptr(armsupport.SeverityLevelModerate),
SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="),
Title: to.Ptr("my title"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.TicketDetails = armsupport.TicketDetails{
// Name: to.Ptr("testticket"),
// Type: to.Ptr("Microsoft.Support/supportTickets"),
// ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"),
// Properties: &armsupport.TicketDetailsProperties{
// Description: to.Ptr("my description"),
// AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes),
// 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}()),
// FileWorkspaceName: to.Ptr("testticket"),
// ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()),
// ProblemClassificationDisplayName: to.Ptr("Batch"),
// ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid"),
// QuotaTicketDetails: &armsupport.QuotaTicketDetails{
// QuotaChangeRequestSubType: to.Ptr("Subscription"),
// QuotaChangeRequestVersion: to.Ptr("1.0"),
// QuotaChangeRequests: []*armsupport.QuotaChangeRequest{
// {
// Payload: to.Ptr("{\"NewLimit\":200,\"Type\":\"Account\"}"),
// Region: to.Ptr("EastUS"),
// }},
// },
// Require24X7Response: to.Ptr(false),
// ServiceDisplayName: to.Ptr("Service and subscription limits (quotas)"),
// ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_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{
// },
// SupportPlanDisplayName: to.Ptr("Premier"),
// SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="),
// SupportPlanType: to.Ptr("Premier"),
// SupportTicketID: to.Ptr("119120321001170"),
// Title: to.Ptr("my title"),
// },
// }
}
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 Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.
*
* @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSubscription.json
*/
async function createATicketToRequestQuotaIncreaseForBatchAccountsForASubscription() {
const subscriptionId =
process.env["SUPPORT_SUBSCRIPTION_ID"] || "132d901f-189d-4381-9214-fe68e27e05a1";
const supportTicketName = "testticket";
const createSupportTicketParameters = {
description: "my description",
advancedDiagnosticConsent: "Yes",
contactDetails: {
country: "usa",
firstName: "abc",
lastName: "xyz",
preferredContactMethod: "email",
preferredSupportLanguage: "en-US",
preferredTimeZone: "Pacific Standard Time",
primaryEmailAddress: "abc@contoso.com",
},
problemClassificationId:
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid",
quotaTicketDetails: {
quotaChangeRequestSubType: "Subscription",
quotaChangeRequestVersion: "1.0",
quotaChangeRequests: [{ payload: '{"NewLimit":200,"Type":"Account"}', region: "EastUS" }],
},
serviceId: "/providers/Microsoft.Support/services/quota_service_guid",
severity: "moderate",
supportPlanId:
"U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
title: "my title",
};
const credential = new DefaultAzureCredential();
const client = new MicrosoftSupport(credential, subscriptionId);
const result = await client.supportTickets.beginCreateAndWait(
supportTicketName,
createSupportTicketParameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Support.Models;
using Azure.ResourceManager.Support;
// Generated from example definition: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSubscription.json
// this example is just showing the usage of "SupportTickets_Create" 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 = "132d901f-189d-4381-9214-fe68e27e05a1";
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
// get the collection of this SubscriptionSupportTicketResource
SubscriptionSupportTicketCollection collection = subscriptionResource.GetSubscriptionSupportTickets();
// invoke the operation
string supportTicketName = "testticket";
SupportTicketData data = new SupportTicketData(
"my description",
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid",
SupportSeverityLevel.Moderate,
AdvancedDiagnosticConsent.Yes,
new SupportContactProfile(
"abc",
"xyz",
PreferredContactMethod.Email,
"abc@contoso.com",
"Pacific Standard Time",
"usa",
"en-US"),
"my title",
"/providers/Microsoft.Support/services/quota_service_guid")
{
SupportPlanId = "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
QuotaTicketDetails = new QuotaTicketDetails
{
QuotaChangeRequestSubType = "Subscription",
QuotaChangeRequestVersion = "1.0",
QuotaChangeRequests = {new SupportQuotaChangeContent
{
Region = "EastUS",
Payload = "{\"NewLimit\":200,\"Type\":\"Account\"}",
}},
},
};
ArmOperation<SubscriptionSupportTicketResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, supportTicketName, data);
SubscriptionSupportTicketResource result = lro.Value;
// the variable result 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 = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
示例响应
location: https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/operationResults/operationid?api-version=2024-04-01
azure-asyncoperation: https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/operationsStatus/operationid?api-version=2024-04-01
{
"id": "/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket",
"name": "testticket",
"type": "Microsoft.Support/supportTickets",
"properties": {
"supportTicketId": "119120321001170",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid",
"problemClassificationDisplayName": "Batch",
"severity": "moderate",
"require24X7Response": false,
"advancedDiagnosticConsent": "Yes",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"fileWorkspaceName": "testticket",
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"primaryEmailAddress": "abc@contoso.com",
"preferredTimeZone": "Pacific Standard Time",
"country": "usa",
"preferredSupportLanguage": "en-US"
},
"quotaTicketDetails": {
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequestSubType": "Subscription",
"quotaChangeRequests": [
{
"region": "EastUS",
"payload": "{\"NewLimit\":200,\"Type\":\"Account\"}"
}
]
},
"serviceLevelAgreement": {
"startTime": "2020-03-20T21:36:18Z",
"expirationTime": "2020-03-21T17:36:18Z",
"slaMinutes": 240
},
"supportEngineer": {
"emailAddress": null
},
"supportPlanType": "Premier",
"supportPlanDisplayName": "Premier",
"title": "my title",
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"serviceDisplayName": "Service and subscription limits (quotas)",
"status": "Open",
"createdDate": "2020-03-20T21:36:18Z",
"modifiedDate": "2020-03-20T21:36:23Z"
}
}
Create a ticket to request Quota increase for Compute VM Cores
示例请求
PUT https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket?api-version=2024-04-01
{
"properties": {
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"title": "my title",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cores_problemClassification_guid",
"severity": "moderate",
"advancedDiagnosticConsent": "Yes",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"primaryEmailAddress": "abc@contoso.com",
"preferredContactMethod": "email",
"preferredTimeZone": "Pacific Standard Time",
"preferredSupportLanguage": "en-US",
"country": "usa"
},
"quotaTicketDetails": {
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequests": [
{
"region": "EastUS",
"payload": "{\"SKU\":\"DSv3 Series\",\"NewLimit\":104}"
}
]
}
}
}
import com.azure.resourcemanager.support.models.Consent;
import com.azure.resourcemanager.support.models.ContactProfile;
import com.azure.resourcemanager.support.models.PreferredContactMethod;
import com.azure.resourcemanager.support.models.QuotaChangeRequest;
import com.azure.resourcemanager.support.models.QuotaTicketDetails;
import com.azure.resourcemanager.support.models.SeverityLevel;
import java.util.Arrays;
/**
* Samples for SupportTickets Create.
*/
public final class Main {
/*
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/
* CreateCoresQuotaTicketForSubscription.json
*/
/**
* Sample code: Create a ticket to request Quota increase for Compute VM Cores.
*
* @param manager Entry point to SupportManager.
*/
public static void
createATicketToRequestQuotaIncreaseForComputeVMCores(com.azure.resourcemanager.support.SupportManager manager) {
manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId(
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cores_problemClassification_guid")
.withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES)
.withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz")
.withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com")
.withPreferredTimeZone("Pacific Standard Time").withCountry("usa")
.withPreferredSupportLanguage("en-US"))
.withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid")
.withSupportPlanId(
"U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=")
.withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestVersion("1.0")
.withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest().withRegion("EastUS")
.withPayload("{\"SKU\":\"DSv3 Series\",\"NewLimit\":104}"))))
.create();
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.support import MicrosoftSupport
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-support
# USAGE
python create_cores_quota_ticket_for_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="132d901f-189d-4381-9214-fe68e27e05a1",
)
response = client.support_tickets.begin_create(
support_ticket_name="testticket",
create_support_ticket_parameters={
"properties": {
"advancedDiagnosticConsent": "Yes",
"contactDetails": {
"country": "usa",
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"preferredSupportLanguage": "en-US",
"preferredTimeZone": "Pacific Standard Time",
"primaryEmailAddress": "abc@contoso.com",
},
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cores_problemClassification_guid",
"quotaTicketDetails": {
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequests": [{"payload": '{"SKU":"DSv3 Series","NewLimit":104}', "region": "EastUS"}],
},
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"severity": "moderate",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"title": "my title",
}
},
).result()
print(response)
# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateCoresQuotaTicketForSubscription.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/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateCoresQuotaTicketForSubscription.json
func ExampleTicketsClient_BeginCreate_createATicketToRequestQuotaIncreaseForComputeVmCores() {
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)
}
poller, err := clientFactory.NewTicketsClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{
Properties: &armsupport.TicketDetailsProperties{
Description: to.Ptr("my description"),
AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes),
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"),
},
ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cores_problemClassification_guid"),
QuotaTicketDetails: &armsupport.QuotaTicketDetails{
QuotaChangeRequestVersion: to.Ptr("1.0"),
QuotaChangeRequests: []*armsupport.QuotaChangeRequest{
{
Payload: to.Ptr("{\"SKU\":\"DSv3 Series\",\"NewLimit\":104}"),
Region: to.Ptr("EastUS"),
}},
},
ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"),
Severity: to.Ptr(armsupport.SeverityLevelModerate),
SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="),
Title: to.Ptr("my title"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.TicketDetails = armsupport.TicketDetails{
// Name: to.Ptr("testticket"),
// Type: to.Ptr("Microsoft.Support/supportTickets"),
// ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"),
// Properties: &armsupport.TicketDetailsProperties{
// Description: to.Ptr("my description"),
// AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes),
// 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}()),
// FileWorkspaceName: to.Ptr("testticket"),
// ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()),
// ProblemClassificationDisplayName: to.Ptr("Compute-VM (cores-vCPUs) subscription limit increases"),
// ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cores_problemClassification_guid"),
// QuotaTicketDetails: &armsupport.QuotaTicketDetails{
// QuotaChangeRequestVersion: to.Ptr("1.0"),
// QuotaChangeRequests: []*armsupport.QuotaChangeRequest{
// {
// Payload: to.Ptr("{\"VmFamily\":\"DSv3 Series\",\"NewLimit\":104}"),
// Region: to.Ptr("EastUS"),
// }},
// },
// Require24X7Response: to.Ptr(false),
// ServiceDisplayName: to.Ptr("Service and subscription limits (quotas)"),
// ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_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{
// },
// SupportPlanDisplayName: to.Ptr("Premier"),
// SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="),
// SupportPlanType: to.Ptr("Premier"),
// SupportTicketID: to.Ptr("119120321001170"),
// Title: to.Ptr("my title"),
// },
// }
}
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 Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.
*
* @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateCoresQuotaTicketForSubscription.json
*/
async function createATicketToRequestQuotaIncreaseForComputeVMCores() {
const subscriptionId =
process.env["SUPPORT_SUBSCRIPTION_ID"] || "132d901f-189d-4381-9214-fe68e27e05a1";
const supportTicketName = "testticket";
const createSupportTicketParameters = {
description: "my description",
advancedDiagnosticConsent: "Yes",
contactDetails: {
country: "usa",
firstName: "abc",
lastName: "xyz",
preferredContactMethod: "email",
preferredSupportLanguage: "en-US",
preferredTimeZone: "Pacific Standard Time",
primaryEmailAddress: "abc@contoso.com",
},
problemClassificationId:
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cores_problemClassification_guid",
quotaTicketDetails: {
quotaChangeRequestVersion: "1.0",
quotaChangeRequests: [{ payload: '{"SKU":"DSv3 Series","NewLimit":104}', region: "EastUS" }],
},
serviceId: "/providers/Microsoft.Support/services/quota_service_guid",
severity: "moderate",
supportPlanId:
"U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
title: "my title",
};
const credential = new DefaultAzureCredential();
const client = new MicrosoftSupport(credential, subscriptionId);
const result = await client.supportTickets.beginCreateAndWait(
supportTicketName,
createSupportTicketParameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Support.Models;
using Azure.ResourceManager.Support;
// Generated from example definition: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateCoresQuotaTicketForSubscription.json
// this example is just showing the usage of "SupportTickets_Create" 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 = "132d901f-189d-4381-9214-fe68e27e05a1";
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
// get the collection of this SubscriptionSupportTicketResource
SubscriptionSupportTicketCollection collection = subscriptionResource.GetSubscriptionSupportTickets();
// invoke the operation
string supportTicketName = "testticket";
SupportTicketData data = new SupportTicketData(
"my description",
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cores_problemClassification_guid",
SupportSeverityLevel.Moderate,
AdvancedDiagnosticConsent.Yes,
new SupportContactProfile(
"abc",
"xyz",
PreferredContactMethod.Email,
"abc@contoso.com",
"Pacific Standard Time",
"usa",
"en-US"),
"my title",
"/providers/Microsoft.Support/services/quota_service_guid")
{
SupportPlanId = "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
QuotaTicketDetails = new QuotaTicketDetails
{
QuotaChangeRequestVersion = "1.0",
QuotaChangeRequests = {new SupportQuotaChangeContent
{
Region = "EastUS",
Payload = "{\"SKU\":\"DSv3 Series\",\"NewLimit\":104}",
}},
},
};
ArmOperation<SubscriptionSupportTicketResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, supportTicketName, data);
SubscriptionSupportTicketResource result = lro.Value;
// the variable result 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 = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
示例响应
location: https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/operationResults/operationid?api-version=2024-04-01
azure-asyncoperation: https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/operationsStatus/operationid?api-version=2024-04-01
{
"id": "/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket",
"name": "testticket",
"type": "Microsoft.Support/supportTickets",
"properties": {
"supportTicketId": "119120321001170",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cores_problemClassification_guid",
"problemClassificationDisplayName": "Compute-VM (cores-vCPUs) subscription limit increases",
"severity": "moderate",
"require24X7Response": false,
"advancedDiagnosticConsent": "Yes",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"fileWorkspaceName": "testticket",
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"primaryEmailAddress": "abc@contoso.com",
"preferredTimeZone": "Pacific Standard Time",
"country": "usa",
"preferredSupportLanguage": "en-US"
},
"quotaTicketDetails": {
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequests": [
{
"region": "EastUS",
"payload": "{\"VmFamily\":\"DSv3 Series\",\"NewLimit\":104}"
}
]
},
"serviceLevelAgreement": {
"startTime": "2020-03-20T21:36:18Z",
"expirationTime": "2020-03-21T17:36:18Z",
"slaMinutes": 240
},
"supportEngineer": {
"emailAddress": null
},
"supportPlanType": "Premier",
"supportPlanDisplayName": "Premier",
"title": "my title",
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"serviceDisplayName": "Service and subscription limits (quotas)",
"status": "Open",
"createdDate": "2020-03-20T21:36:18Z",
"modifiedDate": "2020-03-20T21:36:23Z"
}
}
Create a ticket to request Quota increase for DTUs for Azure Synapse Analytics
示例请求
PUT https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket?api-version=2024-04-01
{
"properties": {
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"title": "my title",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid",
"severity": "moderate",
"advancedDiagnosticConsent": "Yes",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"primaryEmailAddress": "abc@contoso.com",
"preferredContactMethod": "email",
"preferredTimeZone": "Pacific Standard Time",
"preferredSupportLanguage": "en-US",
"country": "usa"
},
"quotaTicketDetails": {
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequestSubType": "DTUs",
"quotaChangeRequests": [
{
"region": "EastUS",
"payload": "{\"ServerName\":\"testserver\",\"NewLimit\":54000}"
}
]
}
}
}
import com.azure.resourcemanager.support.models.Consent;
import com.azure.resourcemanager.support.models.ContactProfile;
import com.azure.resourcemanager.support.models.PreferredContactMethod;
import com.azure.resourcemanager.support.models.QuotaChangeRequest;
import com.azure.resourcemanager.support.models.QuotaTicketDetails;
import com.azure.resourcemanager.support.models.SeverityLevel;
import java.util.Arrays;
/**
* Samples for SupportTickets Create.
*/
public final class Main {
/*
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/
* CreateSqlDatawarehouseQuotaTicketForDTUs.json
*/
/**
* Sample code: Create a ticket to request Quota increase for DTUs for Azure Synapse Analytics.
*
* @param manager Entry point to SupportManager.
*/
public static void createATicketToRequestQuotaIncreaseForDTUsForAzureSynapseAnalytics(
com.azure.resourcemanager.support.SupportManager manager) {
manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId(
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid")
.withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES)
.withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz")
.withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com")
.withPreferredTimeZone("Pacific Standard Time").withCountry("usa")
.withPreferredSupportLanguage("en-US"))
.withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid")
.withSupportPlanId(
"U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=")
.withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("DTUs")
.withQuotaChangeRequestVersion("1.0").withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest()
.withRegion("EastUS").withPayload("{\"ServerName\":\"testserver\",\"NewLimit\":54000}"))))
.create();
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.support import MicrosoftSupport
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-support
# USAGE
python create_sql_datawarehouse_quota_ticket_for_dtus.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="132d901f-189d-4381-9214-fe68e27e05a1",
)
response = client.support_tickets.begin_create(
support_ticket_name="testticket",
create_support_ticket_parameters={
"properties": {
"advancedDiagnosticConsent": "Yes",
"contactDetails": {
"country": "usa",
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"preferredSupportLanguage": "en-US",
"preferredTimeZone": "Pacific Standard Time",
"primaryEmailAddress": "abc@contoso.com",
},
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid",
"quotaTicketDetails": {
"quotaChangeRequestSubType": "DTUs",
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequests": [
{"payload": '{"ServerName":"testserver","NewLimit":54000}', "region": "EastUS"}
],
},
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"severity": "moderate",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"title": "my title",
}
},
).result()
print(response)
# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlDatawarehouseQuotaTicketForDTUs.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/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlDatawarehouseQuotaTicketForDTUs.json
func ExampleTicketsClient_BeginCreate_createATicketToRequestQuotaIncreaseForDtUsForAzureSynapseAnalytics() {
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)
}
poller, err := clientFactory.NewTicketsClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{
Properties: &armsupport.TicketDetailsProperties{
Description: to.Ptr("my description"),
AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes),
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"),
},
ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid"),
QuotaTicketDetails: &armsupport.QuotaTicketDetails{
QuotaChangeRequestSubType: to.Ptr("DTUs"),
QuotaChangeRequestVersion: to.Ptr("1.0"),
QuotaChangeRequests: []*armsupport.QuotaChangeRequest{
{
Payload: to.Ptr("{\"ServerName\":\"testserver\",\"NewLimit\":54000}"),
Region: to.Ptr("EastUS"),
}},
},
ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"),
Severity: to.Ptr(armsupport.SeverityLevelModerate),
SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="),
Title: to.Ptr("my title"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.TicketDetails = armsupport.TicketDetails{
// Name: to.Ptr("testticket"),
// Type: to.Ptr("Microsoft.Support/supportTickets"),
// ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"),
// Properties: &armsupport.TicketDetailsProperties{
// Description: to.Ptr("my description"),
// AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes),
// 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}()),
// FileWorkspaceName: to.Ptr("testticket"),
// ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()),
// ProblemClassificationDisplayName: to.Ptr("SQL Data Warehouse"),
// ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid"),
// QuotaTicketDetails: &armsupport.QuotaTicketDetails{
// QuotaChangeRequestSubType: to.Ptr("DTUs"),
// QuotaChangeRequestVersion: to.Ptr("1.0"),
// QuotaChangeRequests: []*armsupport.QuotaChangeRequest{
// {
// Payload: to.Ptr("{\"ServerName\":\"testserver\",\"NewLimit\":54000}"),
// Region: to.Ptr("EastUS"),
// }},
// },
// Require24X7Response: to.Ptr(false),
// ServiceDisplayName: to.Ptr("Service and subscription limits (quotas)"),
// ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_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{
// },
// SupportPlanDisplayName: to.Ptr("Premier"),
// SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="),
// SupportPlanType: to.Ptr("Premier"),
// SupportTicketID: to.Ptr("119120321001170"),
// Title: to.Ptr("my title"),
// },
// }
}
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 Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.
*
* @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlDatawarehouseQuotaTicketForDTUs.json
*/
async function createATicketToRequestQuotaIncreaseForDtUsForAzureSynapseAnalytics() {
const subscriptionId =
process.env["SUPPORT_SUBSCRIPTION_ID"] || "132d901f-189d-4381-9214-fe68e27e05a1";
const supportTicketName = "testticket";
const createSupportTicketParameters = {
description: "my description",
advancedDiagnosticConsent: "Yes",
contactDetails: {
country: "usa",
firstName: "abc",
lastName: "xyz",
preferredContactMethod: "email",
preferredSupportLanguage: "en-US",
preferredTimeZone: "Pacific Standard Time",
primaryEmailAddress: "abc@contoso.com",
},
problemClassificationId:
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid",
quotaTicketDetails: {
quotaChangeRequestSubType: "DTUs",
quotaChangeRequestVersion: "1.0",
quotaChangeRequests: [
{
payload: '{"ServerName":"testserver","NewLimit":54000}',
region: "EastUS",
},
],
},
serviceId: "/providers/Microsoft.Support/services/quota_service_guid",
severity: "moderate",
supportPlanId:
"U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
title: "my title",
};
const credential = new DefaultAzureCredential();
const client = new MicrosoftSupport(credential, subscriptionId);
const result = await client.supportTickets.beginCreateAndWait(
supportTicketName,
createSupportTicketParameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Support.Models;
using Azure.ResourceManager.Support;
// Generated from example definition: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlDatawarehouseQuotaTicketForDTUs.json
// this example is just showing the usage of "SupportTickets_Create" 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 = "132d901f-189d-4381-9214-fe68e27e05a1";
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
// get the collection of this SubscriptionSupportTicketResource
SubscriptionSupportTicketCollection collection = subscriptionResource.GetSubscriptionSupportTickets();
// invoke the operation
string supportTicketName = "testticket";
SupportTicketData data = new SupportTicketData(
"my description",
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid",
SupportSeverityLevel.Moderate,
AdvancedDiagnosticConsent.Yes,
new SupportContactProfile(
"abc",
"xyz",
PreferredContactMethod.Email,
"abc@contoso.com",
"Pacific Standard Time",
"usa",
"en-US"),
"my title",
"/providers/Microsoft.Support/services/quota_service_guid")
{
SupportPlanId = "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
QuotaTicketDetails = new QuotaTicketDetails
{
QuotaChangeRequestSubType = "DTUs",
QuotaChangeRequestVersion = "1.0",
QuotaChangeRequests = {new SupportQuotaChangeContent
{
Region = "EastUS",
Payload = "{\"ServerName\":\"testserver\",\"NewLimit\":54000}",
}},
},
};
ArmOperation<SubscriptionSupportTicketResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, supportTicketName, data);
SubscriptionSupportTicketResource result = lro.Value;
// the variable result 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 = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
示例响应
location: https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/operationResults/operationid?api-version=2024-04-01
azure-asyncoperation: https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/operationsStatus/operationid?api-version=2024-04-01
{
"id": "/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket",
"name": "testticket",
"type": "Microsoft.Support/supportTickets",
"properties": {
"supportTicketId": "119120321001170",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid",
"problemClassificationDisplayName": "SQL Data Warehouse",
"severity": "moderate",
"require24X7Response": false,
"advancedDiagnosticConsent": "Yes",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"fileWorkspaceName": "testticket",
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"primaryEmailAddress": "abc@contoso.com",
"preferredTimeZone": "Pacific Standard Time",
"country": "usa",
"preferredSupportLanguage": "en-US"
},
"quotaTicketDetails": {
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequestSubType": "DTUs",
"quotaChangeRequests": [
{
"region": "EastUS",
"payload": "{\"ServerName\":\"testserver\",\"NewLimit\":54000}"
}
]
},
"serviceLevelAgreement": {
"startTime": "2020-03-20T21:36:18Z",
"expirationTime": "2020-03-21T17:36:18Z",
"slaMinutes": 240
},
"supportEngineer": {
"emailAddress": null
},
"supportPlanType": "Premier",
"supportPlanDisplayName": "Premier",
"title": "my title",
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"serviceDisplayName": "Service and subscription limits (quotas)",
"status": "Open",
"createdDate": "2020-03-20T21:36:18Z",
"modifiedDate": "2020-03-20T21:36:23Z"
}
}
Create a ticket to request Quota increase for DTUs for SQL Database
示例请求
PUT https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket?api-version=2024-04-01
{
"properties": {
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"title": "my title",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid",
"severity": "moderate",
"advancedDiagnosticConsent": "Yes",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"primaryEmailAddress": "abc@contoso.com",
"preferredContactMethod": "email",
"preferredTimeZone": "Pacific Standard Time",
"preferredSupportLanguage": "en-US",
"country": "usa"
},
"quotaTicketDetails": {
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequestSubType": "DTUs",
"quotaChangeRequests": [
{
"region": "EastUS",
"payload": "{\"ServerName\":\"testserver\",\"NewLimit\":54000}"
}
]
}
}
}
import com.azure.resourcemanager.support.models.Consent;
import com.azure.resourcemanager.support.models.ContactProfile;
import com.azure.resourcemanager.support.models.PreferredContactMethod;
import com.azure.resourcemanager.support.models.QuotaChangeRequest;
import com.azure.resourcemanager.support.models.QuotaTicketDetails;
import com.azure.resourcemanager.support.models.SeverityLevel;
import java.util.Arrays;
/**
* Samples for SupportTickets Create.
*/
public final class Main {
/*
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/
* CreateSqlDatabaseQuotaTicketForDTUs.json
*/
/**
* Sample code: Create a ticket to request Quota increase for DTUs for SQL Database.
*
* @param manager Entry point to SupportManager.
*/
public static void createATicketToRequestQuotaIncreaseForDTUsForSQLDatabase(
com.azure.resourcemanager.support.SupportManager manager) {
manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId(
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid")
.withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES)
.withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz")
.withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com")
.withPreferredTimeZone("Pacific Standard Time").withCountry("usa")
.withPreferredSupportLanguage("en-US"))
.withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid")
.withSupportPlanId(
"U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=")
.withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("DTUs")
.withQuotaChangeRequestVersion("1.0").withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest()
.withRegion("EastUS").withPayload("{\"ServerName\":\"testserver\",\"NewLimit\":54000}"))))
.create();
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.support import MicrosoftSupport
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-support
# USAGE
python create_sql_database_quota_ticket_for_dtus.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="132d901f-189d-4381-9214-fe68e27e05a1",
)
response = client.support_tickets.begin_create(
support_ticket_name="testticket",
create_support_ticket_parameters={
"properties": {
"advancedDiagnosticConsent": "Yes",
"contactDetails": {
"country": "usa",
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"preferredSupportLanguage": "en-US",
"preferredTimeZone": "Pacific Standard Time",
"primaryEmailAddress": "abc@contoso.com",
},
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid",
"quotaTicketDetails": {
"quotaChangeRequestSubType": "DTUs",
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequests": [
{"payload": '{"ServerName":"testserver","NewLimit":54000}', "region": "EastUS"}
],
},
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"severity": "moderate",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"title": "my title",
}
},
).result()
print(response)
# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlDatabaseQuotaTicketForDTUs.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/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlDatabaseQuotaTicketForDTUs.json
func ExampleTicketsClient_BeginCreate_createATicketToRequestQuotaIncreaseForDtUsForSqlDatabase() {
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)
}
poller, err := clientFactory.NewTicketsClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{
Properties: &armsupport.TicketDetailsProperties{
Description: to.Ptr("my description"),
AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes),
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"),
},
ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid"),
QuotaTicketDetails: &armsupport.QuotaTicketDetails{
QuotaChangeRequestSubType: to.Ptr("DTUs"),
QuotaChangeRequestVersion: to.Ptr("1.0"),
QuotaChangeRequests: []*armsupport.QuotaChangeRequest{
{
Payload: to.Ptr("{\"ServerName\":\"testserver\",\"NewLimit\":54000}"),
Region: to.Ptr("EastUS"),
}},
},
ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"),
Severity: to.Ptr(armsupport.SeverityLevelModerate),
SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="),
Title: to.Ptr("my title"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.TicketDetails = armsupport.TicketDetails{
// Name: to.Ptr("testticket"),
// Type: to.Ptr("Microsoft.Support/supportTickets"),
// ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"),
// Properties: &armsupport.TicketDetailsProperties{
// Description: to.Ptr("my description"),
// AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes),
// 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}()),
// FileWorkspaceName: to.Ptr("testticket"),
// ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()),
// ProblemClassificationDisplayName: to.Ptr("SQL database"),
// ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid"),
// QuotaTicketDetails: &armsupport.QuotaTicketDetails{
// QuotaChangeRequestSubType: to.Ptr("DTUs"),
// QuotaChangeRequestVersion: to.Ptr("1.0"),
// QuotaChangeRequests: []*armsupport.QuotaChangeRequest{
// {
// Payload: to.Ptr("{\"ServerName\":\"testserver\",\"NewLimit\":54000}"),
// Region: to.Ptr("EastUS"),
// }},
// },
// Require24X7Response: to.Ptr(false),
// ServiceDisplayName: to.Ptr("Service and subscription limits (quotas)"),
// ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_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{
// },
// SupportPlanDisplayName: to.Ptr("Premier"),
// SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="),
// SupportPlanType: to.Ptr("Premier"),
// SupportTicketID: to.Ptr("119120321001170"),
// Title: to.Ptr("my title"),
// },
// }
}
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 Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.
*
* @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlDatabaseQuotaTicketForDTUs.json
*/
async function createATicketToRequestQuotaIncreaseForDtUsForSqlDatabase() {
const subscriptionId =
process.env["SUPPORT_SUBSCRIPTION_ID"] || "132d901f-189d-4381-9214-fe68e27e05a1";
const supportTicketName = "testticket";
const createSupportTicketParameters = {
description: "my description",
advancedDiagnosticConsent: "Yes",
contactDetails: {
country: "usa",
firstName: "abc",
lastName: "xyz",
preferredContactMethod: "email",
preferredSupportLanguage: "en-US",
preferredTimeZone: "Pacific Standard Time",
primaryEmailAddress: "abc@contoso.com",
},
problemClassificationId:
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid",
quotaTicketDetails: {
quotaChangeRequestSubType: "DTUs",
quotaChangeRequestVersion: "1.0",
quotaChangeRequests: [
{
payload: '{"ServerName":"testserver","NewLimit":54000}',
region: "EastUS",
},
],
},
serviceId: "/providers/Microsoft.Support/services/quota_service_guid",
severity: "moderate",
supportPlanId:
"U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
title: "my title",
};
const credential = new DefaultAzureCredential();
const client = new MicrosoftSupport(credential, subscriptionId);
const result = await client.supportTickets.beginCreateAndWait(
supportTicketName,
createSupportTicketParameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Support.Models;
using Azure.ResourceManager.Support;
// Generated from example definition: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlDatabaseQuotaTicketForDTUs.json
// this example is just showing the usage of "SupportTickets_Create" 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 = "132d901f-189d-4381-9214-fe68e27e05a1";
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
// get the collection of this SubscriptionSupportTicketResource
SubscriptionSupportTicketCollection collection = subscriptionResource.GetSubscriptionSupportTickets();
// invoke the operation
string supportTicketName = "testticket";
SupportTicketData data = new SupportTicketData(
"my description",
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid",
SupportSeverityLevel.Moderate,
AdvancedDiagnosticConsent.Yes,
new SupportContactProfile(
"abc",
"xyz",
PreferredContactMethod.Email,
"abc@contoso.com",
"Pacific Standard Time",
"usa",
"en-US"),
"my title",
"/providers/Microsoft.Support/services/quota_service_guid")
{
SupportPlanId = "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
QuotaTicketDetails = new QuotaTicketDetails
{
QuotaChangeRequestSubType = "DTUs",
QuotaChangeRequestVersion = "1.0",
QuotaChangeRequests = {new SupportQuotaChangeContent
{
Region = "EastUS",
Payload = "{\"ServerName\":\"testserver\",\"NewLimit\":54000}",
}},
},
};
ArmOperation<SubscriptionSupportTicketResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, supportTicketName, data);
SubscriptionSupportTicketResource result = lro.Value;
// the variable result 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 = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
示例响应
location: https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/operationResults/operationid?api-version=2024-04-01
azure-asyncoperation: https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/operationsStatus/operationid?api-version=2024-04-01
{
"id": "/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket",
"name": "testticket",
"type": "Microsoft.Support/supportTickets",
"properties": {
"supportTicketId": "119120321001170",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid",
"problemClassificationDisplayName": "SQL database",
"severity": "moderate",
"require24X7Response": false,
"advancedDiagnosticConsent": "Yes",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"fileWorkspaceName": "testticket",
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"primaryEmailAddress": "abc@contoso.com",
"preferredTimeZone": "Pacific Standard Time",
"country": "usa",
"preferredSupportLanguage": "en-US"
},
"quotaTicketDetails": {
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequestSubType": "DTUs",
"quotaChangeRequests": [
{
"region": "EastUS",
"payload": "{\"ServerName\":\"testserver\",\"NewLimit\":54000}"
}
]
},
"serviceLevelAgreement": {
"startTime": "2020-03-20T21:36:18Z",
"expirationTime": "2020-03-21T17:36:18Z",
"slaMinutes": 240
},
"supportEngineer": {
"emailAddress": null
},
"supportPlanType": "Premier",
"supportPlanDisplayName": "Premier",
"title": "my title",
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"serviceDisplayName": "Service and subscription limits (quotas)",
"status": "Open",
"createdDate": "2020-03-20T21:36:18Z",
"modifiedDate": "2020-03-20T21:36:23Z"
}
}
Create a ticket to request Quota increase for Low-priority cores for a Batch account
示例请求
PUT https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket?api-version=2024-04-01
{
"properties": {
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"title": "my title",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid",
"severity": "moderate",
"advancedDiagnosticConsent": "Yes",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"primaryEmailAddress": "abc@contoso.com",
"preferredContactMethod": "email",
"preferredTimeZone": "Pacific Standard Time",
"preferredSupportLanguage": "en-US",
"country": "usa"
},
"quotaTicketDetails": {
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequestSubType": "Account",
"quotaChangeRequests": [
{
"region": "EastUS",
"payload": "{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"LowPriority\"}"
}
]
}
}
}
import com.azure.resourcemanager.support.models.Consent;
import com.azure.resourcemanager.support.models.ContactProfile;
import com.azure.resourcemanager.support.models.PreferredContactMethod;
import com.azure.resourcemanager.support.models.QuotaChangeRequest;
import com.azure.resourcemanager.support.models.QuotaTicketDetails;
import com.azure.resourcemanager.support.models.SeverityLevel;
import java.util.Arrays;
/**
* Samples for SupportTickets Create.
*/
public final class Main {
/*
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/
* CreateBatchQuotaTicketForSpecificBatchAccountForLowPriorityCores.json
*/
/**
* Sample code: Create a ticket to request Quota increase for Low-priority cores for a Batch account.
*
* @param manager Entry point to SupportManager.
*/
public static void createATicketToRequestQuotaIncreaseForLowPriorityCoresForABatchAccount(
com.azure.resourcemanager.support.SupportManager manager) {
manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId(
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid")
.withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES)
.withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz")
.withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com")
.withPreferredTimeZone("Pacific Standard Time").withCountry("usa")
.withPreferredSupportLanguage("en-US"))
.withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid")
.withSupportPlanId(
"U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=")
.withQuotaTicketDetails(
new QuotaTicketDetails().withQuotaChangeRequestSubType("Account").withQuotaChangeRequestVersion("1.0")
.withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest().withRegion("EastUS")
.withPayload("{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"LowPriority\"}"))))
.create();
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.support import MicrosoftSupport
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-support
# USAGE
python create_batch_quota_ticket_for_specific_batch_account_for_low_priority_cores.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="132d901f-189d-4381-9214-fe68e27e05a1",
)
response = client.support_tickets.begin_create(
support_ticket_name="testticket",
create_support_ticket_parameters={
"properties": {
"advancedDiagnosticConsent": "Yes",
"contactDetails": {
"country": "usa",
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"preferredSupportLanguage": "en-US",
"preferredTimeZone": "Pacific Standard Time",
"primaryEmailAddress": "abc@contoso.com",
},
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid",
"quotaTicketDetails": {
"quotaChangeRequestSubType": "Account",
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequests": [
{"payload": '{"AccountName":"test","NewLimit":200,"Type":"LowPriority"}', "region": "EastUS"}
],
},
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"severity": "moderate",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"title": "my title",
}
},
).result()
print(response)
# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForLowPriorityCores.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/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForLowPriorityCores.json
func ExampleTicketsClient_BeginCreate_createATicketToRequestQuotaIncreaseForLowPriorityCoresForABatchAccount() {
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)
}
poller, err := clientFactory.NewTicketsClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{
Properties: &armsupport.TicketDetailsProperties{
Description: to.Ptr("my description"),
AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes),
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"),
},
ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid"),
QuotaTicketDetails: &armsupport.QuotaTicketDetails{
QuotaChangeRequestSubType: to.Ptr("Account"),
QuotaChangeRequestVersion: to.Ptr("1.0"),
QuotaChangeRequests: []*armsupport.QuotaChangeRequest{
{
Payload: to.Ptr("{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"LowPriority\"}"),
Region: to.Ptr("EastUS"),
}},
},
ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"),
Severity: to.Ptr(armsupport.SeverityLevelModerate),
SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="),
Title: to.Ptr("my title"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.TicketDetails = armsupport.TicketDetails{
// Name: to.Ptr("testticket"),
// Type: to.Ptr("Microsoft.Support/supportTickets"),
// ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"),
// Properties: &armsupport.TicketDetailsProperties{
// Description: to.Ptr("my description"),
// AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes),
// 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}()),
// FileWorkspaceName: to.Ptr("testticket"),
// ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()),
// ProblemClassificationDisplayName: to.Ptr("Batch"),
// ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid"),
// QuotaTicketDetails: &armsupport.QuotaTicketDetails{
// QuotaChangeRequestSubType: to.Ptr("Account"),
// QuotaChangeRequestVersion: to.Ptr("1.0"),
// QuotaChangeRequests: []*armsupport.QuotaChangeRequest{
// {
// Payload: to.Ptr("{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"LowPriority\"}"),
// Region: to.Ptr("EastUS"),
// }},
// },
// Require24X7Response: to.Ptr(false),
// ServiceDisplayName: to.Ptr("Service and subscription limits (quotas)"),
// ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_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{
// },
// SupportPlanDisplayName: to.Ptr("Premier"),
// SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="),
// SupportPlanType: to.Ptr("Premier"),
// SupportTicketID: to.Ptr("119120321001170"),
// Title: to.Ptr("my title"),
// },
// }
}
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 Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.
*
* @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForLowPriorityCores.json
*/
async function createATicketToRequestQuotaIncreaseForLowPriorityCoresForABatchAccount() {
const subscriptionId =
process.env["SUPPORT_SUBSCRIPTION_ID"] || "132d901f-189d-4381-9214-fe68e27e05a1";
const supportTicketName = "testticket";
const createSupportTicketParameters = {
description: "my description",
advancedDiagnosticConsent: "Yes",
contactDetails: {
country: "usa",
firstName: "abc",
lastName: "xyz",
preferredContactMethod: "email",
preferredSupportLanguage: "en-US",
preferredTimeZone: "Pacific Standard Time",
primaryEmailAddress: "abc@contoso.com",
},
problemClassificationId:
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid",
quotaTicketDetails: {
quotaChangeRequestSubType: "Account",
quotaChangeRequestVersion: "1.0",
quotaChangeRequests: [
{
payload: '{"AccountName":"test","NewLimit":200,"Type":"LowPriority"}',
region: "EastUS",
},
],
},
serviceId: "/providers/Microsoft.Support/services/quota_service_guid",
severity: "moderate",
supportPlanId:
"U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
title: "my title",
};
const credential = new DefaultAzureCredential();
const client = new MicrosoftSupport(credential, subscriptionId);
const result = await client.supportTickets.beginCreateAndWait(
supportTicketName,
createSupportTicketParameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Support.Models;
using Azure.ResourceManager.Support;
// Generated from example definition: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForLowPriorityCores.json
// this example is just showing the usage of "SupportTickets_Create" 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 = "132d901f-189d-4381-9214-fe68e27e05a1";
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
// get the collection of this SubscriptionSupportTicketResource
SubscriptionSupportTicketCollection collection = subscriptionResource.GetSubscriptionSupportTickets();
// invoke the operation
string supportTicketName = "testticket";
SupportTicketData data = new SupportTicketData(
"my description",
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid",
SupportSeverityLevel.Moderate,
AdvancedDiagnosticConsent.Yes,
new SupportContactProfile(
"abc",
"xyz",
PreferredContactMethod.Email,
"abc@contoso.com",
"Pacific Standard Time",
"usa",
"en-US"),
"my title",
"/providers/Microsoft.Support/services/quota_service_guid")
{
SupportPlanId = "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
QuotaTicketDetails = new QuotaTicketDetails
{
QuotaChangeRequestSubType = "Account",
QuotaChangeRequestVersion = "1.0",
QuotaChangeRequests = {new SupportQuotaChangeContent
{
Region = "EastUS",
Payload = "{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"LowPriority\"}",
}},
},
};
ArmOperation<SubscriptionSupportTicketResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, supportTicketName, data);
SubscriptionSupportTicketResource result = lro.Value;
// the variable result 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 = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
示例响应
location: https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/operationResults/operationid?api-version=2024-04-01
azure-asyncoperation: https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/operationsStatus/operationid?api-version=2024-04-01
{
"id": "/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket",
"name": "testticket",
"type": "Microsoft.Support/supportTickets",
"properties": {
"supportTicketId": "119120321001170",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid",
"problemClassificationDisplayName": "Batch",
"severity": "moderate",
"require24X7Response": false,
"advancedDiagnosticConsent": "Yes",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"fileWorkspaceName": "testticket",
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"primaryEmailAddress": "abc@contoso.com",
"preferredTimeZone": "Pacific Standard Time",
"country": "usa",
"preferredSupportLanguage": "en-US"
},
"quotaTicketDetails": {
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequestSubType": "Account",
"quotaChangeRequests": [
{
"region": "EastUS",
"payload": "{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"LowPriority\"}"
}
]
},
"serviceLevelAgreement": {
"startTime": "2020-03-20T21:36:18Z",
"expirationTime": "2020-03-21T17:36:18Z",
"slaMinutes": 240
},
"supportEngineer": {
"emailAddress": null
},
"supportPlanType": "Premier",
"supportPlanDisplayName": "Premier",
"title": "my title",
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"serviceDisplayName": "Service and subscription limits (quotas)",
"status": "Open",
"createdDate": "2020-03-20T21:36:18Z",
"modifiedDate": "2020-03-20T21:36:23Z"
}
}
Create a ticket to request Quota increase for Low-priority cores for Machine Learning service
示例请求
PUT https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket?api-version=2024-04-01
{
"properties": {
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"title": "my title",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid",
"severity": "moderate",
"advancedDiagnosticConsent": "Yes",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"primaryEmailAddress": "abc@contoso.com",
"preferredContactMethod": "email",
"preferredTimeZone": "Pacific Standard Time",
"preferredSupportLanguage": "en-US",
"country": "usa"
},
"quotaTicketDetails": {
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequestSubType": "BatchAml",
"quotaChangeRequests": [
{
"region": "EastUS",
"payload": "{\"NewLimit\":200,\"Type\":\"LowPriority\"}"
}
]
}
}
}
import com.azure.resourcemanager.support.models.Consent;
import com.azure.resourcemanager.support.models.ContactProfile;
import com.azure.resourcemanager.support.models.PreferredContactMethod;
import com.azure.resourcemanager.support.models.QuotaChangeRequest;
import com.azure.resourcemanager.support.models.QuotaTicketDetails;
import com.azure.resourcemanager.support.models.SeverityLevel;
import java.util.Arrays;
/**
* Samples for SupportTickets Create.
*/
public final class Main {
/*
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/
* CreateMachineLearningQuotaTicketForLowPriorityCores.json
*/
/**
* Sample code: Create a ticket to request Quota increase for Low-priority cores for Machine Learning service.
*
* @param manager Entry point to SupportManager.
*/
public static void createATicketToRequestQuotaIncreaseForLowPriorityCoresForMachineLearningService(
com.azure.resourcemanager.support.SupportManager manager) {
manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId(
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid")
.withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES)
.withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz")
.withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com")
.withPreferredTimeZone("Pacific Standard Time").withCountry("usa")
.withPreferredSupportLanguage("en-US"))
.withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid")
.withSupportPlanId(
"U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=")
.withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("BatchAml")
.withQuotaChangeRequestVersion("1.0").withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest()
.withRegion("EastUS").withPayload("{\"NewLimit\":200,\"Type\":\"LowPriority\"}"))))
.create();
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.support import MicrosoftSupport
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-support
# USAGE
python create_machine_learning_quota_ticket_for_low_priority_cores.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="132d901f-189d-4381-9214-fe68e27e05a1",
)
response = client.support_tickets.begin_create(
support_ticket_name="testticket",
create_support_ticket_parameters={
"properties": {
"advancedDiagnosticConsent": "Yes",
"contactDetails": {
"country": "usa",
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"preferredSupportLanguage": "en-US",
"preferredTimeZone": "Pacific Standard Time",
"primaryEmailAddress": "abc@contoso.com",
},
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid",
"quotaTicketDetails": {
"quotaChangeRequestSubType": "BatchAml",
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequests": [{"payload": '{"NewLimit":200,"Type":"LowPriority"}', "region": "EastUS"}],
},
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"severity": "moderate",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"title": "my title",
}
},
).result()
print(response)
# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateMachineLearningQuotaTicketForLowPriorityCores.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/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateMachineLearningQuotaTicketForLowPriorityCores.json
func ExampleTicketsClient_BeginCreate_createATicketToRequestQuotaIncreaseForLowPriorityCoresForMachineLearningService() {
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)
}
poller, err := clientFactory.NewTicketsClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{
Properties: &armsupport.TicketDetailsProperties{
Description: to.Ptr("my description"),
AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes),
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"),
},
ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid"),
QuotaTicketDetails: &armsupport.QuotaTicketDetails{
QuotaChangeRequestSubType: to.Ptr("BatchAml"),
QuotaChangeRequestVersion: to.Ptr("1.0"),
QuotaChangeRequests: []*armsupport.QuotaChangeRequest{
{
Payload: to.Ptr("{\"NewLimit\":200,\"Type\":\"LowPriority\"}"),
Region: to.Ptr("EastUS"),
}},
},
ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"),
Severity: to.Ptr(armsupport.SeverityLevelModerate),
SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="),
Title: to.Ptr("my title"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.TicketDetails = armsupport.TicketDetails{
// Name: to.Ptr("testticket"),
// Type: to.Ptr("Microsoft.Support/supportTickets"),
// ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"),
// Properties: &armsupport.TicketDetailsProperties{
// Description: to.Ptr("my description"),
// AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes),
// 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}()),
// FileWorkspaceName: to.Ptr("testticket"),
// ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()),
// ProblemClassificationDisplayName: to.Ptr("Machine Learning service"),
// ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid"),
// QuotaTicketDetails: &armsupport.QuotaTicketDetails{
// QuotaChangeRequestSubType: to.Ptr("Account"),
// QuotaChangeRequestVersion: to.Ptr("1.0"),
// QuotaChangeRequests: []*armsupport.QuotaChangeRequest{
// {
// Payload: to.Ptr("{\"NewLimit\":200,\"Type\":\"LowPriority\"}"),
// Region: to.Ptr("EastUS"),
// }},
// },
// Require24X7Response: to.Ptr(false),
// ServiceDisplayName: to.Ptr("Service and subscription limits (quotas)"),
// ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_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{
// },
// SupportPlanDisplayName: to.Ptr("Premier"),
// SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="),
// SupportPlanType: to.Ptr("Premier"),
// SupportTicketID: to.Ptr("119120321001170"),
// Title: to.Ptr("my title"),
// },
// }
}
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 Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.
*
* @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateMachineLearningQuotaTicketForLowPriorityCores.json
*/
async function createATicketToRequestQuotaIncreaseForLowPriorityCoresForMachineLearningService() {
const subscriptionId =
process.env["SUPPORT_SUBSCRIPTION_ID"] || "132d901f-189d-4381-9214-fe68e27e05a1";
const supportTicketName = "testticket";
const createSupportTicketParameters = {
description: "my description",
advancedDiagnosticConsent: "Yes",
contactDetails: {
country: "usa",
firstName: "abc",
lastName: "xyz",
preferredContactMethod: "email",
preferredSupportLanguage: "en-US",
preferredTimeZone: "Pacific Standard Time",
primaryEmailAddress: "abc@contoso.com",
},
problemClassificationId:
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid",
quotaTicketDetails: {
quotaChangeRequestSubType: "BatchAml",
quotaChangeRequestVersion: "1.0",
quotaChangeRequests: [{ payload: '{"NewLimit":200,"Type":"LowPriority"}', region: "EastUS" }],
},
serviceId: "/providers/Microsoft.Support/services/quota_service_guid",
severity: "moderate",
supportPlanId:
"U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
title: "my title",
};
const credential = new DefaultAzureCredential();
const client = new MicrosoftSupport(credential, subscriptionId);
const result = await client.supportTickets.beginCreateAndWait(
supportTicketName,
createSupportTicketParameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Support.Models;
using Azure.ResourceManager.Support;
// Generated from example definition: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateMachineLearningQuotaTicketForLowPriorityCores.json
// this example is just showing the usage of "SupportTickets_Create" 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 = "132d901f-189d-4381-9214-fe68e27e05a1";
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
// get the collection of this SubscriptionSupportTicketResource
SubscriptionSupportTicketCollection collection = subscriptionResource.GetSubscriptionSupportTickets();
// invoke the operation
string supportTicketName = "testticket";
SupportTicketData data = new SupportTicketData(
"my description",
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid",
SupportSeverityLevel.Moderate,
AdvancedDiagnosticConsent.Yes,
new SupportContactProfile(
"abc",
"xyz",
PreferredContactMethod.Email,
"abc@contoso.com",
"Pacific Standard Time",
"usa",
"en-US"),
"my title",
"/providers/Microsoft.Support/services/quota_service_guid")
{
SupportPlanId = "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
QuotaTicketDetails = new QuotaTicketDetails
{
QuotaChangeRequestSubType = "BatchAml",
QuotaChangeRequestVersion = "1.0",
QuotaChangeRequests = {new SupportQuotaChangeContent
{
Region = "EastUS",
Payload = "{\"NewLimit\":200,\"Type\":\"LowPriority\"}",
}},
},
};
ArmOperation<SubscriptionSupportTicketResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, supportTicketName, data);
SubscriptionSupportTicketResource result = lro.Value;
// the variable result 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 = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
示例响应
location: https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/operationResults/operationid?api-version=2024-04-01
azure-asyncoperation: https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/operationsStatus/operationid?api-version=2024-04-01
{
"id": "/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket",
"name": "testticket",
"type": "Microsoft.Support/supportTickets",
"properties": {
"supportTicketId": "119120321001170",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid",
"problemClassificationDisplayName": "Machine Learning service",
"severity": "moderate",
"require24X7Response": false,
"advancedDiagnosticConsent": "Yes",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"fileWorkspaceName": "testticket",
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"primaryEmailAddress": "abc@contoso.com",
"preferredTimeZone": "Pacific Standard Time",
"country": "usa",
"preferredSupportLanguage": "en-US"
},
"quotaTicketDetails": {
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequestSubType": "Account",
"quotaChangeRequests": [
{
"region": "EastUS",
"payload": "{\"NewLimit\":200,\"Type\":\"LowPriority\"}"
}
]
},
"serviceLevelAgreement": {
"startTime": "2020-03-20T21:36:18Z",
"expirationTime": "2020-03-21T17:36:18Z",
"slaMinutes": 240
},
"supportEngineer": {
"emailAddress": null
},
"supportPlanType": "Premier",
"supportPlanDisplayName": "Premier",
"title": "my title",
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"serviceDisplayName": "Service and subscription limits (quotas)",
"status": "Open",
"createdDate": "2020-03-20T21:36:18Z",
"modifiedDate": "2020-03-20T21:36:23Z"
}
}
Create a ticket to request Quota increase for Pools for a Batch account
示例请求
PUT https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket?api-version=2024-04-01
{
"properties": {
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"title": "my title",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid",
"severity": "moderate",
"advancedDiagnosticConsent": "Yes",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"primaryEmailAddress": "abc@contoso.com",
"preferredContactMethod": "email",
"preferredTimeZone": "Pacific Standard Time",
"preferredSupportLanguage": "en-US",
"country": "usa"
},
"quotaTicketDetails": {
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequestSubType": "Account",
"quotaChangeRequests": [
{
"region": "EastUS",
"payload": "{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"Pools\"}"
}
]
}
}
}
import com.azure.resourcemanager.support.models.Consent;
import com.azure.resourcemanager.support.models.ContactProfile;
import com.azure.resourcemanager.support.models.PreferredContactMethod;
import com.azure.resourcemanager.support.models.QuotaChangeRequest;
import com.azure.resourcemanager.support.models.QuotaTicketDetails;
import com.azure.resourcemanager.support.models.SeverityLevel;
import java.util.Arrays;
/**
* Samples for SupportTickets Create.
*/
public final class Main {
/*
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/
* CreateBatchQuotaTicketForSpecificBatchAccountForPools.json
*/
/**
* Sample code: Create a ticket to request Quota increase for Pools for a Batch account.
*
* @param manager Entry point to SupportManager.
*/
public static void createATicketToRequestQuotaIncreaseForPoolsForABatchAccount(
com.azure.resourcemanager.support.SupportManager manager) {
manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId(
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid")
.withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES)
.withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz")
.withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com")
.withPreferredTimeZone("Pacific Standard Time").withCountry("usa")
.withPreferredSupportLanguage("en-US"))
.withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid")
.withSupportPlanId(
"U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=")
.withQuotaTicketDetails(
new QuotaTicketDetails().withQuotaChangeRequestSubType("Account").withQuotaChangeRequestVersion("1.0")
.withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest().withRegion("EastUS")
.withPayload("{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"Pools\"}"))))
.create();
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.support import MicrosoftSupport
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-support
# USAGE
python create_batch_quota_ticket_for_specific_batch_account_for_pools.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="132d901f-189d-4381-9214-fe68e27e05a1",
)
response = client.support_tickets.begin_create(
support_ticket_name="testticket",
create_support_ticket_parameters={
"properties": {
"advancedDiagnosticConsent": "Yes",
"contactDetails": {
"country": "usa",
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"preferredSupportLanguage": "en-US",
"preferredTimeZone": "Pacific Standard Time",
"primaryEmailAddress": "abc@contoso.com",
},
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid",
"quotaTicketDetails": {
"quotaChangeRequestSubType": "Account",
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequests": [
{"payload": '{"AccountName":"test","NewLimit":200,"Type":"Pools"}', "region": "EastUS"}
],
},
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"severity": "moderate",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"title": "my title",
}
},
).result()
print(response)
# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForPools.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/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForPools.json
func ExampleTicketsClient_BeginCreate_createATicketToRequestQuotaIncreaseForPoolsForABatchAccount() {
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)
}
poller, err := clientFactory.NewTicketsClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{
Properties: &armsupport.TicketDetailsProperties{
Description: to.Ptr("my description"),
AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes),
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"),
},
ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid"),
QuotaTicketDetails: &armsupport.QuotaTicketDetails{
QuotaChangeRequestSubType: to.Ptr("Account"),
QuotaChangeRequestVersion: to.Ptr("1.0"),
QuotaChangeRequests: []*armsupport.QuotaChangeRequest{
{
Payload: to.Ptr("{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"Pools\"}"),
Region: to.Ptr("EastUS"),
}},
},
ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"),
Severity: to.Ptr(armsupport.SeverityLevelModerate),
SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="),
Title: to.Ptr("my title"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.TicketDetails = armsupport.TicketDetails{
// Name: to.Ptr("testticket"),
// Type: to.Ptr("Microsoft.Support/supportTickets"),
// ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"),
// Properties: &armsupport.TicketDetailsProperties{
// Description: to.Ptr("my description"),
// AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes),
// 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}()),
// FileWorkspaceName: to.Ptr("testticket"),
// ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()),
// ProblemClassificationDisplayName: to.Ptr("Batch"),
// ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid"),
// QuotaTicketDetails: &armsupport.QuotaTicketDetails{
// QuotaChangeRequestSubType: to.Ptr("Account"),
// QuotaChangeRequestVersion: to.Ptr("1.0"),
// QuotaChangeRequests: []*armsupport.QuotaChangeRequest{
// {
// Payload: to.Ptr("{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"Pools\"}"),
// Region: to.Ptr("EastUS"),
// }},
// },
// Require24X7Response: to.Ptr(false),
// ServiceDisplayName: to.Ptr("Service and subscription limits (quotas)"),
// ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_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{
// },
// SupportPlanDisplayName: to.Ptr("Premier"),
// SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="),
// SupportPlanType: to.Ptr("Premier"),
// SupportTicketID: to.Ptr("119120321001170"),
// Title: to.Ptr("my title"),
// },
// }
}
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 Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.
*
* @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForPools.json
*/
async function createATicketToRequestQuotaIncreaseForPoolsForABatchAccount() {
const subscriptionId =
process.env["SUPPORT_SUBSCRIPTION_ID"] || "132d901f-189d-4381-9214-fe68e27e05a1";
const supportTicketName = "testticket";
const createSupportTicketParameters = {
description: "my description",
advancedDiagnosticConsent: "Yes",
contactDetails: {
country: "usa",
firstName: "abc",
lastName: "xyz",
preferredContactMethod: "email",
preferredSupportLanguage: "en-US",
preferredTimeZone: "Pacific Standard Time",
primaryEmailAddress: "abc@contoso.com",
},
problemClassificationId:
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid",
quotaTicketDetails: {
quotaChangeRequestSubType: "Account",
quotaChangeRequestVersion: "1.0",
quotaChangeRequests: [
{
payload: '{"AccountName":"test","NewLimit":200,"Type":"Pools"}',
region: "EastUS",
},
],
},
serviceId: "/providers/Microsoft.Support/services/quota_service_guid",
severity: "moderate",
supportPlanId:
"U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
title: "my title",
};
const credential = new DefaultAzureCredential();
const client = new MicrosoftSupport(credential, subscriptionId);
const result = await client.supportTickets.beginCreateAndWait(
supportTicketName,
createSupportTicketParameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Support.Models;
using Azure.ResourceManager.Support;
// Generated from example definition: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForPools.json
// this example is just showing the usage of "SupportTickets_Create" 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 = "132d901f-189d-4381-9214-fe68e27e05a1";
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
// get the collection of this SubscriptionSupportTicketResource
SubscriptionSupportTicketCollection collection = subscriptionResource.GetSubscriptionSupportTickets();
// invoke the operation
string supportTicketName = "testticket";
SupportTicketData data = new SupportTicketData(
"my description",
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid",
SupportSeverityLevel.Moderate,
AdvancedDiagnosticConsent.Yes,
new SupportContactProfile(
"abc",
"xyz",
PreferredContactMethod.Email,
"abc@contoso.com",
"Pacific Standard Time",
"usa",
"en-US"),
"my title",
"/providers/Microsoft.Support/services/quota_service_guid")
{
SupportPlanId = "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
QuotaTicketDetails = new QuotaTicketDetails
{
QuotaChangeRequestSubType = "Account",
QuotaChangeRequestVersion = "1.0",
QuotaChangeRequests = {new SupportQuotaChangeContent
{
Region = "EastUS",
Payload = "{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"Pools\"}",
}},
},
};
ArmOperation<SubscriptionSupportTicketResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, supportTicketName, data);
SubscriptionSupportTicketResource result = lro.Value;
// the variable result 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 = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
示例响应
location: https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/operationResults/operationid?api-version=2024-04-01
azure-asyncoperation: https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/operationsStatus/operationid?api-version=2024-04-01
{
"id": "/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket",
"name": "testticket",
"type": "Microsoft.Support/supportTickets",
"properties": {
"supportTicketId": "119120321001170",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid",
"problemClassificationDisplayName": "Batch",
"severity": "moderate",
"require24X7Response": false,
"advancedDiagnosticConsent": "Yes",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"fileWorkspaceName": "testticket",
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"primaryEmailAddress": "abc@contoso.com",
"preferredTimeZone": "Pacific Standard Time",
"country": "usa",
"preferredSupportLanguage": "en-US"
},
"quotaTicketDetails": {
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequestSubType": "Account",
"quotaChangeRequests": [
{
"region": "EastUS",
"payload": "{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"Pools\"}"
}
]
},
"serviceLevelAgreement": {
"startTime": "2020-03-20T21:36:18Z",
"expirationTime": "2020-03-21T17:36:18Z",
"slaMinutes": 240
},
"supportEngineer": {
"emailAddress": null
},
"supportPlanType": "Premier",
"supportPlanDisplayName": "Premier",
"title": "my title",
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"serviceDisplayName": "Service and subscription limits (quotas)",
"status": "Open",
"createdDate": "2020-03-20T21:36:18Z",
"modifiedDate": "2020-03-20T21:36:23Z"
}
}
Create a ticket to request Quota increase for Servers for Azure Synapse Analytics
示例请求
PUT https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket?api-version=2024-04-01
{
"properties": {
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"title": "my title",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid",
"severity": "moderate",
"advancedDiagnosticConsent": "Yes",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"primaryEmailAddress": "abc@contoso.com",
"preferredContactMethod": "email",
"preferredTimeZone": "Pacific Standard Time",
"preferredSupportLanguage": "en-US",
"country": "usa"
},
"quotaTicketDetails": {
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequestSubType": "Servers",
"quotaChangeRequests": [
{
"region": "EastUS",
"payload": "{\"NewLimit\":200}"
}
]
}
}
}
import com.azure.resourcemanager.support.models.Consent;
import com.azure.resourcemanager.support.models.ContactProfile;
import com.azure.resourcemanager.support.models.PreferredContactMethod;
import com.azure.resourcemanager.support.models.QuotaChangeRequest;
import com.azure.resourcemanager.support.models.QuotaTicketDetails;
import com.azure.resourcemanager.support.models.SeverityLevel;
import java.util.Arrays;
/**
* Samples for SupportTickets Create.
*/
public final class Main {
/*
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/
* CreateSqlDatawarehouseQuotaTicketForServers.json
*/
/**
* Sample code: Create a ticket to request Quota increase for Servers for Azure Synapse Analytics.
*
* @param manager Entry point to SupportManager.
*/
public static void createATicketToRequestQuotaIncreaseForServersForAzureSynapseAnalytics(
com.azure.resourcemanager.support.SupportManager manager) {
manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId(
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid")
.withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES)
.withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz")
.withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com")
.withPreferredTimeZone("Pacific Standard Time").withCountry("usa")
.withPreferredSupportLanguage("en-US"))
.withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid")
.withSupportPlanId(
"U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=")
.withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("Servers")
.withQuotaChangeRequestVersion("1.0").withQuotaChangeRequests(
Arrays.asList(new QuotaChangeRequest().withRegion("EastUS").withPayload("{\"NewLimit\":200}"))))
.create();
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.support import MicrosoftSupport
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-support
# USAGE
python create_sql_datawarehouse_quota_ticket_for_servers.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="132d901f-189d-4381-9214-fe68e27e05a1",
)
response = client.support_tickets.begin_create(
support_ticket_name="testticket",
create_support_ticket_parameters={
"properties": {
"advancedDiagnosticConsent": "Yes",
"contactDetails": {
"country": "usa",
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"preferredSupportLanguage": "en-US",
"preferredTimeZone": "Pacific Standard Time",
"primaryEmailAddress": "abc@contoso.com",
},
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid",
"quotaTicketDetails": {
"quotaChangeRequestSubType": "Servers",
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequests": [{"payload": '{"NewLimit":200}', "region": "EastUS"}],
},
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"severity": "moderate",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"title": "my title",
}
},
).result()
print(response)
# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlDatawarehouseQuotaTicketForServers.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/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlDatawarehouseQuotaTicketForServers.json
func ExampleTicketsClient_BeginCreate_createATicketToRequestQuotaIncreaseForServersForAzureSynapseAnalytics() {
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)
}
poller, err := clientFactory.NewTicketsClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{
Properties: &armsupport.TicketDetailsProperties{
Description: to.Ptr("my description"),
AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes),
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"),
},
ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid"),
QuotaTicketDetails: &armsupport.QuotaTicketDetails{
QuotaChangeRequestSubType: to.Ptr("Servers"),
QuotaChangeRequestVersion: to.Ptr("1.0"),
QuotaChangeRequests: []*armsupport.QuotaChangeRequest{
{
Payload: to.Ptr("{\"NewLimit\":200}"),
Region: to.Ptr("EastUS"),
}},
},
ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"),
Severity: to.Ptr(armsupport.SeverityLevelModerate),
SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="),
Title: to.Ptr("my title"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.TicketDetails = armsupport.TicketDetails{
// Name: to.Ptr("testticket"),
// Type: to.Ptr("Microsoft.Support/supportTickets"),
// ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"),
// Properties: &armsupport.TicketDetailsProperties{
// Description: to.Ptr("my description"),
// AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes),
// 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}()),
// FileWorkspaceName: to.Ptr("testticket"),
// ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()),
// ProblemClassificationDisplayName: to.Ptr("SQL Data Warehouse"),
// ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid"),
// QuotaTicketDetails: &armsupport.QuotaTicketDetails{
// QuotaChangeRequestSubType: to.Ptr("Servers"),
// QuotaChangeRequestVersion: to.Ptr("1.0"),
// QuotaChangeRequests: []*armsupport.QuotaChangeRequest{
// {
// Payload: to.Ptr("{\"NewLimit\":200}"),
// Region: to.Ptr("EastUS"),
// }},
// },
// Require24X7Response: to.Ptr(false),
// ServiceDisplayName: to.Ptr("Service and subscription limits (quotas)"),
// ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_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{
// },
// SupportPlanDisplayName: to.Ptr("Premier"),
// SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="),
// SupportPlanType: to.Ptr("Premier"),
// SupportTicketID: to.Ptr("119120321001170"),
// Title: to.Ptr("my title"),
// },
// }
}
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 Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.
*
* @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlDatawarehouseQuotaTicketForServers.json
*/
async function createATicketToRequestQuotaIncreaseForServersForAzureSynapseAnalytics() {
const subscriptionId =
process.env["SUPPORT_SUBSCRIPTION_ID"] || "132d901f-189d-4381-9214-fe68e27e05a1";
const supportTicketName = "testticket";
const createSupportTicketParameters = {
description: "my description",
advancedDiagnosticConsent: "Yes",
contactDetails: {
country: "usa",
firstName: "abc",
lastName: "xyz",
preferredContactMethod: "email",
preferredSupportLanguage: "en-US",
preferredTimeZone: "Pacific Standard Time",
primaryEmailAddress: "abc@contoso.com",
},
problemClassificationId:
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid",
quotaTicketDetails: {
quotaChangeRequestSubType: "Servers",
quotaChangeRequestVersion: "1.0",
quotaChangeRequests: [{ payload: '{"NewLimit":200}', region: "EastUS" }],
},
serviceId: "/providers/Microsoft.Support/services/quota_service_guid",
severity: "moderate",
supportPlanId:
"U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
title: "my title",
};
const credential = new DefaultAzureCredential();
const client = new MicrosoftSupport(credential, subscriptionId);
const result = await client.supportTickets.beginCreateAndWait(
supportTicketName,
createSupportTicketParameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Support.Models;
using Azure.ResourceManager.Support;
// Generated from example definition: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlDatawarehouseQuotaTicketForServers.json
// this example is just showing the usage of "SupportTickets_Create" 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 = "132d901f-189d-4381-9214-fe68e27e05a1";
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
// get the collection of this SubscriptionSupportTicketResource
SubscriptionSupportTicketCollection collection = subscriptionResource.GetSubscriptionSupportTickets();
// invoke the operation
string supportTicketName = "testticket";
SupportTicketData data = new SupportTicketData(
"my description",
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid",
SupportSeverityLevel.Moderate,
AdvancedDiagnosticConsent.Yes,
new SupportContactProfile(
"abc",
"xyz",
PreferredContactMethod.Email,
"abc@contoso.com",
"Pacific Standard Time",
"usa",
"en-US"),
"my title",
"/providers/Microsoft.Support/services/quota_service_guid")
{
SupportPlanId = "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
QuotaTicketDetails = new QuotaTicketDetails
{
QuotaChangeRequestSubType = "Servers",
QuotaChangeRequestVersion = "1.0",
QuotaChangeRequests = {new SupportQuotaChangeContent
{
Region = "EastUS",
Payload = "{\"NewLimit\":200}",
}},
},
};
ArmOperation<SubscriptionSupportTicketResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, supportTicketName, data);
SubscriptionSupportTicketResource result = lro.Value;
// the variable result 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 = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
示例响应
location: https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/operationResults/operationid?api-version=2024-04-01
azure-asyncoperation: https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/operationsStatus/operationid?api-version=2024-04-01
{
"id": "/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket",
"name": "testticket",
"type": "Microsoft.Support/supportTickets",
"properties": {
"supportTicketId": "119120321001170",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid",
"problemClassificationDisplayName": "SQL Data Warehouse",
"severity": "moderate",
"require24X7Response": false,
"advancedDiagnosticConsent": "Yes",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"fileWorkspaceName": "testticket",
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"primaryEmailAddress": "abc@contoso.com",
"preferredTimeZone": "Pacific Standard Time",
"country": "usa",
"preferredSupportLanguage": "en-US"
},
"quotaTicketDetails": {
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequestSubType": "Servers",
"quotaChangeRequests": [
{
"region": "EastUS",
"payload": "{\"NewLimit\":200}"
}
]
},
"serviceLevelAgreement": {
"startTime": "2020-03-20T21:36:18Z",
"expirationTime": "2020-03-21T17:36:18Z",
"slaMinutes": 240
},
"supportEngineer": {
"emailAddress": null
},
"supportPlanType": "Premier",
"supportPlanDisplayName": "Premier",
"title": "my title",
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"serviceDisplayName": "Service and subscription limits (quotas)",
"status": "Open",
"createdDate": "2020-03-20T21:36:18Z",
"modifiedDate": "2020-03-20T21:36:23Z"
}
}
Create a ticket to request Quota increase for Servers for SQL Database
示例请求
PUT https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket?api-version=2024-04-01
{
"properties": {
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"title": "my title",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid",
"severity": "moderate",
"advancedDiagnosticConsent": "Yes",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"primaryEmailAddress": "abc@contoso.com",
"preferredContactMethod": "email",
"preferredTimeZone": "Pacific Standard Time",
"preferredSupportLanguage": "en-US",
"country": "usa"
},
"quotaTicketDetails": {
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequestSubType": "Servers",
"quotaChangeRequests": [
{
"region": "EastUS",
"payload": "{\"NewLimit\":200}"
}
]
}
}
}
import com.azure.resourcemanager.support.models.Consent;
import com.azure.resourcemanager.support.models.ContactProfile;
import com.azure.resourcemanager.support.models.PreferredContactMethod;
import com.azure.resourcemanager.support.models.QuotaChangeRequest;
import com.azure.resourcemanager.support.models.QuotaTicketDetails;
import com.azure.resourcemanager.support.models.SeverityLevel;
import java.util.Arrays;
/**
* Samples for SupportTickets Create.
*/
public final class Main {
/*
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/
* CreateSqlDatabaseQuotaTicketForServers.json
*/
/**
* Sample code: Create a ticket to request Quota increase for Servers for SQL Database.
*
* @param manager Entry point to SupportManager.
*/
public static void createATicketToRequestQuotaIncreaseForServersForSQLDatabase(
com.azure.resourcemanager.support.SupportManager manager) {
manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId(
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid")
.withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES)
.withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz")
.withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com")
.withPreferredTimeZone("Pacific Standard Time").withCountry("usa")
.withPreferredSupportLanguage("en-US"))
.withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid")
.withSupportPlanId(
"U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=")
.withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("Servers")
.withQuotaChangeRequestVersion("1.0").withQuotaChangeRequests(
Arrays.asList(new QuotaChangeRequest().withRegion("EastUS").withPayload("{\"NewLimit\":200}"))))
.create();
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.support import MicrosoftSupport
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-support
# USAGE
python create_sql_database_quota_ticket_for_servers.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="132d901f-189d-4381-9214-fe68e27e05a1",
)
response = client.support_tickets.begin_create(
support_ticket_name="testticket",
create_support_ticket_parameters={
"properties": {
"advancedDiagnosticConsent": "Yes",
"contactDetails": {
"country": "usa",
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"preferredSupportLanguage": "en-US",
"preferredTimeZone": "Pacific Standard Time",
"primaryEmailAddress": "abc@contoso.com",
},
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid",
"quotaTicketDetails": {
"quotaChangeRequestSubType": "Servers",
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequests": [{"payload": '{"NewLimit":200}', "region": "EastUS"}],
},
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"severity": "moderate",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"title": "my title",
}
},
).result()
print(response)
# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlDatabaseQuotaTicketForServers.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/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlDatabaseQuotaTicketForServers.json
func ExampleTicketsClient_BeginCreate_createATicketToRequestQuotaIncreaseForServersForSqlDatabase() {
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)
}
poller, err := clientFactory.NewTicketsClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{
Properties: &armsupport.TicketDetailsProperties{
Description: to.Ptr("my description"),
AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes),
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"),
},
ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid"),
QuotaTicketDetails: &armsupport.QuotaTicketDetails{
QuotaChangeRequestSubType: to.Ptr("Servers"),
QuotaChangeRequestVersion: to.Ptr("1.0"),
QuotaChangeRequests: []*armsupport.QuotaChangeRequest{
{
Payload: to.Ptr("{\"NewLimit\":200}"),
Region: to.Ptr("EastUS"),
}},
},
ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"),
Severity: to.Ptr(armsupport.SeverityLevelModerate),
SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="),
Title: to.Ptr("my title"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.TicketDetails = armsupport.TicketDetails{
// Name: to.Ptr("testticket"),
// Type: to.Ptr("Microsoft.Support/supportTickets"),
// ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"),
// Properties: &armsupport.TicketDetailsProperties{
// Description: to.Ptr("my description"),
// AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes),
// 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}()),
// FileWorkspaceName: to.Ptr("testticket"),
// ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()),
// ProblemClassificationDisplayName: to.Ptr("SQL database"),
// ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid"),
// QuotaTicketDetails: &armsupport.QuotaTicketDetails{
// QuotaChangeRequestSubType: to.Ptr("Servers"),
// QuotaChangeRequestVersion: to.Ptr("1.0"),
// QuotaChangeRequests: []*armsupport.QuotaChangeRequest{
// {
// Payload: to.Ptr("{\"NewLimit\":200}"),
// Region: to.Ptr("EastUS"),
// }},
// },
// Require24X7Response: to.Ptr(false),
// ServiceDisplayName: to.Ptr("Service and subscription limits (quotas)"),
// ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_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{
// },
// SupportPlanDisplayName: to.Ptr("Premier"),
// SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="),
// SupportPlanType: to.Ptr("Premier"),
// SupportTicketID: to.Ptr("119120321001170"),
// Title: to.Ptr("my title"),
// },
// }
}
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 Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.
*
* @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlDatabaseQuotaTicketForServers.json
*/
async function createATicketToRequestQuotaIncreaseForServersForSqlDatabase() {
const subscriptionId =
process.env["SUPPORT_SUBSCRIPTION_ID"] || "132d901f-189d-4381-9214-fe68e27e05a1";
const supportTicketName = "testticket";
const createSupportTicketParameters = {
description: "my description",
advancedDiagnosticConsent: "Yes",
contactDetails: {
country: "usa",
firstName: "abc",
lastName: "xyz",
preferredContactMethod: "email",
preferredSupportLanguage: "en-US",
preferredTimeZone: "Pacific Standard Time",
primaryEmailAddress: "abc@contoso.com",
},
problemClassificationId:
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid",
quotaTicketDetails: {
quotaChangeRequestSubType: "Servers",
quotaChangeRequestVersion: "1.0",
quotaChangeRequests: [{ payload: '{"NewLimit":200}', region: "EastUS" }],
},
serviceId: "/providers/Microsoft.Support/services/quota_service_guid",
severity: "moderate",
supportPlanId:
"U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
title: "my title",
};
const credential = new DefaultAzureCredential();
const client = new MicrosoftSupport(credential, subscriptionId);
const result = await client.supportTickets.beginCreateAndWait(
supportTicketName,
createSupportTicketParameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Support.Models;
using Azure.ResourceManager.Support;
// Generated from example definition: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlDatabaseQuotaTicketForServers.json
// this example is just showing the usage of "SupportTickets_Create" 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 = "132d901f-189d-4381-9214-fe68e27e05a1";
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
// get the collection of this SubscriptionSupportTicketResource
SubscriptionSupportTicketCollection collection = subscriptionResource.GetSubscriptionSupportTickets();
// invoke the operation
string supportTicketName = "testticket";
SupportTicketData data = new SupportTicketData(
"my description",
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid",
SupportSeverityLevel.Moderate,
AdvancedDiagnosticConsent.Yes,
new SupportContactProfile(
"abc",
"xyz",
PreferredContactMethod.Email,
"abc@contoso.com",
"Pacific Standard Time",
"usa",
"en-US"),
"my title",
"/providers/Microsoft.Support/services/quota_service_guid")
{
SupportPlanId = "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
QuotaTicketDetails = new QuotaTicketDetails
{
QuotaChangeRequestSubType = "Servers",
QuotaChangeRequestVersion = "1.0",
QuotaChangeRequests = {new SupportQuotaChangeContent
{
Region = "EastUS",
Payload = "{\"NewLimit\":200}",
}},
},
};
ArmOperation<SubscriptionSupportTicketResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, supportTicketName, data);
SubscriptionSupportTicketResource result = lro.Value;
// the variable result 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 = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
示例响应
location: https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/operationResults/operationid?api-version=2024-04-01
azure-asyncoperation: https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/operationsStatus/operationid?api-version=2024-04-01
{
"id": "/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket",
"name": "testticket",
"type": "Microsoft.Support/supportTickets",
"properties": {
"supportTicketId": "119120321001170",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid",
"problemClassificationDisplayName": "SQL database",
"severity": "moderate",
"require24X7Response": false,
"advancedDiagnosticConsent": "Yes",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"fileWorkspaceName": "testticket",
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"primaryEmailAddress": "abc@contoso.com",
"preferredTimeZone": "Pacific Standard Time",
"country": "usa",
"preferredSupportLanguage": "en-US"
},
"quotaTicketDetails": {
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequestSubType": "Servers",
"quotaChangeRequests": [
{
"region": "EastUS",
"payload": "{\"NewLimit\":200}"
}
]
},
"serviceLevelAgreement": {
"startTime": "2020-03-20T21:36:18Z",
"expirationTime": "2020-03-21T17:36:18Z",
"slaMinutes": 240
},
"supportEngineer": {
"emailAddress": null
},
"supportPlanType": "Premier",
"supportPlanDisplayName": "Premier",
"title": "my title",
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"serviceDisplayName": "Service and subscription limits (quotas)",
"status": "Open",
"createdDate": "2020-03-20T21:36:18Z",
"modifiedDate": "2020-03-20T21:36:23Z"
}
}
Create a ticket to request Quota increase for services that do not require additional details in the quotaTicketDetails object
示例请求
PUT https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket?api-version=2024-04-01
{
"properties": {
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"title": "my title",
"description": "Increase the maximum throughput per container limit to 10000 for account foo bar",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cosmosdb_problemClassification_guid",
"severity": "moderate",
"advancedDiagnosticConsent": "Yes",
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"primaryEmailAddress": "abc@contoso.com",
"preferredContactMethod": "email",
"preferredTimeZone": "Pacific Standard Time",
"preferredSupportLanguage": "en-US",
"country": "usa"
}
}
}
import com.azure.resourcemanager.support.models.Consent;
import com.azure.resourcemanager.support.models.ContactProfile;
import com.azure.resourcemanager.support.models.PreferredContactMethod;
import com.azure.resourcemanager.support.models.SeverityLevel;
/**
* Samples for SupportTickets Create.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateGenericQuotaTicket.json
*/
/**
* Sample code: Create a ticket to request Quota increase for services that do not require additional details in the
* quotaTicketDetails object.
*
* @param manager Entry point to SupportManager.
*/
public static void
createATicketToRequestQuotaIncreaseForServicesThatDoNotRequireAdditionalDetailsInTheQuotaTicketDetailsObject(
com.azure.resourcemanager.support.SupportManager manager) {
manager.supportTickets().define("testticket")
.withDescription("Increase the maximum throughput per container limit to 10000 for account foo bar")
.withProblemClassificationId(
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cosmosdb_problemClassification_guid")
.withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES)
.withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz")
.withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com")
.withPreferredTimeZone("Pacific Standard Time").withCountry("usa")
.withPreferredSupportLanguage("en-US"))
.withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid").create();
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.support import MicrosoftSupport
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-support
# USAGE
python create_generic_quota_ticket.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="132d901f-189d-4381-9214-fe68e27e05a1",
)
response = client.support_tickets.begin_create(
support_ticket_name="testticket",
create_support_ticket_parameters={
"properties": {
"advancedDiagnosticConsent": "Yes",
"contactDetails": {
"country": "usa",
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"preferredSupportLanguage": "en-US",
"preferredTimeZone": "Pacific Standard Time",
"primaryEmailAddress": "abc@contoso.com",
},
"description": "Increase the maximum throughput per container limit to 10000 for account foo bar",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cosmosdb_problemClassification_guid",
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"severity": "moderate",
"title": "my title",
}
},
).result()
print(response)
# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateGenericQuotaTicket.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/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateGenericQuotaTicket.json
func ExampleTicketsClient_BeginCreate_createATicketToRequestQuotaIncreaseForServicesThatDoNotRequireAdditionalDetailsInTheQuotaTicketDetailsObject() {
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)
}
poller, err := clientFactory.NewTicketsClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{
Properties: &armsupport.TicketDetailsProperties{
Description: to.Ptr("Increase the maximum throughput per container limit to 10000 for account foo bar"),
AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes),
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"),
},
ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cosmosdb_problemClassification_guid"),
ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"),
Severity: to.Ptr(armsupport.SeverityLevelModerate),
Title: to.Ptr("my title"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.TicketDetails = armsupport.TicketDetails{
// Name: to.Ptr("testticket"),
// Type: to.Ptr("Microsoft.Support/supportTickets"),
// ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"),
// Properties: &armsupport.TicketDetailsProperties{
// Description: to.Ptr("Increase the maximum throughput per container limit to 10000 for account foo bar"),
// AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes),
// 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("Cosmos DB"),
// ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cosmosdb_problemClassification_guid"),
// Require24X7Response: to.Ptr(false),
// ServiceDisplayName: to.Ptr("Service and subscription limits (quotas)"),
// ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_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{
// },
// SupportPlanDisplayName: to.Ptr("Premier"),
// SupportPlanType: to.Ptr("Premier"),
// SupportTicketID: to.Ptr("119120321001170"),
// Title: to.Ptr("my title"),
// },
// }
}
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 Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.
*
* @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateGenericQuotaTicket.json
*/
async function createATicketToRequestQuotaIncreaseForServicesThatDoNotRequireAdditionalDetailsInTheQuotaTicketDetailsObject() {
const subscriptionId =
process.env["SUPPORT_SUBSCRIPTION_ID"] || "132d901f-189d-4381-9214-fe68e27e05a1";
const supportTicketName = "testticket";
const createSupportTicketParameters = {
description: "Increase the maximum throughput per container limit to 10000 for account foo bar",
advancedDiagnosticConsent: "Yes",
contactDetails: {
country: "usa",
firstName: "abc",
lastName: "xyz",
preferredContactMethod: "email",
preferredSupportLanguage: "en-US",
preferredTimeZone: "Pacific Standard Time",
primaryEmailAddress: "abc@contoso.com",
},
problemClassificationId:
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cosmosdb_problemClassification_guid",
serviceId: "/providers/Microsoft.Support/services/quota_service_guid",
severity: "moderate",
title: "my title",
};
const credential = new DefaultAzureCredential();
const client = new MicrosoftSupport(credential, subscriptionId);
const result = await client.supportTickets.beginCreateAndWait(
supportTicketName,
createSupportTicketParameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Support.Models;
using Azure.ResourceManager.Support;
// Generated from example definition: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateGenericQuotaTicket.json
// this example is just showing the usage of "SupportTickets_Create" 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 = "132d901f-189d-4381-9214-fe68e27e05a1";
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
// get the collection of this SubscriptionSupportTicketResource
SubscriptionSupportTicketCollection collection = subscriptionResource.GetSubscriptionSupportTickets();
// invoke the operation
string supportTicketName = "testticket";
SupportTicketData data = new SupportTicketData(
"Increase the maximum throughput per container limit to 10000 for account foo bar",
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cosmosdb_problemClassification_guid",
SupportSeverityLevel.Moderate,
AdvancedDiagnosticConsent.Yes,
new SupportContactProfile(
"abc",
"xyz",
PreferredContactMethod.Email,
"abc@contoso.com",
"Pacific Standard Time",
"usa",
"en-US"),
"my title",
"/providers/Microsoft.Support/services/quota_service_guid");
ArmOperation<SubscriptionSupportTicketResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, supportTicketName, data);
SubscriptionSupportTicketResource result = lro.Value;
// the variable result 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 = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
示例响应
location: https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/operationResults/operationid?api-version=2024-04-01
azure-asyncoperation: https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/operationsStatus/operationid?api-version=2024-04-01
{
"id": "/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket",
"name": "testticket",
"type": "Microsoft.Support/supportTickets",
"properties": {
"supportTicketId": "119120321001170",
"description": "Increase the maximum throughput per container limit to 10000 for account foo bar",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cosmosdb_problemClassification_guid",
"problemClassificationDisplayName": "Cosmos DB",
"severity": "moderate",
"require24X7Response": false,
"advancedDiagnosticConsent": "Yes",
"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": null
},
"supportPlanType": "Premier",
"supportPlanDisplayName": "Premier",
"title": "my title",
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"serviceDisplayName": "Service and subscription limits (quotas)",
"status": "Open",
"createdDate": "2020-03-20T21:36:18Z",
"modifiedDate": "2020-03-20T21:36:23Z"
}
}
Create a ticket to request Quota increase for specific VM family cores for a Batch account
示例请求
PUT https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket?api-version=2024-04-01
{
"properties": {
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"title": "my title",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid",
"severity": "moderate",
"advancedDiagnosticConsent": "Yes",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"primaryEmailAddress": "abc@contoso.com",
"preferredContactMethod": "email",
"preferredTimeZone": "Pacific Standard Time",
"preferredSupportLanguage": "en-US",
"country": "usa"
},
"quotaTicketDetails": {
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequestSubType": "Account",
"quotaChangeRequests": [
{
"region": "EastUS",
"payload": "{\"AccountName\":\"test\",\"VMFamily\":\"standardA0_A7Family\",\"NewLimit\":200,\"Type\":\"Dedicated\"}"
}
]
}
}
}
import com.azure.resourcemanager.support.models.Consent;
import com.azure.resourcemanager.support.models.ContactProfile;
import com.azure.resourcemanager.support.models.PreferredContactMethod;
import com.azure.resourcemanager.support.models.QuotaChangeRequest;
import com.azure.resourcemanager.support.models.QuotaTicketDetails;
import com.azure.resourcemanager.support.models.SeverityLevel;
import java.util.Arrays;
/**
* Samples for SupportTickets Create.
*/
public final class Main {
/*
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/
* CreateBatchQuotaTicketForSpecificBatchAccountForDedicatedCores.json
*/
/**
* Sample code: Create a ticket to request Quota increase for specific VM family cores for a Batch account.
*
* @param manager Entry point to SupportManager.
*/
public static void createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForABatchAccount(
com.azure.resourcemanager.support.SupportManager manager) {
manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId(
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid")
.withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES)
.withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz")
.withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com")
.withPreferredTimeZone("Pacific Standard Time").withCountry("usa")
.withPreferredSupportLanguage("en-US"))
.withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid")
.withSupportPlanId(
"U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=")
.withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("Account")
.withQuotaChangeRequestVersion("1.0")
.withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest().withRegion("EastUS").withPayload(
"{\"AccountName\":\"test\",\"VMFamily\":\"standardA0_A7Family\",\"NewLimit\":200,\"Type\":\"Dedicated\"}"))))
.create();
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.support import MicrosoftSupport
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-support
# USAGE
python create_batch_quota_ticket_for_specific_batch_account_for_dedicated_cores.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="132d901f-189d-4381-9214-fe68e27e05a1",
)
response = client.support_tickets.begin_create(
support_ticket_name="testticket",
create_support_ticket_parameters={
"properties": {
"advancedDiagnosticConsent": "Yes",
"contactDetails": {
"country": "usa",
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"preferredSupportLanguage": "en-US",
"preferredTimeZone": "Pacific Standard Time",
"primaryEmailAddress": "abc@contoso.com",
},
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid",
"quotaTicketDetails": {
"quotaChangeRequestSubType": "Account",
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequests": [
{
"payload": '{"AccountName":"test","VMFamily":"standardA0_A7Family","NewLimit":200,"Type":"Dedicated"}',
"region": "EastUS",
}
],
},
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"severity": "moderate",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"title": "my title",
}
},
).result()
print(response)
# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForDedicatedCores.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/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForDedicatedCores.json
func ExampleTicketsClient_BeginCreate_createATicketToRequestQuotaIncreaseForSpecificVmFamilyCoresForABatchAccount() {
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)
}
poller, err := clientFactory.NewTicketsClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{
Properties: &armsupport.TicketDetailsProperties{
Description: to.Ptr("my description"),
AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes),
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"),
},
ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid"),
QuotaTicketDetails: &armsupport.QuotaTicketDetails{
QuotaChangeRequestSubType: to.Ptr("Account"),
QuotaChangeRequestVersion: to.Ptr("1.0"),
QuotaChangeRequests: []*armsupport.QuotaChangeRequest{
{
Payload: to.Ptr("{\"AccountName\":\"test\",\"VMFamily\":\"standardA0_A7Family\",\"NewLimit\":200,\"Type\":\"Dedicated\"}"),
Region: to.Ptr("EastUS"),
}},
},
ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"),
Severity: to.Ptr(armsupport.SeverityLevelModerate),
SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="),
Title: to.Ptr("my title"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.TicketDetails = armsupport.TicketDetails{
// Name: to.Ptr("testticket"),
// Type: to.Ptr("Microsoft.Support/supportTickets"),
// ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"),
// Properties: &armsupport.TicketDetailsProperties{
// Description: to.Ptr("my description"),
// AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes),
// 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}()),
// FileWorkspaceName: to.Ptr("testticket"),
// ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()),
// ProblemClassificationDisplayName: to.Ptr("Batch"),
// ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid"),
// QuotaTicketDetails: &armsupport.QuotaTicketDetails{
// QuotaChangeRequestSubType: to.Ptr("Account"),
// QuotaChangeRequestVersion: to.Ptr("1.0"),
// QuotaChangeRequests: []*armsupport.QuotaChangeRequest{
// {
// Payload: to.Ptr("{\"AccountName\":\"test\",\"VMFamily\":\"standardA0_A7Family\",\"NewLimit\":200,\"Type\":\"Dedicated\"}"),
// Region: to.Ptr("EastUS"),
// }},
// },
// Require24X7Response: to.Ptr(false),
// ServiceDisplayName: to.Ptr("Service and subscription limits (quotas)"),
// ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_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{
// },
// SupportPlanDisplayName: to.Ptr("Premier"),
// SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="),
// SupportPlanType: to.Ptr("Premier"),
// SupportTicketID: to.Ptr("119120321001170"),
// Title: to.Ptr("my title"),
// },
// }
}
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 Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.
*
* @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForDedicatedCores.json
*/
async function createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForABatchAccount() {
const subscriptionId =
process.env["SUPPORT_SUBSCRIPTION_ID"] || "132d901f-189d-4381-9214-fe68e27e05a1";
const supportTicketName = "testticket";
const createSupportTicketParameters = {
description: "my description",
advancedDiagnosticConsent: "Yes",
contactDetails: {
country: "usa",
firstName: "abc",
lastName: "xyz",
preferredContactMethod: "email",
preferredSupportLanguage: "en-US",
preferredTimeZone: "Pacific Standard Time",
primaryEmailAddress: "abc@contoso.com",
},
problemClassificationId:
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid",
quotaTicketDetails: {
quotaChangeRequestSubType: "Account",
quotaChangeRequestVersion: "1.0",
quotaChangeRequests: [
{
payload:
'{"AccountName":"test","VMFamily":"standardA0_A7Family","NewLimit":200,"Type":"Dedicated"}',
region: "EastUS",
},
],
},
serviceId: "/providers/Microsoft.Support/services/quota_service_guid",
severity: "moderate",
supportPlanId:
"U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
title: "my title",
};
const credential = new DefaultAzureCredential();
const client = new MicrosoftSupport(credential, subscriptionId);
const result = await client.supportTickets.beginCreateAndWait(
supportTicketName,
createSupportTicketParameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Support.Models;
using Azure.ResourceManager.Support;
// Generated from example definition: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForDedicatedCores.json
// this example is just showing the usage of "SupportTickets_Create" 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 = "132d901f-189d-4381-9214-fe68e27e05a1";
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
// get the collection of this SubscriptionSupportTicketResource
SubscriptionSupportTicketCollection collection = subscriptionResource.GetSubscriptionSupportTickets();
// invoke the operation
string supportTicketName = "testticket";
SupportTicketData data = new SupportTicketData(
"my description",
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid",
SupportSeverityLevel.Moderate,
AdvancedDiagnosticConsent.Yes,
new SupportContactProfile(
"abc",
"xyz",
PreferredContactMethod.Email,
"abc@contoso.com",
"Pacific Standard Time",
"usa",
"en-US"),
"my title",
"/providers/Microsoft.Support/services/quota_service_guid")
{
SupportPlanId = "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
QuotaTicketDetails = new QuotaTicketDetails
{
QuotaChangeRequestSubType = "Account",
QuotaChangeRequestVersion = "1.0",
QuotaChangeRequests = {new SupportQuotaChangeContent
{
Region = "EastUS",
Payload = "{\"AccountName\":\"test\",\"VMFamily\":\"standardA0_A7Family\",\"NewLimit\":200,\"Type\":\"Dedicated\"}",
}},
},
};
ArmOperation<SubscriptionSupportTicketResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, supportTicketName, data);
SubscriptionSupportTicketResource result = lro.Value;
// the variable result 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 = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
示例响应
location: https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/operationResults/operationid?api-version=2024-04-01
azure-asyncoperation: https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/operationsStatus/operationid?api-version=2024-04-01
{
"id": "/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket",
"name": "testticket",
"type": "Microsoft.Support/supportTickets",
"properties": {
"supportTicketId": "119120321001170",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid",
"problemClassificationDisplayName": "Batch",
"severity": "moderate",
"require24X7Response": false,
"advancedDiagnosticConsent": "Yes",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"fileWorkspaceName": "testticket",
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"primaryEmailAddress": "abc@contoso.com",
"preferredTimeZone": "Pacific Standard Time",
"country": "usa",
"preferredSupportLanguage": "en-US"
},
"quotaTicketDetails": {
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequestSubType": "Account",
"quotaChangeRequests": [
{
"region": "EastUS",
"payload": "{\"AccountName\":\"test\",\"VMFamily\":\"standardA0_A7Family\",\"NewLimit\":200,\"Type\":\"Dedicated\"}"
}
]
},
"serviceLevelAgreement": {
"startTime": "2020-03-20T21:36:18Z",
"expirationTime": "2020-03-21T17:36:18Z",
"slaMinutes": 240
},
"supportEngineer": {
"emailAddress": null
},
"supportPlanType": "Premier",
"supportPlanDisplayName": "Premier",
"title": "my title",
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"serviceDisplayName": "Service and subscription limits (quotas)",
"status": "Open",
"createdDate": "2020-03-20T21:36:18Z",
"modifiedDate": "2020-03-20T21:36:23Z"
}
}
Create a ticket to request Quota increase for specific VM family cores for Machine Learning service
示例请求
PUT https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket?api-version=2024-04-01
{
"properties": {
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"title": "my title",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid",
"severity": "moderate",
"advancedDiagnosticConsent": "Yes",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"primaryEmailAddress": "abc@contoso.com",
"preferredContactMethod": "email",
"preferredTimeZone": "Pacific Standard Time",
"preferredSupportLanguage": "en-US",
"country": "usa"
},
"quotaTicketDetails": {
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequestSubType": "BatchAml",
"quotaChangeRequests": [
{
"region": "EastUS",
"payload": "{\"VMFamily\":\"standardA0_A7Family\",\"NewLimit\":200,\"Type\":\"Dedicated\"}"
}
]
}
}
}
import com.azure.resourcemanager.support.models.Consent;
import com.azure.resourcemanager.support.models.ContactProfile;
import com.azure.resourcemanager.support.models.PreferredContactMethod;
import com.azure.resourcemanager.support.models.QuotaChangeRequest;
import com.azure.resourcemanager.support.models.QuotaTicketDetails;
import com.azure.resourcemanager.support.models.SeverityLevel;
import java.util.Arrays;
/**
* Samples for SupportTickets Create.
*/
public final class Main {
/*
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/
* CreateMachineLearningQuotaTicketForDedicatedCores.json
*/
/**
* Sample code: Create a ticket to request Quota increase for specific VM family cores for Machine Learning service.
*
* @param manager Entry point to SupportManager.
*/
public static void createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForMachineLearningService(
com.azure.resourcemanager.support.SupportManager manager) {
manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId(
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid")
.withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES)
.withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz")
.withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com")
.withPreferredTimeZone("Pacific Standard Time").withCountry("usa")
.withPreferredSupportLanguage("en-US"))
.withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid")
.withSupportPlanId(
"U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=")
.withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("BatchAml")
.withQuotaChangeRequestVersion("1.0")
.withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest().withRegion("EastUS")
.withPayload("{\"VMFamily\":\"standardA0_A7Family\",\"NewLimit\":200,\"Type\":\"Dedicated\"}"))))
.create();
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.support import MicrosoftSupport
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-support
# USAGE
python create_machine_learning_quota_ticket_for_dedicated_cores.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="132d901f-189d-4381-9214-fe68e27e05a1",
)
response = client.support_tickets.begin_create(
support_ticket_name="testticket",
create_support_ticket_parameters={
"properties": {
"advancedDiagnosticConsent": "Yes",
"contactDetails": {
"country": "usa",
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"preferredSupportLanguage": "en-US",
"preferredTimeZone": "Pacific Standard Time",
"primaryEmailAddress": "abc@contoso.com",
},
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid",
"quotaTicketDetails": {
"quotaChangeRequestSubType": "BatchAml",
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequests": [
{
"payload": '{"VMFamily":"standardA0_A7Family","NewLimit":200,"Type":"Dedicated"}',
"region": "EastUS",
}
],
},
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"severity": "moderate",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"title": "my title",
}
},
).result()
print(response)
# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateMachineLearningQuotaTicketForDedicatedCores.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/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateMachineLearningQuotaTicketForDedicatedCores.json
func ExampleTicketsClient_BeginCreate_createATicketToRequestQuotaIncreaseForSpecificVmFamilyCoresForMachineLearningService() {
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)
}
poller, err := clientFactory.NewTicketsClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{
Properties: &armsupport.TicketDetailsProperties{
Description: to.Ptr("my description"),
AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes),
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"),
},
ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid"),
QuotaTicketDetails: &armsupport.QuotaTicketDetails{
QuotaChangeRequestSubType: to.Ptr("BatchAml"),
QuotaChangeRequestVersion: to.Ptr("1.0"),
QuotaChangeRequests: []*armsupport.QuotaChangeRequest{
{
Payload: to.Ptr("{\"VMFamily\":\"standardA0_A7Family\",\"NewLimit\":200,\"Type\":\"Dedicated\"}"),
Region: to.Ptr("EastUS"),
}},
},
ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"),
Severity: to.Ptr(armsupport.SeverityLevelModerate),
SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="),
Title: to.Ptr("my title"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.TicketDetails = armsupport.TicketDetails{
// Name: to.Ptr("testticket"),
// Type: to.Ptr("Microsoft.Support/supportTickets"),
// ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"),
// Properties: &armsupport.TicketDetailsProperties{
// Description: to.Ptr("my description"),
// AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes),
// 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}()),
// FileWorkspaceName: to.Ptr("testticket"),
// ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()),
// ProblemClassificationDisplayName: to.Ptr("Machine Learning service"),
// ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid"),
// QuotaTicketDetails: &armsupport.QuotaTicketDetails{
// QuotaChangeRequestSubType: to.Ptr("Account"),
// QuotaChangeRequestVersion: to.Ptr("1.0"),
// QuotaChangeRequests: []*armsupport.QuotaChangeRequest{
// {
// Payload: to.Ptr("{\"VMFamily\":\"standardA0_A7Family\",\"NewLimit\":200,\"Type\":\"Dedicated\"}"),
// Region: to.Ptr("EastUS"),
// }},
// },
// Require24X7Response: to.Ptr(false),
// ServiceDisplayName: to.Ptr("Service and subscription limits (quotas)"),
// ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_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{
// },
// SupportPlanDisplayName: to.Ptr("Premier"),
// SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="),
// SupportPlanType: to.Ptr("Premier"),
// SupportTicketID: to.Ptr("119120321001170"),
// Title: to.Ptr("my title"),
// },
// }
}
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 Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.
*
* @summary Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an existing support ticket, visit the [Manage support ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in the Azure portal, select the support ticket, and use the file upload control to add a new file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as per [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). The primary token will be from the tenant for whom a support ticket is being raised against the subscription, i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider (CSP) partner tenant.
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateMachineLearningQuotaTicketForDedicatedCores.json
*/
async function createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForMachineLearningService() {
const subscriptionId =
process.env["SUPPORT_SUBSCRIPTION_ID"] || "132d901f-189d-4381-9214-fe68e27e05a1";
const supportTicketName = "testticket";
const createSupportTicketParameters = {
description: "my description",
advancedDiagnosticConsent: "Yes",
contactDetails: {
country: "usa",
firstName: "abc",
lastName: "xyz",
preferredContactMethod: "email",
preferredSupportLanguage: "en-US",
preferredTimeZone: "Pacific Standard Time",
primaryEmailAddress: "abc@contoso.com",
},
problemClassificationId:
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid",
quotaTicketDetails: {
quotaChangeRequestSubType: "BatchAml",
quotaChangeRequestVersion: "1.0",
quotaChangeRequests: [
{
payload: '{"VMFamily":"standardA0_A7Family","NewLimit":200,"Type":"Dedicated"}',
region: "EastUS",
},
],
},
serviceId: "/providers/Microsoft.Support/services/quota_service_guid",
severity: "moderate",
supportPlanId:
"U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
title: "my title",
};
const credential = new DefaultAzureCredential();
const client = new MicrosoftSupport(credential, subscriptionId);
const result = await client.supportTickets.beginCreateAndWait(
supportTicketName,
createSupportTicketParameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Support.Models;
using Azure.ResourceManager.Support;
// Generated from example definition: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateMachineLearningQuotaTicketForDedicatedCores.json
// this example is just showing the usage of "SupportTickets_Create" 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 = "132d901f-189d-4381-9214-fe68e27e05a1";
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
// get the collection of this SubscriptionSupportTicketResource
SubscriptionSupportTicketCollection collection = subscriptionResource.GetSubscriptionSupportTickets();
// invoke the operation
string supportTicketName = "testticket";
SupportTicketData data = new SupportTicketData(
"my description",
"/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid",
SupportSeverityLevel.Moderate,
AdvancedDiagnosticConsent.Yes,
new SupportContactProfile(
"abc",
"xyz",
PreferredContactMethod.Email,
"abc@contoso.com",
"Pacific Standard Time",
"usa",
"en-US"),
"my title",
"/providers/Microsoft.Support/services/quota_service_guid")
{
SupportPlanId = "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
QuotaTicketDetails = new QuotaTicketDetails
{
QuotaChangeRequestSubType = "BatchAml",
QuotaChangeRequestVersion = "1.0",
QuotaChangeRequests = {new SupportQuotaChangeContent
{
Region = "EastUS",
Payload = "{\"VMFamily\":\"standardA0_A7Family\",\"NewLimit\":200,\"Type\":\"Dedicated\"}",
}},
},
};
ArmOperation<SubscriptionSupportTicketResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, supportTicketName, data);
SubscriptionSupportTicketResource result = lro.Value;
// the variable result 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 = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
示例响应
location: https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/operationResults/operationid?api-version=2024-04-01
azure-asyncoperation: https://management.azure.com/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/operationsStatus/operationid?api-version=2024-04-01
{
"id": "/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket",
"name": "testticket",
"type": "Microsoft.Support/supportTickets",
"properties": {
"supportTicketId": "119120321001170",
"description": "my description",
"problemClassificationId": "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid",
"problemClassificationDisplayName": "Machine Learning service",
"severity": "moderate",
"require24X7Response": false,
"advancedDiagnosticConsent": "Yes",
"supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=",
"fileWorkspaceName": "testticket",
"contactDetails": {
"firstName": "abc",
"lastName": "xyz",
"preferredContactMethod": "email",
"primaryEmailAddress": "abc@contoso.com",
"preferredTimeZone": "Pacific Standard Time",
"country": "usa",
"preferredSupportLanguage": "en-US"
},
"quotaTicketDetails": {
"quotaChangeRequestVersion": "1.0",
"quotaChangeRequestSubType": "Account",
"quotaChangeRequests": [
{
"region": "EastUS",
"payload": "{\"VMFamily\":\"standardA0_A7Family\",\"NewLimit\":200,\"Type\":\"Dedicated\"}"
}
]
},
"serviceLevelAgreement": {
"startTime": "2020-03-20T21:36:18Z",
"expirationTime": "2020-03-21T17:36:18Z",
"slaMinutes": 240
},
"supportEngineer": {
"emailAddress": null
},
"supportPlanType": "Premier",
"supportPlanDisplayName": "Premier",
"title": "my title",
"serviceId": "/providers/Microsoft.Support/services/quota_service_guid",
"serviceDisplayName": "Service and subscription limits (quotas)",
"status": "Open",
"createdDate": "2020-03-20T21:36:18Z",
"modifiedDate": "2020-03-20T21:36:23Z"
}
}
定义
Consent
枚举
在支持票证上更新高级诊断同意。
Object
与支持票证关联的联系信息。
名称 |
类型 |
说明 |
additionalEmailAddresses
|
string[]
|
在有关支持票证的任何信件中,将复制列出的其他电子邮件地址。
|
country
|
string
|
用户的国家/地区。 这是 ISO 3166-1 alpha-3 代码。
|
firstName
|
string
|
名字。
|
lastName
|
string
|
姓。
|
phoneNumber
|
string
|
电话号码。 如果首选的联系人方法是电话,则需要这样做。
|
preferredContactMethod
|
PreferredContactMethod
|
首选联系人方法。
|
preferredSupportLanguage
|
string
|
Azure 中的首选支持语言。 支持语言因为支持票证选择的严重性而异。 有关详细信息,Azure 严重性和响应能力。 使用标准语言国家/地区代码。 有效值为英语的“en-us”、西班牙语的“es-es”、“法语fr-fr”、“日语ja-jp”、“朝鲜语ko-kr”、“俄语ru-ru”、“pt-br”、“葡萄牙语”、“it-it”、“it-it”、“中文zh-tw”、“德语de-de”。
|
preferredTimeZone
|
string
|
用户的时区。 这是时区的名称,Microsoft时区索引值。
|
primaryEmailAddress
|
string
|
主要电子邮件地址。
|
ErrorAdditionalInfo
Object
资源管理错误附加信息。
名称 |
类型 |
说明 |
info
|
object
|
其他信息。
|
type
|
string
|
其他信息类型。
|
ErrorDetail
Object
错误详细信息。
ErrorResponse
Object
错误响应
IsTemporaryTicket
枚举
此属性指示支持票证是否为临时票证。
枚举
首选联系人方法。
QuotaChangeRequest
Object
提供区域和新配额限制需要此属性。
名称 |
类型 |
说明 |
payload
|
string
|
配额增加请求的有效负载。
|
region
|
string
|
要为其发出配额增加请求的区域。
|
QuotaTicketDetails
Object
某些配额类型(例如虚拟机核心)增加配额支持票证所需的其他信息集。 获取有关配额有效负载支持请求的完整详细信息,以及 支持配额请求的示例。
名称 |
类型 |
说明 |
quotaChangeRequestSubType
|
string
|
当有子类型(例如 Batch)请求增加配额时,某些配额类型是必需的。
|
quotaChangeRequestVersion
|
string
|
配额更改请求版本。
|
quotaChangeRequests
|
QuotaChangeRequest[]
|
提供区域和新配额限制需要此属性。
|
SecondaryConsent
Object
此属性指示支持票证的辅助同意。
名称 |
类型 |
说明 |
type
|
string
|
正在为其提供辅助许可的服务名称。 需要从问题分类 API 响应中检索该值。
|
userConsent
|
UserConsent
|
提供的用户同意值
|
ServiceLevelAgreement
Object
支持票证的服务级别协议详细信息。
名称 |
类型 |
说明 |
expirationTime
|
string
(date-time)
|
服务级别协议到期的时间(ISO 8601 格式)。
|
slaMinutes
|
integer
(int32)
|
服务级别协议(以分钟为单位)。
|
startTime
|
string
(date-time)
|
服务级别协议启动时采用 UTC 时间(ISO 8601 格式)。
|
SeverityLevel
枚举
一个值,指示案例的紧迫性,这反过来又根据与 Azure 签订的技术支持计划的服务级别协议来确定响应时间。 注意:“最高严重影响”,也称为 Azure 门户中的“紧急 - 严重影响”级别仅保留给高级客户。
值 |
说明 |
critical
|
|
highestcriticalimpact
|
|
minimal
|
|
moderate
|
|
SupportEngineer
Object
支持工程师信息。
名称 |
类型 |
说明 |
emailAddress
|
string
|
分配给支持票证的 Azure 支持工程师的电子邮件地址。
|
SupportTicketDetails
Object
表示 SupportTicketDetails 资源的对象。
名称 |
类型 |
说明 |
id
|
string
|
资源的 ID。
|
name
|
string
|
资源的名称。
|
properties.advancedDiagnosticConsent
|
Consent
|
在支持票证上更新高级诊断同意。
|
properties.contactDetails
|
ContactProfile
|
请求创建支持票证的用户的联系信息。
|
properties.createdDate
|
string
(date-time)
|
创建支持票证的时间(ISO 8601 格式)。
|
properties.description
|
string
|
问题的详细描述。
|
properties.enrollmentId
|
string
|
与支持票证关联的注册 ID。
|
properties.fileWorkspaceName
|
string
|
文件工作区名称。
|
properties.isTemporaryTicket
|
IsTemporaryTicket
|
此属性指示支持票证是否为临时票证。
|
properties.modifiedDate
|
string
(date-time)
|
上次修改支持票证的时间(ISO 8601 格式)。
|
properties.problemClassificationDisplayName
|
string
|
问题分类的本地化名称。
|
properties.problemClassificationId
|
string
|
每个 Azure 服务都有自己的一组问题类别,也称为问题分类。 此参数是所遇到的问题类型的唯一 ID。
|
properties.problemScopingQuestions
|
string
|
与支持票证关联的问题范围问题。
|
properties.problemStartTime
|
string
(date-time)
|
问题开始的时间(ISO 8601 格式)。
|
properties.quotaTicketDetails
|
QuotaTicketDetails
|
与配额支持票证请求关联的其他票证详细信息。
|
properties.require24X7Response
|
boolean
|
指示这是否需要来自 Azure 的 24x7 响应。
|
properties.secondaryConsent
|
SecondaryConsent[]
|
此属性指示支持票证的辅助同意
|
properties.serviceDisplayName
|
string
|
Azure 服务的本地化名称。
|
properties.serviceId
|
string
|
这是与支持票证关联的 Azure 服务资源的资源 ID。
|
properties.serviceLevelAgreement
|
ServiceLevelAgreement
|
此支持票证的服务级别协议信息。
|
properties.severity
|
SeverityLevel
|
一个值,指示案例的紧迫性,这反过来又根据与 Azure 签订的技术支持计划的服务级别协议来确定响应时间。 注意:“最高严重影响”,也称为 Azure 门户中的“紧急 - 严重影响”级别仅保留给高级客户。
|
properties.status
|
string
|
支持票证的状态。
|
properties.supportEngineer
|
SupportEngineer
|
有关处理此支持票证的支持工程师的信息。
|
properties.supportPlanDisplayName
|
string
|
与支持票证关联的支持计划类型。
|
properties.supportPlanId
|
string
|
与支持票证关联的支持计划 ID。
|
properties.supportPlanType
|
string
|
与支持票证关联的支持计划类型。
|
properties.supportTicketId
|
string
|
系统生成的支持票证 ID 是唯一的。
|
properties.technicalTicketDetails
|
TechnicalTicketDetails
|
与技术支持票证请求关联的其他票证详细信息。
|
properties.title
|
string
|
支持票证的标题。
|
type
|
string
|
资源“Microsoft.Support/supportTickets”的类型。
|
TechnicalTicketDetails
Object
有关技术支持票证的其他信息。
名称 |
类型 |
说明 |
resourceId
|
string
|
这是 Azure 服务资源的资源 ID(例如:创建支持票证的虚拟机资源或 HDInsight 资源)。
|
UserConsent
枚举
提供的用户同意值