Gets information about the specified certificate.
Warning: This operation is deprecated and will be removed after February, 2024. Please use the Azure KeyVault Extension instead.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}?api-version=2024-02-01
URI Parameters
Name |
In |
Required |
Type |
Description |
accountName
|
path |
True
|
string
|
The name of the Batch account.
Regex pattern: ^[a-zA-Z0-9]+$
|
certificateName
|
path |
True
|
string
|
The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5.
Regex pattern: ^[\w]+-[\w]+$
|
resourceGroupName
|
path |
True
|
string
|
The name of the resource group that contains the Batch account.
|
subscriptionId
|
path |
True
|
string
|
The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)
|
api-version
|
query |
True
|
string
|
The API version to be used with the HTTP request.
|
Responses
Name |
Type |
Description |
200 OK
|
Certificate
|
The operation was successful. The response contains the certificate entity.
Headers
ETag: string
|
Other Status Codes
|
CloudError
|
Error response describing why the operation failed.
|
Security
azure_auth
Microsoft Entra OAuth 2.0 auth code flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name |
Description |
user_impersonation
|
impersonate your user account
|
Examples
Get Certificate
Sample Request
GET https://management.azure.com/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/certificates/sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e?api-version=2024-02-01
/**
* Samples for Certificate Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/CertificateGet.json
*/
/**
* Sample code: Get Certificate.
*
* @param manager Entry point to BatchManager.
*/
public static void getCertificate(com.azure.resourcemanager.batch.BatchManager manager) {
manager.certificates().getWithResponse("default-azurebatch-japaneast", "sampleacct",
"sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e", com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.batch import BatchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-batch
# USAGE
python certificate_get.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 = BatchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.certificate.get(
resource_group_name="default-azurebatch-japaneast",
account_name="sampleacct",
certificate_name="sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e",
)
print(response)
# x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/CertificateGet.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 armbatch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/CertificateGet.json
func ExampleCertificateClient_Get_getCertificate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbatch.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewCertificateClient().Get(ctx, "default-azurebatch-japaneast", "sampleacct", "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e", nil)
if err != nil {
log.Fatalf("failed to finish the request: %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.Certificate = armbatch.Certificate{
// Name: to.Ptr("sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"),
// Type: to.Ptr("Microsoft.Batch/batchAccounts/certificates"),
// Etag: to.Ptr("W/\"0x8D4EDD5118668F7\""),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/samplecct/certificates/sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"),
// Properties: &armbatch.CertificateProperties{
// Format: to.Ptr(armbatch.CertificateFormatPfx),
// Thumbprint: to.Ptr("0a0e4f50d51beadeac1d35afc5116098e7902e6e"),
// ThumbprintAlgorithm: to.Ptr("sha1"),
// ProvisioningState: to.Ptr(armbatch.CertificateProvisioningStateSucceeded),
// ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-21T01:47:38.442Z"); return t}()),
// PublicData: to.Ptr("MIICrjCCAZagAwI..."),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { BatchManagementClient } = require("@azure/arm-batch");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead.
*
* @summary Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead.
* x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/CertificateGet.json
*/
async function getCertificate() {
const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast";
const accountName = "sampleacct";
const certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e";
const credential = new DefaultAzureCredential();
const client = new BatchManagementClient(credential, subscriptionId);
const result = await client.certificateOperations.get(
resourceGroupName,
accountName,
certificateName,
);
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 System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Batch;
using Azure.ResourceManager.Batch.Models;
// Generated from example definition: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/CertificateGet.json
// this example is just showing the usage of "Certificate_Get" 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 BatchAccountCertificateResource created on azure
// for more information of creating BatchAccountCertificateResource, please refer to the document of BatchAccountCertificateResource
string subscriptionId = "subid";
string resourceGroupName = "default-azurebatch-japaneast";
string accountName = "sampleacct";
string certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e";
ResourceIdentifier batchAccountCertificateResourceId = BatchAccountCertificateResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, certificateName);
BatchAccountCertificateResource batchAccountCertificate = client.GetBatchAccountCertificateResource(batchAccountCertificateResourceId);
// invoke the operation
BatchAccountCertificateResource result = await batchAccountCertificate.GetAsync();
// 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
BatchAccountCertificateData 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
Sample Response
ETag: W/"0x8D4EDD5118668F7"
{
"id": "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/samplecct/certificates/sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e",
"name": "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e",
"type": "Microsoft.Batch/batchAccounts/certificates",
"etag": "W/\"0x8D4EDD5118668F7\"",
"properties": {
"thumbprintAlgorithm": "sha1",
"thumbprint": "0a0e4f50d51beadeac1d35afc5116098e7902e6e",
"provisioningState": "Succeeded",
"provisioningStateTransitionTime": "2017-07-21T01:47:38.4420202Z",
"format": "Pfx",
"publicData": "MIICrjCCAZagAwI..."
}
}
Get Certificate with Deletion Error
Sample Request
GET https://management.azure.com/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/certificates/sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e?api-version=2024-02-01
/**
* Samples for Certificate Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/CertificateGetWithDeletionError.
* json
*/
/**
* Sample code: Get Certificate with Deletion Error.
*
* @param manager Entry point to BatchManager.
*/
public static void getCertificateWithDeletionError(com.azure.resourcemanager.batch.BatchManager manager) {
manager.certificates().getWithResponse("default-azurebatch-japaneast", "sampleacct",
"sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e", com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.batch import BatchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-batch
# USAGE
python certificate_get_with_deletion_error.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 = BatchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.certificate.get(
resource_group_name="default-azurebatch-japaneast",
account_name="sampleacct",
certificate_name="sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e",
)
print(response)
# x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/CertificateGetWithDeletionError.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 armbatch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/CertificateGetWithDeletionError.json
func ExampleCertificateClient_Get_getCertificateWithDeletionError() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbatch.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewCertificateClient().Get(ctx, "default-azurebatch-japaneast", "sampleacct", "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e", nil)
if err != nil {
log.Fatalf("failed to finish the request: %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.Certificate = armbatch.Certificate{
// Name: to.Ptr("sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"),
// Type: to.Ptr("Microsoft.Batch/batchAccounts/certificates"),
// Etag: to.Ptr("W/\"0x8D4EDD5118668F7\""),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/samplecct/certificates/sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"),
// Properties: &armbatch.CertificateProperties{
// Format: to.Ptr(armbatch.CertificateFormatPfx),
// Thumbprint: to.Ptr("0a0e4f50d51beadeac1d35afc5116098e7902e6e"),
// ThumbprintAlgorithm: to.Ptr("sha1"),
// DeleteCertificateError: &armbatch.DeleteCertificateError{
// Code: to.Ptr("NodesReferencingCertificate"),
// Message: to.Ptr("The specified certificate is being used by the below mentioned node(s)\nRequestId:2dc78afc-b15b-42d2-8c85-39cb61a0799e\nTime:2017-08-28T10:22:52.8633406Z"),
// Target: to.Ptr("BatchAccount"),
// Details: []*armbatch.DeleteCertificateError{
// {
// Code: to.Ptr("Nodes"),
// Message: to.Ptr("node1, node3"),
// }},
// },
// PreviousProvisioningState: to.Ptr(armbatch.CertificateProvisioningStateDeleting),
// PreviousProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-21T00:15:25.562Z"); return t}()),
// ProvisioningState: to.Ptr(armbatch.CertificateProvisioningStateSucceeded),
// ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-21T01:47:38.442Z"); return t}()),
// PublicData: to.Ptr("MIICrjCCAZagAwI..."),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { BatchManagementClient } = require("@azure/arm-batch");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead.
*
* @summary Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead.
* x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/CertificateGetWithDeletionError.json
*/
async function getCertificateWithDeletionError() {
const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast";
const accountName = "sampleacct";
const certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e";
const credential = new DefaultAzureCredential();
const client = new BatchManagementClient(credential, subscriptionId);
const result = await client.certificateOperations.get(
resourceGroupName,
accountName,
certificateName,
);
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 System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Batch;
using Azure.ResourceManager.Batch.Models;
// Generated from example definition: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/CertificateGetWithDeletionError.json
// this example is just showing the usage of "Certificate_Get" 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 BatchAccountCertificateResource created on azure
// for more information of creating BatchAccountCertificateResource, please refer to the document of BatchAccountCertificateResource
string subscriptionId = "subid";
string resourceGroupName = "default-azurebatch-japaneast";
string accountName = "sampleacct";
string certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e";
ResourceIdentifier batchAccountCertificateResourceId = BatchAccountCertificateResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, certificateName);
BatchAccountCertificateResource batchAccountCertificate = client.GetBatchAccountCertificateResource(batchAccountCertificateResourceId);
// invoke the operation
BatchAccountCertificateResource result = await batchAccountCertificate.GetAsync();
// 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
BatchAccountCertificateData 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
Sample Response
ETag: W/"0x8D4EDD5118668F7"
{
"id": "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/samplecct/certificates/sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e",
"name": "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e",
"type": "Microsoft.Batch/batchAccounts/certificates",
"etag": "W/\"0x8D4EDD5118668F7\"",
"properties": {
"thumbprintAlgorithm": "sha1",
"thumbprint": "0a0e4f50d51beadeac1d35afc5116098e7902e6e",
"provisioningState": "Failed",
"provisioningStateTransitionTime": "2017-07-21T01:47:38.4420202Z",
"previousProvisioningState": "Deleting",
"previousProvisioningStateTransitionTime": "2017-07-21T00:15:25.5625498Z",
"format": "Pfx",
"publicData": "MIICrjCCAZagAwI...",
"deleteCertificateError": {
"code": "NodesReferencingCertificate",
"message": "The specified certificate is being used by the below mentioned node(s)\nRequestId:2dc78afc-b15b-42d2-8c85-39cb61a0799e\nTime:2017-08-28T10:22:52.8633406Z",
"target": "BatchAccount",
"details": [
{
"code": "Nodes",
"message": "node1, node3"
}
]
}
}
}
Definitions
Certificate
Contains information about a certificate.
Name |
Type |
Description |
etag
|
string
|
The ETag of the resource, used for concurrency statements.
|
id
|
string
|
The ID of the resource.
|
name
|
string
|
The name of the resource.
|
properties.deleteCertificateError
|
DeleteCertificateError
|
The error which occurred while deleting the certificate
This is only returned when the certificate provisioningState is 'Failed'.
|
properties.format
|
CertificateFormat
|
The format of the certificate - either Pfx or Cer. If omitted, the default is Pfx.
|
properties.previousProvisioningState
|
CertificateProvisioningState
|
The previous provisioned state of the resource
|
properties.previousProvisioningStateTransitionTime
|
string
|
The time at which the certificate entered its previous state.
|
properties.provisioningState
|
CertificateProvisioningState
|
The provisioned state of the resource
|
properties.provisioningStateTransitionTime
|
string
|
The time at which the certificate entered its current state.
|
properties.publicData
|
string
|
The public key of the certificate.
|
properties.thumbprint
|
string
|
The thumbprint of the certificate.
This must match the thumbprint from the name.
|
properties.thumbprintAlgorithm
|
string
|
The algorithm of the certificate thumbprint.
This must match the first portion of the certificate name. Currently required to be 'SHA1'.
|
type
|
string
|
The type of the resource.
|
The format of the certificate - either Pfx or Cer. If omitted, the default is Pfx.
Name |
Type |
Description |
Cer
|
string
|
The certificate is a base64-encoded X.509 certificate.
|
Pfx
|
string
|
The certificate is a PFX (PKCS#12) formatted certificate or certificate chain.
|
CertificateProvisioningState
The provisioned state of the resource
Name |
Type |
Description |
Deleting
|
string
|
The user has requested that the certificate be deleted, but the delete operation has not yet completed. You may not reference the certificate when creating or updating pools.
|
Failed
|
string
|
The user requested that the certificate be deleted, but there are pools that still have references to the certificate, or it is still installed on one or more compute nodes. (The latter can occur if the certificate has been removed from the pool, but the node has not yet restarted. Nodes refresh their certificates only when they restart.) You may use the cancel certificate delete operation to cancel the delete, or the delete certificate operation to retry the delete.
|
Succeeded
|
string
|
The certificate is available for use in pools.
|
CloudError
An error response from the Batch service.
Name |
Type |
Description |
error
|
CloudErrorBody
|
The body of the error response.
|
CloudErrorBody
An error response from the Batch service.
Name |
Type |
Description |
code
|
string
|
An identifier for the error. Codes are invariant and are intended to be consumed programmatically.
|
details
|
CloudErrorBody[]
|
A list of additional details about the error.
|
message
|
string
|
A message describing the error, intended to be suitable for display in a user interface.
|
target
|
string
|
The target of the particular error. For example, the name of the property in error.
|
DeleteCertificateError
An error response from the Batch service.
Name |
Type |
Description |
code
|
string
|
An identifier for the error. Codes are invariant and are intended to be consumed programmatically.
|
details
|
DeleteCertificateError[]
|
A list of additional details about the error.
|
message
|
string
|
A message describing the error, intended to be suitable for display in a user interface.
|
target
|
string
|
The target of the particular error. For example, the name of the property in error.
|