{"id":17498,"date":"2022-09-20T15:03:34","date_gmt":"2022-09-20T15:03:34","guid":{"rendered":"https:\/\/algotrading101.com\/learn\/?p=17498"},"modified":"2023-11-25T20:48:55","modified_gmt":"2023-11-25T20:48:55","slug":"algo-trading-deployment-microsoft-azure","status":"publish","type":"post","link":"https:\/\/algotrading101.com\/learn\/algo-trading-deployment-microsoft-azure\/","title":{"rendered":"Live Algo Trading on the Cloud &#8211; Microsoft Azure"},"content":{"rendered":"<div class=\"pvc_clear\"><\/div><p id=\"pvc_stats_17498\" class=\"pvc_stats total_only  \" data-element-id=\"17498\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/algotrading101.com\/learn\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p><div class=\"pvc_clear\"><\/div>\n<figure class=\"wp-block-image size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"900\" height=\"750\" src=\"http:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2022\/09\/Microsoft-Azure-Logo.png\" alt=\"Microsoft-Azure-Logo\" class=\"wp-image-18214\" srcset=\"https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2022\/09\/Microsoft-Azure-Logo.png 900w, https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2022\/09\/Microsoft-Azure-Logo-300x250.png 300w, https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2022\/09\/Microsoft-Azure-Logo-768x640.png 768w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Table of contents:<\/h3>\n\n\n\n<ol>\n<li><a href=\"#what-does-algorithmic-trading-on-the-cloud-mean\">What does live algorithmic trading on the Cloud mean?<\/a><\/li>\n\n\n\n<li><a href=\"#prerequisite-basic-guide\">Prerequisite &#8211; Basic guide<\/a><\/li>\n\n\n\n<li><a href=\"#pros-of-cloud\">What are the pros of deploying your trading strategies to the Cloud?<\/a><\/li>\n\n\n\n<li><a href=\"#cons-of-cloud\">What are the cons of deploying your trading strategies to the Cloud?<\/a><\/li>\n\n\n\n<li><a href=\"#cloud-service\">What is the Cloud Service?<\/a><\/li>\n\n\n\n<li><a href=\"#cloud-service-use\">What is the Cloud used for?&nbsp;<\/a><\/li>\n\n\n\n<li><a href=\"#cloud-providers\">What cloud providers are good?<\/a><\/li>\n\n\n\n<li><a href=\"#what-is-microsoft-azure\">What is Microsoft Azure?<\/a><\/li>\n\n\n\n<li><a href=\"#microsoft-azure-pros\">Why should I use Microsoft Azure?<\/a><\/li>\n\n\n\n<li><a href=\"#microsoft-azure-cons\">Why shouldn\u2019t I use Microsoft Azure?<\/a><\/li>\n\n\n\n<li><a href=\"#microsoft-azure-start\">How to get started with Microsoft Azure?<\/a><\/li>\n\n\n\n<li><a href=\"#microsoft-azure-cli\">What is the Azure CLI?<\/a><\/li>\n\n\n\n<li><a href=\"#microsoft-azure-cli-start\">How to get started with the Azure CLI?<\/a><\/li>\n\n\n\n<li><a href=\"#microsoft-azure-docker\">What is Docker?<\/a><\/li>\n\n\n\n<li><a href=\"#microsoft-azure-kraken-bot\">Kraken exchange trading bot setup<\/a><\/li>\n\n\n\n<li><a href=\"#microsoft-azure-trading-algorithm-docker\">How to package a trading algorithm with Docker?<\/a><\/li>\n\n\n\n<li><a href=\"#microsoft-azure-container-registry\">What is Azure Container Registry?<\/a><\/li>\n\n\n\n<li><a href=\"#microsoft-azure-cli-container-registry\">How to create Azure Container Registry with Azure CLI?<\/a><\/li>\n\n\n\n<li><a href=\"#microsoft-azure-container-registry-docker-push\">How to push a Docker image to Azure Container Registry?<\/a><\/li>\n\n\n\n<li><a href=\"#microsoft-azure-protect-container-registry\">How to protect your Azure Container Registry?<\/a><\/li>\n\n\n\n<li><a href=\"#microsoft-azure-container-instances\">What are Azure Container Instances?<\/a><\/li>\n\n\n\n<li><a href=\"#microsoft-azure-container-instace-deploy-docker\">How to deploy a docker image to Azure Container Instance?<\/a><\/li>\n\n\n\n<li><a href=\"#microsoft-azure-cli-docker-logs\">How to view Docker logs with Azure CLI?<\/a><\/li>\n\n\n\n<li><a href=\"#microsoft-azure-cli-remove-docker\">How to remove a Docker container from Azure with the CLI?<\/a><\/li>\n\n\n\n<li><a href=\"#microsoft-azure-learn-more\">Where can I learn more?<\/a><\/li>\n\n\n\n<li><a href=\"#microsoft-azure-full-code\">Full code<\/a><\/li>\n<\/ol>\n\n\n\n<a name=\"what-does-algorithmic-trading-on-the-cloud-mean\">\n\n\n\n<h2 class=\"wp-block-heading\">What does live algorithmic trading on the Cloud mean?<\/h2>\n\n\n\n<p>Live algorithmic trading on the Cloud means that your trading bots can use the cloud provider\u2019s resources to run 24\/7 while being easily maintainable.<\/p>\n\n\n\n<p>This is article, we will demonstrate how to deploy a live algorithmic trading strategy to the cloud server using Microsoft Azure and Docker.<\/p>\n\n\n\n<a name=\"prerequisite-basic-guide\">\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisite &#8211; Basic Guide<\/h2>\n\n\n\n<p>If you are new to deploying strategies to the cloud, do check out our <a href=\"https:\/\/algotrading101.com\/learn\/live-algo-trading-on-the-cloud-aws\/\">basic guide using AWS<\/a>.<\/p>\n\n\n\n<p>We covered how to:<\/p>\n\n\n\n<ul>\n<li>Choose a location for your server<\/li>\n\n\n\n<li>Input your secret keys<\/li>\n\n\n\n<li>Deploy a trading script using Github<\/li>\n\n\n\n<li>Set Telegram notifications when trades and key events happen<\/li>\n<\/ul>\n\n\n\n<a name=\"pros-of-cloud\">\n\n\n\n<h2 class=\"wp-block-heading\">What are the pros of deploying your trading strategies to the Cloud?<\/h2>\n\n\n\n<p>The pros of deploying trading strategies to the Cloud are:<\/p>\n\n\n\n<ul>\n<li><strong>Cloud services are easily accessible<\/strong>&nbsp;\u2013 they allow the user to access them at any time, from anywhere, and from almost any device.<\/li>\n\n\n\n<li><strong>Can lower costs<\/strong>&nbsp;\u2013 cloud computing can lower the costs and provide you with a good connection and hardware that saves you money in the long run.<\/li>\n\n\n\n<li><strong>Easy to maintain<\/strong>&nbsp;\u2013 you can upload your trading strategies to the cloud and get them running 24\/7 with minimal effort.<\/li>\n\n\n\n<li><strong>Is scalable<\/strong>&nbsp;\u2013 you can store almost limitless amounts of data in the cloud.<\/li>\n\n\n\n<li><strong>Easy to set up<\/strong>&nbsp;\u2013 setting up your cloud server is quite easy.<\/li>\n<\/ul>\n\n\n\n<a name=\"cons-of-cloud\">\n\n\n\n<h2 class=\"wp-block-heading\">What are the cons of deploying your trading strategies to the Cloud?<\/h2>\n\n\n\n<p>The cons of deploying trading strategies to the Cloud are:<\/p>\n\n\n\n<ul>\n<li><strong>Security risks<\/strong>&nbsp;\u2013 your data is being stored by a third-party provider and if a security breach happens your data is at high risk.<\/li>\n\n\n\n<li><strong>Depends on the internet connection<\/strong>&nbsp;\u2013 even though this is the same case when running trading strategies by yourself, the cloud service provider can also suffer from downtime and other natural risks.<\/li>\n\n\n\n<li><strong>Data confidentiality risk&nbsp;<\/strong>\u2013 your privacy is of utmost importance and when using a third-party cloud provider you can\u2019t be too sure that you\u2019re the only one accessing your data or being able to see it.<\/li>\n<\/ul>\n\n\n\n<a name=\"cloud-service\">\n\n\n\n<h2 class=\"wp-block-heading\">What is the Cloud Service?<\/h2>\n\n\n\n<p>A Cloud Service delivers cloud computing as a service with an intent to deliver affordable, easy and efficient access to diverse resources without the need to have your own hardware or infrastructure.<\/p>\n\n\n\n<a name=\"cloud-service-use\">\n\n\n\n<h2 class=\"wp-block-heading\">What is the Cloud used for?&nbsp;<\/h2>\n\n\n\n<p>Cloud services have many purposes for which they could be used for and here are some of the common ones:<\/p>\n\n\n\n<ul>\n<li><strong>Algorithmic trading&nbsp;<\/strong>\u2013 cloud services allow algorithmic traders to run multiple bots that trade the market.<\/li>\n\n\n\n<li><strong>Big data storage&nbsp;<\/strong>\u2013 clouds offer an almost limitless storage capacity which is great when dealing with big data.<\/li>\n\n\n\n<li><strong>Backup and recovery<\/strong>&nbsp;\u2013 clouds can be frequently backed up and you can easily recover data from them. They also offer good disaster recovery.<\/li>\n\n\n\n<li><strong>Test and Development<\/strong>&nbsp;\u2013 cloud services are great when testing and developing your applications and trading strategies.<\/li>\n\n\n\n<li><strong>Model training&nbsp;<\/strong>\u2013 when doing machine learning work, model training can take up to several months, and running it on a cloud can save you computing power and in some cases even money.<\/li>\n<\/ul>\n\n\n\n<a name=\"cloud-providers\">\n\n\n\n<h2 class=\"wp-block-heading\">What cloud providers are good?<\/h2>\n\n\n\n<p>There are many cloud services and picking a quality one is important. In order to make your decisions process easier I will mention a few that are on top of their cloud game:<\/p>\n\n\n\n<ul>\n<li><a href=\"https:\/\/algotrading101.com\/learn\/live-algo-trading-on-the-cloud-aws\/\">Amazon Web Services (AWS)<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/algotrading101.com\/learn\/algo-trading-deployment-google-cloud-platform\/\">Google Cloud Platform<\/a><\/li>\n\n\n\n<li>Server Space<\/li>\n\n\n\n<li>IBM Cloud Services<\/li>\n\n\n\n<li>Oracle<\/li>\n<\/ul>\n\n\n\n<a name=\"what-is-microsoft-azure\">\n\n\n\n<h2 class=\"wp-block-heading\">What is Microsoft Azure?<\/h2>\n\n\n\n<p>Microsoft Azure is a cloud provider service that offers various cloud solutions for things such as algorithmic trading, data storage, development, AI and machine learning, app scaling, system monitoring, and more.<\/p>\n\n\n\n<a name=\"microsoft-azure-pros\">\n\n\n\n<h2 class=\"wp-block-heading\">Why should I use Microsoft Azure?<\/h2>\n\n\n\n<ul>\n<li>Microsoft Azure is cost-effective (pay as you go)<\/li>\n\n\n\n<li>Microsoft Azure is scalable<\/li>\n\n\n\n<li>Offers many cloud solutions<\/li>\n\n\n\n<li>Has SOTA security practices<\/li>\n\n\n\n<li>Has a good uptime track record<\/li>\n\n\n\n<li>Has good documentation with examples<\/li>\n\n\n\n<li>Is one of the largest and most known cloud providers<\/li>\n<\/ul>\n\n\n\n<a name=\"microsoft-azure-cons\">\n\n\n\n<h2 class=\"wp-block-heading\">Why shouldn&#8217;t I use Microsoft Azure?<\/h2>\n\n\n\n<ul>\n<li>Microsoft Azure can be confusing for beginners<\/li>\n\n\n\n<li>Microsoft Azure support can take a while to respond<\/li>\n\n\n\n<li>It can be hard to migrate off of Azure<\/li>\n\n\n\n<li>The interface might be complicated for beginners<\/li>\n\n\n\n<li>Might have a steep learning curve<\/li>\n\n\n\n<li>Can get pricey depending on the user&#8217;s needs<\/li>\n<\/ul>\n\n\n\n<a name=\"microsoft-azure-start\">\n\n\n\n<h2 class=\"wp-block-heading\">How to get started with Microsoft Azure?<\/h2>\n\n\n\n<p>To get started with Microsoft Azure, we will open up a free account. To do this, go over to their <a href=\"https:\/\/azure.microsoft.com\/en-us\/\">website<\/a>, and click the green &#8220;Free account&#8221; button in the upper right corner of your screen. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"426\" src=\"https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2022\/09\/1.PNG-1-1024x426.webp\" alt=\"\" class=\"wp-image-17347\" srcset=\"https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2022\/09\/1.PNG-1-1024x426.webp 1024w, https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2022\/09\/1.PNG-1-300x125.webp 300w, https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2022\/09\/1.PNG-1-768x319.webp 768w, https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2022\/09\/1.PNG-1.webp 1325w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>This will open up a new page that will explain what you will get for free in terms of their services. In my case, I&#8217;m getting $200 in free credits in addition to all the free services for the next 12 months. We confirm our account creation intent by clicking the green &#8220;Start free&#8221; button.<\/p>\n\n\n\n<p>This will open up a Microsoft sign-up prompt where you will need to use your email, phone, or skype. Signing up with GitHub is also an option. I&#8217;ll go the GitHub route. After you agree to authorize Microsoft Corp with your Github, you will need to agree to their terms and similar.<\/p>\n\n\n\n<p>Now, a signup form will be presented to us where you will be asked for a lot of things such as your name, country, phone, address, and more. After that, you will also be asked to provide your card for payment verification. Even if you are using the free account they will ask you for this.<\/p>\n\n\n\n<p>It is good to keep the information in the picture below in mind:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"657\" height=\"439\" src=\"https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2022\/09\/2.PNG.webp\" alt=\"\" class=\"wp-image-17348\" srcset=\"https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2022\/09\/2.PNG.webp 657w, https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2022\/09\/2.PNG-300x200.webp 300w\" sizes=\"(max-width: 657px) 100vw, 657px\" \/><\/figure>\n\n\n\n<p>After your card has been verified, you should be ready to go from the account side of things. The way we want to interact with Azure in this guide is through their CLI. <\/p>\n\n\n\n<p>In the following headers of the article, we&#8217;ll explore how to deploy our trading algorithms by using the Azure CLI, Docker, and the Kraken exchange. The code used will be available at the end of the article in a GitHub repository.<\/p>\n\n\n\n<p>If you would want a more beginner and manual way of deploying your algorithm to a cloud service, check out our <a href=\"https:\/\/algotrading101.com\/learn\/live-algo-trading-on-the-cloud-aws\/\">AWS example<\/a>. If you have read the AWS version before, you can also apply this method to AWS as it also supports all the services we need. They just have a slightly different name.<\/p>\n\n\n\n<a name=\"microsoft-azure-cli\">\n\n\n\n<h2 class=\"wp-block-heading\">What is the Azure CLI?<\/h2>\n\n\n\n<p>The Azure CLI (Command-Line Interface) is a way for us to interact with Microsoft Azure via code. This way, we don&#8217;t need to go over to their website to manually create, start and stop our cloud services.<\/p>\n\n\n\n<a name=\"microsoft-azure-cli-start\">\n\n\n\n<h2 class=\"wp-block-heading\">How to get started with the Azure CLI?<\/h2>\n\n\n\n<p>To get started with the Azure CLI, we will need to install it. The approach may differ depending on your OS, so we won&#8217;t waste time going over that step-by-step. Instead, here are the <a href=\"https:\/\/docs.microsoft.com\/en-us\/cli\/azure\/install-azure-cli\">instructions<\/a> from Microsoft on how to install it for your OS.<\/p>\n\n\n\n<p>I&#8217;ll be using VS Code as my code editor and Azure CLI has a useful extension if you plan to use Azure CLI more often. To install it, we navigate to the extensions at the left bar of your editor and search for &#8220;Azure CLI Tools&#8221;. When you find it, click the blue &#8220;Install&#8221; button if you wish to have it.<\/p>\n\n\n\n<a name=\"microsoft-azure-docker\">\n\n\n\n<h2 class=\"wp-block-heading\"><span style=\"color: initial;\">What is Docker?<\/span><\/h2>\n\n\n\n<p>Docker is&nbsp;an open source containerization platform. It allows us to package our code into containers that can be easily deployed anywhere while being sure that the code in them will work and function in a standardized way.<\/p>\n\n\n\n<p>To install Docker please follow one of <a href=\"https:\/\/docs.docker.com\/get-docker\/\">these guides<\/a> depending on your OS. I&#8217;ll be using Docker Desktop as I&#8217;m on Windows 10.<\/p>\n\n\n\n<a name=\"microsoft-azure-kraken-bot\">\n\n\n\n<h2 class=\"wp-block-heading\">Kraken exchange trading bot setup<\/h2>\n\n\n\n<p>In this article, we will explore a simple trading strategy that will feature the Kraken exchange, Azure CLI, and Docker. Before we set up anything, we need to explain how this strategy works and where you can learn how to code a similar one.<\/p>\n\n\n\n<p>The main idea behind the strategy will be to buy ETH when BTC moves 5% in the last 5 minutes. For this to work, we will pull BTC prices in 5 minute intervals and calculate the percentage difference.<\/p>\n\n\n\n<p>If this difference is more or equal to 5% we will buy ETH, if the requirement isn\u2019t reached we will continue to loop around. The strategy also features error management, logging, and environmental variables.<\/p>\n\n\n\n<p>Error management is used to catch errors that might occur, logging is used so we can obtain data about our bot and what it\u2019s been up to while running on the server and environmental variables allow us to interact with the bot.<\/p>\n\n\n\n<p>The code below is what our trading strategy looks like and here you can find a <a href=\"https:\/\/algotrading101.com\/learn\/kraken-api-guide\/\">quick guide about&nbsp;Kraken<\/a>&nbsp;and how to code a similar strategy by yourself.<\/p>\n\n\n\n<p>Take note that the intent is to fit everything in one file to get us going quicker, you&#8217;ll probably want to clean up the code as your strategies will be more complex and have more moving parts to them.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code># Import the libraries we need\nimport time, logging, os\nimport pandas as pd\nimport krakenex\nfrom pykrakenapi import KrakenAPI\nfrom dotenv import load_dotenv\n\n# Grab environment variables\nload_dotenv()\nAPI_KEY = os.getenv(&quot;KRAKEN_API_KEY&quot;)\nAPI_SECRET = os.getenv(&quot;KRAKEN_API_SECRET&quot;)\nTRACK_TICKER = os.getenv(&quot;TRACK_TICKER&quot;)\nTRADE_TICKER = os.getenv(&quot;TRADE_TICKER&quot;)\n\napi = krakenex.API(key=API_KEY, secret=API_SECRET)\nkraken = KrakenAPI(api)\n\n# Set up the logging\nfor handler in logging.root.handlers[:]:\n    logging.root.removeHandler(handler)\n\nlogging.basicConfig(\n    level=logging.INFO, format=&quot;%(asctime)s: %(levelname)s: %(message)s&quot;\n)\nconsole = logging.StreamHandler()\nconsole.setLevel(logging.INFO)\nformatter = logging.Formatter(&quot;%(asctime)s: %(levelname)s: %(message)s&quot;)\nconsole.setFormatter(formatter)\nlogging.getLogger(&quot;&quot;).addHandler(console)\n\n# Create the main script logic\nwhile True:\n    logging.info(&quot;--------- Start of current 5 minute period ---------&quot;)\n    logging.info(pd.Timestamp.now())\n\n    try:\n        BTC_old = float((kraken.get_ticker_information(TRACK_TICKER))[&quot;b&quot;][0][0])\n    except Exception as e:\n        logging.warning(&quot;Error obtaining data&quot;)\n\n    time.sleep(300)\n\n    try:\n        BTC_new = float((kraken.get_ticker_information(TRACK_TICKER))[&quot;b&quot;][0][0])\n    except Exception as e:\n        logging.warning(&quot;Error obtaining data&quot;)\n\n    percent = ((BTC_new - BTC_old) * 100) \/ BTC_old\n\n    logging.info(f&quot;BTC moved {percent:.2f}% over the last 5 minutes&quot;)\n\n    if percent &gt;= 5:\n\n        try:\n            ETH = float((kraken.get_ticker_information(TRADE_TICKER))[&quot;a&quot;][0][0]) + 2\n        except Exception as e:\n            logging.warning(&quot;Error obtaining data&quot;)\n\n        try:\n            response = kraken.add_standard_order(\n                pair=TRADE_TICKER,\n                type=&quot;buy&quot;,\n                ordertype=&quot;limit&quot;,\n                volume=&quot;0.007&quot;,\n                price=ETH,\n                validate=False,\n            )\n        except Exception as e:\n            logging.warning(&quot;Error placing order&quot;)\n\n        logging.info(f&quot;Order details:\\n{response}&quot;)\n\n        time.sleep(2)\n\n        try:\n            check_order = kraken.query_orders_info(response[&quot;txid&quot;][0])\n        except Exception as e:\n            logging.warning(&quot;Error checking order&quot;)\n\n        if check_order[&quot;status&quot;][0] == &quot;open&quot; or &quot;closed&quot;:\n            logging.info(&quot;Order executed sucessfully&quot;)\n            break\n        else:\n            logging.info(&quot;Order rejected&quot;)\n            break\n    else:\n        logging.info(&quot;--------- End of current 5 minute period ---------&quot;)<\/code><\/pre><\/div>\n\n\n\n<p>For our local testing purposes, we will have a <code>.env<\/code> file that looks like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>KRAKEN_API_KEY = 'YOUR_KRAKEN_API_KEY'\nKRAKEN_API_SECRET = 'YOUR_KRAKEN_API_SECRET'\nTRACK_TICKER  = 'BTCUSDT'\nTRADE_TICKER = 'ETHUSDT'<\/code><\/pre>\n\n\n\n<p>Now, let&#8217;s set up this algorithm for Docker.<\/p>\n\n\n\n<a name=\"microsoft-azure-trading-algorithm-docker\">\n\n\n\n<h2 class=\"wp-block-heading\">How to package a trading algorithm with Docker?<\/h2>\n\n\n\n<p>To package a trading algorithm with Docker, we will need to have a file named <code>dockerfile<\/code> that has all the instructions on how to make our algorithm ready by copying code files we need, installing libraries, passing the environment variables, and more.<\/p>\n\n\n\n<p>Because Docker needs to know what dependencies we want to install for our algorithm, it is good practice to have a <code>requirements.txt<\/code> file that features all the libraries we need and their versions:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>python-dotenv==0.21.0\npandas==1.4.4\nkrakenex==2.1.0\npykrakenapi==0.3.1<\/code><\/pre>\n\n\n\n<p>To get your package version you can write <code>pip show &lt;package&gt;<\/code>.<\/p>\n\n\n\n<p>Now that the requirements are ready, we can move on to specifying our installation and other setup commands inside of the <code>dockerfile<\/code>. We first create the <code>dockerfile<\/code> by writing <code>touch dockerfile<\/code>.<\/p>\n\n\n\n<p>The inside of our <code>dockerfile<\/code> looks the following way:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>FROM python:3.8\nRUN mkdir -p \/code\n\nCOPY .\/main.py \/code\/\nCOPY .\/requirements.txt \/code\/\n\nWORKDIR \/code\n\n# set environment variables\nARG API_KEY\nARG API_SECRET\nARG TRACK\nARG TRADE\n\nENV KRAKEN_API_KEY $API_KEY\nENV KRAKEN_API_SECRET $API_SECRET\nENV TRACK_TICKER $TRACK\nENV TRADE_TICKER $TRADE\n\nRUN pip install -r requirements.txt\nCMD &#91;\"python\", \"\/code\/main.py\"]<\/code><\/pre>\n\n\n\n<p>In the code above we specify what version of python we&#8217;re using, then we create a folder <code>\/code<\/code> to hold our script. Then, we copy over the two files we need to the newly created folder and set it as our working directory. We then provide environment variables that will be set when we build the docker image.<\/p>\n\n\n\n<p>The <code>ARG<\/code> is your placeholder that is only accessible during the build time and then it vanishes, while the <code>ENV<\/code> will be accessible through your whole image process. We use the <code>ARG<\/code> parameter to dynamically pass our environment variables on docker image builds.<\/p>\n\n\n\n<p>There is also a way to pass the environment variables via <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/container-instances\/container-instances-environment-variables\">Azure<\/a>.<\/p>\n\n\n\n<p>At the end of the file, we install the dependencies and start the <code>main.py<\/code> script. Have in mind that you should double-check what ports are exposed in your instance as the code might not run. To open a specific port via Docker you can add <code>EXPOSE &lt;PORT_NUMBER&gt;<\/code>.<\/p>\n\n\n\n<p>Before we build the image, it is good practice to have a <code>.gitignore<\/code> and <code>.dockerignore<\/code> files where we place files (<code>.env<\/code>) that we don&#8217;t want to push into GitHub or the Docker Container.<\/p>\n\n\n\n<p>Now that we have everything ready, make sure to start your Docker Desktop so that we can build our docker container image. To build the image, we run the following command to our terminal:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker build -t azure-algotrading101 \\\n\t--build-arg API_KEY=&lt;YOUR-API-KEY&gt; \\\n\t--build-arg API_SECRET=&lt;YOUR-API-SECRET&gt; \\\n\t--build-arg TRACK=BTCUSDT \\\n\t--build-arg TRADE=ETHUSDT .<\/code><\/pre>\n\n\n\n<p>Once docker is done, you will see a message similar to this one:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;+] Building 8.2s (11\/11) FINISHED\n=&gt; &#91;internal] load build definition from Dockerfile ...                                                              <\/code><\/pre>\n\n\n\n<p>To see your docker images, you can write the following command to the terminal:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>docker images<\/code><\/pre><\/div>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>REPOSITORY                       TAG               IMAGE ID       CREATED         SIZE\nazure-algotrading101             latest            f81336abb1fc   2 minutes ago   1.08GB<\/code><\/pre><\/div>\n\n\n\n<p>If you want to run the container locally, you can write the following command:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>docker run -d -p 8080:80 azure-algotrading101<\/code><\/pre><\/div>\n\n\n\n<p>The next step is to push our container image to the Azure Container Registry.<\/p>\n\n\n\n<a name=\"microsoft-azure-container-registry\">\n\n\n\n<h2 class=\"wp-block-heading\">What is Azure Container Registry?<\/h2>\n\n\n\n<p>Azure Container Registry is a service that allows us to build, store, secure, scan, replicate, and manage container images and artifacts. You can think of it as GitHub but private and for containers.<\/p>\n\n\n\n<a name=\"microsoft-azure-cli-container-registry\">\n\n\n\n<h2 class=\"wp-block-heading\">How to create Azure Container Registry with Azure CLI?<\/h2>\n\n\n\n<p>To create an Azure Container Registry with the Azure CLI, we will need to have Azure CLI installed and authenticate our account through it. Then we will create our registry and push the container image to it.<\/p>\n\n\n\n<p>To make sure that your Azure CLI is ready to go, write the following command in your terminal emulator:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>az --version<\/code><\/pre><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>azure-cli                         2.40.0\n\ncore                              2.40.0\ntelemetry                          1.0.8\n\nDependencies:\nmsal                            1.18.0b1\nazure-mgmt-resource             21.1.0b1<\/code><\/pre>\n\n\n\n<p>Now, let us login into our account by writing <code>az login<\/code>. This will open up your browser and ask you to log in. After you do that, you can close the browser.<\/p>\n\n\n\n<p>Before creating the Azure Container Registry we will need a resource group. To create a resource group we write the following :<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>az group create --name algotrading101Group --location eastus<\/code><\/pre><\/div>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>{\n  &quot;id&quot;: &quot;\/subscriptions\/...&quot;,\n  &quot;location&quot;: &quot;eastus&quot;,\n  &quot;managedBy&quot;: null,\n  &quot;name&quot;: &quot;algotrading101Group&quot;,\n  &quot;properties&quot;: {\n    &quot;provisioningState&quot;: &quot;Succeeded&quot;\n  },\n  &quot;tags&quot;: null,\n  &quot;type&quot;: &quot;Microsoft.Resources\/resourceGroups&quot;\n}<\/code><\/pre><\/div>\n\n\n\n<p>When picking a location, it is best to find to try one that is the closest to the main servers of your exchange for the best latency. If you want to learn how to do that, check out our <a href=\"https:\/\/algotrading101.com\/learn\/live-algo-trading-on-the-cloud-aws\/\">AWS article<\/a> here.<\/p>\n\n\n\n<p>Now, we create our Container Registry with this command:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>az acr create --resource-group algotrading101Group --name krakenexample101 --sku Basic<\/code><\/pre><\/div>\n\n\n\n<p>Your Registry name should be all lowercase, unique within Azure, and contain 5-50 alphanumeric characters.<\/p>\n\n\n\n<p>Now that the Registry is set, we will log into it with this command:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>az acr login --name krakenexample101\n\n-&gt; Login Succeeded<\/code><\/pre><\/div>\n\n\n\n<a name=\"microsoft-azure-container-registry-docker-push\">\n\n\n\n<h2 class=\"wp-block-heading\">How to push a Docker image to Azure Container Registry?<\/h2>\n\n\n\n<p>To push a Docker image to the Azure Container Registry, we must first tag the image with the full name of the registry&#8217;s login server. Let&#8217;s find that full name by writing the following command:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>az acr show --name krakenexample101 --query loginServer --output table<\/code><\/pre><\/div>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>Result\n---------------------------\nkrakenexample101.azurecr.io<\/code><\/pre><\/div>\n\n\n\n<p>Now we tag the image, I&#8217;ll add <code>:awesome<\/code> as its tag. To recall the image name, run <code>docker images<\/code>.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>docker tag azure-algotrading101 krakenexample101.azurecr.io\/azure-algotrading101:awesome<\/code><\/pre><\/div>\n\n\n\n<p>To make sure the tag was set, run <code>docker images<\/code> again.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>REPOSITORY                                         TAG      \nkrakenexample101.azurecr.io\/azure-algotrading101   awesome<\/code><\/pre><\/div>\n\n\n\n<p>Finally, we can push our Docker image to the Registry by writing the following:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>docker push krakenexample101.azurecr.io\/azure-algotrading101:awesome<\/code><\/pre><\/div>\n\n\n\n<p>The speed of the push will depend on your internet connection and the size of your image. As this is a small image it shouldn&#8217;t take long in most cases. To make sure that the image has been properly pushed, we can inspect the registry for its images:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>az acr repository list --name krakenexample101 --output table<\/code><\/pre><\/div>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>Result\n--------------------\nazure-algotrading101<\/code><\/pre><\/div>\n\n\n\n<a name=\"microsoft-azure-protect-container-registry\">\n\n\n\n<h2 class=\"wp-block-heading\">How to protect your Azure Container Registry?<\/h2>\n\n\n\n<p>To protect your Azure Container Registry from cybersecurity attacks, it is best practice to set up a feature named Azure Active Directory. The Active Directory is a service that provides single sign-on, multifactor authentication, and conditional access to guard against cybersecurity attacks.<\/p>\n\n\n\n<p>In the case of our Container Registry, the best practice for many scenarios is to create and configure an Azure Active Directory service principal with&nbsp;pull&nbsp;permissions to the registry. Azure has us covered with an example of how to do this.<\/p>\n\n\n\n<p>You can find the bash script for it in the GitHub repo linked at the bottom of the article. Be sure to edit the script to your liking by changing the first two parameters indicated in the script.<\/p>\n\n\n\n<p>To run the script go to the directory and do:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>.\\active_directory.sh<\/code><\/pre><\/div>\n\n\n\n<p>To get your registry credentials, run:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>az acr show --name krakenexample101 --query loginServer<\/code><\/pre><\/div>\n\n\n\n<a name=\"microsoft-azure-container-instances\">\n\n\n\n<h2 class=\"wp-block-heading\">What are Azure Container Instances?<\/h2>\n\n\n\n<p>Azure Container Instances is&nbsp;a service that enables users to deploy containers on the Microsoft Azure public cloud without having to provision or manage any underlying infrastructure.<\/p>\n\n\n\n<a name=\"microsoft-azure-container-instace-deploy-docker\">\n\n\n\n<h2 class=\"wp-block-heading\">How to deploy a docker image to Azure Container Instance?<\/h2>\n\n\n\n<p>To deploy a docker image to Azure Container Instance, use the&nbsp;az container create&nbsp;command to deploy the container. <\/p>\n\n\n\n<p>Replace&nbsp;&lt;acrLoginServer&gt;&nbsp;with the value, you obtained previously. Replace&nbsp;<code>&lt;service-principal-ID&gt;<\/code>&nbsp;and&nbsp;<code>&lt;service-principal-password&gt;<\/code>&nbsp;with the service principal ID and password that you created to access the registry. Replace&nbsp;<code>&lt;aciDnsLabel&gt;<\/code>&nbsp;with the desired DNS name.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>az container create --resource-group algotrading101Group \\\n\t--name azure-algotrading101 --image &lt;acrLoginServer&gt;\/azure-algotrading101:awesome \\\n\t--cpu 1 --memory 1 --registry-login-server &lt;acrLoginServer&gt; \\\n\t--registry-username &lt;service-principal-ID&gt; \\\n\t--registry-password &lt;service-principal-password&gt; \\\n\t--ip-address Public --dns-name-label &lt;aciDnsLabel&gt; --ports 80<\/code><\/pre><\/div>\n\n\n\n<p>To verify our deployment we run the following command:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>az container show --resource-group algotrading101Group \\\n   --name krakenexample101 --query instanceView.state<\/code><\/pre><\/div>\n\n\n\n<p>Until you get &#8220;Running&#8221; as a response, don&#8217;t proceed to the next step.<\/p>\n\n\n\n<a name=\"microsoft-azure-cli-docker-logs\">\n\n\n\n<h2 class=\"wp-block-heading\">How to view Docker logs with Azure CLI?<\/h2>\n\n\n\n<p>To view the output logs of your Docker container with Azure CLI, run the following command:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>az container logs --resource-group algotrading101Group --name azure-algotrading101<\/code><\/pre><\/div>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>2022-09-13 21:13:32,340: INFO: --------- Start of current 5 minute period ---------\n2022-09-13 21:13:32,343: INFO: 2022-09-13 21:13:32.342519<\/code><\/pre><\/div>\n\n\n\n<a name=\"microsoft-azure-cli-remove-docker\">\n\n\n\n<h2 class=\"wp-block-heading\">How to remove a Docker container from Azure with the CLI?<\/h2>\n\n\n\n<p>To remove a Docker container from Azure and all other things we created with the Azure CLI, we only need to delete the resource group which will take care of everything else. To delete the group we do the following:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>az group delete --name algotrading101Group<\/code><\/pre><\/div>\n\n\n\n<a name=\"microsoft-azure-learn-more\">\n\n\n\n<h2 class=\"wp-block-heading\">Where can I learn more?<\/h2>\n\n\n\n<p>To learn more about Microsoft Azure, I advise checking out their <a href=\"https:\/\/docs.microsoft.com\/en-us\/\">documentation<\/a> and visiting their <a href=\"https:\/\/docs.microsoft.com\/en-us\/training\/\">learning<\/a> paths and tutorials which are structured nicely. There are also good <a href=\"https:\/\/docs.microsoft.com\/en-us\/samples\/browse\/\">code samples<\/a> to explore and learn from.<\/p>\n\n\n\n<a name=\"microsoft-azure-full-code\">\n\n\n\n<h2 class=\"wp-block-heading\">Full code<\/h2>\n\n\n\n<p><a href=\"https:\/\/github.com\/IgorWounds\/Microsoft-Azure-Algotrading101\">GitHub Link<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_17498\" class=\"pvc_stats total_only  \" data-element-id=\"17498\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/algotrading101.com\/learn\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n<p>Table of contents: What does live algorithmic trading on the Cloud mean? Live algorithmic trading on the Cloud means that your trading bots can use the cloud provider\u2019s resources to run 24\/7 while being easily maintainable. This is article, we will demonstrate how to deploy a live algorithmic trading strategy to the cloud server using [&hellip;]<\/p>\n","protected":false},"author":14,"featured_media":18214,"comment_status":"closed","ping_status":"closed","sticky":true,"template":"","format":"standard","meta":{"_lmt_disableupdate":"no","_lmt_disable":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[3,2],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Live Algo Trading on the Cloud - Microsoft Azure - AlgoTrading101 Blog<\/title>\n<meta name=\"description\" content=\"Deploy live algorithmic trading strategies to the cloud server using Microsoft Azure and Docker.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/algotrading101.com\/learn\/algo-trading-deployment-microsoft-azure\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Live Algo Trading on the Cloud - Microsoft Azure - AlgoTrading101 Blog\" \/>\n<meta property=\"og:description\" content=\"Deploy live algorithmic trading strategies to the cloud server using Microsoft Azure and Docker.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/algotrading101.com\/learn\/algo-trading-deployment-microsoft-azure\/\" \/>\n<meta property=\"og:site_name\" content=\"Quantitative Trading Ideas and Guides - AlgoTrading101 Blog\" \/>\n<meta property=\"article:published_time\" content=\"2022-09-20T15:03:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-11-25T20:48:55+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2022\/09\/Microsoft-Azure-Logo.png\" \/>\n\t<meta property=\"og:image:width\" content=\"900\" \/>\n\t<meta property=\"og:image:height\" content=\"750\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Igor Radovanovic\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Igor Radovanovic\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"16 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Live Algo Trading on the Cloud - Microsoft Azure - AlgoTrading101 Blog","description":"Deploy live algorithmic trading strategies to the cloud server using Microsoft Azure and Docker.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/algotrading101.com\/learn\/algo-trading-deployment-microsoft-azure\/","og_locale":"en_US","og_type":"article","og_title":"Live Algo Trading on the Cloud - Microsoft Azure - AlgoTrading101 Blog","og_description":"Deploy live algorithmic trading strategies to the cloud server using Microsoft Azure and Docker.","og_url":"https:\/\/algotrading101.com\/learn\/algo-trading-deployment-microsoft-azure\/","og_site_name":"Quantitative Trading Ideas and Guides - AlgoTrading101 Blog","article_published_time":"2022-09-20T15:03:34+00:00","article_modified_time":"2023-11-25T20:48:55+00:00","og_image":[{"width":900,"height":750,"url":"http:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2022\/09\/Microsoft-Azure-Logo.png","type":"image\/png"}],"author":"Igor Radovanovic","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Igor Radovanovic","Est. reading time":"16 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/algotrading101.com\/learn\/algo-trading-deployment-microsoft-azure\/#article","isPartOf":{"@id":"https:\/\/algotrading101.com\/learn\/algo-trading-deployment-microsoft-azure\/"},"author":{"name":"Igor Radovanovic","@id":"https:\/\/algotrading101.com\/learn\/#\/schema\/person\/a7ae60c112a73b7c3fe14ac56726a0ae"},"headline":"Live Algo Trading on the Cloud &#8211; Microsoft Azure","datePublished":"2022-09-20T15:03:34+00:00","dateModified":"2023-11-25T20:48:55+00:00","mainEntityOfPage":{"@id":"https:\/\/algotrading101.com\/learn\/algo-trading-deployment-microsoft-azure\/"},"wordCount":2863,"publisher":{"@id":"https:\/\/algotrading101.com\/learn\/#organization"},"articleSection":["Programming","Trading"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/algotrading101.com\/learn\/algo-trading-deployment-microsoft-azure\/","url":"https:\/\/algotrading101.com\/learn\/algo-trading-deployment-microsoft-azure\/","name":"Live Algo Trading on the Cloud - Microsoft Azure - AlgoTrading101 Blog","isPartOf":{"@id":"https:\/\/algotrading101.com\/learn\/#website"},"datePublished":"2022-09-20T15:03:34+00:00","dateModified":"2023-11-25T20:48:55+00:00","description":"Deploy live algorithmic trading strategies to the cloud server using Microsoft Azure and Docker.","breadcrumb":{"@id":"https:\/\/algotrading101.com\/learn\/algo-trading-deployment-microsoft-azure\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/algotrading101.com\/learn\/algo-trading-deployment-microsoft-azure\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/algotrading101.com\/learn\/algo-trading-deployment-microsoft-azure\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/algotrading101.com\/learn\/"},{"@type":"ListItem","position":2,"name":"Live Algo Trading on the Cloud &#8211; Microsoft Azure"}]},{"@type":"WebSite","@id":"https:\/\/algotrading101.com\/learn\/#website","url":"https:\/\/algotrading101.com\/learn\/","name":"Quantitative Trading Ideas and Guides - AlgoTrading101 Blog","description":"Authentic Stories about Algorithmic trading, coding and life.","publisher":{"@id":"https:\/\/algotrading101.com\/learn\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/algotrading101.com\/learn\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/algotrading101.com\/learn\/#organization","name":"AlgoTrading101","url":"https:\/\/algotrading101.com\/learn\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/algotrading101.com\/learn\/#\/schema\/logo\/image\/","url":"https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2020\/11\/AlgoTrading101-Lucas-Liew.jpg","contentUrl":"https:\/\/algotrading101.com\/learn\/wp-content\/uploads\/2020\/11\/AlgoTrading101-Lucas-Liew.jpg","width":1200,"height":627,"caption":"AlgoTrading101"},"image":{"@id":"https:\/\/algotrading101.com\/learn\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/algotrading101.com\/learn\/#\/schema\/person\/a7ae60c112a73b7c3fe14ac56726a0ae","name":"Igor Radovanovic","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/algotrading101.com\/learn\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d46175c509b3ee240a1e2bbe735a4d1e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d46175c509b3ee240a1e2bbe735a4d1e?s=96&d=mm&r=g","caption":"Igor Radovanovic"},"sameAs":["https:\/\/igorradovanovic.com","https:\/\/www.linkedin.com\/in\/igor-radovanovic-profile"],"url":"https:\/\/algotrading101.com\/learn\/author\/igor\/"}]}},"modified_by":"Lucas Liew","_links":{"self":[{"href":"https:\/\/algotrading101.com\/learn\/wp-json\/wp\/v2\/posts\/17498"}],"collection":[{"href":"https:\/\/algotrading101.com\/learn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/algotrading101.com\/learn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/algotrading101.com\/learn\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/algotrading101.com\/learn\/wp-json\/wp\/v2\/comments?post=17498"}],"version-history":[{"count":10,"href":"https:\/\/algotrading101.com\/learn\/wp-json\/wp\/v2\/posts\/17498\/revisions"}],"predecessor-version":[{"id":22313,"href":"https:\/\/algotrading101.com\/learn\/wp-json\/wp\/v2\/posts\/17498\/revisions\/22313"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/algotrading101.com\/learn\/wp-json\/wp\/v2\/media\/18214"}],"wp:attachment":[{"href":"https:\/\/algotrading101.com\/learn\/wp-json\/wp\/v2\/media?parent=17498"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/algotrading101.com\/learn\/wp-json\/wp\/v2\/categories?post=17498"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/algotrading101.com\/learn\/wp-json\/wp\/v2\/tags?post=17498"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}