Lists all the Azure services available for support ticket creation. For Technical issues, select the Service Id that maps to the Azure service/product as displayed in the Services drop-down list on the Azure portal's New support request page. Always use the service and its corresponding problem classification(s) obtained programmatically for support ticket creation. This practice ensures that you always have the most recent set of service and problem classification Ids.
GET https://management.azure.com/providers/Microsoft.Support/services?api-version=2020-04-01
GET https://management.azure.com/providers/Microsoft.Support/services?api-version=2020-04-01
/** Samples for Services List. */
public final class Main {
/*
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListServices.json
*/
/**
* Sample code: Gets list of services for which a support ticket can be created.
*
* @param manager Entry point to SupportManager.
*/
public static void getsListOfServicesForWhichASupportTicketCanBeCreated(
com.azure.resourcemanager.support.SupportManager manager) {
manager.services().list(com.azure.core.util.Context.NONE);
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.support import MicrosoftSupport
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-support
# USAGE
python gets_list_of_services_for_which_a_support_ticket_can_be_created.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="SUBSCRIPTION_ID",
)
response = client.services.list()
for item in response:
print(item)
# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListServices.json
if __name__ == "__main__":
main()
const { MicrosoftSupport } = require("@azure/arm-support");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Lists all the Azure services available for support ticket creation. For **Technical** issues, select the Service Id that maps to the Azure service/product as displayed in the **Services** drop-down list on the Azure portal's [New support request](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/overview) page. Always use the service and its corresponding problem classification(s) obtained programmatically for support ticket creation. This practice ensures that you always have the most recent set of service and problem classification Ids.
*
* @summary Lists all the Azure services available for support ticket creation. For **Technical** issues, select the Service Id that maps to the Azure service/product as displayed in the **Services** drop-down list on the Azure portal's [New support request](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/overview) page. Always use the service and its corresponding problem classification(s) obtained programmatically for support ticket creation. This practice ensures that you always have the most recent set of service and problem classification Ids.
* x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListServices.json
*/
async function getsListOfServicesForWhichASupportTicketCanBeCreated() {
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new MicrosoftSupport(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.services.list()) {
resArray.push(item);
}
console.log(resArray);
}
getsListOfServicesForWhichASupportTicketCanBeCreated().catch(console.error);
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Support;
// Generated from example definition: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListServices.json
// this example is just showing the usage of "Services_List" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this TenantResource created on azure
// for more information of creating TenantResource, please refer to the document of TenantResource
var tenantResource = client.GetTenants().GetAllAsync().GetAsyncEnumerator().Current;
// get the collection of this SupportAzureServiceResource
SupportAzureServiceCollection collection = tenantResource.GetSupportAzureServices();
// invoke the operation and iterate over the result
await foreach (SupportAzureServiceResource item in collection.GetAllAsync())
{
// the variable item is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SupportAzureServiceData resourceData = item.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
Console.WriteLine($"Succeeded");