swagger: "2.0"
schemes:
  - https
host: management.azure.com
info:
  title: Certificates API Client
  version: 2018-11-01
  x-apisguru-categories:
    - cloud
  x-logo:
    url: https://api.apis.guru/v2/cache/logo/https_assets.onestore.ms_cdnfiles_onestorerolling-1606-01000_shell_v3_images_logo_microsoft.png
  x-origin:
    - format: swagger
      url: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/web/resource-manager/Microsoft.Web/stable/2018-11-01/Certificates.json
      version: "2.0"
  x-preferred: true
  x-providerName: azure.com
  x-serviceName: web-Certificates
  x-tags:
    - Azure
    - Microsoft
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  azure_auth:
    authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
    description: Azure Active Directory OAuth2 Flow
    flow: implicit
    scopes:
      user_impersonation: impersonate your user account
    type: oauth2
security:
  - azure_auth:
      - user_impersonation
parameters:
  apiVersionParameter:
    description: API Version
    in: query
    name: api-version
    required: true
    type: string
  resourceGroupNameParameter:
    description: Name of the resource group to which the resource belongs.
    in: path
    maxLength: 90
    minLength: 1
    name: resourceGroupName
    pattern: ^[-\w\._\(\)]+[^\.]$
    required: true
    type: string
    x-ms-parameter-location: method
  subscriptionIdParameter:
    description: Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
    in: path
    name: subscriptionId
    required: true
    type: string
