# Use Azure Pay-As-You-Go

The EMQX Cloud offers subscriptions from the Azure Marketplace with the Pay-As-You-Go billing model. This page introduces how to link an EMQX account to an Azure Billing Account and cancel an existing subscription.

## Prerequisites

Before you begin, ensure the following requirements are met:

- You need an active Azure Marketplace account to use Confluent Cloud and get billed directly through Azure.
- To make a purchase, you must log in to the [Azure Marketplace](https://azuremarketplace.microsoft.com/marketplace/) with the appropriate permissions:
  - You must either be the subscription owner or have contributor permissions.
  - For more details on purchasing permissions, refer to the [Azure Marketplace Purchasing Guide](https://docs.microsoft.com/en-us/marketplace/azure-purchasing-invoicing).
- Your Azure policy must allow the provisioning of resources in the region where you choose to set up the EMQX Cloud resource.

## Link an Azure Billing Account to EMQX Cloud

1. Sign in to your [Azure account](https://portal.azure.com/#home).

2. Navigate to [Azure Marketplace](https://portal.azure.com/#view/Microsoft_Azure_Marketplace/MarketplaceOffersBlade/selectedMenuItemId/home).

3. Search for "EMQX Cloud (Pay as you go)" in the search bar. 

   ![search_bar_azure](./_assets/search_bar_azure.png)

   Alternatively, you can click **Azure Marketplace** at the bottom of the EMQX Cloud [Sign in and Sign up](https://accounts.emqx.com/signup?continue=https%3A%2F%2Fcloud-intl.emqx.com%2Fconsole%2F) page to go to the target page.

   <img src="./_assets/sign_up_page_azure.png" alt="sign_up_page_azure" style="zoom:67%;" />

4. On the EMQX Cloud product overview page, click **Subscribe**.

   ![azure_subscribe](./_assets/azure_subscribe.png)

5. You are redirected to the **Basics** tab, where you can fill in the information for **Project details** and **SaaS details**. For more information on how to fill in the information, you can refer to the [Azure Documentation](https://learn.microsoft.com/en-us/marketplace/purchase-saas-offer-in-azure-portal).

   ::: tip

   If you use the service for more than a trial, it is recommended to select `On` for **Recurring billing**.

   :::

   

   ![project_details](./_assets/project_details.png)

6. Proceed to the **Tags** tab. You can leave the options blank.

   ![tags_tab](./_assets/tags_tab.png)

7. Continue to **Review + Subscribe** to go through the offer and plan details.

8. Upon confirmation, select **Subscribe**.

   ![subscribe_tab_azure](./_assets/subscribe_tab_azure.png)

9. During the subscription process, you will be informed of the tips to configure the account on the EMQX Cloud website. Click **Configure account now** and open the EMQX Sign-in page.

   - You are automatically redirected to the index page if you are already signed in to an existing EMQX account. A modal will display the status of linking to your Azure Billing Account.

     ![linking_status_azure](./_assets/linking_status_azure.png)

   - If you are not signed in, you will be prompted to log into your EMQX account. Upon successful sign-in, you are automatically redirected to the index page. A modal will display the status of linking to your Azure Billing Account.

10. Wait for the system to finish syncing.
    EMQX Cloud index page displays a pop-up notifying you of the account syncing status. Additionally, the Payment Method field of the Billing page will change to Azure Marketplace Subscription when the sync is complete.

    ![payment_info_azure](./_assets/payment_info_azure.png)

::: warning Important

The following situations will cause a failure in account linking.

- The EMQX account already has been set up as a credit card.
- The EMQX account uses Available Credits.
- The EMQX account already has been linked to a Marketplace EMQX product.

If you still encounter a problem, please submit a [ticket](../feature/tickets.md) to get help.

:::


## Unlink an Azure Billing Account from EMQX Cloud

1. Sign in to your [Azure account](https://portal.azure.com/#home).

2. Navigate to [SaaS](https://portal.azure.com/#view/HubsExtension/BrowseResourceBlade/resourceType/Microsoft.SaaS%2Fresources) management page.

3. Select the **EMQX Cloud (Pay as You Go)** subscription that you wish to unlink.

4. You can find all the details about the subscription on the SaaS detail information page.

5. Click the **Cancel subscription** button in the top right of the page. Then confirm the unsubscription.

   ![cancel_subscription_azure](./_assets/cancel_subscription_azure.png)

::: warning Important
1. Canceling the subscription will stop your running deployments except for the trial deployment. You can keep using the trial deployment until the trial ends.
2. The stopped deployment will be deleted after 3 days.

:::