paths:
  "/subscriptions/{subscriptionId}/providers/Microsoft.Web/certificates":
    get:
      description: Get all certificates for a subscription.
      operationId: Certificates_List
      parameters:
        - $ref: "#/parameters/subscriptionIdParameter"
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/CertificateCollection"
        default:
          description: App Service error response.
          schema:
            description: App Service error response.
            properties:
              error:
                description: Error model.
                properties:
                  code:
                    description: Standardized string to programmatically identify the error.
                    readOnly: true
                    type: string
                  details:
                    items:
                      description: Detailed errors.
                      properties:
                        code:
                          description: Standardized string to programmatically identify the error.
                          readOnly: true
                          type: string
                        message:
                          description: Detailed error description and debugging information.
                          readOnly: true
                          type: string
                        target:
                          description: Detailed error description and debugging information.
                          readOnly: true
                          type: string
                      readOnly: true
                    type: array
                  innererror:
                    description: More information to debug error.
                    readOnly: true
                    type: string
                  message:
                    description: Detailed error description and debugging information.
                    readOnly: true
                    type: string
                  target:
                    description: Detailed error description and debugging information.
                    readOnly: true
                    type: string
                readOnly: true
                type: object
            type: object
      summary: Get all certificates for a subscription.
      tags:
        - Certificates
      x-ms-examples:
        List Certificates for subscription:
          parameters:
            api-version: 2018-02-01
            subscriptionId: 34adfa4f-cedf-4dc0-ba29-b6d1a69ab345
          responses:
            "200":
              body:
                value:
                  - id: /subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Web/certificates/testc6282
                    location: East US
                    name: testc6282
                    properties:
                      expirationDate: 2039-12-31T23:59:59+00:00
                      friendlyName: ""
                      hostNames:
                        - ServerCert
                      issueDate: 2015-11-12T23:40:25+00:00
                      issuer: CACert
                      password: SWsSsd__233$Sdsds#%Sd!
                      subjectName: ServerCert
                      thumbprint: FE703D7411A44163B6D32B3AD9B03E175886EBFE
                    type: Microsoft.Web/certificates
                  - id: /subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Web/certificates/testc4912
                    location: West US
                    name: testc4912
                    properties:
                      expirationDate: 2040-12-31T23:59:59+00:00
                      friendlyName: ""
                      hostNames:
                        - ServerCert2
                      issueDate: 2015-12-12T23:40:25+00:00
                      issuer: CACert
                      password: SWsSsd__233$Sdsds#%Sd!
                      subjectName: ServerCert2
                      thumbprint: FE703D7411A44163B6D32B3AD9B0490D5886EBFE
                    type: Microsoft.Web/certificates
              headers: {}
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates":
    get:
      description: Get all certificates in a resource group.
      operationId: Certificates_ListByResourceGroup
      parameters:
        - $ref: "#/parameters/resourceGroupNameParameter"
        - $ref: "#/parameters/subscriptionIdParameter"
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: OK.
          schema:
            $ref: "#/definitions/CertificateCollection"
        default:
          description: App Service error response.
          schema:
            description: App Service error response.
            properties:
              error:
                description: Error model.
                properties:
                  code:
                    description: Standardized string to programmatically identify the error.
                    readOnly: true
                    type: string
                  details:
                    items:
                      description: Detailed errors.
                      properties:
                        code:
                          description: Standardized string to programmatically identify the error.
                          readOnly: true
                          type: string
                        message:
                          description: Detailed error description and debugging information.
                          readOnly: true
                          type: string
                        target:
                          description: Detailed error description and debugging information.
                          readOnly: true
                          type: string
                      readOnly: true
                    type: array
                  innererror:
                    description: More information to debug error.
                    readOnly: true
                    type: string
                  message:
                    description: Detailed error description and debugging information.
                    readOnly: true
                    type: string
                  target:
                    description: Detailed error description and debugging information.
                    readOnly: true
                    type: string
                readOnly: true
                type: object
            type: object
      summary: Get all certificates in a resource group.
      tags:
        - Certificates
      x-ms-examples:
        List Certificates by resource group:
          parameters:
            api-version: 2018-02-01
            resourceGroupName: testrg123
            subscriptionId: 34adfa4f-cedf-4dc0-ba29-b6d1a69ab345
          responses:
            "200":
              body:
                value:
                  - id: /subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Web/certificates/testc6282
                    location: East US
                    name: testc6282
                    properties:
                      expirationDate: 2039-12-31T23:59:59+00:00
                      friendlyName: ""
                      hostNames:
                        - ServerCert
                      issueDate: 2015-11-12T23:40:25+00:00
                      issuer: CACert
                      password: SWsSsd__233$Sdsds#%Sd!
                      subjectName: ServerCert
                      thumbprint: FE703D7411A44163B6D32B3AD9B03E175886EBFE
                    type: Microsoft.Web/certificates
                  - id: /subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Web/certificates/testc4912
                    location: West US
                    name: testc4912
                    properties:
                      expirationDate: 2040-12-31T23:59:59+00:00
                      friendlyName: ""
                      hostNames:
                        - ServerCert2
                      issueDate: 2015-12-12T23:40:25+00:00
                      issuer: CACert
                      password: SWsSsd__233$Sdsds#%Sd!
                      subjectName: ServerCert2
                      thumbprint: FE703D7411A44163B6D32B3AD9B0490D5886EBFE
                    type: Microsoft.Web/certificates
              headers: {}
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}":
    delete:
      description: Delete a certificate.
      operationId: Certificates_Delete
      parameters:
        - $ref: "#/parameters/resourceGroupNameParameter"
        - description: Name of the certificate.
          in: path
          name: name
          required: true
          type: string
        - $ref: "#/parameters/subscriptionIdParameter"
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: Successfully deleted certificate.
        "204":
          description: Certificate does not exist.
      summary: Delete a certificate.
      tags:
        - Certificates
      x-ms-examples:
        Delete Certificate:
          parameters:
            api-version: 2018-02-01
            name: testc6282
            resourceGroupName: testrg123
            subscriptionId: 34adfa4f-cedf-4dc0-ba29-b6d1a69ab345
          responses:
            "200": {}
            "204": {}
    get:
      description: Get a certificate.
      operationId: Certificates_Get
      parameters:
        - $ref: "#/parameters/resourceGroupNameParameter"
        - description: Name of the certificate.
          in: path
          name: name
          required: true
          type: string
        - $ref: "#/parameters/subscriptionIdParameter"
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/Certificate"
        default:
          description: App Service error response.
          schema:
            description: App Service error response.
            properties:
              error:
                description: Error model.
                properties:
                  code:
                    description: Standardized string to programmatically identify the error.
                    readOnly: true
                    type: string
                  details:
                    items:
                      description: Detailed errors.
                      properties:
                        code:
                          description: Standardized string to programmatically identify the error.
                          readOnly: true
                          type: string
                        message:
                          description: Detailed error description and debugging information.
                          readOnly: true
                          type: string
                        target:
                          description: Detailed error description and debugging information.
                          readOnly: true
                          type: string
                      readOnly: true
                    type: array
                  innererror:
                    description: More information to debug error.
                    readOnly: true
                    type: string
                  message:
                    description: Detailed error description and debugging information.
                    readOnly: true
                    type: string
                  target:
                    description: Detailed error description and debugging information.
                    readOnly: true
                    type: string
                readOnly: true
                type: object
            type: object
      summary: Get a certificate.
      tags:
        - Certificates
      x-ms-examples:
        Get Certificate:
          parameters:
            api-version: 2018-02-01
            name: testc6282
            resourceGroupName: testrg123
            subscriptionId: 34adfa4f-cedf-4dc0-ba29-b6d1a69ab345
          responses:
            "200":
              body:
                id: /subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Web/certificates/testc6282
                location: East US
                name: testc6282
                properties:
                  expirationDate: 2039-12-31T23:59:59+00:00
                  friendlyName: ""
                  hostNames:
                    - ServerCert
                  issueDate: 2015-11-12T23:40:25+00:00
                  issuer: CACert
                  password: SWsSsd__233$Sdsds#%Sd!
                  subjectName: ServerCert
                  thumbprint: FE703D7411A44163B6D32B3AD9B03E175886EBFE
                type: Microsoft.Web/certificates
              headers: {}
    patch:
      description: Create or update a certificate.
      operationId: Certificates_Update
      parameters:
        - $ref: "#/parameters/resourceGroupNameParameter"
        - description: Name of the certificate.
          in: path
          name: name
          required: true
          type: string
        - description: Details of certificate, if it exists already.
          in: body
          name: certificateEnvelope
          required: true
          schema:
            $ref: "#/definitions/CertificatePatchResource"
        - $ref: "#/parameters/subscriptionIdParameter"
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: OK.
          schema:
            $ref: "#/definitions/Certificate"
        default:
          description: App Service error response.
          schema:
            description: App Service error response.
            properties:
              error:
                description: Error model.
                properties:
                  code:
                    description: Standardized string to programmatically identify the error.
                    readOnly: true
                    type: string
                  details:
                    items:
                      description: Detailed errors.
                      properties:
                        code:
                          description: Standardized string to programmatically identify the error.
                          readOnly: true
                          type: string
                        message:
                          description: Detailed error description and debugging information.
                          readOnly: true
                          type: string
                        target:
                          description: Detailed error description and debugging information.
                          readOnly: true
                          type: string
                      readOnly: true
                    type: array
                  innererror:
                    description: More information to debug error.
                    readOnly: true
                    type: string
                  message:
                    description: Detailed error description and debugging information.
                    readOnly: true
                    type: string
                  target:
                    description: Detailed error description and debugging information.
                    readOnly: true
                    type: string
                readOnly: true
                type: object
            type: object
      summary: Create or update a certificate.
      tags:
        - Certificates
      x-ms-examples:
        Patch Certificate:
          parameters:
            api-version: 2018-02-01
            certificateEnvelope:
              id: /subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Web/certificates/testc6282
              name: testc6282
              properties:
                password: SWsSsd__233$Sdsds#%Sd!
              type: Microsoft.Web/certificates
            name: testc6282
            resourceGroupName: testrg123
            subscriptionId: 34adfa4f-cedf-4dc0-ba29-b6d1a69ab345
          responses:
            "200":
              body:
                id: /subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Web/certificates/testc6282
                location: East US
                name: testc6282
                properties:
                  expirationDate: 2039-12-31T23:59:59+00:00
                  friendlyName: ""
                  hostNames:
                    - ServerCert
                  issueDate: 2015-11-12T23:40:25+00:00
                  issuer: CACert
                  password: SWsSsd__233$Sdsds#%Sd!
                  subjectName: ServerCert
                  thumbprint: FE703D7411A44163B6D32B3AD9B03E175886EBFE
                type: Microsoft.Web/certificates
              headers: {}
    put:
      description: Create or update a certificate.
      operationId: Certificates_CreateOrUpdate
      parameters:
        - $ref: "#/parameters/resourceGroupNameParameter"
        - description: Name of the certificate.
          in: path
          name: name
          required: true
          type: string
        - description: Details of certificate, if it exists already.
          in: body
          name: certificateEnvelope
          required: true
          schema:
            $ref: "#/definitions/Certificate"
        - $ref: "#/parameters/subscriptionIdParameter"
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: OK.
          schema:
            $ref: "#/definitions/Certificate"
        default:
          description: App Service error response.
          schema:
            description: App Service error response.
            properties:
              error:
                description: Error model.
                properties:
                  code:
                    description: Standardized string to programmatically identify the error.
                    readOnly: true
                    type: string
                  details:
                    items:
                      description: Detailed errors.
                      properties:
                        code:
                          description: Standardized string to programmatically identify the error.
                          readOnly: true
                          type: string
                        message:
                          description: Detailed error description and debugging information.
                          readOnly: true
                          type: string
                        target:
                          description: Detailed error description and debugging information.
                          readOnly: true
                          type: string
                      readOnly: true
                    type: array
                  innererror:
                    description: More information to debug error.
                    readOnly: true
                    type: string
                  message:
                    description: Detailed error description and debugging information.
                    readOnly: true
                    type: string
                  target:
                    description: Detailed error description and debugging information.
                    readOnly: true
                    type: string
                readOnly: true
                type: object
            type: object
      summary: Create or update a certificate.
      tags:
        - Certificates
      x-ms-examples:
        Create Or Update Certificate:
          parameters:
            api-version: 2018-02-01
            certificateEnvelope:
              id: /subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Web/certificates/testc6282
              location: East US
              name: testc6282
              properties:
                expirationDate: 2039-12-31T23:59:59+00:00
                friendlyName: ""
                hostNames:
                  - ServerCert
                issueDate: 2015-11-12T23:40:25+00:00
                issuer: CACert
                password: SWsSsd__233$Sdsds#%Sd!
                subjectName: ServerCert
                thumbprint: FE703D7411A44163B6D32B3AD9B03E175886EBFE
              type: Microsoft.Web/certificates
            name: testc6282
            resourceGroupName: testrg123
            subscriptionId: 34adfa4f-cedf-4dc0-ba29-b6d1a69ab345
          responses:
            "200":
              body:
                id: /subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Web/certificates/testc6282
                location: East US
                name: testc6282
                properties:
                  expirationDate: 2039-12-31T23:59:59+00:00
                  friendlyName: ""
                  hostNames:
                    - ServerCert
                  issueDate: 2015-11-12T23:40:25+00:00
                  issuer: CACert
                  password: SWsSsd__233$Sdsds#%Sd!
                  subjectName: ServerCert
                  thumbprint: FE703D7411A44163B6D32B3AD9B03E175886EBFE
                type: Microsoft.Web/certificates
              headers: {}
definitions:
  Certificate:
    allOf:
      - description: Azure resource. This resource is tracked in Azure Resource Manager
        properties:
          id:
            description: Resource Id.
            readOnly: true
            type: string
          kind:
            description: Kind of resource.
            type: string
          location:
            description: Resource Location.
            type: string
          name:
            description: Resource Name.
            readOnly: true
            type: string
          tags:
            additionalProperties:
              type: string
            description: Resource tags.
            type: object
          type:
            description: Resource type.
            readOnly: true
            type: string
        required:
          - location
        x-ms-azure-resource: true
    description: SSL certificate for an app.
    properties:
      properties:
        description: Certificate resource specific properties
        properties:
          cerBlob:
            description: Raw bytes of .cer file
            format: byte
            readOnly: true
            type: string
          expirationDate:
            description: Certificate expiration date.
            format: date-time
            readOnly: true
            type: string
          friendlyName:
            description: Friendly name of the certificate.
            readOnly: true
            type: string
          hostNames:
            description: Host names the certificate applies to.
            items:
              type: string
            type: array
          hostingEnvironmentProfile:
            description: Specification for an App Service Environment to use for this resource.
            properties:
              id:
                description: Resource ID of the App Service Environment.
                type: string
              name:
                description: Name of the App Service Environment.
                readOnly: true
                type: string
              type:
                description: Resource type of the App Service Environment.
                readOnly: true
                type: string
            type: object
          issueDate:
            description: Certificate issue Date.
            format: date-time
            readOnly: true
            type: string
          issuer:
            description: Certificate issuer.
            readOnly: true
            type: string
          keyVaultId:
            description: Key Vault Csm resource Id.
            type: string
          keyVaultSecretName:
            description: Key Vault secret name.
            type: string
          keyVaultSecretStatus:
            description: Status of the Key Vault secret.
            enum:
              - Initialized
              - WaitingOnCertificateOrder
              - Succeeded
              - CertificateOrderFailed
              - OperationNotPermittedOnKeyVault
              - AzureServiceUnauthorizedToAccessKeyVault
              - KeyVaultDoesNotExist
              - KeyVaultSecretDoesNotExist
              - UnknownError
              - ExternalPrivateKey
              - Unknown
            readOnly: true
            type: string
            x-ms-enum:
              modelAsString: false
              name: KeyVaultSecretStatus
          password:
            description: Certificate password.
            type: string
            x-ms-mutability:
              - create
          pfxBlob:
            description: Pfx blob.
            format: byte
            type: string
          publicKeyHash:
            description: Public key hash.
            readOnly: true
            type: string
          selfLink:
            description: Self link.
            readOnly: true
            type: string
          serverFarmId:
            description: 'Resource ID of the associated App Service plan, formatted as: "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}".'
            type: string
          siteName:
            description: App name.
            readOnly: true
            type: string
          subjectName:
            description: Subject name of the certificate.
            readOnly: true
            type: string
          thumbprint:
            description: Certificate thumbprint.
            readOnly: true
            type: string
          valid:
            description: Is the certificate valid?.
            readOnly: true
            type: boolean
        required:
          - password
        x-ms-client-flatten: true
    type: object
  CertificateCollection:
    description: Collection of certificates.
    properties:
      nextLink:
        description: Link to next page of resources.
        readOnly: true
        type: string
      value:
        description: Collection of resources.
        items:
          $ref: "#/definitions/Certificate"
        type: array
    required:
      - value
    type: object
  CertificatePatchResource:
    allOf:
      - description: Azure proxy only resource. This resource is not tracked by Azure Resource Manager.
        properties:
          id:
            description: Resource Id.
            readOnly: true
            type: string
          kind:
            description: Kind of resource.
            type: string
          name:
            description: Resource Name.
            readOnly: true
            type: string
          type:
            description: Resource type.
            readOnly: true
            type: string
        x-ms-azure-resource: true
    description: ARM resource for a certificate.
    properties:
      properties:
        description: CertificatePatchResource resource specific properties
        properties:
          cerBlob:
            description: Raw bytes of .cer file
            format: byte
            readOnly: true
            type: string
          expirationDate:
            description: Certificate expiration date.
            format: date-time
            readOnly: true
            type: string
          friendlyName:
            description: Friendly name of the certificate.
            readOnly: true
            type: string
          hostNames:
            description: Host names the certificate applies to.
            items:
              type: string
            type: array
          hostingEnvironmentProfile:
            description: Specification for an App Service Environment to use for this resource.
            properties:
              id:
                description: Resource ID of the App Service Environment.
                type: string
              name:
                description: Name of the App Service Environment.
                readOnly: true
                type: string
              type:
                description: Resource type of the App Service Environment.
                readOnly: true
                type: string
            type: object
          issueDate:
            description: Certificate issue Date.
            format: date-time
            readOnly: true
            type: string
          issuer:
            description: Certificate issuer.
            readOnly: true
            type: string
          keyVaultId:
            description: Key Vault Csm resource Id.
            type: string
          keyVaultSecretName:
            description: Key Vault secret name.
            type: string
          keyVaultSecretStatus:
            description: Status of the Key Vault secret.
            enum:
              - Initialized
              - WaitingOnCertificateOrder
              - Succeeded
              - CertificateOrderFailed
              - OperationNotPermittedOnKeyVault
              - AzureServiceUnauthorizedToAccessKeyVault
              - KeyVaultDoesNotExist
              - KeyVaultSecretDoesNotExist
              - UnknownError
              - ExternalPrivateKey
              - Unknown
            readOnly: true
            type: string
            x-ms-enum:
              modelAsString: false
              name: KeyVaultSecretStatus
          password:
            description: Certificate password.
            type: string
            x-ms-mutability:
              - create
          pfxBlob:
            description: Pfx blob.
            format: byte
            type: string
          publicKeyHash:
            description: Public key hash.
            readOnly: true
            type: string
          selfLink:
            description: Self link.
            readOnly: true
            type: string
          serverFarmId:
            description: 'Resource ID of the associated App Service plan, formatted as: "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}".'
            type: string
          siteName:
            description: App name.
            readOnly: true
            type: string
          subjectName:
            description: Subject name of the certificate.
            readOnly: true
            type: string
          thumbprint:
            description: Certificate thumbprint.
            readOnly: true
            type: string
          valid:
            description: Is the certificate valid?.
            readOnly: true
            type: boolean
        required:
          - password
        x-ms-client-flatten: true
    type: object
